diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/forgot-interpolator.check | 11 | ||||
-rw-r--r-- | test/files/neg/forgot-interpolator.scala | 34 |
2 files changed, 44 insertions, 1 deletions
diff --git a/test/files/neg/forgot-interpolator.check b/test/files/neg/forgot-interpolator.check index 98440fe657..157cbb4802 100644 --- a/test/files/neg/forgot-interpolator.check +++ b/test/files/neg/forgot-interpolator.check @@ -16,6 +16,15 @@ forgot-interpolator.scala:42: warning: `$bar` looks like an interpolated identif forgot-interpolator.scala:47: warning: `$hippo` looks like an interpolated identifier! Did you forget the interpolator? def h = "$hippo takes an implicit" // warn 6 ^ +forgot-interpolator.scala:88: warning: `$groucho` looks like an interpolated identifier! Did you forget the interpolator? + def f2 = "I salute $groucho" // warn 7 + ^ +forgot-interpolator.scala:89: warning: `$dingo` looks like an interpolated identifier! Did you forget the interpolator? + def f3 = "I even salute $dingo" // warn 8 + ^ +forgot-interpolator.scala:90: warning: `$calico` looks like an interpolated identifier! Did you forget the interpolator? + def f4 = "I also salute $calico" // warn 9 + ^ error: No warnings can be incurred under -Xfatal-warnings. -6 warnings found +9 warnings found one error found diff --git a/test/files/neg/forgot-interpolator.scala b/test/files/neg/forgot-interpolator.scala index e007f15009..34a7c7aef4 100644 --- a/test/files/neg/forgot-interpolator.scala +++ b/test/files/neg/forgot-interpolator.scala @@ -57,3 +57,37 @@ package test { @implicitNotFound("No Z in ${A}") // no warn class Z[A] } + + +package inf1 { + import scala.annotation.implicitNotFound + + @implicitNotFound(msg = "Cannot construct a collection of type ${To} with elements of type ${Elem} based on a collection of type ${From}.") // no warn + trait CannotBuildFrom[-From, -Elem, +To] +} + +package inf2 { + @scala.annotation.implicitNotFound(msg = "Cannot construct a collection of type ${To} with elements of type ${Elem} based on a collection of type ${From}.") // no warn + trait CannotBuildFrom[-From, -Elem, +To] +} + +package inf3 { + @scala.annotation.implicitNotFound("Cannot construct a collection of type ${To} with elements of type ${Elem} based on a collection of type ${From}.") // no warn + trait CannotBuildFrom[-From, -Elem, +To] +} + +package curry { + class A { + def bunko()(x: Int): Int = 5 + def groucho(): Int = 5 + def dingo()()()()()(): Int = 5 // kind of nuts this can be evaluated with just 'dingo', but okay + def calico[T1, T2]()()(): Int = 5 // even nutsier + def palomino[T1, T2]()(y: Int = 5)(): Int = 5 // even nutsier + + def f1 = "I was picked up by the $bunko squad" // no warn + def f2 = "I salute $groucho" // warn 7 + def f3 = "I even salute $dingo" // warn 8 + def f4 = "I also salute $calico" // warn 9 + def f5 = "I draw the line at $palomino" // no warn + } +} |