diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/macro-qmarkqmarkqmark.check | 13 | ||||
-rw-r--r-- | test/files/neg/macro-qmarkqmarkqmark.scala | 13 | ||||
-rw-r--r-- | test/files/neg/stringinterpolation_macro-neg.check | 2 | ||||
-rw-r--r-- | test/files/neg/t5510.check | 6 | ||||
-rw-r--r-- | test/files/neg/t5856.check | 2 | ||||
-rw-r--r-- | test/files/neg/t6771b.check | 6 | ||||
-rw-r--r-- | test/files/neg/t6771b.scala | 16 | ||||
-rw-r--r-- | test/files/neg/t7325.check | 19 | ||||
-rw-r--r-- | test/files/neg/t7325.scala | 25 | ||||
-rw-r--r-- | test/files/neg/t7385.check | 10 | ||||
-rw-r--r-- | test/files/neg/t7385.scala | 7 | ||||
-rw-r--r-- | test/files/neg/t7441.check | 6 | ||||
-rw-r--r-- | test/files/neg/t7441.scala | 7 |
13 files changed, 127 insertions, 5 deletions
diff --git a/test/files/neg/macro-qmarkqmarkqmark.check b/test/files/neg/macro-qmarkqmarkqmark.check new file mode 100644 index 0000000000..afd49e7d90 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.check @@ -0,0 +1,13 @@ +macro-qmarkqmarkqmark.scala:5: error: macro implementation is missing + foo1 + ^ +macro-qmarkqmarkqmark.scala:8: error: macros cannot be partially applied + foo2 + ^ +macro-qmarkqmarkqmark.scala:9: error: macro implementation is missing + foo2(1) + ^ +macro-qmarkqmarkqmark.scala:12: error: macro implementation is missing + foo3[Int] + ^ +four errors found diff --git a/test/files/neg/macro-qmarkqmarkqmark.scala b/test/files/neg/macro-qmarkqmarkqmark.scala new file mode 100644 index 0000000000..c8d8550fd8 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.scala @@ -0,0 +1,13 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + foo1 + + def foo2(x: Int) = macro ??? + foo2 + foo2(1) + + def foo3[T] = macro ??? + foo3[Int] +}
\ No newline at end of file diff --git a/test/files/neg/stringinterpolation_macro-neg.check b/test/files/neg/stringinterpolation_macro-neg.check index 8986b899a3..457f497f2f 100644 --- a/test/files/neg/stringinterpolation_macro-neg.check +++ b/test/files/neg/stringinterpolation_macro-neg.check @@ -66,5 +66,5 @@ Note that implicit conversions are not applicable because they are ambiguous: ^ stringinterpolation_macro-neg.scala:30: error: illegal conversion character f"$s%i" - ^ + ^ 15 errors found diff --git a/test/files/neg/t5510.check b/test/files/neg/t5510.check index 04220e79bb..322a2f5e25 100644 --- a/test/files/neg/t5510.check +++ b/test/files/neg/t5510.check @@ -1,15 +1,15 @@ t5510.scala:2: error: unclosed string literal val s1 = s"xxx - ^ + ^ t5510.scala:3: error: unclosed string literal val s2 = s"xxx $x ^ t5510.scala:4: error: unclosed string literal val s3 = s"xxx $$ - ^ + ^ t5510.scala:5: error: unclosed string literal val s4 = ""s" - ^ + ^ t5510.scala:6: error: unclosed multi-line string literal val s5 = ""s""" $s1 $s2 s" ^ diff --git a/test/files/neg/t5856.check b/test/files/neg/t5856.check index ac49d4b9ac..08a61bdc07 100644 --- a/test/files/neg/t5856.check +++ b/test/files/neg/t5856.check @@ -1,6 +1,6 @@ t5856.scala:10: error: invalid string interpolation: `$$', `$'ident or `$'BlockExpr expected val s9 = s"$" - ^ + ^ t5856.scala:10: error: unclosed string literal val s9 = s"$" ^ diff --git a/test/files/neg/t6771b.check b/test/files/neg/t6771b.check new file mode 100644 index 0000000000..ba99e9178d --- /dev/null +++ b/test/files/neg/t6771b.check @@ -0,0 +1,6 @@ +t6771b.scala:14: error: type mismatch; + found : x.type (with underlying type String) + required: Test.a.type + b = b match { case x => x } + ^ +one error found diff --git a/test/files/neg/t6771b.scala b/test/files/neg/t6771b.scala new file mode 100644 index 0000000000..78f11f7750 --- /dev/null +++ b/test/files/neg/t6771b.scala @@ -0,0 +1,16 @@ +// Currently, the pattern matcher widens the type of the +// scrutinee, so this doesn't typecheck. This test just +// confirms this behaviour, although it would be an improvement +// to change this and make this a `pos` test. +// +// But, to the intrepid hacker who works on this, a few notes: +// You'll have to look into places in the pattern matcher that +// call `dealias`, and see if they need to be `dealiasWiden`. +// For example, if `checkableType` used only `dealias`, `pos/t6671.scala` +// would fail. +object Test { + val a = ""; var b: a.type = a + + b = b match { case x => x } +} + diff --git a/test/files/neg/t7325.check b/test/files/neg/t7325.check new file mode 100644 index 0000000000..709ab6db3e --- /dev/null +++ b/test/files/neg/t7325.check @@ -0,0 +1,19 @@ +t7325.scala:2: error: percent signs not directly following splicees must be escaped + println(f"%") + ^ +t7325.scala:4: error: percent signs not directly following splicees must be escaped + println(f"%%%") + ^ +t7325.scala:6: error: percent signs not directly following splicees must be escaped + println(f"%%%%%") + ^ +t7325.scala:16: error: wrong conversion string + println(f"${0}%") + ^ +t7325.scala:19: error: percent signs not directly following splicees must be escaped + println(f"${0}%%%d") + ^ +t7325.scala:21: error: percent signs not directly following splicees must be escaped + println(f"${0}%%%%%d") + ^ +6 errors found diff --git a/test/files/neg/t7325.scala b/test/files/neg/t7325.scala new file mode 100644 index 0000000000..adfd8dd47a --- /dev/null +++ b/test/files/neg/t7325.scala @@ -0,0 +1,25 @@ +object Test extends App { + println(f"%") + println(f"%%") + println(f"%%%") + println(f"%%%%") + println(f"%%%%%") + println(f"%%%%%%") + + println(f"%%n") + println(f"%%%n") + println(f"%%%%n") + println(f"%%%%%n") + println(f"%%%%%%n") + println(f"%%%%%%%n") + + println(f"${0}%") + println(f"${0}%d") + println(f"${0}%%d") + println(f"${0}%%%d") + println(f"${0}%%%%d") + println(f"${0}%%%%%d") + + println(f"${0}%n") + println(f"${0}%d%n") +}
\ No newline at end of file diff --git a/test/files/neg/t7385.check b/test/files/neg/t7385.check new file mode 100644 index 0000000000..70d3c3fb61 --- /dev/null +++ b/test/files/neg/t7385.check @@ -0,0 +1,10 @@ +t7385.scala:2: error: '(' expected but identifier found. + do { println("bippy") } while i<10 + ^ +t7385.scala:6: error: '(' expected but identifier found. + while i<10 { () } + ^ +t7385.scala:7: error: illegal start of simple expression +} +^ +three errors found diff --git a/test/files/neg/t7385.scala b/test/files/neg/t7385.scala new file mode 100644 index 0000000000..a7f801098b --- /dev/null +++ b/test/files/neg/t7385.scala @@ -0,0 +1,7 @@ +object Bar { + do { println("bippy") } while i<10 +} + +object Foo { + while i<10 { () } +} diff --git a/test/files/neg/t7441.check b/test/files/neg/t7441.check new file mode 100644 index 0000000000..f259457197 --- /dev/null +++ b/test/files/neg/t7441.check @@ -0,0 +1,6 @@ +t7441.scala:4: error: type mismatch; + found : Int(1) + required: List[Any] + def test = apply(1) + ^ +one error found diff --git a/test/files/neg/t7441.scala b/test/files/neg/t7441.scala new file mode 100644 index 0000000000..dad7421e3f --- /dev/null +++ b/test/files/neg/t7441.scala @@ -0,0 +1,7 @@ +object Test { + object Bar { + def apply(xs: List[Any]): Int = 0 + def test = apply(1) + } + implicit def foo = 1 +} |