diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-08-23 15:28:58 -0700 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2016-08-26 14:16:56 -0700 |
commit | d275b0372b661d4df22db52f0ec3802843332ad6 (patch) | |
tree | f547e5ec9398b7562fb0b7cf9c209adcb1873680 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | b3f6c7796e139e5a5e0e3588201aa97d1dc4ef3c (diff) | |
download | scala-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.scala | 2 |
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 } |