summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-08-23 15:28:58 -0700
committerSeth Tisue <seth@tisue.net>2016-08-26 14:16:56 -0700
commitd275b0372b661d4df22db52f0ec3802843332ad6 (patch)
treef547e5ec9398b7562fb0b7cf9c209adcb1873680 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentb3f6c7796e139e5a5e0e3588201aa97d1dc4ef3c (diff)
downloadscala-d275b0372b661d4df22db52f0ec3802843332ad6.tar.gz
scala-d275b0372b661d4df22db52f0ec3802843332ad6.tar.bz2
scala-d275b0372b661d4df22db52f0ec3802843332ad6.zip
SAM for subtypes of FunctionN
only exclude FunctionN types themselves from SAM, don't exclude their subtypes; we want e.g. trait T extends Function1[String, String] (x => x) : T to compile reference: https://github.com/scala/scala-dev/issues/206
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 33cf5b9a09..a95ecd360c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -773,7 +773,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
else FunctionClass(numVparams)
}
- if (samSym.exists && samSym.owner != correspondingFunctionSymbol) // don't treat Functions as SAMs
+ if (samSym.exists && tp.typeSymbol != correspondingFunctionSymbol) // don't treat Functions as SAMs
wildcardExtrapolation(normalize(tp memberInfo samSym))
else NoType
}