blob: e007f150095b491b76039d130b2e3eac311d3a3b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
class A {
val bippy = 123
def f = "Put the $bippy in the $bippy!" // warn 1
}
class B {
val dingus = 123
def f = "Put the $bippy in the $bippy!" // no warn
}
class C {
def f = """Put the ${println("bippy")} in the bippy!""" // warn 2
}
package object test {
def aleppo = 9
def greppo(n: Int) = ???
def zappos(n: Int)(implicit ord: math.Ordering[Int]) = ???
def hippo(implicit n: Int) = ???
}
package test {
// not sure if overloading is kosher in pkg obj yet
class Doo {
def beppo(i: Int) = 8 * i
def beppo = 8
class Dah extends Doo {
def f = "$beppo was a marx bros who saw dollars." // warn 3
}
}
class E {
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 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 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]
}
|