summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-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