diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 51b8b3dc5d93..377ae621deae 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -47,6 +47,8 @@ class tests extends CompilerTest { val runDir = testsDir + "run/" val newDir = testsDir + "new/" val replDir = testsDir + "repl/" + val tastyDir = testsDir + "tasty/" + val tastyFailedDir = tastyDir + "failed/" val sourceDir = "./src/" val dottyDir = sourceDir + "dotty/" @@ -287,4 +289,34 @@ class tests extends CompilerTest { @Test def tasty_dotc_util = compileDir(dotcDir, "util", testPickling) @Test def tasty_tools_io = compileDir(toolsDir, "io", testPickling) @Test def tasty_tests = compileDir(testsDir, "tasty", testPickling) + + //TODO - failed TASTY tests + @Test def tasty_runtime_vc = compileDir(s"${dottyDir}runtime/", "vc", testPickling) + @Test def tasty_fail1 = compileFile(tastyFailedDir, "Fail1", testPickling) + + //issue with types in import, lazy val imports from Scala + @Test def tasty_fail_backend = compileFile(s"${backendDir}jvm/", "DottyBackendInterface", testPickling) + + @Test def tasty_fail_sjs = compileDir(s"${backendDir}", "sjs", testPickling) + + @Test def tasty_fail_types = compileFile(coreDir, "Types", testPickling) + @Test def tasty_fail2 = compileFile(tastyFailedDir, "Fail2", testPickling) + //TODO - Fail3.scala - problem with the compilation after unpickling + + @Test def tasty_fail_parsers = compileFile(parsingDir, "Parsers", testPickling) + @Test def tasty_fail4 = compileFile(tastyFailedDir, "Fail4", testPickling) + + @Test def tasty_fail_repl1 = compileFile(dotcDir + "repl/", "CompilingInterpreter", testPickling) + @Test def tasty_fail5 = compileFile(tastyFailedDir, "Fail5", testPickling) + + //var param, issue with order + @Test def tasty_fail6 = compileFile(tastyFailedDir, "Fail6", testPickling) + //TODO - Fail7.scala - problem with unpickling - var param + + @Test def tasty_fail_transform = compileFile(s"${dotcDir}transform/", "PatternMatcher", testPickling) + @Test def tasty_fail8 = compileFile(tastyFailedDir, "Fail8", testPickling) + @Test def tasty_fail9 = compileFile(tastyFailedDir, "Fail9", testPickling) + + @Test def tasty_fail_typer = compileFile(typerDir, "Namer", testPickling) + @Test def tasty_fail10 = compileFile(tastyFailedDir, "Fail10", testPickling) } diff --git a/tests/tasty/failed/Fail1.scala b/tests/tasty/failed/Fail1.scala new file mode 100644 index 000000000000..f75afabc5591 --- /dev/null +++ b/tests/tasty/failed/Fail1.scala @@ -0,0 +1,8 @@ +class Test[T] { + def testMethod: Unit = + new Foo(this) +} + +class Foo[T] { + def this(ct: Test[T]) = this() +} \ No newline at end of file diff --git a/tests/tasty/failed/Fail10.scala b/tests/tasty/failed/Fail10.scala new file mode 100644 index 000000000000..f208c7424e11 --- /dev/null +++ b/tests/tasty/failed/Fail10.scala @@ -0,0 +1,7 @@ +class Fail10 { + Nil foreach { + case cdef => + Some(true) + case _ => + } +} \ No newline at end of file diff --git a/tests/tasty/failed/Fail2.scala b/tests/tasty/failed/Fail2.scala new file mode 100644 index 000000000000..94cd4556c9ec --- /dev/null +++ b/tests/tasty/failed/Fail2.scala @@ -0,0 +1,14 @@ +class Test() { + thisTest => //pickling representation is the same if remove self renaming + + import Test._ + + val myStatus: Status = Unknown + + def currentStatus: Status = myStatus +} + +object Test { + private type Status = Byte + val Unknown: Status = 0 +} diff --git a/tests/tasty/failed/Fail3.scala b/tests/tasty/failed/Fail3.scala new file mode 100644 index 000000000000..bbe2e393ad5e --- /dev/null +++ b/tests/tasty/failed/Fail3.scala @@ -0,0 +1,9 @@ +//compilation fails after unpickling + class Test() { + import Test._ + + val myStatus = Unknown + } + object Test { + private val Unknown: Int = 0 // not yet computed + } \ No newline at end of file diff --git a/tests/tasty/failed/Fail4.scala b/tests/tasty/failed/Fail4.scala new file mode 100644 index 000000000000..27e696447a12 --- /dev/null +++ b/tests/tasty/failed/Fail4.scala @@ -0,0 +1,5 @@ +class Builder(parser: Parser) + +class Parser { + object concreteBuilder extends Builder(this) +} diff --git a/tests/tasty/failed/Fail5.scala b/tests/tasty/failed/Fail5.scala new file mode 100644 index 000000000000..1044f660aa16 --- /dev/null +++ b/tests/tasty/failed/Fail5.scala @@ -0,0 +1,4 @@ +class Fail5 { + val someClass: Class[_] = ??? + val resultMethod = someClass.getMethod("result") +} \ No newline at end of file diff --git a/tests/tasty/failed/Fail6.scala b/tests/tasty/failed/Fail6.scala new file mode 100644 index 000000000000..50f433794b4d --- /dev/null +++ b/tests/tasty/failed/Fail6.scala @@ -0,0 +1,2 @@ +//different order of getter and setter of in +abstract class Fail6(var in: Int, out: Double) \ No newline at end of file diff --git a/tests/tasty/failed/Fail7.scala b/tests/tasty/failed/Fail7.scala new file mode 100644 index 000000000000..f8f48d37ab9f --- /dev/null +++ b/tests/tasty/failed/Fail7.scala @@ -0,0 +1,13 @@ +//Problem with unpickling +//error: class Test needs to be abstract, since var in_=: (x$1: Int)Unit is not defined +// (Note that an abstract var requires a setter in addition to the getter) +// one error found +class Fail7(var in: Int) + +/* +//This code fails while compiling with -Ycheck:all +//Exception in thread "main" java.lang.AssertionError: assertion failed: method in_$eq is both Deferred and Private +abstract class Fail7(private var in: Int, out: Double) { + val interpreter = 5 +} +*/ \ No newline at end of file diff --git a/tests/tasty/failed/Fail8.scala b/tests/tasty/failed/Fail8.scala new file mode 100644 index 000000000000..cdb5bbebd7df --- /dev/null +++ b/tests/tasty/failed/Fail8.scala @@ -0,0 +1,6 @@ +trait Fail8 { + val ignoredSubPatBinders: Set[Int] + val storedBinders: Set[Int] = + (if (true) List.empty.toSet else Set.empty) ++ extraStoredBinders -- ignoredSubPatBinders + val extraStoredBinders: Set[Int] +} \ No newline at end of file diff --git a/tests/tasty/failed/Fail9.scala b/tests/tasty/failed/Fail9.scala new file mode 100644 index 000000000000..eca5a4558b8e --- /dev/null +++ b/tests/tasty/failed/Fail9.scala @@ -0,0 +1,2 @@ +//def $default$2(private[this] val param1: scala.Int) +class Fail9(param1: Int)(param2: Boolean = true) //default value should be in second param list, and multiple parameter lists \ No newline at end of file