summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/future-spec/FutureTests.scala19
-rw-r--r--test/files/neg/macro-qmarkqmarkqmark.check13
-rw-r--r--test/files/neg/macro-qmarkqmarkqmark.scala13
-rw-r--r--test/files/neg/stringinterpolation_macro-neg.check2
-rw-r--r--test/files/neg/t5510.check6
-rw-r--r--test/files/neg/t5856.check2
-rw-r--r--test/files/neg/t6771b.check6
-rw-r--r--test/files/neg/t6771b.scala16
-rw-r--r--test/files/neg/t7325.check19
-rw-r--r--test/files/neg/t7325.scala25
-rw-r--r--test/files/neg/t7385.check10
-rw-r--r--test/files/neg/t7385.scala7
-rw-r--r--test/files/neg/t7441.check6
-rw-r--r--test/files/neg/t7441.scala7
-rw-r--r--test/files/pos/macro-qmarkqmarkqmark.check0
-rw-r--r--test/files/pos/macro-qmarkqmarkqmark.scala7
-rw-r--r--test/files/pos/t5886.scala18
-rw-r--r--test/files/pos/t6091.flags1
-rw-r--r--test/files/pos/t6091.scala10
-rw-r--r--test/files/pos/t6771.flags1
-rw-r--r--test/files/pos/t6771.scala9
-rw-r--r--test/files/pos/t7426.scala3
-rw-r--r--test/files/run/interpolation.scala2
-rw-r--r--test/files/run/interpolationMultiline1.scala2
-rw-r--r--test/files/run/macro-system-properties.check26
-rw-r--r--test/files/run/macro-system-properties.scala16
-rw-r--r--test/files/run/macro-toplevel-companion-c.check2
-rw-r--r--test/files/run/memberpos.check2
-rw-r--r--test/files/run/reflection-fieldmirror-getsetval.check2
-rw-r--r--test/files/run/reflection-fieldmirror-getsetval.scala12
-rw-r--r--test/files/run/t5603.check2
-rw-r--r--test/files/run/t6028.check2
-rw-r--r--test/files/run/t6288.check2
-rw-r--r--test/files/run/t6440.check2
-rw-r--r--test/files/run/t6555.check2
-rw-r--r--test/files/run/t7271.check12
-rw-r--r--test/files/run/t7271.scala34
-rw-r--r--test/files/run/t7325.check19
-rw-r--r--test/files/run/t7325.scala25
-rw-r--r--test/files/run/t7398.scala31
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_lookup.check2
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check2
42 files changed, 373 insertions, 26 deletions
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala
index 01c9cf82ba..7deb4929d4 100644
--- a/test/files/jvm/future-spec/FutureTests.scala
+++ b/test/files/jvm/future-spec/FutureTests.scala
@@ -71,6 +71,25 @@ object FutureTests extends MinimalScalaTest {
}
}
+ "The Future companion object" should {
+ "call ExecutionContext.prepare on apply" in {
+ val p = Promise[Boolean]()
+ val ec = new ExecutionContext {
+ val delegate = ExecutionContext.global
+ override def prepare(): ExecutionContext = {
+ p.success(true)
+ delegate.prepare
+ }
+ override def execute(r: Runnable) = delegate.execute(r)
+ override def reportFailure(t: Throwable): Unit = delegate.reportFailure(t)
+ }
+
+ val f = Future("foo")(ec)
+ Await.result(f, defaultTimeout) mustBe ("foo")
+ Await.result(p.future, defaultTimeout) mustBe (true)
+ }
+ }
+
"The default ExecutionContext" should {
"report uncaught exceptions" in {
val p = Promise[Throwable]()
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
+}
diff --git a/test/files/pos/macro-qmarkqmarkqmark.check b/test/files/pos/macro-qmarkqmarkqmark.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/pos/macro-qmarkqmarkqmark.check
diff --git a/test/files/pos/macro-qmarkqmarkqmark.scala b/test/files/pos/macro-qmarkqmarkqmark.scala
new file mode 100644
index 0000000000..a91e4320b6
--- /dev/null
+++ b/test/files/pos/macro-qmarkqmarkqmark.scala
@@ -0,0 +1,7 @@
+import language.experimental.macros
+
+object Macros {
+ def foo1 = macro ???
+ def foo2(x: Int) = macro ???
+ def foo3[T] = macro ???
+} \ No newline at end of file
diff --git a/test/files/pos/t5886.scala b/test/files/pos/t5886.scala
new file mode 100644
index 0000000000..066187322d
--- /dev/null
+++ b/test/files/pos/t5886.scala
@@ -0,0 +1,18 @@
+object A {
+ def f0[T](x: T): T = x
+ def f1[T](x: => T): T = x
+ def f2[T](x: () => T): T = x()
+
+ f0(this.getClass) // ok
+ f1(this.getClass)
+ f2(this.getClass) // ok
+
+ // a.scala:7: error: type mismatch;
+ // found : Class[_ <: A.type]
+ // required: Class[?0(in value x1)] where type ?0(in value x1) <: A.type
+ // Note: A.type >: ?0, but Java-defined class Class is invariant in type T.
+ // You may wish to investigate a wildcard type such as `_ >: ?0`. (SLS 3.2.10)
+ // val x1 = f1(this.getClass)
+ // ^
+ // one error found
+}
diff --git a/test/files/pos/t6091.flags b/test/files/pos/t6091.flags
new file mode 100644
index 0000000000..954eaba352
--- /dev/null
+++ b/test/files/pos/t6091.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Xlint
diff --git a/test/files/pos/t6091.scala b/test/files/pos/t6091.scala
new file mode 100644
index 0000000000..72e663ec3b
--- /dev/null
+++ b/test/files/pos/t6091.scala
@@ -0,0 +1,10 @@
+object Foo { def eq(x:Int) = x }
+
+class X { def ==(other: String) = true }
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ Foo eq 1
+ new X == null
+ }
+}
diff --git a/test/files/pos/t6771.flags b/test/files/pos/t6771.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t6771.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t6771.scala b/test/files/pos/t6771.scala
new file mode 100644
index 0000000000..0f0bd4e4a0
--- /dev/null
+++ b/test/files/pos/t6771.scala
@@ -0,0 +1,9 @@
+object Test {
+ type Id[X] = X
+ val a: Id[Option[Int]] = None
+
+ a match {
+ case Some(x) => println(x)
+ case None =>
+ }
+}
diff --git a/test/files/pos/t7426.scala b/test/files/pos/t7426.scala
new file mode 100644
index 0000000000..8e42ad1812
--- /dev/null
+++ b/test/files/pos/t7426.scala
@@ -0,0 +1,3 @@
+class foo(x: Any) extends annotation.StaticAnnotation
+
+@foo(new AnyRef { }) trait A
diff --git a/test/files/run/interpolation.scala b/test/files/run/interpolation.scala
index f443bd5feb..14d9819348 100644
--- a/test/files/run/interpolation.scala
+++ b/test/files/run/interpolation.scala
@@ -13,7 +13,7 @@ object Test extends App {
println(s"Best price: $f")
println(f"Best price: $f%.2f")
println(s"$f% discount included")
- println(f"$f%3.2f% discount included")
+ println(f"$f%3.2f%% discount included")
}
test1(1)
diff --git a/test/files/run/interpolationMultiline1.scala b/test/files/run/interpolationMultiline1.scala
index 437aed44b0..db634e7775 100644
--- a/test/files/run/interpolationMultiline1.scala
+++ b/test/files/run/interpolationMultiline1.scala
@@ -13,7 +13,7 @@ object Test extends App {
println(s"""Best price: $f""")
println(f"""Best price: $f%.2f""")
println(s"""$f% discount included""")
- println(f"""$f%3.2f% discount included""")
+ println(f"""$f%3.2f%% discount included""")
}
test1(1)
diff --git a/test/files/run/macro-system-properties.check b/test/files/run/macro-system-properties.check
new file mode 100644
index 0000000000..a2da4aaf60
--- /dev/null
+++ b/test/files/run/macro-system-properties.check
@@ -0,0 +1,26 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import language.experimental._, reflect.macros.Context
+import language.experimental._
+import reflect.macros.Context
+
+scala> object GrabContext {
+ def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context])
+ // System.properties lets you stash true globals (unlike statics which are classloader scoped)
+ def impl(c: Context)() = { System.getProperties.put("lastContext", c); c.literalUnit }
+ def grab() = macro impl
+ }
+defined object GrabContext
+
+scala> object Test { class C(implicit a: Any) { GrabContext.grab } }
+defined object Test
+
+scala> object Test { class C(implicit a: Any) { GrabContext.grab } }
+defined object Test
+
+scala>
+
+scala>
diff --git a/test/files/run/macro-system-properties.scala b/test/files/run/macro-system-properties.scala
new file mode 100644
index 0000000000..e182defc81
--- /dev/null
+++ b/test/files/run/macro-system-properties.scala
@@ -0,0 +1,16 @@
+import scala.tools.nsc._
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ import language.experimental._, reflect.macros.Context
+ object GrabContext {
+ def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context])
+ // System.properties lets you stash true globals (unlike statics which are classloader scoped)
+ def impl(c: Context)() = { System.getProperties.put("lastContext", c); c.literalUnit }
+ def grab() = macro impl
+ }
+ object Test { class C(implicit a: Any) { GrabContext.grab } }
+ object Test { class C(implicit a: Any) { GrabContext.grab } }
+ """
+}
diff --git a/test/files/run/macro-toplevel-companion-c.check b/test/files/run/macro-toplevel-companion-c.check
index 8b422c2061..4052c472f8 100644
--- a/test/files/run/macro-toplevel-companion-c.check
+++ b/test/files/run/macro-toplevel-companion-c.check
@@ -1,3 +1,3 @@
error: Companions 'class C' and 'object C' must be defined in same file:
- Found in <synthetic file name> and newSource1
+ Found in <synthetic file name> and newSource1.scala
diff --git a/test/files/run/memberpos.check b/test/files/run/memberpos.check
index e7d3534000..9e3a807f5a 100644
--- a/test/files/run/memberpos.check
+++ b/test/files/run/memberpos.check
@@ -1,4 +1,4 @@
-newSource1
+newSource1.scala
2,4 class A
6,28 object A
7,10 def bippy
diff --git a/test/files/run/reflection-fieldmirror-getsetval.check b/test/files/run/reflection-fieldmirror-getsetval.check
index 82fef37c25..1e959a9900 100644
--- a/test/files/run/reflection-fieldmirror-getsetval.check
+++ b/test/files/run/reflection-fieldmirror-getsetval.check
@@ -1,2 +1,2 @@
42
-cannot set an immutable field x
+2
diff --git a/test/files/run/reflection-fieldmirror-getsetval.scala b/test/files/run/reflection-fieldmirror-getsetval.scala
index 9cacb7080b..6a88dc3118 100644
--- a/test/files/run/reflection-fieldmirror-getsetval.scala
+++ b/test/files/run/reflection-fieldmirror-getsetval.scala
@@ -12,13 +12,7 @@ object Test extends App {
val cs = im.symbol
val f = cs.typeSignature.declaration(TermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm
val fm: FieldMirror = im.reflectField(f)
- try {
- println(fm.get)
- fm.set(2)
- println(fm.get)
- println("this indicates a failure")
- } catch {
- case ex: Throwable =>
- println(ex.getMessage)
- }
+ println(fm.get)
+ fm.set(2)
+ println(fm.get)
}
diff --git a/test/files/run/t5603.check b/test/files/run/t5603.check
index 3b2eb55313..188f39ff82 100644
--- a/test/files/run/t5603.check
+++ b/test/files/run/t5603.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of parser]] // newSource1
+[[syntax trees at end of parser]] // newSource1.scala
[0:241]package [0:0]<empty> {
[0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef {
[15]def $init$() = [15]{
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index 57fd58f7d3..46974589d3 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of lambdalift]] // newSource1
+[[syntax trees at end of lambdalift]] // newSource1.scala
package <empty> {
class T extends Object {
<paramaccessor> val classParam: Int = _;
diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check
index 4465b6302c..a032a10de6 100644
--- a/test/files/run/t6288.check
+++ b/test/files/run/t6288.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of patmat]] // newSource1
+[[syntax trees at end of patmat]] // newSource1.scala
[7]package [7]<empty> {
[7]object Case3 extends [13][106]scala.AnyRef {
[106]def <init>(): [13]Case3.type = [106]{
diff --git a/test/files/run/t6440.check b/test/files/run/t6440.check
index 69c253eab4..806279fb74 100644
--- a/test/files/run/t6440.check
+++ b/test/files/run/t6440.check
@@ -1,4 +1,4 @@
-pos: source-newSource1,line-9,offset=109 bad symbolic reference. A signature in U.class refers to term pack1
+pos: source-newSource1.scala,line-9,offset=109 bad symbolic reference. A signature in U.class refers to term pack1
in package <root> which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling U.class. ERROR
diff --git a/test/files/run/t6555.check b/test/files/run/t6555.check
index 04117b7c2f..a18a8e8023 100644
--- a/test/files/run/t6555.check
+++ b/test/files/run/t6555.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of specialize]] // newSource1
+[[syntax trees at end of specialize]] // newSource1.scala
package <empty> {
class Foo extends Object {
def <init>(): Foo = {
diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check
new file mode 100644
index 0000000000..6db301c21d
--- /dev/null
+++ b/test/files/run/t7271.check
@@ -0,0 +1,12 @@
+[[syntax trees at end of parser]] // newSource1.scala
+[0:91]package [0:0]<empty> {
+ [0:91]class C extends [8:91][91]scala.AnyRef {
+ [8]def <init>() = [8]{
+ [NoPosition][NoPosition][NoPosition]super.<init>();
+ [8]()
+ };
+ [16:44]def quote = [28:44]<28:44><28:44>[28]StringContext([30:34]"foo", [40:44]"baz").s([35:39]this);
+ [51:85]def tripleQuote = [69:85]<69:85><69:85>[69]StringContext([71:75]"foo", [81:85]"baz").s([76:80]this)
+ }
+}
+
diff --git a/test/files/run/t7271.scala b/test/files/run/t7271.scala
new file mode 100644
index 0000000000..6fccf14d20
--- /dev/null
+++ b/test/files/run/t7271.scala
@@ -0,0 +1,34 @@
+import scala.tools.partest._
+import java.io._
+import scala.tools.nsc._
+import scala.tools.nsc.util.CommandLineParser
+import scala.tools.nsc.{Global, Settings, CompilerCommand}
+import scala.tools.nsc.reporters.ConsoleReporter
+
+object Test extends DirectTest {
+
+ override def extraSettings: String = "-usejavacp -Xprint:parser -Ystop-after:parser -d " + testOutput.path
+
+ override def code = """
+ class C {
+ def quote = s"foo${this}baz"
+ def tripleQuote = s"foo${this}baz"
+ }
+ """.trim
+
+ override def show(): Unit = {
+ // redirect err to out, for logging
+ val prevErr = System.err
+ System.setErr(System.out)
+ compile()
+ System.setErr(prevErr)
+ }
+
+ override def newCompiler(args: String*): Global = {
+
+ val settings = new Settings()
+ settings.Xprintpos.value = true
+ val command = new CompilerCommand((CommandLineParser tokenize extraSettings) ++ args.toList, settings)
+ new Global(command.settings, new ConsoleReporter(settings)) with interactive.RangePositions
+ }
+}
diff --git a/test/files/run/t7325.check b/test/files/run/t7325.check
new file mode 100644
index 0000000000..3c7652f42c
--- /dev/null
+++ b/test/files/run/t7325.check
@@ -0,0 +1,19 @@
+%
+%%
+%%%
+%n
+%
+
+%%n
+%%
+
+%%%n
+%%%
+
+0
+0%d
+0%%d
+0
+
+0
+
diff --git a/test/files/run/t7325.scala b/test/files/run/t7325.scala
new file mode 100644
index 0000000000..26f6bc6ef7
--- /dev/null
+++ b/test/files/run/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/run/t7398.scala b/test/files/run/t7398.scala
new file mode 100644
index 0000000000..e4090f7db3
--- /dev/null
+++ b/test/files/run/t7398.scala
@@ -0,0 +1,31 @@
+import scala.tools.partest._
+
+object Test extends CompilerTest {
+ import global._
+
+ def javaVersion = scala.util.Properties.javaVersion
+ def isJavaEight = javaVersion startsWith "1.8"
+ // This way we auto-pass on non-java8 since there's nothing to check
+ override lazy val units = {
+ val res: List[CompilationUnit] = if (isJavaEight) javaCompilationUnits(global)(defaultMethodSource) else Nil
+ val word = if (isJavaEight) "Attempting" else "Skipping"
+ log(s"$word java8-specific test under java version $javaVersion")
+ res
+ }
+
+ private def defaultMethodSource = """
+public interface Iterator<E> {
+ boolean hasNext();
+ E next();
+ default void remove() {
+ throw new UnsupportedOperationException("remove");
+ }
+ default void forEachRemaining(Consumer<? super E> action) {
+ throw new UnsupportedOperationException("forEachRemaining");
+ }
+}
+ """
+
+ // We're only checking we can parse it.
+ def check(source: String, unit: global.CompilationUnit): Unit = ()
+}
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_lookup.check b/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
index 8c558ced60..84e5435afe 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
+++ b/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
@@ -1,2 +1,2 @@
-pos: source-newSource1,line-9,offset=466 could not find implicit value for evidence parameter of type reflect.runtime.package.universe.TypeTag[Int] ERROR
+pos: source-newSource1.scala,line-9,offset=466 could not find implicit value for evidence parameter of type reflect.runtime.package.universe.TypeTag[Int] ERROR
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
index acfecce628..8c9d07d836 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
+++ b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
@@ -1,2 +1,2 @@
-pos: source-newSource1,line-9,offset=479 No Manifest available for App.this.T. ERROR
+pos: source-newSource1.scala,line-9,offset=479 No Manifest available for App.this.T. ERROR