summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2016-07-26 11:31:06 -0700
committerGitHub <noreply@github.com>2016-07-26 11:31:06 -0700
commit4f749ceedb8b9a0a4417e2d2259c9a20853ad772 (patch)
tree8e1d0da9b08a7a49157e5ebe468e14e177fc1516 /src
parent2f95a247d69843547901501c5bca976d0b95ac0a (diff)
parentf806073d32a476d156f1b3ec24c17f35ed65b4c3 (diff)
downloadscala-4f749ceedb8b9a0a4417e2d2259c9a20853ad772.tar.gz
scala-4f749ceedb8b9a0a4417e2d2259c9a20853ad772.tar.bz2
scala-4f749ceedb8b9a0a4417e2d2259c9a20853ad772.zip
Merge pull request #5279 from retronym/ticket/SD-183
SD-183 Make refinement classes ineligible as SAMs
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index fe6d88e7c7..0342daf113 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -837,9 +837,9 @@ trait Definitions extends api.StandardDefinitions {
* The class defining the method is a supertype of `tp` that
* has a public no-arg primary constructor.
*/
- def samOf(tp: Type): Symbol = if (!doSam) NoSymbol else {
+ def samOf(tp: Type): Symbol = if (!doSam) NoSymbol else if (!isNonRefinementClassType(unwrapToClass(tp))) NoSymbol else {
// look at erased type because we (only) care about what ends up in bytecode
- // (e.g., an alias type or intersection type is fine as long as the intersection dominator compiles to an interface)
+ // (e.g., an alias type is fine as long as is compiles to a single-abstract-method)
val tpSym: Symbol = erasure.javaErasure(tp).typeSymbol
if (tpSym.exists && tpSym.isClass