summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Infer.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-03-24 14:50:44 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-03-26 22:55:14 -0700
commit925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37 (patch)
tree3971d6191046a498f2b48fc73ea5d29edfe9c70b /src/compiler/scala/tools/nsc/typechecker/Infer.scala
parentaa972dc100544179beecde48b52dfdb847162001 (diff)
downloadscala-925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37.tar.gz
scala-925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37.tar.bz2
scala-925b394dbf2fc8f9a0a6f64e374dc6ab5564ab37.zip
Refactor: simplify fallbackAfterVanillaAdapt.
Trying to figure out if we can avoid adapting to SAM, and just type them once and for all in typedFunction. Looks like overload resolution requires SAM adaptation to happen in adapt. Cleaned up while I was in the area.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Infer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 9b42841eb8..dc91d23011 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1220,7 +1220,7 @@ trait Infer extends Checkable {
}
def inferModulePattern(pat: Tree, pt: Type) =
- if (!(pat.tpe <:< pt)) {
+ if ((pat.symbol ne null) && pat.symbol.isModule && !(pat.tpe <:< pt)) {
val ptparams = freeTypeParamsOfTerms(pt)
debuglog("free type params (2) = " + ptparams)
val ptvars = ptparams map freshVar