summaryrefslogtreecommitdiff
path: root/test/files/neg/forgot-interpolator.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-09-18 18:06:59 -0700
committerSom Snytt <som.snytt@gmail.com>2013-09-23 13:23:24 -0700
commit69ce27434e07c8dc215490256fe51622d768dd7e (patch)
tree827d13297d325a51af6f16ed856734a2e1583a39 /test/files/neg/forgot-interpolator.scala
parent7d570b54c3c895bc8948adeca2e463d135e38feb (diff)
downloadscala-69ce27434e07c8dc215490256fe51622d768dd7e.tar.gz
scala-69ce27434e07c8dc215490256fe51622d768dd7e.tar.bz2
scala-69ce27434e07c8dc215490256fe51622d768dd7e.zip
SI-7848 Xlint no warn on $sym with params
This idea brought to you by retronym. Also improve implicitNotFound detection at typer; and avoid checking the standard interpolation expression for cases like s"some $$x". Some minor refactorings of implicitNotFound strings. The intersobralator allows extra spaces, i.e., trims.
Diffstat (limited to 'test/files/neg/forgot-interpolator.scala')
-rw-r--r--test/files/neg/forgot-interpolator.scala24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/files/neg/forgot-interpolator.scala b/test/files/neg/forgot-interpolator.scala
index 5067f1dce9..e007f15009 100644
--- a/test/files/neg/forgot-interpolator.scala
+++ b/test/files/neg/forgot-interpolator.scala
@@ -1,7 +1,7 @@
class A {
val bippy = 123
- def f = "Put the $bippy in the $bippy!" // warn
+ def f = "Put the $bippy in the $bippy!" // warn 1
}
class B {
@@ -11,7 +11,7 @@ class B {
}
class C {
- def f = """Put the ${println("bippy")} in the bippy!""" // warn
+ def f = """Put the ${println("bippy")} in the bippy!""" // warn 2
}
package object test {
@@ -27,21 +27,33 @@ package test {
def beppo(i: Int) = 8 * i
def beppo = 8
class Dah extends Doo {
- def f = "$beppo was a marx bros who saw dollars." // warn
+ def f = "$beppo was a marx bros who saw dollars." // warn 3
}
}
class E {
- def f = "$aleppo is a pepper and a city." // warn
+ def f = "$aleppo is a pepper and a city." // warn 4
+ def k = s"Just an interpolation of $aleppo" // no warn
}
class Bar {
private def bar = 8
+ if (bar > 8) ??? // use it to avoid extra warning
}
class Baz extends Bar {
- def f = "$bar is private, shall we warn just in case?" // warn
+ def f = "$bar is private, shall we warn just in case?" // warn 5
}
class G {
def g = "$greppo takes an arg" // no warn
def z = "$zappos takes an arg too" // no warn
- def h = "$hippo takes an implicit" // warn
+ def h = "$hippo takes an implicit" // warn 6
}
+ class J {
+ def j = 8
+ class J2 {
+ def j(i: Int) = 2 * i
+ def jj = "shadowed $j" // no warn
+ }
+ }
+ import annotation._
+ @implicitNotFound("No Z in ${A}") // no warn
+ class Z[A]
}