summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-23 01:46:32 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-09-23 01:46:32 -0700
commit26420f469ebab27a644473c50ca2ac69b02e0314 (patch)
treead28e836bc4e1c74c54aa6ef6dc41550af68b637
parent469d303d7b0b052880f0365f304ca7df09148ec4 (diff)
parent3d7f84e83b85f26f1ae84acdd7edcfddeefc6322 (diff)
downloadscala-26420f469ebab27a644473c50ca2ac69b02e0314.tar.gz
scala-26420f469ebab27a644473c50ca2ac69b02e0314.tar.bz2
scala-26420f469ebab27a644473c50ca2ac69b02e0314.zip
Merge pull request #2974 from retronym/ticket/7864
SI-7864 Harden "looks like an interpolated String" warning
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--test/files/pos/t7864.flags1
-rw-r--r--test/files/pos/t7864.scala5
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 ")
+}
+