summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-03-25 18:41:48 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-03-26 22:55:19 -0700
commita17d247a8acea2daaddb39263ebf1dcf5673bcba (patch)
treea67078f7cef0cc5ab410711df0f06aa2a1c0523d /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37 (diff)
downloadscala-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.scala2
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