diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t7864.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t7864.scala | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 5c8f1bd1c7..e07c68de8a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4878,7 +4878,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper // Unfortunately implicit not found strings looks for all the world like // missing interpolators. def isArgToImplicitNotFound = context.enclosingApply.tree match { - case Apply(fn, _) => fn.symbol.enclClass == ImplicitNotFoundClass + case Apply(fn, _) => fn.symbol != null && fn.symbol.enclClass == ImplicitNotFoundClass case _ => false } tree.value match { diff --git a/test/files/pos/t7864.flags b/test/files/pos/t7864.flags new file mode 100644 index 0000000000..7ccd56103a --- /dev/null +++ b/test/files/pos/t7864.flags @@ -0,0 +1 @@ +-Xlint
\ No newline at end of file diff --git a/test/files/pos/t7864.scala b/test/files/pos/t7864.scala new file mode 100644 index 0000000000..b2d8911a17 --- /dev/null +++ b/test/files/pos/t7864.scala @@ -0,0 +1,5 @@ +object Test { + val f = 0; + ({ toString; (x: Any) => x})("$f ") +} + |