diff options
Diffstat (limited to 'test/files/neg/forgot-interpolator.scala')
-rw-r--r-- | test/files/neg/forgot-interpolator.scala | 24 |
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] } |