diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-25 18:41:48 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-26 22:55:19 -0700 |
commit | a17d247a8acea2daaddb39263ebf1dcf5673bcba (patch) | |
tree | a67078f7cef0cc5ab410711df0f06aa2a1c0523d /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37 (diff) | |
download | scala-a17d247a8acea2daaddb39263ebf1dcf5673bcba.tar.gz scala-a17d247a8acea2daaddb39263ebf1dcf5673bcba.tar.bz2 scala-a17d247a8acea2daaddb39263ebf1dcf5673bcba.zip |
SAM conversion can be disabled using `-Xsource:2.11`
For completeness, `-Xsource:2.11 -Xexperimental` does enable it.
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, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ba6a9e20ea..35cfc644ab 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2752,6 +2752,8 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper def inferSamType(fun: Tree, pt: Type, mode: Mode): SAMFunction = { val sam = if (fun.isInstanceOf[Function] && !isFunctionType(pt)) { + // TODO: can we ensure there's always a SAMFunction attachment, instead of looking up the sam again??? + // seems like overloading complicates things? val sam = samOf(pt) if (samMatchesFunctionBasedOnArity(sam, fun.asInstanceOf[Function].vparams)) sam else NoSymbol |