summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/dotless-targs.flags1
-rw-r--r--test/files/run/applydynamic_sip.flags1
-rw-r--r--test/files/run/interop_typetags_are_manifests.flags1
-rw-r--r--test/files/run/macro-openmacros.flags3
-rw-r--r--test/files/run/macro-parse-position.flags1
-rw-r--r--test/files/run/macroPlugins-macroExpand.flags1
-rw-r--r--test/files/run/macroPlugins-typedMacroBody.flags1
-rw-r--r--test/files/run/t6327.flags1
-rw-r--r--test/files/run/t6663.flags1
-rw-r--r--test/files/run/t6731.flags1
-rw-r--r--test/files/run/t8196.check7
-rw-r--r--test/files/run/t8196.scala51
-rw-r--r--test/files/run/t8442.check1
-rw-r--r--test/files/run/t8442/A_1.java4
-rw-r--r--test/files/run/t8442/B_1.java3
-rw-r--r--test/files/run/t8442/C_2.scala5
-rw-r--r--test/files/run/t8442/Test.scala29
-rw-r--r--test/files/run/virtpatmat_staging.flags1
-rw-r--r--test/scaladoc/run/SI-8479.check1
-rwxr-xr-xtest/scaladoc/run/SI-8479.scala32
20 files changed, 145 insertions, 1 deletions
diff --git a/test/files/pos/dotless-targs.flags b/test/files/pos/dotless-targs.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/pos/dotless-targs.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/applydynamic_sip.flags b/test/files/run/applydynamic_sip.flags
index 1141f97507..ba6d37305e 100644
--- a/test/files/run/applydynamic_sip.flags
+++ b/test/files/run/applydynamic_sip.flags
@@ -1 +1,2 @@
+-Yrangepos:false
-language:dynamics
diff --git a/test/files/run/interop_typetags_are_manifests.flags b/test/files/run/interop_typetags_are_manifests.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/interop_typetags_are_manifests.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/macro-openmacros.flags b/test/files/run/macro-openmacros.flags
index cd66464f2f..2433c055a4 100644
--- a/test/files/run/macro-openmacros.flags
+++ b/test/files/run/macro-openmacros.flags
@@ -1 +1,2 @@
--language:experimental.macros \ No newline at end of file
+-Yrangepos:false
+-language:experimental.macros
diff --git a/test/files/run/macro-parse-position.flags b/test/files/run/macro-parse-position.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/macro-parse-position.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/macroPlugins-macroExpand.flags b/test/files/run/macroPlugins-macroExpand.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/macroPlugins-macroExpand.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/macroPlugins-typedMacroBody.flags b/test/files/run/macroPlugins-typedMacroBody.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/macroPlugins-typedMacroBody.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/t6327.flags b/test/files/run/t6327.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/t6327.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/t6663.flags b/test/files/run/t6663.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/t6663.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/t6731.flags b/test/files/run/t6731.flags
new file mode 100644
index 0000000000..ea7fc37e1a
--- /dev/null
+++ b/test/files/run/t6731.flags
@@ -0,0 +1 @@
+-Yrangepos:false
diff --git a/test/files/run/t8196.check b/test/files/run/t8196.check
new file mode 100644
index 0000000000..b32f42cf07
--- /dev/null
+++ b/test/files/run/t8196.check
@@ -0,0 +1,7 @@
+t8196.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ form2.g1 // comment this line in order to make the test pass
+ ^
+warning: there were 2 feature warning(s); re-run with -feature for details
+Scope{
+ final private val f1: Int
+}
diff --git a/test/files/run/t8196.scala b/test/files/run/t8196.scala
new file mode 100644
index 0000000000..e219ac166b
--- /dev/null
+++ b/test/files/run/t8196.scala
@@ -0,0 +1,51 @@
+import scala.reflect.runtime.{ universe => ru }
+
+object Test extends App {
+
+ trait FormTrait {
+
+ val runtimeMirror = ru.runtimeMirror(this.getClass.getClassLoader)
+ val instanceMirror = runtimeMirror.reflect(this)
+ val members = instanceMirror.symbol.typeSignature.members
+ def fields = members.filter(_.typeSignature <:< ru.typeOf[Int])
+ }
+
+ val f = () => {
+
+ class Form1 extends FormTrait {
+ val f1 = 5
+ }
+ val form1 = new Form1
+
+ println(form1.fields)
+
+ val form2 = new FormTrait {
+ val g1 = new Form1
+ }
+
+ form2.g1 // comment this line in order to make the test pass
+ ()
+ }
+
+ val g = () => {
+ // Reported as SI-8195, same root cause
+ trait Form {
+
+ private val runtimeMirror = ru.runtimeMirror(this.getClass.getClassLoader)
+ private val instanceMirror = runtimeMirror.reflect(this)
+ private val members = instanceMirror.symbol.typeSignature.members
+
+ }
+
+ val f1 = new Form {
+ val a = 1
+ }
+
+ val f2 = new Form {
+ val b = f1.a
+ }
+ }
+
+ f()
+ g()
+}
diff --git a/test/files/run/t8442.check b/test/files/run/t8442.check
new file mode 100644
index 0000000000..ce9e8b52ff
--- /dev/null
+++ b/test/files/run/t8442.check
@@ -0,0 +1 @@
+pos: NoPosition Class A_1 not found - continuing with a stub. WARNING
diff --git a/test/files/run/t8442/A_1.java b/test/files/run/t8442/A_1.java
new file mode 100644
index 0000000000..227451eecd
--- /dev/null
+++ b/test/files/run/t8442/A_1.java
@@ -0,0 +1,4 @@
+@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+public @interface A_1 {
+
+} \ No newline at end of file
diff --git a/test/files/run/t8442/B_1.java b/test/files/run/t8442/B_1.java
new file mode 100644
index 0000000000..1680684495
--- /dev/null
+++ b/test/files/run/t8442/B_1.java
@@ -0,0 +1,3 @@
+public class B_1 {
+ @A_1 public String get() { return ""; }
+}
diff --git a/test/files/run/t8442/C_2.scala b/test/files/run/t8442/C_2.scala
new file mode 100644
index 0000000000..d75d4bd910
--- /dev/null
+++ b/test/files/run/t8442/C_2.scala
@@ -0,0 +1,5 @@
+class C_2 {
+ def foo(b: B_1) {
+ b.get()
+ }
+}
diff --git a/test/files/run/t8442/Test.scala b/test/files/run/t8442/Test.scala
new file mode 100644
index 0000000000..ff6da4e206
--- /dev/null
+++ b/test/files/run/t8442/Test.scala
@@ -0,0 +1,29 @@
+import scala.tools.partest._
+import java.io.File
+
+object Test extends StoreReporterDirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code)
+ }
+
+ def app = """
+ class C_2 {
+ def foo(b: B_1) {
+ b.get()
+ }
+ }
+ """
+
+ def show(): Unit = {
+ val tClass = new File(testOutput.path, "A_1.class")
+ assert(tClass.exists)
+ assert(tClass.delete())
+
+ // Expecting stub symbol warning, but no stack trace!
+ compileCode(app)
+ println(filteredInfos.mkString("\n"))
+ }
+}
diff --git a/test/files/run/virtpatmat_staging.flags b/test/files/run/virtpatmat_staging.flags
index 48fd867160..0a22f7c729 100644
--- a/test/files/run/virtpatmat_staging.flags
+++ b/test/files/run/virtpatmat_staging.flags
@@ -1 +1,2 @@
+-Yrangepos:false
-Xexperimental
diff --git a/test/scaladoc/run/SI-8479.check b/test/scaladoc/run/SI-8479.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/SI-8479.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/SI-8479.scala b/test/scaladoc/run/SI-8479.scala
new file mode 100755
index 0000000000..3c91395025
--- /dev/null
+++ b/test/scaladoc/run/SI-8479.scala
@@ -0,0 +1,32 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.nsc.doc.base._
+import scala.tools.nsc.doc.base.comment._
+import scala.tools.partest.ScaladocModelTest
+import java.net.{URI, URL}
+import java.io.File
+
+object Test extends ScaladocModelTest {
+
+ override def code =
+ """
+ |object Test {
+ | val x = new SparkContext(master = "")
+ |}
+ |
+ |class SparkContext(config: Any) {
+ |
+ | /** Scaladoc comment */
+ | def this(
+ | master: String,
+ | appName: String = "") = this(null)
+ |}
+ |
+ |
+ """.stripMargin
+
+ override def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) {
+ // it didn't crash
+ }
+}