diff --git a/project/Build.scala b/project/Build.scala index 504185e65f6c..271e54f8786d 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -74,12 +74,16 @@ object DottyBuild extends Build { partestLockFile.createNewFile partestLockFile.deleteOnExit }, - runPartestRunner <<= Def.taskDyn { + runPartestRunner <<= Def.inputTaskDyn { + // Magic! This is both an input task and a dynamic task. Apparently + // command line arguments get passed to the last task in an aliased + // sequence (see partest alias below), so this works. + val args = Def.spaceDelimited("").parsed val jars = Seq((packageBin in Compile).value.getAbsolutePath) ++ getJarPaths(partestDeps.value, ivyPaths.value.ivyHome) val dottyJars = "-dottyJars " + jars.length + " " + jars.mkString(" ") // Provide the jars required on the classpath of run tests - runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars) + runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars + " " + args.mkString(" ")) }, // Adjust classpath for running dotty @@ -170,7 +174,7 @@ object DottyBuild extends Build { lazy val partestLockFile = new File("." + File.separator + "tests" + File.separator + "locks" + File.separator + s"partest-$pid.lock") def pid = java.lang.Long.parseLong(java.lang.management.ManagementFactory.getRuntimeMXBean().getName().split("@")(0)) - lazy val runPartestRunner = TaskKey[Unit]("runPartestRunner", "Runs partest") + lazy val runPartestRunner = InputKey[Unit]("runPartestRunner", "Runs partest") lazy val partestDeps = SettingKey[Seq[ModuleID]]("partestDeps", "Finds jars for partest dependencies") def getJarPaths(modules: Seq[ModuleID], ivyHome: Option[File]): Seq[String] = ivyHome match { diff --git a/src/dotty/runtime/LegacyApp.scala b/src/dotty/runtime/LegacyApp.scala new file mode 100644 index 000000000000..2c4b295d05b5 --- /dev/null +++ b/src/dotty/runtime/LegacyApp.scala @@ -0,0 +1,9 @@ +package dotty.runtime + + +/** + * replaces the `scala.App` class which relies on `DelayedInit` functionality, not supported by Dotty. + */ +class LegacyApp { + def main(args: Array[String]): Unit = () +} diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 88d076fd3b61..42ce1136c75e 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -137,9 +137,9 @@ class tests extends CompilerTest { @Test def neg_escapingRefs = compileFile(negDir, "escapingRefs", xerrors = 2) @Test def neg_instantiateAbstract = compileFile(negDir, "instantiateAbstract", xerrors = 8) @Test def neg_selfInheritance = compileFile(negDir, "selfInheritance", xerrors = 5) + - @Test def run_hello = runFile(runDir, "hello") - @Test def run_lazyVals = runFile(runDir, "lazyVals") + @Test def run_all = runFiles(runDir) @Test def dotty = compileDir(dottyDir, "tools", "-deep" :: allowDeepSubtypes ++ twice) // note the -deep argument diff --git a/test/dotty/partest/DPConsoleRunner.scala b/test/dotty/partest/DPConsoleRunner.scala index 31b8467d347c..1f3eaa39d760 100644 --- a/test/dotty/partest/DPConsoleRunner.scala +++ b/test/dotty/partest/DPConsoleRunner.scala @@ -23,21 +23,24 @@ object DPConsoleRunner { // extra jars for run tests are passed with -dottyJars ... val jarFinder = """-dottyJars (\d*) (.*)""".r val (jarList, otherArgs) = args.toList.partition(jarFinder.findFirstIn(_).isDefined) - val extraJars = jarList match { + val (extraJars, moreArgs) = jarList match { case Nil => sys.error("Error: DPConsoleRunner needs \"-dottyJars *\".") case jarFinder(nr, jarString) :: Nil => val jars = jarString.split(" ").toList - if (jars.length.toString != nr) - sys.error("Error: DPConsoleRunner found wrong number of dottyJars: " + jars + ", expected: " + nr + ". Make sure the path doesn't contain any spaces.") - else jars + val count = nr.toInt + if (jars.length < count) + sys.error("Error: DPConsoleRunner found wrong number of dottyJars: " + jars + ", expected: " + nr) + else (jars.take(count), jars.drop(count)) case list => sys.error("Error: DPConsoleRunner found several -dottyJars options: " + list) } - new DPConsoleRunner(otherArgs mkString (" "), extraJars).runPartest + new DPConsoleRunner((otherArgs ::: moreArgs) mkString (" "), extraJars).runPartest } } // console runner has a suite runner which creates a test runner for each test class DPConsoleRunner(args: String, extraJars: List[String]) extends ConsoleRunner(args) { + println("ConsoleRunner options: " + args) + override val suiteRunner = new DPSuiteRunner ( testSourcePath = optSourcePath getOrElse DPConfig.testRoot, fileManager = new DottyFileManager(extraJars), diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala index 0e5c9a6b47fe..7b2e24ac12de 100644 --- a/test/test/CompilerTest.scala +++ b/test/test/CompilerTest.scala @@ -82,7 +82,7 @@ abstract class CompilerTest extends DottyTest { * @param extension the file extension, .scala by default * @param defaultOptions more arguments to the compiler */ - def compileFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0, + def compileFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0, extension: String = ".scala", runTest: Boolean = false) (implicit defaultOptions: List[String]): Unit = { if (!generatePartestFiles || !partestableFile(prefix, fileName, extension, args ++ defaultOptions, xerrors)) { @@ -102,7 +102,8 @@ abstract class CompilerTest extends DottyTest { } } } - def runFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0, + + def runFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0, extension: String = ".scala")(implicit defaultOptions: List[String]): Unit = compileFile(prefix, fileName, args, xerrors, extension, true) @@ -140,23 +141,28 @@ abstract class CompilerTest extends DottyTest { } } } + def runDir(prefix: String, dirName: String, args: List[String] = Nil, xerrors: Int = 0) (implicit defaultOptions: List[String]): Unit = compileDir(prefix, dirName, args, xerrors, true) + def runFiles(path: String, args: List[String] = Nil, verbose: Boolean = true) + (implicit defaultOptions: List[String]): Unit = + compileFiles(path, args, verbose, true) + /** Compiles each source in the directory path separately by calling * compileFile resp. compileDir. */ - def compileFiles(path: String, args: List[String] = Nil, verbose: Boolean = true) + def compileFiles(path: String, args: List[String] = Nil, verbose: Boolean = true, isRunTest: Boolean = false) (implicit defaultOptions: List[String]): Unit = { val dir = Directory(path) val fileNames = dir.files.toArray.map(_.jfile.getName).filter(name => (name endsWith ".scala") || (name endsWith ".java")) for (name <- fileNames) { if (verbose) println(s"testing $path$name") - compileFile(path, name, args, 0, "") + compileFile(path, name, args, 0, "", isRunTest) } for (subdir <- dir.dirs) { if (verbose) println(s"testing $subdir") - compileDir(path, subdir.jfile.getName, args, 0) + compileDir(path, subdir.jfile.getName, args, 0, isRunTest) } } @@ -167,7 +173,7 @@ abstract class CompilerTest extends DottyTest { compileArgs((files ++ args).toArray, xerrors) } else { val destDir = Directory(DPConfig.testRoot + JFile.separator + testName) - files.foreach({ file => + files.foreach({ file => val jfile = new JFile(file) recCopyFiles(jfile, destDir / jfile.getName) }) @@ -192,7 +198,7 @@ abstract class CompilerTest extends DottyTest { if (runTest) "run" else if (xerrors > 0) "neg" else if (prefixDir.endsWith("run" + JFile.separator)) { - NestUI.echoWarning("WARNING: test is being run as pos test despite being in a run directory. " + + NestUI.echoWarning("WARNING: test is being run as pos test despite being in a run directory. " + "Use runFile/runDir instead of compileFile/compileDir to do a run test") "pos" } else "pos" @@ -226,7 +232,7 @@ abstract class CompilerTest extends DottyTest { computeDestAndCopyFiles(source, nextDest, kind, flags, nerr, nr + 1, partestOutput) } } - + /** Copies the test sources. Creates flags, nerr, check and output files. */ private def copyFiles(sourceFile: Path, dest: Path, partestOutput: String, flags: List[String], nerr: String, kind: String) = { recCopyFiles(sourceFile, dest) @@ -237,7 +243,7 @@ abstract class CompilerTest extends DottyTest { dest.changeExtension("flags").createFile(true).writeAll(flags.mkString(" ")) if (nerr != "0") dest.changeExtension("nerr").createFile(true).writeAll(nerr) - sourceFile.changeExtension("check").ifFile({ check => + sourceFile.changeExtension("check").ifFile({ check => if (kind == "run") FileManager.copyFile(check.jfile, dest.changeExtension("check").jfile) else @@ -256,7 +262,7 @@ abstract class CompilerTest extends DottyTest { } else { NestUI.echoWarning(s"WARNING: ignoring $sf") } - }, { sdir => + }, { sdir => dest.jfile.mkdirs sdir.list.foreach(path => recCopyFiles(path, dest / path.name)) }, Some("DPCompilerTest.recCopyFiles: sourceFile not found: " + sourceFile)) @@ -278,7 +284,7 @@ abstract class CompilerTest extends DottyTest { if (!genSrc.isDefined) { NotExists } else { - val source = processFileDir(sourceFile, { f => f.safeSlurp }, { d => Some("") }, + val source = processFileDir(sourceFile, { f => f.safeSlurp }, { d => Some("") }, Some("DPCompilerTest sourceFile doesn't exist: " + sourceFile)).get if (source == genSrc) { nerr match { @@ -299,7 +305,7 @@ abstract class CompilerTest extends DottyTest { val nrString = nr.toString name match { case nrFinder(prefix, `nrString`) => prefix + (nr + 1) - case _ => + case _ => assert(nr == 0, "DPCompilerTest couldn't create new version of files, match error") name + "_v1" } @@ -324,7 +330,7 @@ abstract class CompilerTest extends DottyTest { Directory(prefix + dirName).deepFiles.foreach(source => recCopyFiles(source, destDir / source.name)) destDir.jfile } - + } object CompilerTest extends App { diff --git a/tests/pending/run/.checkSrcRegen b/tests/pending/run/.checkSrcRegen new file mode 100644 index 000000000000..61e03159a3c2 --- /dev/null +++ b/tests/pending/run/.checkSrcRegen @@ -0,0 +1 @@ +source regeneration: Tue May 12 18:21:01 CEST 2015 \ No newline at end of file diff --git a/tests/pending/run/Course-2002-01.check b/tests/pending/run/Course-2002-01.check new file mode 100644 index 000000000000..16b491d6e2bc --- /dev/null +++ b/tests/pending/run/Course-2002-01.check @@ -0,0 +1,37 @@ +Course-2002-01.scala:41: warning: method loop in object M0 does nothing other than call itself recursively + def loop: Int = loop; + ^ +232 +667 +11 +10 +62.8318 +62.8318 +62.8318 +4.0 +81.0 +256.0 +25.0 +1 +737.0 +1.0 +0.0 +1.0 +76.0 +1.4142156862745097 +1.7321428571428572 +2.0000000929222947 +1.4142156862745097 +1.7321428571428572 +2.0000000929222947 +1.4142156862745097 +1.7321428571428572 +2.0000000929222947 +sqrt(2) = 1.4142135623746899 +sqrt(2) = 1.4142135623746899 +cbrt(2) = 1.2599210500177698 +1 +1 1 +1 2 1 +1 3 3 1 +1 4 6 4 1 diff --git a/tests/pending/run/Course-2002-01.scala b/tests/pending/run/Course-2002-01.scala new file mode 100644 index 000000000000..3426f26eed19 --- /dev/null +++ b/tests/pending/run/Course-2002-01.scala @@ -0,0 +1,239 @@ +//############################################################################ +// Programmation IV - 2002 - Week 01 +//############################################################################ + +object M0 { + + //########################################################################## + + Console.println(87 + 145); + Console.println(1000 - 333); + Console.println(5 + 2 * 3); + + //########################################################################## + + def size = 2; + def pi = 3.14159; + def radius = 10; + def circumference = 2 * pi * radius; + + Console.println(5 * size); + Console.println(2 * pi * radius); + Console.println(circumference); + Console.println((2 * pi) * radius); + + //########################################################################## + + def square(x: Double) = x * x; + + Console.println(square(2)); + Console.println(square(5 + 4)); + Console.println(square(square(4))); + + //########################################################################## + + def sumOfSquares(x: Double, y: Double) = square(x) + square(y); + + Console.println(sumOfSquares(3, 2+2)); + + //########################################################################## + + def loop: Int = loop; + def first(x: Int, y: Int) = x; + def constOne(x: Int, y: => Int) = 1; + + Console.println(constOne(1, loop)); + + //########################################################################## + + def abs(x: Double) = if (x >= 0) x else -x; + + Console.println(abs(737)); + Console.println(abs(1)); + Console.println(abs(0)); + Console.println(abs(-1)); + Console.println(abs(-76)); + + //########################################################################## + + def sqrtIter0(guess: Double, x: Double): Double = + if (isGoodEnough0(guess, x)) guess + else sqrtIter0(improve0(guess, x), x); + + def improve0(guess: Double, x: Double) = + (guess + x / guess) / 2; + + def isGoodEnough0(guess: Double, x: Double) = + abs(square(guess) - x) < 0.001; + + def sqrt0(x: Double) = sqrtIter0(1.0, x); + + Console.println(sqrt0(2)); + Console.println(sqrt0(3)); + Console.println(sqrt0(4)); + + //########################################################################## + + def sqrt1(x: Double) = { + def sqrtIter1(guess: Double, x: Double): Double = + if (isGoodEnough1(guess, x)) guess + else sqrtIter1(improve1(guess, x), x); + + def improve1(guess: Double, x: Double) = + (guess + x / guess) / 2; + + def isGoodEnough1(guess: Double, x: Double) = + abs(square(guess) - x) < 0.001; + + sqrtIter1(1.0, x) + } + + Console.println(sqrt1(2)); + Console.println(sqrt1(3)); + Console.println(sqrt1(4)); + + //########################################################################## + + def sqrt2(x: Double) = { + def sqrtIter2(guess: Double): Double = + if (isGoodEnough2(guess)) guess + else sqrtIter2(improve2(guess)); + + def improve2(guess: Double) = + (guess + x / guess) / 2; + + def isGoodEnough2(guess: Double) = + abs(square(guess) - x) < 0.001; + + sqrtIter2(1.0) + } + + Console.println(sqrt2(2)); + Console.println(sqrt2(3)); + Console.println(sqrt2(4)); + + //########################################################################## +} + +//############################################################################ + +object M1 { + def abs(x: Double) = if (x >= 0) x else -x; + + def sqrt(x: Double): Double = { + def sqrtIter(prev: Double, guess: Double): Double = + if (isGoodEnough(prev, guess)) guess + else sqrtIter(guess, improve(guess)); + + def improve(guess: Double) = (guess + x / guess) / 2; + + def isGoodEnough(prev: Double, guess: Double) = + abs(prev - guess) / guess < 0.001; + + sqrtIter(1.0, improve(1.0)) + } + + Console.println("sqrt(2) = " + sqrt(2)); +} + +//############################################################################ + +object M2 { + def abs(x: Double) = if (x >= 0) x else -x; + + def sqrt(x:Double):Double = { + def sqrtIter(guess:Double):Double = { + val next = improve(guess); + if (isGoodEnough(guess,next)) next + else sqrtIter(next) + } + + def improve(guess:Double) = (guess+x/guess)/2; + + def isGoodEnough(prev:Double,guess:Double) = abs(prev-guess)/guess<0.001; + + sqrtIter(1.0) + } + + Console.println("sqrt(2) = " + sqrt(2)); +} + +//############################################################################ + +object M3 { + def abs(x: Double) = if (x >= 0) x else -x; + + def cbrt(x:Double):Double = { + def cbrtIter(guess:Double):Double = { + val next = improve(guess); + if (isGoodEnough(guess,next)) next + else cbrtIter(next) + } + + def improve(y:Double) = (x/(y*y)+2*y)/3; + + def isGoodEnough(prev:Double,guess:Double) = abs(prev-guess)/guess<0.001; + + cbrtIter(1.0) + } + + Console.println("cbrt(2) = " + cbrt(2)); +} + +//############################################################################ + +object M4 { + def pascal(c: Int, l: Int): Int = + if (c <= 0 || c >= l) 1 + else pascal(c - 1, l - 1) + pascal(c, l - 1); + + Console.print(pascal(0,0)); + Console.println; + + Console.print(pascal(0,1)); + Console.print(' '); + Console.print(pascal(1,1)); + Console.println; + + Console.print(pascal(0,2)); + Console.print(' '); + Console.print(pascal(1,2)); + Console.print(' '); + Console.print(pascal(2,2)); + Console.println; + + Console.print(pascal(0,3)); + Console.print(' '); + Console.print(pascal(1,3)); + Console.print(' '); + Console.print(pascal(2,3)); + Console.print(' '); + Console.print(pascal(3,3)); + Console.println; + + Console.print(pascal(0,4)); + Console.print(' '); + Console.print(pascal(1,4)); + Console.print(' '); + Console.print(pascal(2,4)); + Console.print(' '); + Console.print(pascal(3,4)); + Console.print(' '); + Console.print(pascal(4,4)); + Console.println; +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0; + M1; + M2; + M3; + M4; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-02.check b/tests/pending/run/Course-2002-02.check new file mode 100644 index 000000000000..7d9695071181 --- /dev/null +++ b/tests/pending/run/Course-2002-02.check @@ -0,0 +1,187 @@ +7 +120 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 + +pi = 3.181104885577714 +pi = 3.181104885577714 + +10.0 +100.0 +2.083333333333333 +3025.7687714031754 +pi = 3.1659792728432152 +pi = 3.181104885577714 +pi = 3.181104885577714 + +1.5 +1.4166666666666665 +1.4142156862745097 +1.4142135623746899 +sqrt(2) = 1.4142135623746899 + +1.5 +1.4166666666666665 +1.4142156862745097 +1.4142135623746899 +sqrt(2) = 1.4142135623746899 + +1 + 2 + .. + 5 = 15.0 +1 * 2 * .. * 5 = 120.0 + +1^2 + 2^2 + .. + 5^2 = 55.0 +1^2 * 2^2 * .. * 5^2 = 14400.0 + +factorial(0) = 1.0 +factorial(1) = 1.0 +factorial(2) = 2.0 +factorial(3) = 6.0 +factorial(4) = 24.0 +factorial(5) = 120.0 + +1 + 2 + .. + 5 = 15.0 +1 * 2 * .. * 5 = 120.0 + +1^2 + 2^2 + .. + 5^2 = 55.0 +1^2 * 2^2 * .. * 5^2 = 14400.0 + +factorial(0) = 1.0 +factorial(1) = 1.0 +factorial(2) = 2.0 +factorial(3) = 6.0 +factorial(4) = 24.0 +factorial(5) = 120.0 + +1 + 2 + .. + 5 = 15.0 +1 * 2 * .. * 5 = 120.0 + +1^2 + 2^2 + .. + 5^2 = 55.0 +1^2 * 2^2 * .. * 5^2 = 14400.0 + +factorial(0) = 1.0 +factorial(1) = 1.0 +factorial(2) = 2.0 +factorial(3) = 6.0 +factorial(4) = 24.0 +factorial(5) = 120.0 + +fib(0) = 0 +fib(1) = 1 +fib(2) = 1 +fib(3) = 2 +fib(4) = 3 +fib(5) = 5 +fib(6) = 8 +fib(7) = 13 +fib(8) = 21 +fib(9) = 34 +fib(0) = 0 +fib(1) = 1 +fib(2) = 1 +fib(3) = 2 +fib(4) = 3 +fib(5) = 5 +fib(6) = 8 +fib(7) = 13 +fib(8) = 21 +fib(9) = 34 +power(0,0) = 1.0 +power(0,1) = 0.0 +power(0,2) = 0.0 +power(0,3) = 0.0 +power(0,4) = 0.0 +power(0,5) = 0.0 +power(0,6) = 0.0 +power(0,7) = 0.0 +power(0,8) = 0.0 + +power(1,0) = 1.0 +power(1,1) = 1.0 +power(1,2) = 1.0 +power(1,3) = 1.0 +power(1,4) = 1.0 +power(1,5) = 1.0 +power(1,6) = 1.0 +power(1,7) = 1.0 +power(1,8) = 1.0 + +power(2,0) = 1.0 +power(2,1) = 2.0 +power(2,2) = 4.0 +power(2,3) = 8.0 +power(2,4) = 16.0 +power(2,5) = 32.0 +power(2,6) = 64.0 +power(2,7) = 128.0 +power(2,8) = 256.0 + +power(3,0) = 1.0 +power(3,1) = 3.0 +power(3,2) = 9.0 +power(3,3) = 27.0 +power(3,4) = 81.0 +power(3,5) = 243.0 +power(3,6) = 729.0 +power(3,7) = 2187.0 +power(3,8) = 6561.0 + +power(4,0) = 1.0 +power(4,1) = 4.0 +power(4,2) = 16.0 +power(4,3) = 64.0 +power(4,4) = 256.0 +power(4,5) = 1024.0 +power(4,6) = 4096.0 +power(4,7) = 16384.0 +power(4,8) = 65536.0 + +power(5,0) = 1.0 +power(5,1) = 5.0 +power(5,2) = 25.0 +power(5,3) = 125.0 +power(5,4) = 625.0 +power(5,5) = 3125.0 +power(5,6) = 15625.0 +power(5,7) = 78125.0 +power(5,8) = 390625.0 + diff --git a/tests/pending/run/Course-2002-02.scala b/tests/pending/run/Course-2002-02.scala new file mode 100644 index 000000000000..b8650108ed89 --- /dev/null +++ b/tests/pending/run/Course-2002-02.scala @@ -0,0 +1,551 @@ +//############################################################################ +// Programmation IV - 2002 - Week 02 +//############################################################################ + +object M0 { + def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b) + def factorial(n: Int): Int = if (n == 0) 1 else n * factorial(n - 1) + + Console.println(gcd(14,21)) + Console.println(factorial(5)) + Console.println +} + +//############################################################################ + +object M1 { + def cube(x: Int): Double = x * x * x + + def sumInts(a: Int, b: Int): Double = if (a > b) 0 + else a + sumInts(a + 1, b); + + def sumCubes(a: Int, b: Int): Double = if (a > b) 0 + else cube(a) + sumCubes(a + 1, b); + + def sumReciprocals(a: Int, b: Int): Double = if (a > b) 0 + else 1.0/a + sumReciprocals(a + 1, b); + + def sumPi(n: Int): Double = { + def element(x: Int): Double = 4.0/(4*x+1) - 4.0/(4*x-1); + def sumElements(a: Int, b: Int): Double = + if (a > b) 0 + else element(a) + sumElements(a + 1, b); + 4 + sumElements(1,n) + } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M2 { + def id(x: Int): Double = x; + def cube(x: Int): Double = x * x * x; + def reciprocal(x: Int): Double = 1.0/x; + + def sum(f: Int => Double, a: Int, b: Int): Double = + if (a > b) 0 + else f(a) + sum(f, a + 1, b); + + def sumInts(a: Int, b: Int): Double = sum(id, a, b); + def sumCubes(a: Int, b: Int): Double = sum(cube, a, b); + def sumReciprocals(a: Int, b: Int): Double = sum(reciprocal, a, b); + def sumPi(n: Int): Double = { + def element(x: Int): Double = 4.0/(4*x+1) - 4.0/(4*x-1); + 4 + sum(element, 1, n) + } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M3 { + def sum(f: Int => Double, a: Int, b: Int): Double = + if (a > b) 0 + else f(a) + sum(f, a + 1, b); + + def sumInts(a: Int, b: Int): Double = sum((xXXXXX => xXXXXX), a, b); + def sumCubes(a: Int, b: Int): Double = sum((x => x * x * x), a, b); + def sumReciprocals(a: Int, b: Int): Double = sum((x => 1.0/x), a, b); + def sumPi(n: Int): Double = 4 + sum((x => 4.0/(4*x+1) - 4.0/(4*x-1)), 1, n); + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M4 { + def sum(f: Int => Double): (Int, Int) => Double = { + def sumF(a: Int, b: Int): Double = + if (a > b) 0 + else f(a) + sumF(a + 1, b); + sumF + } + + def sumInts = sum(x => x) + def sumCubes = sum(x => x * x * x) + def sumReciprocals = sum(1.0/_) + def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M5 { + def sum(f: Int => Double): (Int, Int) => Double = { (a, b) => + if (a > b) 0 + else f(a) + sum(f)(a + 1, b) + } + + def sumInts = sum(x => x) + def sumCubes = sum(x => x * x * x) + def sumReciprocals = sum(x => 1.0/x) + def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M6 { + def sum(f: Int => Double)(a: Int, b: Int): Double = + if (a > b) 0 + else f(a) + sum(f)(a + 1, b); + + def sumInts = sum(x => x)_ + def sumCubes = sum(x => x * x * x)_ + def sumReciprocals = sum(x => 1.0/x)_ + def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M7 { + def sum(f: Int => Double)(a: Int, b: Int): Double = { + def iter(a: Int, result: Double): Double = + if (a > b) result + else iter(a + 1, f(a) + result); + iter(a, 0) + } + + def sumInts = sum(x => x)_ + def sumCubes = sum(x => x * x * x)_ + def sumReciprocals = sum(x => 1.0/x)_ + def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } + + Console.println(sumInts(1,4)) + Console.println(sumCubes(1,4)) + Console.println(sumReciprocals(1,4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println +} + +//############################################################################ + +object M8 { + def product(f: Int => Double)(a: Int, step: Int, b: Int): Double = + if (a > b) 1 + else f(a) * product(f)(a + step, step, b); + + def productPi = { n: Int => product(x=>4.0*x*x/(2*x-1)/(2*x-1))(1,1,n)/n } + + val pi = 2 * product(x => x * x)(2, 2, 40) / product(x => x * x)(1, 2,40)/40; + + Console.println("pi = " + productPi(20)) + Console.println("pi = " + pi) + Console.println +} + +//############################################################################ + +object M9 { + def accumulate[t](combiner: (t, t) => t, nullValue: t, f: Int => t, + next: Int => Int)(a: Int, b: Int): t = + if (a > b) nullValue + else combiner(f(a), accumulate(combiner, nullValue, f, next)(next(a), b)) + + def inc(x: Int) = x + 1 + + def sum(f: Int => Double): (Int, Int) => Double = + accumulate((x: Double, y: Double) => x + y, 0d, f, inc) + + def product(f: Int => Double): (Int, Int) => Double = + accumulate((x: Double, y: Double) => x * y, 1d, f, inc) + + def sumInts = sum(x => x) + def sumCubes = sum(x => x * x * x) + def sumReciprocals = sum(x => 1.0 / x) + def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } + + def productPi = { n: Int => product(x=>4.0*x*x/(2*x-1)/(2*x-1))(1,n)/n } + + val pi = 2*product(x => 2*x*2*x)(1,20)/product(x =>(2*x-1)*(2*x-1))(1,20)/40 + + Console.println(sumInts(1, 4)) + Console.println(sumCubes(1, 4)) + Console.println(sumReciprocals(1, 4)) + Console.println(sumCubes(1, 10) + sumReciprocals(10, 20)) + Console.println("pi = " + sumPi(20)) + Console.println("pi = " + productPi(20)) + Console.println("pi = " + pi) + Console.println +} + +//############################################################################ + +object MA { + val tolerance = 0.0001 + def abs(x: Double) = if (x < 0) -x else x + def isCloseEnough(x: Double, y: Double) = abs((x - y) / x) < tolerance + def fixedPoint(f: Double => Double)(firstGuess: Double) = { + def iterate(guess: Double): Double = { + val next = f(guess); + Console.println(next); + if (isCloseEnough(guess, next)) next + else iterate(next) + } + iterate(firstGuess) + } + def sqrt(x: Double) = fixedPoint(y => (y + x / y) / 2)(1.0) + + Console.println("sqrt(2) = " + sqrt(2)) + Console.println +} + +//############################################################################ + +object MB { + val tolerance = 0.0001; + def abs(x: Double) = if (x < 0) -x else x; + def isCloseEnough(x: Double, y: Double) = abs((x - y) / x) < tolerance; + def fixedPoint(f: Double => Double)(firstGuess: Double) = { + def iterate(guess: Double): Double = { + val next = f(guess); + Console.println(next); + if (isCloseEnough(guess, next)) next + else iterate(next) + } + iterate(firstGuess) + } + def averageDamp(f: Double => Double)(x: Double) = (x + f(x)) / 2; + def sqrt(x: Double) = fixedPoint(averageDamp(y => x/y))(1.0); + + Console.println("sqrt(2) = " + sqrt(2)) + Console.println +} + +//############################################################################ + +object MC { + def sum(f: Int => Double)(a: Int, b: Int): Double = { + def iter(a: Int, result: Double): Double = { + if (a > b) result + else iter(a + 1, result + f(a)) + } + iter(a, 0) + } + + def product(f: Int => Double)(a: Int, b: Int): Double = { + def iter(a: Int, result: Double): Double = { + if (a > b) result + else iter(a + 1, result * f(a)) + } + iter(a, 1) + } + + def factorial(n: Int) = product(x => x)(1 , n) + + Console.println( + "1 + 2 + .. + 5 = " + sum(x => x)(1, 5)); + Console.println( + "1 * 2 * .. * 5 = " + product(x => x)(1, 5)); + Console.println; + + Console.println( + "1^2 + 2^2 + .. + 5^2 = " + sum(x => x*x)(1, 5)); + Console.println( + "1^2 * 2^2 * .. * 5^2 = " + product(x => x*x)(1, 5)); + Console.println; + + Console.println( + "factorial(0) = " + factorial(0)) + Console.println( + "factorial(1) = " + factorial(1)) + Console.println( + "factorial(2) = " + factorial(2)) + Console.println( + "factorial(3) = " + factorial(3)) + Console.println( + "factorial(4) = " + factorial(4)) + Console.println( + "factorial(5) = " + factorial(5)) + Console.println +} + +//############################################################################ + +object MD { + def reduce(op: (Double,Double) => Double, zero:Double)(f: Int => Double)(a: Int,b: Int): Double = { + def iter(a: Int, result: Double): Double = { + if (a > b) result + else iter(a + 1, op(result, f(a))) + } + iter(a, zero) + } + + def plus (x:Double,y:Double) = x+y; + val sum: (Int => Double) => (Int, Int) => Double = reduce(plus , 0); + def times(x:Double,y:Double) = x*y; + val product: (Int => Double) => (Int, Int) => Double = reduce(times, 1); + + def factorial(n: Int) = product(x => x)(1 , n) + + Console.println( + "1 + 2 + .. + 5 = " + sum(x => x)(1, 5)) + Console.println( + "1 * 2 * .. * 5 = " + product(x => x)(1, 5)) + Console.println; + + Console.println( + "1^2 + 2^2 + .. + 5^2 = " + sum(x => x*x)(1, 5)) + Console.println( + "1^2 * 2^2 * .. * 5^2 = " + product(x => x*x)(1, 5)) + Console.println; + + Console.println( + "factorial(0) = " + factorial(0)) + Console.println( + "factorial(1) = " + factorial(1)) + Console.println( + "factorial(2) = " + factorial(2)) + Console.println( + "factorial(3) = " + factorial(3)) + Console.println( + "factorial(4) = " + factorial(4)) + Console.println( + "factorial(5) = " + factorial(5)) + Console.println +} + +//############################################################################ + +object ME { + def reduce(op: (Double,Double) => Double, zero:Double)(f: Int => Double)(a: Int,b: Int): Double = { + def iter(a: Int, result: Double): Double = { + if (a > b) result + else iter(a + 1, op(result, f(a))) + } + iter(a, zero) + } + + def sum: (Int => Double) => (Int, Int) => Double = reduce((x,y) => x + y, 0); + def product: (Int => Double) => (Int, Int) => Double = reduce((x,y) => x * y, 1); + + def factorial(n: Int) = product(x => x)(1 , n) + + Console.println( + "1 + 2 + .. + 5 = " + sum(x => x)(1, 5)) + Console.println( + "1 * 2 * .. * 5 = " + product(x => x)(1, 5)) + Console.println; + + Console.println( + "1^2 + 2^2 + .. + 5^2 = " + sum(x => x*x)(1, 5)) + Console.println( + "1^2 * 2^2 * .. * 5^2 = " + product(x => x*x)(1, 5)) + Console.println; + + Console.println( + "factorial(0) = " + factorial(0)) + Console.println( + "factorial(1) = " + factorial(1)) + Console.println( + "factorial(2) = " + factorial(2)) + Console.println( + "factorial(3) = " + factorial(3)) + Console.println( + "factorial(4) = " + factorial(4)) + Console.println( + "factorial(5) = " + factorial(5)) + Console.println +} + +//############################################################################ + +object MF { + def fib(x: Int): Int = + if (x <= 1) x + else fib(x - 2) + fib(x - 1) + + Console.println("fib(0) = " + fib(0)) + Console.println("fib(1) = " + fib(1)) + Console.println("fib(2) = " + fib(2)) + Console.println("fib(3) = " + fib(3)) + Console.println("fib(4) = " + fib(4)) + Console.println("fib(5) = " + fib(5)) + Console.println("fib(6) = " + fib(6)) + Console.println("fib(7) = " + fib(7)) + Console.println("fib(8) = " + fib(8)) + Console.println("fib(9) = " + fib(9)) +} + +//############################################################################ + +object MG { + def fib(x: Int) = { + def loop(n: Int, prev: Int, fibn: Int): Int = + if (n == x) fibn + else loop(n + 1, fibn, fibn + prev) + if (x == 0) 0 else loop(1, 0, 1) + } + + Console.println("fib(0) = " + fib(0)) + Console.println("fib(1) = " + fib(1)) + Console.println("fib(2) = " + fib(2)) + Console.println("fib(3) = " + fib(3)) + Console.println("fib(4) = " + fib(4)) + Console.println("fib(5) = " + fib(5)) + Console.println("fib(6) = " + fib(6)) + Console.println("fib(7) = " + fib(7)) + Console.println("fib(8) = " + fib(8)) + Console.println("fib(9) = " + fib(9)) +} + +//############################################################################ + +object MH { + def power(x: Double, y: Int): Double = + if (y <= 0) 1 + else if (y % 2 == 0) power(x * x, y / 2) + else x * power(x, y - 1); + + + Console.println("power(0,0) = " + power(0,0)) + Console.println("power(0,1) = " + power(0,1)) + Console.println("power(0,2) = " + power(0,2)) + Console.println("power(0,3) = " + power(0,3)) + Console.println("power(0,4) = " + power(0,4)) + Console.println("power(0,5) = " + power(0,5)) + Console.println("power(0,6) = " + power(0,6)) + Console.println("power(0,7) = " + power(0,7)) + Console.println("power(0,8) = " + power(0,8)) + Console.println + + Console.println("power(1,0) = " + power(1,0)) + Console.println("power(1,1) = " + power(1,1)) + Console.println("power(1,2) = " + power(1,2)) + Console.println("power(1,3) = " + power(1,3)) + Console.println("power(1,4) = " + power(1,4)) + Console.println("power(1,5) = " + power(1,5)) + Console.println("power(1,6) = " + power(1,6)) + Console.println("power(1,7) = " + power(1,7)) + Console.println("power(1,8) = " + power(1,8)) + Console.println + + Console.println("power(2,0) = " + power(2,0)) + Console.println("power(2,1) = " + power(2,1)) + Console.println("power(2,2) = " + power(2,2)) + Console.println("power(2,3) = " + power(2,3)) + Console.println("power(2,4) = " + power(2,4)) + Console.println("power(2,5) = " + power(2,5)) + Console.println("power(2,6) = " + power(2,6)) + Console.println("power(2,7) = " + power(2,7)) + Console.println("power(2,8) = " + power(2,8)) + Console.println + + Console.println("power(3,0) = " + power(3,0)) + Console.println("power(3,1) = " + power(3,1)) + Console.println("power(3,2) = " + power(3,2)) + Console.println("power(3,3) = " + power(3,3)) + Console.println("power(3,4) = " + power(3,4)) + Console.println("power(3,5) = " + power(3,5)) + Console.println("power(3,6) = " + power(3,6)) + Console.println("power(3,7) = " + power(3,7)) + Console.println("power(3,8) = " + power(3,8)) + Console.println + + Console.println("power(4,0) = " + power(4,0)) + Console.println("power(4,1) = " + power(4,1)) + Console.println("power(4,2) = " + power(4,2)) + Console.println("power(4,3) = " + power(4,3)) + Console.println("power(4,4) = " + power(4,4)) + Console.println("power(4,5) = " + power(4,5)) + Console.println("power(4,6) = " + power(4,6)) + Console.println("power(4,7) = " + power(4,7)) + Console.println("power(4,8) = " + power(4,8)) + Console.println + + Console.println("power(5,0) = " + power(5,0)) + Console.println("power(5,1) = " + power(5,1)) + Console.println("power(5,2) = " + power(5,2)) + Console.println("power(5,3) = " + power(5,3)) + Console.println("power(5,4) = " + power(5,4)) + Console.println("power(5,5) = " + power(5,5)) + Console.println("power(5,6) = " + power(5,6)) + Console.println("power(5,7) = " + power(5,7)) + Console.println("power(5,8) = " + power(5,8)) + Console.println +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0 + M1 + M2 + M3 + M4 + M5 + M6 + M7 + M8 + M9 + MA + MB + MC + MD + ME + MF + MG + MH + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-03.check b/tests/pending/run/Course-2002-03.check new file mode 100644 index 000000000000..01b9977d39bd --- /dev/null +++ b/tests/pending/run/Course-2002-03.check @@ -0,0 +1,67 @@ +1 +2 +1/2 +5/6 + +1/3 +5/7 +3/2 +66/42 + +1/3 +5/7 +3/2 +11/7 + +11/7 +7/11 +11/7 +11/7 + +13/36 + +false +true +true +false + +set0 = [] +set1 = [1] +set2 = [1,2] +set3 = [1,2,3] +set4 = [1,2,3,4] + +set2 contains the following elements: +1 +2 + +set3 contains the following elements: +1 +2 +3 + +set4 contains the following elements: +1 +2 +3 +4 + +2 <- set2: true +3 <- set2: false + +setx = [-10,-1,0,3,5,21] +setx * 2 = [-20,-2,0,6,10,42] + +setx = [-10,-1,0,3,5,21] +sety = [-9,-5,-1,0,3,7,8] +setx & sety = [-1,0,3] +sety & setx = [-1,0,3] +setx > 0 = [3,5,21] +sety > 0 = [3,7,8] +setx & sety = [-1,0,3] +sety & setx = [-1,0,3] + +1/1 +1/1 +1/1 + diff --git a/tests/pending/run/Course-2002-03.scala b/tests/pending/run/Course-2002-03.scala new file mode 100644 index 000000000000..44cc75aaa53d --- /dev/null +++ b/tests/pending/run/Course-2002-03.scala @@ -0,0 +1,392 @@ +//############################################################################ +// Programmation IV - 2002 - Week 03 +//############################################################################ + + +object M0 { + class Rational(x: Int, y: Int) { + def numer = x; + def denom = y; + } + + def addRational(r: Rational, s: Rational): Rational = + new Rational( + r.numer * s.denom + s.numer * r.denom, + r.denom * s.denom); + + def makeString(r: Rational) = + r.numer + "/" + r.denom; + + val x = new Rational(1, 2); + val y = new Rational(1, 3); + Console.println(x.numer); + Console.println(x.denom); + Console.println(makeString(x)); + Console.println(makeString(addRational(x,y))); + Console.println; +} + +//############################################################################ + +object M1 { + class Rational(x: Int, y: Int) { + def numer = x; + def denom = y; + def add(r: Rational) = + new Rational( + numer * r.denom + r.numer * denom, + denom * r.denom); + def mul(r: Rational) = + new Rational( + numer * r.numer, + denom * r.denom); + override def toString() = numer + "/" + denom; + } + + val x = new Rational(1, 3); + val y = new Rational(5, 7); + val z = new Rational(3, 2); + Console.println(x); + Console.println(y); + Console.println(z); + Console.println(x.add(y).mul(z)); + Console.println; +} + +//############################################################################ + +object M2 { + class Rational(x: Int, y: Int) { + private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b); + private val g = gcd(x, y); + def numer = x / g; + def denom = y / g; + def add(r: Rational) = + new Rational( + numer * r.denom + r.numer * denom, + denom * r.denom); + def sub(r: Rational) = + new Rational( + numer * r.denom - r.numer * denom, + denom * r.denom); + def mul(r: Rational) = + new Rational( + numer * r.numer, + denom * r.denom); + def div(r: Rational) = + new Rational( + numer * r.denom, + denom * r.numer); + override def toString() = numer + "/" + denom; + } + + val x = new Rational(1, 3); + val y = new Rational(5, 7); + val z = new Rational(3, 2); + Console.println(x); + Console.println(y); + Console.println(z); + Console.println(x.add(y).mul(z)); + Console.println; +} + +//############################################################################ + +object M3 { + class Rational(x: Int, y: Int) { + private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b); + def numer = x / gcd(x, y); + def denom = y / gcd(x, y); + def less(that: Rational) = + this.numer * that.denom < that.numer * this.denom; + def max(that: Rational) = if (this.less(that)) that else this; + override def toString() = numer + "/" + denom; + } + + val x = new Rational(66, 42); + val y = new Rational(42, 66); + Console.println(x); + Console.println(y); + Console.println(x.max(y)); + Console.println(y.max(x)); + Console.println; +} + +//############################################################################ + +object M4 { + class Rational(x: Int, y: Int) { + private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b); + private val g = gcd(x, y); + def numer = x / g; + def denom = y / g; + def + (r: Rational) = + new Rational( + numer * r.denom + r.numer * denom, + denom * r.denom); + def - (r: Rational) = + new Rational( + numer * r.denom - r.numer * denom, + denom * r.denom); + def * (r: Rational) = + new Rational( + numer * r.numer, + denom * r.denom); + def / (r: Rational) = + new Rational( + numer * r.denom, + denom * r.numer); + override def toString() = numer + "/" + denom; + } + + val x = new Rational(1, 2); + val y = new Rational(1, 3); + Console.println(x * x + y * y); + Console.println; +} + +//############################################################################ + +object M5 { + trait IntSet { + def incl(x: Int): IntSet; + def contains(x: Int): Boolean; + } + + class Empty extends IntSet { + def contains(x: Int): Boolean = false; + def incl(x: Int): IntSet = new NonEmpty(x, new Empty, new Empty); + } + + class NonEmpty(elem: Int, left: IntSet, right: IntSet) extends IntSet { + def contains(x: Int): Boolean = + if (x < elem) left contains x + else if (x > elem) right contains x + else true; + def incl(x: Int): IntSet = + if (x < elem) new NonEmpty(elem, left incl x, right) + else if (x > elem) new NonEmpty(elem, left, right incl x) + else this; + } + + val x = new Empty incl 1 incl 2; + Console.println(x contains 0); + Console.println(x contains 1); + Console.println(x contains 2); + Console.println(x contains 3); + Console.println; +} + +//############################################################################ + +object M6 { + trait Boolean { + def ifThenElse[a](t: => a)(e: => a): a; + + def ! : Boolean = ifThenElse[Boolean](new False())(new True()); + + def && (x: => Boolean): Boolean = ifThenElse[Boolean](x)(new False()); + def || (x: => Boolean): Boolean = ifThenElse[Boolean](new True())(x); + + // !!! def == (x: Boolean): Boolean = ifThenElse[Boolean](x)(x.!); + // !!! def != (x: Boolean): Boolean = ifThenElse[Boolean](x.!)(x); + def < (x: Boolean): Boolean = ifThenElse[Boolean](new False())(x); + def > (x: Boolean): Boolean = ifThenElse[Boolean](x.!)(new False()); + def <= (x: Boolean): Boolean = ifThenElse[Boolean](x)(new True()); + def >= (x: Boolean): Boolean = ifThenElse[Boolean](new True())(x.!); + } + class True() extends Boolean { // !!! class -> object + def ifThenElse[a](t: => a)(e: => a): a = t } + class False() extends Boolean { // !!! class -> object + def ifThenElse[a](t: => a)(e: => a): a = e } +} + +//############################################################################ + +object M7 { + trait Nat { + def isZero(): Boolean; + def predecessor: Nat; + def successor: Nat; + def + (that: Nat): Nat; + def - (that: Nat): Nat; + } +} + +//############################################################################ + +object M8 { + + trait IntSet { + def incl(x: Int): IntSet; + def contains(x: Int): Boolean; + def map(f: Int => Int): IntSet; + + def foreach(f: Int => Unit): Unit; + def intersect0(that: IntSet, accu: IntSet): IntSet; + def filter0(f: Int => Boolean, accu: IntSet): IntSet; + + def intersect(that: IntSet): IntSet = intersect0(that, new Empty); + def intersect2(that: IntSet): IntSet = filter(x => that.contains(x)); + def filter(f: Int => Boolean): IntSet = filter0(f, new Empty); + + def print() = foreach(Console.println); + + override def toString(): String = { + val buffer: StringBuilder = new StringBuilder(); + buffer.append('['); + foreach(i => { + if (buffer.length > 1) {buffer.append(','); ()}; // !!! ; () + buffer.append(i); + ()}); + buffer.append(']'); + buffer.toString(); + } + } + + class Empty extends IntSet { // !!! class Empty() -> object Empty + def contains(x: Int): Boolean = false; + def incl(x: Int): IntSet = new NonEmpty(x, new Empty, new Empty); + def map(f: Int => Int): IntSet = this; + + def foreach(f: Int => Unit): Unit = (); + def intersect0(that: IntSet, accu: IntSet): IntSet = accu; + def filter0(f: Int => Boolean, accu: IntSet): IntSet = accu; + } + + class NonEmpty(elem: Int, left: IntSet, right: IntSet) extends IntSet { + def contains(x: Int): Boolean = + if (x < elem) left contains x + else if (x > elem) right contains x + else true; + + def incl(x: Int): IntSet = + if (x < elem) new NonEmpty(elem, left incl x, right) + else if (x > elem) new NonEmpty(elem, left, right incl x) + else this; + + + def map(f: Int => Int): IntSet = { + val lset = left.map(f); + val rset = right.map(f); + new NonEmpty(f(elem), lset, rset) + } + + def foreach(f: Int => Unit): Unit = { + left.foreach(f); + f(elem); + right.foreach(f); + } + + def intersect0(that: IntSet, accu: IntSet): IntSet = + right.intersect0(that, left.intersect0(that, + if (that.contains(elem)) accu.incl(elem) else accu)); + + def filter0(f: Int => Boolean, accu: IntSet): IntSet = + right.filter0(f, left.filter0(f, + if (f(elem)) accu.incl(elem) else accu)); + } + + def test = { + val set0: IntSet = new Empty; + val set1: IntSet = new Empty incl 1; + val set2: IntSet = new Empty incl 1 incl 2; + val set3: IntSet = new Empty incl 1 incl 2 incl 3; + val set4: IntSet = new Empty incl 1 incl 2 incl 3 incl 4; + val setx: IntSet = set0 incl -10 incl 5 incl 21 incl -1 incl 0 incl 3; + val sety: IntSet = set0 incl 3 incl 7 incl -5 incl 0 incl-9 incl 8 incl-1; + + Console.println("set0 = " + set0); + Console.println("set1 = " + (set1.toString())); + Console.println("set2 = " + set2); + Console.println("set3 = " + (set3.toString())); + Console.println("set4 = " + set4); + Console.println; + + Console.println("set2 contains the following elements:"); + set2.foreach(Console.println); + Console.println; + + Console.println("set3 contains the following elements:"); + set3 foreach Console.println; + Console.println; + + Console.println("set4 contains the following elements:"); + set4.print(); + Console.println; + + Console.println("2 <- set2: " + (set2 contains 2)); + Console.println("3 <- set2: " + set2.contains(3)); + Console.println; + + Console.println("setx = " + setx); + Console.println("setx * 2 = " + (setx.map(x => 2 * x))); + Console.println; + + Console.println("setx = " + setx); + Console.println("sety = " + sety); + Console.println("setx & sety = " + (setx.intersect(sety))); + Console.println("sety & setx = " + (sety.intersect(setx))); + Console.println("setx > 0 = " + (setx.filter(x => x > 0))); + Console.println("sety > 0 = " + (sety.filter(x => x > 0))); + Console.println("setx & sety = " + (setx.intersect2(sety))); + Console.println("sety & setx = " + (sety.intersect2(setx))); + Console.println; + } +} + +//############################################################################ + +object M9 { + class Rational(x: Int, y: Int) { + private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b); + private val g = gcd(x, y); + def numer = x / g; + def denom = y / g; + def add(r: Rational) = + new Rational( + numer * r.denom + r.numer * denom, + denom * r.denom); + def sub(r: Rational) = + new Rational( + numer * r.denom - r.numer * denom, + denom * r.denom); + def mul(r: Rational) = + new Rational( + numer * r.numer, + denom * r.denom); + def equal(r: Rational) = + new Rational( + numer * r.denom, + denom * r.numer); + def asString = numer.toString().concat("/").concat(denom.toString()); + override def toString() = asString; + } + + def test = { + Console.println(new Rational(2,2).asString); + Console.println(new Rational(2,2).toString()); + Console.println(new Rational(2,2)); + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0; + M1; + M2; + M3; + M4; + M5; + M6; + M7; + M8.test; + M9.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-04.check b/tests/pending/run/Course-2002-04.check new file mode 100644 index 000000000000..1110fd05ab03 --- /dev/null +++ b/tests/pending/run/Course-2002-04.check @@ -0,0 +1,64 @@ +list0 = List(6, 3, 1, 8, 7, 1, 2, 5, 8, 4, 3, 4, 8) +list1 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8) +list2 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8) +list3 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8) +list4 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8) +list5 = List(8, 8, 8, 7, 6, 5, 4, 4, 3, 3, 2, 1, 1) +list6 = List(8, 8, 8, 7, 6, 5, 4, 4, 3, 3, 2, 1, 1) + +list0: List() -> List() +list1: List(0) -> List(0) +list2: List(0, 1) -> List(0, 1) +list3: List(1, 0) -> List(0, 1) +list4: List(0, 1, 2) -> List(0, 1, 2) +list5: List(1, 0, 2) -> List(0, 1, 2) +list6: List(0, 1, 2) -> List(0, 1, 2) +list7: List(1, 0, 2) -> List(0, 1, 2) +list8: List(2, 0, 1) -> List(0, 1, 2) +list9: List(2, 1, 0) -> List(0, 1, 2) +listA: List(6, 3, 1, 8, 7, 1, 2, 5, 8, 4) -> List(1, 1, 2, 3, 4, 5, 6, 7, 8, 8) + +f(x) = 5x^3+7x^2+5x+9 +f(0) = 9.0 +f(1) = 26.0 +f(2) = 87.0 +f(3) = 222.0 + +v1 = List(2.0, 3.0, 4.0) +v2 = List(6.0, 7.0, 8.0) + +id = List(List(1.0, 0.0, 0.0), List(0.0, 1.0, 0.0), List(0.0, 0.0, 1.0)) +m1 = List(List(2.0, 0.0, 0.0), List(0.0, 2.0, 0.0), List(0.0, 0.0, 2.0)) +m2 = List(List(1.0, 2.0, 3.0), List(4.0, 5.0, 6.0), List(7.0, 8.0, 9.0)) + +v1 * v1 = 29.0 +v1 * v2 = 65.0 +v2 * v1 = 65.0 +v1 * v2 = 65.0 + +id * v1 = List(2.0, 3.0, 4.0) +m1 * v1 = List(4.0, 6.0, 8.0) +m2 * v1 = List(20.0, 47.0, 74.0) + +trn(id) = List(List(1.0, 0.0, 0.0), List(0.0, 1.0, 0.0), List(0.0, 0.0, 1.0)) +trn(m1) = List(List(2.0, 0.0, 0.0), List(0.0, 2.0, 0.0), List(0.0, 0.0, 2.0)) +trn(m2) = List(List(1.0, 4.0, 7.0), List(2.0, 5.0, 8.0), List(3.0, 6.0, 9.0)) + +List(v1) * id = List(List(2.0, 3.0, 4.0)) +List(v1) * m1 = List(List(4.0, 6.0, 8.0)) +List(v1) * m2 = List(List(42.0, 51.0, 60.0)) + +id * List(v1) = List(List(2.0, 3.0, 4.0), List(0.0, 0.0, 0.0), List(0.0, 0.0, 0.0)) +m1 * List(v1) = List(List(4.0, 6.0, 8.0), List(0.0, 0.0, 0.0), List(0.0, 0.0, 0.0)) +m2 * List(v1) = List(List(2.0, 3.0, 4.0), List(8.0, 12.0, 16.0), List(14.0, 21.0, 28.0)) + +id * id = List(List(1.0, 0.0, 0.0), List(0.0, 1.0, 0.0), List(0.0, 0.0, 1.0)) +id * m1 = List(List(2.0, 0.0, 0.0), List(0.0, 2.0, 0.0), List(0.0, 0.0, 2.0)) +m1 * id = List(List(2.0, 0.0, 0.0), List(0.0, 2.0, 0.0), List(0.0, 0.0, 2.0)) +m1 * m1 = List(List(4.0, 0.0, 0.0), List(0.0, 4.0, 0.0), List(0.0, 0.0, 4.0)) +id * m2 = List(List(1.0, 2.0, 3.0), List(4.0, 5.0, 6.0), List(7.0, 8.0, 9.0)) +m2 * id = List(List(1.0, 2.0, 3.0), List(4.0, 5.0, 6.0), List(7.0, 8.0, 9.0)) +m1 * m2 = List(List(2.0, 4.0, 6.0), List(8.0, 10.0, 12.0), List(14.0, 16.0, 18.0)) +m2 * m1 = List(List(2.0, 4.0, 6.0), List(8.0, 10.0, 12.0), List(14.0, 16.0, 18.0)) +m2 * m2 = List(List(30.0, 36.0, 42.0), List(66.0, 81.0, 96.0), List(102.0, 126.0, 150.0)) + diff --git a/tests/pending/run/Course-2002-04.scala b/tests/pending/run/Course-2002-04.scala new file mode 100644 index 000000000000..368e29db453d --- /dev/null +++ b/tests/pending/run/Course-2002-04.scala @@ -0,0 +1,244 @@ +//############################################################################ +// Programmation IV - 2002 - Week 04 +//############################################################################ + +object M0 { + + def quicksort[a] (less : (a,a) => Boolean) (xs : List[a]) : List[a] = { + if (xs.isEmpty) + xs + else { + val pivot : a = xs.head; + val smaller : List[a] = + quicksort(less)(xs.tail.filter(elem => less(elem, pivot))); + val greaterOrEqual : List[a] = + quicksort(less)(xs.tail.filter(elem => !less(elem, pivot))); + smaller ::: List(pivot) ::: greaterOrEqual + } + } + + def test = { + val isort: List[Int] => List[Int] = quicksort[Int]((x,y) => x < y); + val list0 = List(6,3,1,8,7,1,2,5,8,4,3,4,8); + val list1 = quicksort[Int]((x,y) => x < y)(list0); + val list2 = quicksort[Int]((x,y) => x < y)(list1); + val list3 = isort(list0); + val list4 = isort(list1); + val list5 = quicksort[Int]((x,y) => x >= y)(list0); + val list6 = quicksort[Int]((x,y) => x >= y)(list1); + + Console.println("list0 = " + list0); + Console.println("list1 = " + list1); + Console.println("list2 = " + list2); + Console.println("list3 = " + list3); + Console.println("list4 = " + list4); + Console.println("list5 = " + list5); + Console.println("list6 = " + list6); + Console.println; + } +} + +//############################################################################ + +object M1 { + + def mergesort[a] (less : (a,a) => Boolean) (xs: Array[a]): Unit = { + + def While(c: => Boolean)(b: => Unit): Unit = + if (c) { b ; While(c)(b) } else (); + + def swap(i: Int, j: Int): Unit = { + val t = xs(i); + val u = xs(j); + xs(i) = u; + xs(j) = t; + } + + def sort1(l: Int, r: Int): Unit = { + val pivot = xs((l + r) / 2); + var i = l; + var j = r; + While (i <= j) { + While (less(xs(i), pivot)) { i = i + 1 } + While (less(pivot, xs(j))) { j = j - 1 } + if (i <= j) { + swap(i, j); + i = i + 1; + j = j - 1; + } + } + if (l < j) sort1(l, j); + if (j < r) sort1(i, r); + } + + if (xs.length > 0) sort1(0, xs.length - 1); + } + + def list2array(list: List[Int]): Array[Int] = { + val array = new Array[Int](list.length); + list.copyToArray(array, 0); + array; + } + + def array2list(array: Array[Int]): List[Int] = { + var list = List[Int](); + List.range(0, array.length).map(i => list = array(i) :: list); + list.reverse; + } + + def isort(list: List[Int]): List[Int] = { + val array = list2array(list); + mergesort[Int]((x,y) => x < y)(array); + array2list(array); + } + + def test = { + val list0 = List(); + val list1 = List(0); + val list2 = List(0,1); + val list3 = List(1,0); + val list4 = List(0,1,2); + val list5 = List(1,0,2); + val list6 = List(0,1,2); + val list7 = List(1,0,2); + val list8 = List(2,0,1); + val list9 = List(2,1,0); + val listA = List(6,3,1,8,7,1,2,5,8,4); + + Console.println("list0: " + list0 + " -> " + isort(list0)); + Console.println("list1: " + list1 + " -> " + isort(list1)); + Console.println("list2: " + list2 + " -> " + isort(list2)); + Console.println("list3: " + list3 + " -> " + isort(list3)); + Console.println("list4: " + list4 + " -> " + isort(list4)); + Console.println("list5: " + list5 + " -> " + isort(list5)); + Console.println("list6: " + list6 + " -> " + isort(list6)); + Console.println("list7: " + list7 + " -> " + isort(list7)); + Console.println("list8: " + list8 + " -> " + isort(list8)); + Console.println("list9: " + list9 + " -> " + isort(list9)); + Console.println("listA: " + listA + " -> " + isort(listA)); + Console.println; + } + +} + +//############################################################################ + +object M2 { + + def horner (x : Double, coefs : List[Double]) : Double = { + if (coefs.isEmpty) + 0 + else + horner(x, coefs.tail) * x + coefs.head + } + + def test = { + val poly = List(9.0,5.0,7.0,5.0); + Console.println("f(x) = 5x^3+7x^2+5x+9"); + Console.println("f(0) = " + horner(0, poly)); + Console.println("f(1) = " + horner(1, poly)); + Console.println("f(2) = " + horner(2, poly)); + Console.println("f(3) = " + horner(3, poly)); + Console.println; + } +} + +//############################################################################ + +object M3 { + + def dotproduct (v : List[Double], w : List[Double]) : Double = { + if (v.isEmpty) + 0 + else + (v.head * w.head) + dotproduct(v.tail, w.tail) + } + + def matrixTimesVector (m : List[List[Double]], v : List[Double]) + : List[Double] = { + m.map(row => dotproduct(row, v)) + } + + def transpose(m : List[List[Double]]) : List[List[Double]] = { + if (m.isEmpty || m.head.isEmpty) + List() + else + m.map(row => row.head) :: transpose (m.map (row => row.tail)) + } + + def matrixTimesMatrix(m1 : List[List[Double]], m2 : List[List[Double]]) + : List[List[Double]] = { + val columns = transpose(m2); + m1.map(row => matrixTimesVector(columns, row)) + } + + def test = { + val v1 = List(2.0,3.0,4.0); + val v2 = List(6.0,7.0,8.0); + def id = List(List(1.0,0.0,0.0),List(0.0,1.0,0.0),List(0.0,0.0,1.0)); + def m1 = List(List(2.0,0.0,0.0),List(0.0,2.0,0.0),List(0.0,0.0,2.0)); + def m2 = List(List(1.0,2.0,3.0),List(4.0,5.0,6.0),List(7.0,8.0,9.0)); + + def v = List(2.0,3.0,4.0); + + Console.println("v1 = " + v1); + Console.println("v2 = " + v2); + Console.println; + + Console.println("id = " + id); + Console.println("m1 = " + m1); + Console.println("m2 = " + m2); + Console.println; + + Console.println("v1 * v1 = " + dotproduct(v1,v1)); + Console.println("v1 * v2 = " + dotproduct(v1,v2)); + Console.println("v2 * v1 = " + dotproduct(v2,v1)); + Console.println("v1 * v2 = " + dotproduct(v1,v2)); + Console.println; + + Console.println("id * v1 = " + matrixTimesVector(id,v1)); + Console.println("m1 * v1 = " + matrixTimesVector(m1,v1)); + Console.println("m2 * v1 = " + matrixTimesVector(m2,v1)); + Console.println; + + Console.println("trn(id) = " + transpose(id)); + Console.println("trn(m1) = " + transpose(m1)); + Console.println("trn(m2) = " + transpose(m2)); + Console.println; + + Console.println("List(v1) * id = " + matrixTimesMatrix(List(v1),id)); + Console.println("List(v1) * m1 = " + matrixTimesMatrix(List(v1),m1)); + Console.println("List(v1) * m2 = " + matrixTimesMatrix(List(v1),m2)); + Console.println; + + Console.println("id * List(v1) = " + matrixTimesMatrix(id,List(v1))); + Console.println("m1 * List(v1) = " + matrixTimesMatrix(m1,List(v1))); + Console.println("m2 * List(v1) = " + matrixTimesMatrix(m2,List(v1))); + Console.println; + + Console.println("id * id = " + matrixTimesMatrix(id,id)); + Console.println("id * m1 = " + matrixTimesMatrix(id,m1)); + Console.println("m1 * id = " + matrixTimesMatrix(m1,id)); + Console.println("m1 * m1 = " + matrixTimesMatrix(m1,m1)); + Console.println("id * m2 = " + matrixTimesMatrix(id,m2)); + Console.println("m2 * id = " + matrixTimesMatrix(m2,id)); + Console.println("m1 * m2 = " + matrixTimesMatrix(m1,m2)); + Console.println("m2 * m1 = " + matrixTimesMatrix(m2,m1)); + Console.println("m2 * m2 = " + matrixTimesMatrix(m2,m2)); + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + M3.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-05.check b/tests/pending/run/Course-2002-05.check new file mode 100644 index 000000000000..d41120ad48f2 --- /dev/null +++ b/tests/pending/run/Course-2002-05.check @@ -0,0 +1,44 @@ +(List(),List(1, 2, 3, 4, 5, 6, 7, 8)) +(List(1, 2, 3, 4),List(5, 6, 7, 8)) +(List(1, 2, 3, 4, 5, 6, 7, 8),List()) + +(List(),List(8, 7, 6, 5, 4, 3, 2, 1)) +(List(4, 3, 2, 1),List(8, 7, 6, 5)) +(List(8, 7, 6, 5, 4, 3, 2, 1),List()) + +(List(),List(7, 2, 1, 5, 4, 3, 8, 6)) +(List(2, 1, 4, 3),List(7, 5, 8, 6)) +(List(7, 2, 1, 5, 4, 3, 8, 6),List()) + +List(1, 2, 3, 4, 5, 6, 7, 8) + +(List(),List(1, 2, 3, 4, 5, 6, 7, 8)) +(List(1, 2, 3, 4),List(5, 6, 7, 8)) +(List(1, 2, 3, 4, 5, 6, 7, 8),List()) + +(List(),List(8, 7, 6, 5, 4, 3, 2, 1)) +(List(4, 3, 2, 1),List(8, 7, 6, 5)) +(List(8, 7, 6, 5, 4, 3, 2, 1),List()) + +(List(),List(7, 2, 1, 5, 4, 3, 8, 6)) +(List(2, 1, 4, 3),List(7, 5, 8, 6)) +(List(7, 2, 1, 5, 4, 3, 8, 6),List()) + +List(1, 2, 3, 4, 5, 6, 7, 8) + +List(List()) +List(List(), List(1)) +List(List(), List(2), List(1), List(1, 2)) +List(List(), List(3), List(2), List(2, 3), List(1), List(1, 3), List(1, 2), List(1, 2, 3)) +List(List(), List(4), List(3), List(3, 4), List(2), List(2, 4), List(2, 3), List(2, 3, 4), List(1), List(1, 4), List(1, 3), List(1, 3, 4), List(1, 2), List(1, 2, 4), List(1, 2, 3), List(1, 2, 3, 4)) + +queens(1) = List(List((1,1))) +queens(2) = List() +queens(3) = List() +queens(4) = List(List((4,3), (3,1), (2,4), (1,2)), List((4,2), (3,4), (2,1), (1,3))) + +queens(1) = List(List(1)) +queens(2) = List() +queens(3) = List() +queens(4) = List(List(3, 1, 4, 2), List(2, 4, 1, 3)) + diff --git a/tests/pending/run/Course-2002-05.scala b/tests/pending/run/Course-2002-05.scala new file mode 100644 index 000000000000..c1e6b07c0ef4 --- /dev/null +++ b/tests/pending/run/Course-2002-05.scala @@ -0,0 +1,214 @@ +//############################################################################ +// Programmation IV - 2002 - Week 05 +//############################################################################ + +object M0 { + def partition[a](xs: List[a], pred: a => Boolean): Tuple2[List[a], List[a]] = { + if (xs.isEmpty) + (List(),List()) + else { + val tailPartition = partition(xs.tail, pred); + if (pred(xs.head)) + (xs.head :: tailPartition._1, tailPartition._2) + else + (tailPartition._1, xs.head :: tailPartition._2) + } + } + + def quicksort[a] (less : (a,a) => Boolean) (xs : List[a]) : List[a] = { + if (xs.isEmpty) + xs + else { + val pivot = xs.head; + val sub = partition(xs.tail, { elem : a => less(elem, pivot) }); + quicksort(less)(sub._1) ::: List(pivot) ::: quicksort(less)(sub._2) + } + } + + def test = { + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 0))); + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 5))); + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 9))); + Console.println; + + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 0))); + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 5))); + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 9))); + Console.println; + + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 0))); + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 5))); + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 9))); + Console.println; + + Console.println(quicksort[Int]((x,y) => x < y)(List(7,2,1,5,4,3,8,6))); + Console.println; + } +} + +//############################################################################ + +object M1 { + def partition[a](xs: List[a], pred: a => Boolean): Tuple2[List[a], List[a]] = { + xs.foldRight[Tuple2[List[a], List[a]]]((List(), List())) { + (x, p) => if (pred (x)) (x :: p._1, p._2) else (p._1, x :: p._2) + } + } + + def quicksort[a] (less : (a,a) => Boolean) (xs : List[a]) : List[a] = { + if (xs.isEmpty) + xs + else { + val pivot = xs.head; + val sub = partition(xs.tail, (elem : a) => less(elem, pivot)); + quicksort(less)(sub._1) ::: List(pivot) ::: quicksort(less)(sub._2) + } + } + + def test = { + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 0))); + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 5))); + Console.println(partition[Int](List(1,2,3,4,5,6,7,8), (x => x < 9))); + Console.println; + + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 0))); + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 5))); + Console.println(partition[Int](List(8,7,6,5,4,3,2,1), (x => x < 9))); + Console.println; + + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 0))); + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 5))); + Console.println(partition[Int](List(7,2,1,5,4,3,8,6), (x => x < 9))); + Console.println; + + Console.println(quicksort[Int]((x,y) => x < y)(List(7,2,1,5,4,3,8,6))); + Console.println; + } +} + +//############################################################################ + +object M2 { + + def powerset[a] (s: List[a]): List[List[a]] = { + if (s.isEmpty) + List(List()) + else { + val x = s.head; + val withoutX = powerset(s.tail); + withoutX ::: withoutX.map { s1 : List[a] => x::s1 } + } + } + + def test = { + Console.println(powerset(List())); + Console.println(powerset(List(1))); + Console.println(powerset(List(1,2))); + Console.println(powerset(List(1,2,3))); + Console.println(powerset(List(1,2,3,4))); + Console.println; + } +} + +//############################################################################ + +object M3 { + + def abs(x: Int) = if (x < 0) 0 - x else x; + + def range(lo: Int, hi: Int): List[Int] = + if (lo > hi) List() + else lo :: range(lo + 1, hi); + + type Placement = List[(Int, Int)]; + + def queens(n: Int): List[Placement] = { + def placeQueens(row: Int): List[Placement] = { + if (row == 0) + List(List()) + else { + def isSafe(column: Int, placement: Placement): Boolean = + placement forall { + pos => (pos._2 != column && + abs(pos._2 - column) != row - pos._1) + } + + def adjoinRow(placement: Placement): List[Placement] = + range(1, n) + .filter (column => isSafe(column, placement)) + .map (column => (row, column) :: placement); + + placeQueens(row - 1) flatMap adjoinRow + } + } + placeQueens(n) + } + + def test: Unit = { + Console.println("queens(1) = " + queens(1)); + Console.println("queens(2) = " + queens(2)); + Console.println("queens(3) = " + queens(3)); + Console.println("queens(4) = " + queens(4)); + Console.println; + } +} + +//############################################################################ + +object M4 { + + def abs(x: Int) = if (x < 0) 0 - x else x; + + def range(lo: Int, hi: Int): List[Int] = + if (lo > hi) List() + else lo :: range(lo + 1, hi); + + type Placement = List[Int]; + + def queens(n: Int): List[Placement] = { + val columns = range(1, n); + def placeQueens(row: Int): List[Placement] = { + if (row == 0) + List(List()) + else { + def isSafe(col: Int, p: Placement, delta: Int): Boolean = + (p.isEmpty || + (col != p.head && + abs(col - p.head) != delta && + isSafe(col, p.tail, delta + 1))); + + for ( + placement <- placeQueens(row - 1); + col <- columns; + if isSafe(col, placement, 1) + ) yield { + col :: placement + } + } + } + placeQueens(n); + } + + def test: Unit = { + Console.println("queens(1) = " + queens(1)); + Console.println("queens(2) = " + queens(2)); + Console.println("queens(3) = " + queens(3)); + Console.println("queens(4) = " + queens(4)); + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + M3.test; + M4.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-06.check b/tests/pending/run/Course-2002-06.check new file mode 100644 index 000000000000..bd354594af99 --- /dev/null +++ b/tests/pending/run/Course-2002-06.check @@ -0,0 +1,38 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: ProgrammationIV +%%Creator: LAMP +%%BoundingBox: 0 0 595.28 841.89 +%%EndComments + +/m {moveto} bind def +/l {lineto} bind def + +0.14 setlinewidth +newpath +42.52 165.83 m 297.64 165.83 l +297.64 165.83 m 297.64 505.99 l +297.64 505.99 m 42.52 505.99 l +42.52 505.99 m 170.08 676.07 l +170.08 676.07 m 297.64 505.99 l +297.64 505.99 m 42.52 165.83 l +42.52 165.83 m 42.52 505.99 l +42.52 505.99 m 297.64 165.83 l +297.64 165.83 m 425.2 165.83 l +425.2 165.83 m 425.2 505.99 l +425.2 505.99 m 297.64 505.99 l +297.64 505.99 m 361.42 676.07 l +361.42 676.07 m 425.2 505.99 l +425.2 505.99 m 297.64 165.83 l +297.64 165.83 m 297.64 505.99 l +297.64 505.99 m 425.2 165.83 l +425.2 676.07 m 552.76 676.07 l +552.76 676.07 m 552.76 335.91 l +552.76 335.91 m 425.2 335.91 l +425.2 335.91 m 488.98 165.83 l +488.98 165.83 m 552.76 335.91 l +552.76 335.91 m 425.2 676.07 l +425.2 676.07 m 425.2 335.91 l +425.2 335.91 m 552.76 676.07 l +stroke +showpage +%%EOF diff --git a/tests/pending/run/Course-2002-06.scala b/tests/pending/run/Course-2002-06.scala new file mode 100644 index 000000000000..908a934041b8 --- /dev/null +++ b/tests/pending/run/Course-2002-06.scala @@ -0,0 +1,261 @@ +//############################################################################ +// Programmation IV - 2002 - Week 06 +//############################################################################ + +/** Two-dimensional vector. */ +class Vector (_x: Double, _y: Double) { + def x: Double = _x; + def y: Double = _y; + def +(that: Vector): Vector = new Vector(x + that.x, y + that.y); + def *(scalar: Double): Vector = new Vector(x * scalar, y * scalar); + def -(that: Vector): Vector = new Vector(x - that.x, y - that.y); + def /(scalar: Double): Vector = new Vector(x / scalar, y / scalar); + def norm: Double = Math.sqrt(x * x + y * y); +} + +//############################################################################ + +/** Frame. */ +class Frame (_origin: Vector, _edgeX: Vector, _edgeY: Vector) { + def origin: Vector = _origin; + def edgeX: Vector = _edgeX; + def edgeY: Vector = _edgeY; + /** The vector v in the absolute (drawing) coordinate system */ + def coordMap(v: Vector): Vector = origin + (edgeX * v.x) + (edgeY * v.y); +} + +//############################################################################ + +/** Space on which we can draw lines. */ +abstract class Graphics(_width: Double, _height: Double) { + /** Width of the picture.*/ + def width: Double = _width; + + /** Height of the picture.*/ + def height: Double = _height; + + /** Frame that represents the drawable area of the output device*/ + val frame: Frame; + + /** Draw a line in device coordinates*/ + def plotLine(x1: Double, y1: Double, x2: Double, y2: Double): Unit; + + /** Draw a line in logical coordinates*/ + def drawLine(v1: Vector, v2: Vector): Unit = { + val _v1 = frame.coordMap(v1); + val _v2 = frame.coordMap(v2); + plotLine(_v1.x, _v1.y, _v2.x, _v2.y); + } + + /** Draw a segment of the picture.*/ + def drawSegment(frm: Frame)(v1: Vector, v2: Vector): Unit = { + val _v1 = frm.coordMap(v1); + val _v2 = frm.coordMap(v2); + drawLine(_v1, _v2); + } + + /** Draw a list of segments on the picture.*/ + def drawSegments(frm: Frame)(segments: List[Tuple2[Vector, Vector]]): Unit = + if (segments.isEmpty) () + else { + drawSegment(frm)(segments.head._1, segments.head._2); + drawSegments(frm)(segments.tail) + } + + /** Draw a list of continuous segments on the picture.*/ + def drawPolySegment(frm: Frame)(points: List[Vector]) : Unit = + if (!points.tail.isEmpty) { + drawSegment(frm)(points.head, points.tail.head); + drawPolySegment(frm)(points.tail); + } + + /** updates the contents of the output device*/ + def repaint = (); + + /** Add the last touch to the picture.*/ + def close : Unit; +} + +//############################################################################ + +/** Provides PostScript output. The name of the file is the first parameter + * of the constructor. The width and height determine the aspect ratio + */ +class PostScript (filename: String, _width: Double, _height: Double) + extends Graphics(_width, _height) { + /** Convert mm into 72th of inch.*/ + def mm2ps(x: Double) : Double = round(x * 72.0 / 25.4); + + def round(x: Double): Double = + Math.floor(x * 100.0 + 0.5) / 100.0; + + def scaleAndCenter(frm: Frame, ratio:Double): Frame = { + val currentRatio = frm.edgeX.norm / frm.edgeY.norm; + if (currentRatio < ratio) { + val newEdgeX = frm.edgeX; + val newEdgeY = frm.edgeY * (currentRatio /ratio); + val newOrigin = frm.origin + ((frm.edgeY - newEdgeY) / 2); + new Frame(newOrigin, newEdgeX, newEdgeY) + } + else { + val newEdgeX = frm.edgeX * (ratio / currentRatio); + val newEdgeY = frm.edgeY; + val newOrigin = frm.origin + ((frm.edgeX - newEdgeX) / 2); + new Frame(newOrigin, newEdgeX, newEdgeY) + } + } + + /** Line thickness in millimeters.*/ + val line_thickness : Double = 0.05; + + /** Width, height, left and right margins in mm.*/ + val psWidth: Double = 210.0; + val psHeight: Double = 297.0; + val psWidthMargin: Double = 15.0; + val psHeightMargin: Double = 15.0; + + val frame: Frame = { + val origin = new Vector(mm2ps(psWidthMargin), mm2ps(psHeightMargin)); + val edgeX = new Vector(mm2ps(psWidth) - 2 * mm2ps(psWidthMargin), 0); + val edgeY = new Vector(0, mm2ps(psHeight) - 2 * mm2ps(psHeightMargin)); + scaleAndCenter(new Frame(origin, edgeX, edgeY), width / height) + } + + def plotLine(x1: Double, y1: Double, x2: Double, y2: Double): Unit = { + Console.println(round(x1) + " " + round(y1) + " m " + + round(x2) + " " + round(y2) + " l"); + } + + /** Print the PS header.*/ + Console.println("%!PS-Adobe-3.0 EPSF-3.0\n%%Title: ProgrammationIV"); + Console.println("%%Creator: LAMP"); + Console.println("%%BoundingBox: 0 0 " + mm2ps(psWidth) + " " + mm2ps(psHeight)); + Console.println("%%EndComments\n"); + Console.println("/m {moveto} bind def\n/l {lineto} bind def\n"); + Console.println(mm2ps(line_thickness) + " setlinewidth\nnewpath"); + + /** Terminate the PS document and close the file stream. */ + def close : Unit = { + Console.println("stroke\nshowpage\n%%EOF"); + Console.flush; + } +} + +//############################################################################ + +object M0 { + + /** Define the type of a painter as a function that takes a frame, + * draws itself onto it and returns nothing + */ + type Painter = (Frame) => Unit; + + + /** Transform the frame in which the painter is to be drawn, hence + * changing the appearance of the painter + */ + def transformPainter(origin: Vector, newX: Vector, newY: Vector)(painter: Painter): Painter = { + frame: Frame => { + val newOrigin = frame.coordMap(origin); + val newFrame = new Frame(newOrigin, + frame.coordMap(newX) - newOrigin, + frame.coordMap(newY) - newOrigin); + painter(newFrame) + } + } + + + /** Flip the painter vertically + */ + def flipVert: Painter => Painter = + transformPainter(new Vector(0.0, 1.0), + new Vector(1.0, 1.0), + new Vector(0.0, 0.0)); + + /** Flip the painter horizontally + */ + def flipHoriz: Painter => Painter = + transformPainter(new Vector(1.0, 0.0), + new Vector(0.0, 0.0), + new Vector(1.0, 1.0)); + + /** Compose a painter that draws p1 on the left of p2 + */ + def beside(p1: Painter, p2: Painter) : Painter = { + frame: Frame => { + transformPainter(new Vector(0.0, 0.0), + new Vector(0.5, 0.0), + new Vector(0.0, 1.0))(p1)(frame); + transformPainter(new Vector(0.5, 0.0), + new Vector(1.0, 0.0), + new Vector(0.5, 1.0))(p2)(frame) + } + } + + /** Compose a painter that draws p1 below p2 + */ + def below(p1: Painter, p2: Painter): Painter = { + frame: Frame => { + transformPainter(new Vector(0.0, 0.0), + new Vector(1.0, 0.0), + new Vector(0.0, 0.5))(p1)(frame); + transformPainter(new Vector(0.0, 0.5), + new Vector(1.0, 0.5), + new Vector(0.0, 1.0))(p2)(frame) + } + } + + def rightSplit(painter: Painter, n: Int): Painter = { + if (n == 0) painter + else { + val smaller = rightSplit(painter, n-1); + beside(painter, below(smaller, smaller)) + } + } + + // A small test painter. + def house(canvas: Graphics)(frame: Frame): Unit = { + canvas.drawPolySegment(frame)(List(new Vector(0.0, 0.0), + new Vector(1.0, 0.0), + new Vector(1.0, 2.0/3.0), + new Vector(0.0, 2.0/3.0), + new Vector(0.5, 1.0), + new Vector(1.0, 2.0/3.0), + new Vector(0.0, 0.0), + new Vector(0.0, 2.0/3.0), + new Vector(1.0, 0.0))); + canvas.repaint + } + + def test = { + val psfile = "-"; + val canvas: Graphics = new PostScript(psfile, 2, 2); + + // the identity frame + val identFrame = new Frame(new Vector(0.0,0.0), + new Vector(1.0,0.0), + new Vector(0.0,1.0)); + + // Create a basic painter... + val p: Painter = house(canvas); + // ...then compose it with itself. + val threeHouses = beside(p, beside(p, flipVert(p))); + + // Use the painter to draw the final image. + threeHouses(identFrame); + + // Don't forget to close the canvas! + canvas.close + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-07.check b/tests/pending/run/Course-2002-07.check new file mode 100644 index 000000000000..75e956f31054 --- /dev/null +++ b/tests/pending/run/Course-2002-07.check @@ -0,0 +1,137 @@ + 0 = 0 + 1 = 1 + 0 + 1 = 1 + 1 + 2 = 3 +2 + 3 + 4 = 9 + + 0 = 0 + 1 = 1 + 0 + 1 = 1 + 1 + 2 = 3 +2 + 3 + 4 = 9 + + 0 = 0 + 1 = 1 + 0 + 1 = 1 + 1 + 2 = 3 +2 + 3 + 4 = 9 + + 0 = 0 + 1 = 1 + 0 + 1 = 1 + 1 + 2 = 3 +2 + 3 + 4 = 9 + +List() = concat(List()) +List() = concat(List(List())) +List() = concat(List(List(), List())) +List() = concat(List(List(), List(), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3, 4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3, 4, 5, 6), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3), List(4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(1, 2, 3, 4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3, 4, 5, 6), List(), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3, 4, 5), List(6), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2, 3), List(4, 5, 6), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1), List(2, 3, 4, 5, 6), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(1, 2, 3, 4, 5, 6), List())) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(1, 2, 3, 4, 5), List(6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(1, 2, 3), List(4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(1), List(2, 3, 4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(), List(), List(1, 2, 3, 4, 5, 6))) +List(1, 2, 3, 4, 5, 6) = concat(List(List(1, 2), List(3, 4), List(5, 6))) + +List() = zipFun(List(),List()) +List() = zipFun(List(),List(a, b, c)) +List() = zipFun(List(1, 2, 3),List()) +List((1,a)) = zipFun(List(1),List(a)) +List((1,a)) = zipFun(List(1),List(a, b, c)) +List((1,a)) = zipFun(List(1, 2, 3),List(a)) +List((1,a), (2,b)) = zipFun(List(1, 2),List(a, b)) +List((1,a), (2,b)) = zipFun(List(1, 2),List(a, b, c)) +List((1,a), (2,b)) = zipFun(List(1, 2, 3),List(a, b)) +List((1,a), (2,b), (3,c)) = zipFun(List(1, 2, 3),List(a, b, c)) + +List() = heads(List()) +List() = heads(List(List())) +List() = heads(List(List(), List())) +List() = heads(List(List(), List(), List())) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6))) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6), List())) +List(1) = heads(List(List(), List(1, 2, 3, 4, 5, 6))) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6), List(), List())) +List(1) = heads(List(List(), List(1, 2, 3, 4, 5, 6), List())) +List(1) = heads(List(List(), List(), List(1, 2, 3, 4, 5, 6))) +List(1, 2) = heads(List(List(1), List(2, 3, 4, 5, 6), List())) +List(1, 2) = heads(List(List(), List(1), List(2, 3, 4, 5, 6))) +List(1, 4) = heads(List(List(1, 2, 3), List(4, 5, 6))) +List(1, 4) = heads(List(List(1, 2, 3), List(4, 5, 6), List())) +List(1, 4) = heads(List(List(), List(1, 2, 3), List(4, 5, 6))) +List(1, 6) = heads(List(List(1, 2, 3, 4, 5), List(6), List())) +List(1, 6) = heads(List(List(), List(1, 2, 3, 4, 5), List(6))) +List(1, 3, 5) = heads(List(List(1, 2), List(3, 4), List(5, 6))) + +List() = heads(List()) +List() = heads(List(List())) +List() = heads(List(List(), List())) +List() = heads(List(List(), List(), List())) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6))) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6), List())) +List(1) = heads(List(List(), List(1, 2, 3, 4, 5, 6))) +List(1) = heads(List(List(1, 2, 3, 4, 5, 6), List(), List())) +List(1) = heads(List(List(), List(1, 2, 3, 4, 5, 6), List())) +List(1) = heads(List(List(), List(), List(1, 2, 3, 4, 5, 6))) +List(1, 2) = heads(List(List(1), List(2, 3, 4, 5, 6), List())) +List(1, 2) = heads(List(List(), List(1), List(2, 3, 4, 5, 6))) +List(1, 4) = heads(List(List(1, 2, 3), List(4, 5, 6))) +List(1, 4) = heads(List(List(1, 2, 3), List(4, 5, 6), List())) +List(1, 4) = heads(List(List(), List(1, 2, 3), List(4, 5, 6))) +List(1, 6) = heads(List(List(1, 2, 3, 4, 5), List(6), List())) +List(1, 6) = heads(List(List(), List(1, 2, 3, 4, 5), List(6))) +List(1, 3, 5) = heads(List(List(1, 2), List(3, 4), List(5, 6))) + +f (x) = Prod(Var(x), Var(x)) +f'(x) = Sum(Prod(Var(x), Number(1)), Prod(Var(x), Number(1))) + +f (x) = x * x +f'(x) = x * 1 + x * 1 +g (x) = 2 * x * x + 3 * x +g'(x) = 2 * x * 1 + x * (2 * 1 + x * 0) + 3 * 1 + x * 0 +g (3) = 27 +g'(3) = 15 + +ta(x) = x + 3 +tb(x) = x + 3 +tc(x) = x + 3 +td(x) = x + 3 +te(x) = 2 * x + 3 +tf(x) = 2 * x + 3 +tg(x) = 6 * x +th(x) = x^6 + +f4(x) = x^4 + 7 * x^3 + 20 * x^2 + 23 * x + 5 +f3(x) = 4 * x^3 + 21 * x^2 + 40 * x + 23 +f2(x) = 12 * x^2 + 42 * x + 40 +f1(x) = 24 * x + 42 +f0(x) = 24 + +f4(0) = 5 ok +f4(1) = 56 ok +f4(2) = 203 ok +f4(3) = 524 ok +f4(4) = 1121 ok + +f3(0) = 23 ok +f3(1) = 88 ok +f3(2) = 219 ok +f3(3) = 440 ok + +f2(0) = 40 ok +f2(1) = 94 ok +f2(2) = 172 ok + +f1(0) = 42 ok +f1(1) = 66 ok + +f0(0) = 24 ok + diff --git a/tests/pending/run/Course-2002-07.scala b/tests/pending/run/Course-2002-07.scala new file mode 100644 index 000000000000..b26eda1e0ecd --- /dev/null +++ b/tests/pending/run/Course-2002-07.scala @@ -0,0 +1,722 @@ +//############################################################################ +// Programmation IV - 2002 - Week 07 +//############################################################################ + +object M0 { + + trait Expr { + def isNumber: Boolean; + def isSum: Boolean; + def numValue: Int; + def leftOp: Expr; + def rightOp: Expr; + } + + class Number(n: Int) extends Expr { + def isNumber: Boolean = true; + def isSum: Boolean = false; + def numValue: Int = n; + def leftOp: Expr = sys.error("Number.leftOp"); + def rightOp: Expr = sys.error("Number.rightOp"); + } + class Sum(e1: Expr, e2: Expr) extends Expr { + def isNumber: Boolean = false; + def isSum: Boolean = true; + def numValue: Int = sys.error("Sum.numValue"); + def leftOp: Expr = e1; + def rightOp: Expr = e2; + } + + class Prod(e1: Expr, e2: Expr) extends Expr { + def isNumber: Boolean = false; + def isSum: Boolean = false; + def numValue: Int = sys.error("Prod.numValue"); + def leftOp: Expr = e1; + def rightOp: Expr = e2; + } + + class Var(x: String) extends Expr { + def isNumber: Boolean = false; + def isSum: Boolean = false; + def numValue: Int = sys.error("Var.numValue"); + def leftOp: Expr = sys.error("Var.leftOp"); + def rightOp: Expr = sys.error("Var.rightOp"); + } + + def eval(e: Expr): Int = { + if (e.isNumber) e.numValue + else if (e.isSum) eval(e.leftOp) + eval(e.rightOp) + else sys.error("unknown expression") + } + + def test = { + Console.println(" 0 = " + eval(new Number(0))); + Console.println(" 1 = " + eval(new Number(1))); + Console.println(" 0 + 1 = " + + eval(new Sum(new Number(0),new Number(1)))); + Console.println(" 1 + 2 = " + + eval(new Sum(new Number(1),new Number(2)))); + Console.println("2 + 3 + 4 = " + + eval(new Sum(new Sum(new Number(2),new Number(3)),new Number(4)))); + Console.println; + } + +} + +//############################################################################ + +object M1 { + + trait Expr { + def eval: Int; + } + class Number(n: Int) extends Expr { + def eval: Int = n; + } + class Sum(e1: Expr, e2: Expr) extends Expr { + def eval: Int = e1.eval + e2.eval; + } + + def test = { + Console.println(" 0 = " + new Number(0).eval); + Console.println(" 1 = " + new Number(1).eval); + Console.println(" 0 + 1 = " + + new Sum(new Number(0),new Number(1)).eval); + Console.println(" 1 + 2 = " + + new Sum(new Number(1),new Number(2)).eval); + Console.println("2 + 3 + 4 = " + + new Sum(new Sum(new Number(2),new Number(3)),new Number(4)).eval); + Console.println; + } +} + +//############################################################################ + +object M2 { + + trait Expr; + case class Number(n: Int) extends Expr; + case class Sum(e1: Expr, e2: Expr) extends Expr; + + def eval(e: Expr): Int = e match { + case Number(n) => n + case Sum(e1, e2) => eval(e1) + eval(e2) + } + + def test = { + Console.println(" 0 = " + eval(Number(0))); + Console.println(" 1 = " + eval(Number(1))); + Console.println(" 0 + 1 = " + eval(Sum(Number(0),Number(1)))); + Console.println(" 1 + 2 = " + eval(Sum(Number(1),Number(2)))); + Console.println("2 + 3 + 4 = " + eval(Sum(Sum(Number(2),Number(3)), + Number(4)))); + Console.println; + } +} + +//############################################################################ + +object M3 { + + trait Expr { + def eval: Int = this match { + case Number(n) => n + case Sum(e1, e2) => e1.eval + e2.eval + } + } + case class Number(n: Int) extends Expr; + case class Sum(e1: Expr, e2: Expr) extends Expr; + + def test = { + Console.println(" 0 = " + Number(0).eval); + Console.println(" 1 = " + Number(1).eval); + Console.println(" 0 + 1 = " + Sum(Number(0),Number(1)).eval); + Console.println(" 1 + 2 = " + Sum(Number(1),Number(2)).eval); + Console.println("2 + 3 + 4 = " + Sum(Sum(Number(2),Number(3)), + Number(4)).eval); + Console.println; + } + +} + +//############################################################################ + +object M4 { + + def concat[a](xss: List[List[a]]): List[a] = xss match { + case List() => List() + case xs :: xss1 => xs ::: concat(xss1) + } + + def test_concat[a](xss: List[List[a]]) = { + Console.println(concat(xss).toString + " = concat(" + xss + ")"); // !!! .toString + } + + def test = { + test_concat(List()); + test_concat(List(List())); + test_concat(List(List(),List())); + test_concat(List(List(),List(),List())); + + test_concat(List(List(1,2,3,4,5,6))); + test_concat(List(List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_concat(List(List(1,2,3),List(4,5,6))); + test_concat(List(List[Int](),List(1,2,3,4,5,6))); // !!! [int] + test_concat(List(List(1,2,3,4,5,6),List[Int](),List[Int]())); // !!! [int] + test_concat(List(List(1,2,3,4,5),List(6),List[Int]())); // !!! [int] + test_concat(List(List(1,2,3),List(4,5,6),List[Int]())); // !!! [int] + test_concat(List(List(1),List(2,3,4,5,6),List[Int]())); // !!! [int] + test_concat(List(List[Int](),List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_concat(List(List[Int](),List(1,2,3,4,5),List(6))); // !!! [int] + test_concat(List(List[Int](),List(1,2,3),List(4,5,6))); // !!! [int] + test_concat(List(List[Int](),List(1),List(2,3,4,5,6))); // !!! [int] + test_concat(List(List[Int](),List[Int](),List(1,2,3,4,5,6))); // !!! [int] + test_concat(List(List(1,2),List(3,4),List(5,6))); + Console.println; + } + +} + +//############################################################################ + +object M5 { + + def zipFun[a,b](xs:List[a], ys:List[b]):List[Tuple2[a,b]] = (xs,ys) match { + case (List(), _) => List() + case (_, List()) => List() + case (x :: xs1, y :: ys1) => (x, y) :: zipFun(xs1, ys1) + } + + def test_zipFun[a,b](xs: List[a], ys: List[b]) = { + Console.println(zipFun(xs,ys).toString + " = zipFun(" + xs + "," + ys + ")"); // !!! .toString + } + + def test = { + test_zipFun(List(),List()); + test_zipFun(List(),List('a','b','c')); + test_zipFun(List(1,2,3),List()); + + test_zipFun(List(1),List('a')); + test_zipFun(List(1),List('a','b','c')); + test_zipFun(List(1,2,3),List('a')); + + test_zipFun(List(1,2),List('a','b')); + test_zipFun(List(1,2),List('a','b','c')); + test_zipFun(List(1,2,3),List('a','b')); + + test_zipFun(List(1,2,3),List('a','b','c')); + + Console.println; + } + +} + + +//############################################################################ + +object M6 { + + def zipFun[a,b](xs:List[a], ys:List[b]):List[Tuple2[a,b]] = ((xs,ys): @unchecked) match { + // !!! case (List(), _), (_, List()) => List() + case (x :: xs1, y :: ys1) => (x, y) :: zipFun(xs1, ys1) + } + + def test_zipFun[a,b](xs: List[a], ys: List[b]) = { + Console.println(zipFun(xs,ys).toString + " = zipFun(" + xs + "," + ys + ")"); // !!! .toString + } + + def test = { + test_zipFun(List(),List()); + test_zipFun(List(),List('a','b','c')); + test_zipFun(List(1,2,3),List()); + + test_zipFun(List(1),List('a')); + test_zipFun(List(1),List('a','b','c')); + test_zipFun(List(1,2,3),List('a')); + + test_zipFun(List(1,2),List('a','b')); + test_zipFun(List(1,2),List('a','b','c')); + test_zipFun(List(1,2,3),List('a','b')); + + test_zipFun(List(1,2,3),List('a','b','c')); + + Console.println; + } + +} + +//############################################################################ + +object M7 { + + def heads[a](xss: List[List[a]]): List[a] = xss flatMap { + case x :: xs => List(x) + case List() => List() + } + + def test_heads[a](xss: List[List[a]]) = { + Console.println(heads(xss).toString + " = heads(" + xss + ")"); // !!! .toString + } + + def test = { + test_heads(List()); + test_heads(List(List())); + test_heads(List(List(),List())); + test_heads(List(List(),List(),List())); + + test_heads(List(List(1,2,3,4,5,6))); + test_heads(List(List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5,6))); // !!! [int] + test_heads(List(List(1,2,3,4,5,6),List[Int](),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List[Int](),List(1,2,3,4,5,6))); // !!! [int] + + test_heads(List(List(1),List(2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1),List(2,3,4,5,6))); // !!! [int] + + test_heads(List(List(1,2,3),List(4,5,6))); + test_heads(List(List(1,2,3),List(4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3),List(4,5,6))); // !!! [int] + + test_heads(List(List(1,2,3,4,5),List(6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5),List(6))); // !!! [int] + + test_heads(List(List(1,2),List(3,4),List(5,6))); + + Console.println; + } + +} + +//############################################################################ + +object M8 { + + def heads[a](xss: List[List[a]]): List[a] = xss.flatMap { + y => y match { + case x :: xs => List(x) + case List() => List() + } + } + + def test_heads[a](xss: List[List[a]]) = { + Console.println(heads(xss).toString + " = heads(" + xss + ")"); // !!! .toString + } + + + def test = { + test_heads(List()); + test_heads(List(List())); + test_heads(List(List(),List())); + test_heads(List(List(),List(),List())); + + test_heads(List(List(1,2,3,4,5,6))); + test_heads(List(List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5,6))); // !!! [int] + test_heads(List(List(1,2,3,4,5,6),List[Int](),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List[Int](),List(1,2,3,4,5,6))); // !!! [int] + + test_heads(List(List(1),List(2,3,4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1),List(2,3,4,5,6))); // !!! [int] + + test_heads(List(List(1,2,3),List(4,5,6))); + test_heads(List(List(1,2,3),List(4,5,6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3),List(4,5,6))); // !!! + + test_heads(List(List(1,2,3,4,5),List(6),List[Int]())); // !!! [int] + test_heads(List(List[Int](),List(1,2,3,4,5),List(6))); // !!! [int] + + test_heads(List(List(1,2),List(3,4),List(5,6))); + + Console.println; + } + +} + +//############################################################################ + +object M9 { + + trait Expr { + def derive(v: Var): Expr = this match { + case Number(_) => Number(0) + case Var(name) => if (name == v.name) Number(1) else Number(0) + case Sum(e1, e2) => Sum(e1 derive v, e2 derive v) + case Prod(e1, e2) => Sum(Prod(e1, e2 derive v), Prod(e2, e1 derive v)) + } + } + case class Number(x: Int) extends Expr { + override def toString = "Number(" + x + ")"; // !!! remove ! + } + case class Var(name: String) extends Expr { + override def toString = "Var(" + name + ")"; // !!! remove ! + } + case class Sum(e1: Expr, e2: Expr) extends Expr { + override def toString = "Sum(" + e1 + ", " + e2 + ")"; // !!! remove ! + } + case class Prod(e1: Expr, e2: Expr) extends Expr { + override def toString = "Prod(" + e1 + ", " + e2 + ")"; // !!! remove ! + } + + def test = { + val x = Var("x"); + val f0 = Prod(x, x); + val f1 = f0 derive x; + Console.println("f (x) = " + f0); + Console.println("f'(x) = " + f1); + Console.println; + } + +} + +//############################################################################ + +object MA { + + def lookup[k,v](xs: List[Tuple2[k,v]], k: k): v = xs match { + case List() => sys.error("no value for " + k) + case (k1,v1) :: xs1 => if (k1 == k) v1 else lookup(xs1, k) + } + + trait Expr { + def + (that: Expr) = Sum(this, that); + def * (that: Expr) = Prod(this, that); + def derive(v: Var): Expr = this match { + case Number(_) => Number(0) + case Var(name) => if (name == v.name) Number(1) else Number(0) + case Sum(e1, e2) => (e1 derive v) + (e2 derive v) + case Prod(e1, e2) => e1 * (e2 derive v) + e2 * (e1 derive v) + } + } + case class Number(x: Int) extends Expr { + override def toString = x.toString + } + case class Var(name: String) extends Expr { + override def toString = name; + } + case class Sum(e1: Expr, e2: Expr) extends Expr { + override def toString = e1.toString + " + " + e2.toString; + } + case class Prod(e1: Expr, e2: Expr) extends Expr { + override def toString = { + def factorToString(e: Expr) = e match { + case Sum(_, _) => "(" + e.toString + ")" + case _ => e.toString + } + factorToString(e1) + " * " + factorToString(e2); + } + } + + def eval(e: Expr): Int = e match { + case Number(n) => n + case Var(_) => sys.error("cannot evaluate variable") + case Sum(e1, e2) => eval(e1) + eval(e2) + case Prod(e1, e2) => eval(e1) * eval(e2) + } + + def evalvars(xs: List[(String,Int)]): Expr => Int = { + def loop(e: Expr): Int = e match { + case Number(n) => n + case Var(name) => lookup(xs,name) + case Sum(e1, e2) => loop(e1) + loop(e2) + case Prod(e1, e2) => loop(e1) * loop(e2) + } + loop + } + + def test = { + val x = Var("x"); + + val f0 = x * x; + val f1 = f0 derive x; + Console.println("f (x) = " + f0); + Console.println("f'(x) = " + f1); + + val g0 = Number(2) * x * x + Number(3) * x; + val g1 = g0 derive x; + Console.println("g (x) = " + g0); + Console.println("g'(x) = " + g1); + Console.println("g (3) = " + evalvars(List(("x",3)))(g0)); + Console.println("g'(3) = " + evalvars(List(("x",3)))(g1)); + + Console.println; + } + +} + +//############################################################################ + +object Utils { + + private def power0(x: Int, y: Int): Int = + if (y == 1) x else if (y % 2 == 0) power0(x*x,y/2) else x*power0(x, y-1); + + def power(x: Int, y: Int): Int = (x,y) match { + case (0,0) => sys.error("power(0,0)") + case (0,_) => 0 + case (1,_) => 1 + case (_,0) => 1 + case (_,1) => x + case (_,2) => x*x + case (_,_) => if (y < 0) 1/power0(x,y) else power0(x,y) + } + + def lookup(entries: List[(String,Int)], key: String): Int = entries match { + case List() => sys.error("no value for " + key) + case (k,v) :: _ if (k == key) => v + case _ :: rest => lookup(rest, key) + } + + def compare(xs: List[String], ys: List[String]): Int = (xs, ys) match { + case (List(), List()) => 0 + case (List(), _ ) => -1 + case (_ , List()) => +1 + case (x::xs , y::ys ) => { + val diff = x.compareTo(y); + if (diff != 0) diff else compare(xs,ys) + } + } + +} + +object MB { + + import Utils._; + + + trait Expr { + + private def count: Int = this match { + case Lit(n) => n + case Mul(Lit(n),_) => n + case _ => 1 + } + + private def term: Expr = this match { + case Lit(_) => Lit(1) + case Mul(Lit(_),r) => r + case _ => this + } + + private def vars: List[String] = this match { + case Var(n) => List(n) + case Mul(l,r) => l.vars ::: r.vars + case Pow(l,n) => { val vs = l.vars; List.range(0,n).flatMap(i => vs) } + case _ => List() + } + + private def +< (that: Expr): Boolean = (this + 0 + case (_ , Add(_,_)) => 0 + case (_ , _ ) => compare(this.vars,that.vars) + } + + def + (that: Expr): Expr = if (that +<= this) (this,that) match { + case (_ , Lit(0) ) => this + case (Lit(l) , Lit(r) ) => Lit(l + r) + case (_ , Add(rl,rr)) => (this + rl) + rr + case (Add(ll,lr), _ ) if (lr +<= that) => ll + (that + lr) + case (_ , _ ) => { + val l = this.term; + val r = that.term; + if (l equ r) Lit(this.count + that.count) * r else Add(this, that) + } + } else that + this; + + private def *< (that: Expr): Boolean = (this * 0 + case (_ , Mul(_,_)) => 0 + case (Add(_,_), Add(_,_)) => 0 + case (Add(_,_), _ ) => -1 + case (_ , Add(_,_)) => +1 + case (Lit(_) , Lit(_) ) => 0 + case (Lit(_) , _ ) => -1 + case (_ , Lit(_) ) => +1 + case (Var(l) , Var(r) ) => l.compareTo(r) + case (Var(_) , Pow(r,_)) => if (this *<= r) -1 else +1 + case (Pow(l,_), Var(_) ) => if (l *< that) -1 else +1 + case (Pow(l,_), Pow(r,_)) => l * this + case (Lit(1) , _ ) => that + case (Mul(ll,lr), r ) => ll * (lr * r) + case (Add(ll,lr), r ) => ll * r + lr * r + case (Lit(l) , Lit(r) ) => Lit(l * r) + case (Var(_) , Var(_) ) if (this equ that) => Pow(this,2) + case (Var(_) , Pow(r,n) ) if (this equ r) => Pow(this,n + 1) + case (Pow(ll,lr), Pow(rl,rr)) if (ll equ rl) => Pow(ll,lr + rr) + case (l , Mul(rl,rr)) if (rl *<= l) => (rl * l) * rr + case (_ , _ ) => Mul(this,that) + } else that * this; + + def ^ (that: Int): Expr = (this,that) match { + case (_ ,1) => this + case (Lit(i) ,n) => Lit(power(i,n)) + case (Var(_) ,n) => Pow(this,n) + case (Add(_,_),n) => this * (this ^ (n - 1)) + case (Mul(l,r),n) => (l ^ n) * (r ^ n) + case (Pow(e,m),n) => Pow(e,m + n) + } + + def derive(v: Var): Expr = this match { + case Lit(_) => Lit(0) + case Var(name) => if (name == v.name) Lit(1) else Lit(0) + case Add(e1, e2) => (e1 derive v) + (e2 derive v) + case Mul(e1, e2) => e1 * (e2 derive v) + e2 * (e1 derive v) + case Pow(e1, i2) => Lit(i2) * (e1 derive v) * (e1 ^ (i2 - 1)) + } + + def evaluate(vars: List[(String,Int)]): Int = this match { + case Lit(cst) => cst + case Var (name) => lookup(vars, name) + case Add (l, r) => l.evaluate(vars) + r.evaluate(vars) + case Mul (l, r) => l.evaluate(vars) * r.evaluate(vars) + case Pow(l, r) => power(l.evaluate(vars), r) + } + + def equ(that: Expr): Boolean = (this,that) match { + case (Lit(l) ,Lit(r)) => l == r + case (Var(l) ,Var(r)) => l == r + case (Add(ll,lr),Add(rl,rr)) => (ll equ rl) && (lr equ rr) + case (Mul(ll,lr),Mul(rl,rr)) => (ll equ rl) && (lr equ rr) + case (Pow(ll,lr),Pow(rl,rr)) => (ll equ rl) && (lr == rr) + case _ => false + } + + } + + case class Lit(x: Int) extends Expr { + override def toString = x.toString + } + + case class Var(name: String) extends Expr { + override def toString = name; + } + + case class Add(e1: Expr, e2: Expr) extends Expr { + override def toString = e1.toString + " + " + e2.toString; // !!! .toString + } + + case class Mul(e1: Expr, e2: Expr) extends Expr { + override def toString = { + def factorToString(e: Expr) = e match { + case Add(_, _) => "(" + e.toString + ")" + case _ => e.toString + } + factorToString(e1) + " * " + factorToString(e2); + } + } + + case class Pow(e1: Expr, i2: Int) extends Expr { + override def toString = { + def factorToString(e: Expr) = e match { + case Add(_, _) => "(" + e.toString + ")" + case Mul(_, _) => "(" + e.toString + ")" + case _ => e.toString + } + factorToString(e1) + "^" + i2; + } + } + + def test = { + val _1 = Lit(1); + val _2 = Lit(2); + val _3 = Lit(3); + val _4 = Lit(4); + val _5 = Lit(5); + + val x = Var("x"); + + val ta = (_1 + (_2 + x)); + val tb = (_1 + (x + _2)); + val tc = ((_1 + x) + _2); + val td = ((x + _1) + _2); + val te = ((x + _1) + (x + _2)); + val tf = ((_1 + x) + (_2 + x)); + val tg = x + x + (x * _2) + x + x; + val th = x * x * (x ^ 2) * x * x; + + Console.println("ta(x) = " + ta); + Console.println("tb(x) = " + tb); + Console.println("tc(x) = " + tc); + Console.println("td(x) = " + td); + Console.println("te(x) = " + te); + Console.println("tf(x) = " + tf); + Console.println("tg(x) = " + tg); + Console.println("th(x) = " + th); + Console.println; + + val f4 = (x+ _3)*(_2+x)*x*(x+ _1) + (x+ _5)*(x*(x+ _2)+x+ _1) + (x^2) + x; + val f3 = f4.derive(x); + val f2 = f3.derive(x); + val f1 = f2.derive(x); + val f0 = f1.derive(x); + + Console.println("f4(x) = " + f4); + Console.println("f3(x) = " + f3); + Console.println("f2(x) = " + f2); + Console.println("f1(x) = " + f1); + Console.println("f0(x) = " + f0); + Console.println; + + def check(n: String, f: Expr, x: Int, e: Int): Unit = { + val a: Int = f.evaluate(List(("x",x))); + val s: String = if (a == e) "ok" else "KO(" + e + ")"; + Console.println(n + "(" + x + ") = " + a + " " + s); + } + + check("f4", f4, 0, 5); + check("f4", f4, 1, 56); + check("f4", f4, 2, 203); + check("f4", f4, 3, 524); + check("f4", f4, 4, 1121); + Console.println; + + check("f3", f3, 0, 23); + check("f3", f3, 1, 88); + check("f3", f3, 2, 219); + check("f3", f3, 3, 440); + Console.println; + + check("f2", f2, 0, 40); + check("f2", f2, 1, 94); + check("f2", f2, 2, 172); + Console.println; + + check("f1", f1, 0, 42); + check("f1", f1, 1, 66); + Console.println; + + check("f0", f0, 0, 24); + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + M3.test; + M4.test; + M5.test; + // !!! M6.test; + M7.test; + M8.test; + M9.test; + MA.test; + MB.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-08.check b/tests/pending/run/Course-2002-08.check new file mode 100644 index 000000000000..e2a780ecb698 --- /dev/null +++ b/tests/pending/run/Course-2002-08.check @@ -0,0 +1,171 @@ +x = abc +count = 111 +x = hello +count = 112 + +account deposit 50 -> () +account withdraw 20 -> 30 +account withdraw 20 -> 10 +account withdraw 15 -> + +x deposit 30 -> () +y withdraw 20 -> + +x deposit 30 -> () +x withdraw 20 -> 10 + +x deposit 30 -> () +y withdraw 20 -> 10 + +2^0 = 1.0 +2^1 = 2.0 +2^2 = 4.0 +2^3 = 8.0 + +2^0 = 1.0 +2^1 = 2.0 +2^2 = 4.0 +2^3 = 8.0 + +1 2 3 +List(1, 2, 3) + +out 0 new-value = false +*** simulation started *** +out 1 new-value = true +!0 = 1 + +*** simulation started *** +out 2 new-value = false +!1 = 0 + +out 2 new-value = false + +*** simulation started *** +0 & 0 = 0 + +*** simulation started *** +0 & 1 = 0 + +*** simulation started *** +out 11 new-value = true +out 11 new-value = false +1 & 0 = 0 + +*** simulation started *** +out 14 new-value = true +1 & 1 = 1 + +out 14 new-value = false + +*** simulation started *** +0 | 0 = 0 + +*** simulation started *** +out 24 new-value = true +0 | 1 = 1 + +*** simulation started *** +1 | 0 = 1 + +*** simulation started *** +1 | 1 = 1 + +sum 34 new-value = false +carry 34 new-value = false + +*** simulation started *** +0 + 0 = 0 + +*** simulation started *** +sum 47 new-value = true +0 + 1 = 1 + +*** simulation started *** +carry 50 new-value = true +carry 50 new-value = false +sum 54 new-value = false +sum 54 new-value = true +1 + 0 = 1 + +*** simulation started *** +carry 57 new-value = true +sum 61 new-value = false +1 + 1 = 2 + +sum 61 new-value = false +carry 61 new-value = false + +*** simulation started *** +0 + 0 + 0 = 0 + +*** simulation started *** +sum 82 new-value = true +0 + 0 + 1 = 1 + +*** simulation started *** +sum 89 new-value = false +carry 90 new-value = true +sum 97 new-value = true +carry 98 new-value = false +0 + 1 + 0 = 1 + +*** simulation started *** +sum 113 new-value = false +carry 114 new-value = true +0 + 1 + 1 = 2 + +*** simulation started *** +sum 121 new-value = true +carry 122 new-value = false +sum 129 new-value = false +sum 129 new-value = true +1 + 0 + 0 = 1 + +*** simulation started *** +carry 137 new-value = true +sum 144 new-value = false +1 + 0 + 1 = 2 + +*** simulation started *** +carry 152 new-value = false +sum 152 new-value = true +sum 158 new-value = false +carry 159 new-value = true +1 + 1 + 0 = 2 + +*** simulation started *** +sum 173 new-value = true +1 + 1 + 1 = 3 + +in 0 new-value = false +ctrl0 0 new-value = false +ctrl1 0 new-value = false +ctrl2 0 new-value = false +out0 0 new-value = false +out1 0 new-value = false +out2 0 new-value = false +out3 0 new-value = false +out4 0 new-value = false +out5 0 new-value = false +out6 0 new-value = false +out7 0 new-value = false +in 0 new-value = true +*** simulation started *** +out0 10 new-value = true +ctrl0 10 new-value = true +*** simulation started *** +out1 13 new-value = true +out0 14 new-value = false +ctrl1 14 new-value = true +*** simulation started *** +out3 20 new-value = true +out1 21 new-value = false +ctrl2 21 new-value = true +*** simulation started *** +out7 30 new-value = true +out3 31 new-value = false +ctrl0 31 new-value = false +*** simulation started *** +out7 34 new-value = false +out6 35 new-value = true diff --git a/tests/pending/run/Course-2002-08.scala b/tests/pending/run/Course-2002-08.scala new file mode 100644 index 000000000000..5e21edaba353 --- /dev/null +++ b/tests/pending/run/Course-2002-08.scala @@ -0,0 +1,601 @@ +//############################################################################ +// Programmation IV - 2002 - Week 08 +//############################################################################ + +import List._; + +object M0 { + + var x: String = "abc"; + var count = 111; + + def test = { + Console.println("x = " + x); + Console.println("count = " + count); + x = "hello"; + count = count + 1; + Console.println("x = " + x); + Console.println("count = " + count); + Console.println; + } +} + +//############################################################################ + +object M1 { + + class BankAccount() { + private var balance = 0; + def deposit(amount: Int): Unit = + if (amount > 0) balance = balance + amount; + + def withdraw(amount: Int): Int = + if (0 < amount && amount <= balance) { + balance = balance - amount; + balance + } else sys.error("insufficient funds"); + } + + def test0 = { + val account = new BankAccount(); + Console.print("account deposit 50 -> "); + Console.println((account deposit 50).toString()); // !!! .toString + Console.print("account withdraw 20 -> "); + Console.println(account withdraw 20); + Console.print("account withdraw 20 -> "); + Console.println(account withdraw 20); + Console.print("account withdraw 15 -> "); + Console.println; + } + + def test1 = { + val x = new BankAccount(); + val y = new BankAccount(); + Console.print("x deposit 30 -> "); + Console.println((x deposit 30).toString()); // !!! .toString + Console.print("y withdraw 20 -> "); + Console.println; + } + + def test2 = { + val x = new BankAccount(); + val y = new BankAccount(); + Console.print("x deposit 30 -> "); + Console.println((x deposit 30).toString()); // !!! .toString + Console.print("x withdraw 20 -> "); + Console.println(x withdraw 20); + } + + def test3 = { + val x = new BankAccount(); + val y = x; + Console.print("x deposit 30 -> "); + Console.println((x deposit 30).toString()); // !!! .toString + Console.print("y withdraw 20 -> "); + Console.println(y withdraw 20); + } + + def test = { + test0; Console.println; + test1; Console.println; + test2; Console.println; + test3; Console.println; + } +} + + +//############################################################################ + +object M2 { + + def While(condition: => Boolean)(command: => Unit): Unit = + if (condition) { + command; While(condition)(command) + } else { + } + + def power (x: Double, exp: Int): Double = { + var r = 1.0; + var i = exp; + While (i > 0) { r = r * x; i = i - 1 } + r + } + + def test = { + Console.println("2^0 = " + power(2,0)); + Console.println("2^1 = " + power(2,1)); + Console.println("2^2 = " + power(2,2)); + Console.println("2^3 = " + power(2,3)); + Console.println; + } +} + +//############################################################################ + +object M3 { + + def power (x: Double, exp: Int): Double = { + var r = 1.0; + var i = exp; + while (i > 0) { r = r * x; i = i - 1 } + r + } + + def test = { + Console.println("2^0 = " + power(2,0)); + Console.println("2^1 = " + power(2,1)); + Console.println("2^2 = " + power(2,2)); + Console.println("2^3 = " + power(2,3)); + Console.println; + } +} + +//############################################################################ + +object M4 { + + def test = { + for (i <- range(1, 4)) { Console.print(i + " ") }; + Console.println; + Console.println(for (i <- range(1, 4)) yield i); + Console.println; + } +} + +//############################################################################ + +object M5 { + + type Action = () => Unit; + + class Wire() { + private var sigVal = false; + private var actions: List[Action] = List(); + def getSignal = sigVal; + def setSignal(s: Boolean) = + if (s != sigVal) { + sigVal = s; + actions.foreach(action => action()); + } + def addAction(a: Action) = { + actions = a :: actions; a() + } + } + + abstract class Simulation() { + private type Agenda = List[Tuple2[Int, Action]]; + private var agenda: Agenda = List(); + private var curtime = 0; + def currentTime: Int = curtime; + + def afterDelay(delay: Int)(action: Action): Unit = { + def insert(ag: Agenda, time: Int): Agenda = ag match { + case List() => + List((time, action)) + case (t, act) :: ag1 => + if (time < t) (time, action) :: ag + else (t, act) :: insert(ag1, time) + } + agenda = insert(agenda, curtime + delay) + } + + private def next: Unit = agenda match { + case List() => () + case (time, action) :: ag1 => { + agenda = ag1; + curtime = time; + action(); + } + } + + def run: Unit = { + afterDelay(0){() => Console.println("*** simulation started ***"); } + while (!agenda.isEmpty) { next } + } + } + + abstract class BasicCircuitSimulation() extends Simulation() { + + val InverterDelay: Int; + val AndGateDelay: Int; + val OrGateDelay: Int; + + def inverter(input: Wire, output: Wire): Unit = { + def invertAction() = { + val inputSig = input.getSignal; + afterDelay(InverterDelay) {() => output.setSignal(!inputSig) }; + } + input addAction invertAction + } + + def andGate(a1: Wire, a2: Wire, output: Wire): Unit = { + def andAction() = { + val a1Sig = a1.getSignal; + val a2Sig = a2.getSignal; + afterDelay(AndGateDelay) {() => output.setSignal(a1Sig & a2Sig) }; + } + a1 addAction andAction; + a2 addAction andAction; + } + + def orGate(o1: Wire, o2: Wire, output: Wire): Unit = { + def orAction() = { + val o1Sig = o1.getSignal; + val o2Sig = o2.getSignal; + afterDelay(OrGateDelay) {() => output.setSignal(o1Sig | o2Sig) }; + } + o1 addAction orAction; + o2 addAction orAction; + } + + def probe(name: String, wire: Wire): Unit = { + wire addAction {() => + Console.println( + name + " " + currentTime + " new-value = " + wire.getSignal); + } + } + } + + abstract class CircuitSimulation() extends BasicCircuitSimulation() { + + def halfAdder(a: Wire, b: Wire, s: Wire, c: Wire): Unit = { + val d = new Wire(); + val e = new Wire(); + orGate(a, b, d); + andGate(a, b, c); + inverter(c, e); + andGate(d, e, s); + } + + def fullAdder(a: Wire, b: Wire, cin: Wire, sum: Wire, cout: Wire): Unit = { + val s = new Wire(); + val c1 = new Wire(); + val c2 = new Wire(); + halfAdder(a, cin, s, c1); + halfAdder(b, s, sum, c2); + orGate(c1, c2, cout); + } + } + + class Test() extends CircuitSimulation() { + + val InverterDelay = 1; + val AndGateDelay = 3; + val OrGateDelay = 5; + + def invert = { + val ain = new Wire(); + val cout = new Wire(); + inverter(ain, cout); + + def result = if (cout.getSignal) 1 else 0; + + def test(a: Int) = { + ain setSignal (if (a == 0) false else true); + run; + Console.println("!" + a + " = " + result); + Console.println; + } + + probe("out ", cout); + + test(0); + test(1); + } + + def and = { + val ain = new Wire(); + val bin = new Wire(); + val cout = new Wire(); + andGate(ain, bin, cout); + + def result = if (cout.getSignal) 1 else 0; + + def test(a: Int, b: Int) = { + ain setSignal (if (a == 0) false else true); + bin setSignal (if (b == 0) false else true); + run; + Console.println(a + " & " + b + " = " + result); + Console.println; + } + + probe("out ", cout); + Console.println; + + test(0,0); + test(0,1); + test(1,0); + test(1,1); + } + + def or = { + val ain = new Wire(); + val bin = new Wire(); + val cout = new Wire(); + orGate(ain, bin, cout); + + def result = if (cout.getSignal) 1 else 0; + + def test(a: Int, b: Int) = { + ain setSignal (if (a == 0) false else true); + bin setSignal (if (b == 0) false else true); + run; + Console.println(a + " | " + b + " = " + result); + Console.println; + } + + probe("out ", cout); + Console.println; + + test(0,0); + test(0,1); + test(1,0); + test(1,1); + } + + def half = { + val ain = new Wire(); + val bin = new Wire(); + val sout = new Wire(); + val cout = new Wire(); + halfAdder(ain, bin, sout, cout); + + def result = + ((if (sout.getSignal) 1 else 0) + + (if (cout.getSignal) 2 else 0)); + + def test(a: Int, b: Int) = { + ain setSignal (if (a == 0) false else true); + bin setSignal (if (b == 0) false else true); + run; + Console.println(a + " + " + b + " = " + result); + Console.println; + } + + probe("sum ", sout); + probe("carry", cout); + Console.println; + + test(0,0); + test(0,1); + test(1,0); + test(1,1); + } + + def full = { + val ain = new Wire(); + val bin = new Wire(); + val cin = new Wire(); + val sout = new Wire(); + val cout = new Wire(); + fullAdder(ain, bin, cin, sout, cout); + + def result = + ((if (sout.getSignal) 1 else 0) + + (if (cout.getSignal) 2 else 0)); + + def test(a: Int, b: Int, c: Int) = { + ain setSignal (if (a == 0) false else true); + bin setSignal (if (b == 0) false else true); + cin setSignal (if (c == 0) false else true); + run; + Console.println(a + " + " + b + " + " + c + " = " + result); + Console.println; + } + + probe("sum ", sout); + probe("carry", cout); + Console.println; + + test(0,0,0); + test(0,0,1); + test(0,1,0); + test(0,1,1); + test(1,0,0); + test(1,0,1); + test(1,1,0); + test(1,1,1); + } + } + + def test = { + val sim = new Test(); + sim.invert; + sim.and; + sim.or; + sim.half; + sim.full; + } +} + +//############################################################################ + +class Simulator() { + + type Action = () => Unit; + type Agenda = List[Tuple2[Int, Action]]; + + private var agenda: Agenda = List(); + private var curtime = 0; + + def afterDelay(delay: Int)(action: Action) = { + def insert(ag: Agenda, time: Int): Agenda = ag match { + case List() => + List((time, action)) + case (t, act) :: ag1 => + if (time < t) (time, action) :: ag + else (t, act) :: insert(ag1, time) + } + agenda = insert(agenda, curtime + delay) + } + + def next: Unit = agenda match { + case List() => () + case (time, action) :: rest => { + agenda = rest; + curtime = time; + action(); + } + } + + protected def currentTime: Int = curtime; + + def run = { + afterDelay(0){() => Console.println("*** simulation started ***"); } + while (!agenda.isEmpty) { next } + } +} + +class Wire() { + private var sigVal = false; + private var actions: List[() => Unit] = List(); + def getSignal = sigVal; + def setSignal(s: Boolean) = + if (s != sigVal) { + sigVal = s; + actions.foreach(action => action()); + } + def addAction(a: () => Unit) = { + actions = a :: actions; + a() + } +} + +abstract class BasicCircuitSimulator() extends Simulator() { + + def probe(name: String, wire: Wire): Unit = { + wire addAction {() => + Console.println( + name + " " + currentTime + " new-value = " + wire.getSignal); + } + } + + val InverterDelay: Int; + val AndGateDelay: Int; + val OrGateDelay: Int; + + def inverter(input: Wire, output: Wire) = { + def invertAction() = { + val inputSig = input.getSignal; + afterDelay(InverterDelay) {() => output.setSignal(!inputSig) }; + } + input addAction invertAction + } + + def andGate(a1: Wire, a2: Wire, output: Wire) = { + def andAction() = { + val a1Sig = a1.getSignal; + val a2Sig = a2.getSignal; + afterDelay(AndGateDelay) {() => output.setSignal(a1Sig & a2Sig) }; + } + a1 addAction andAction; + a2 addAction andAction + } + + def orGate(a1: Wire, a2: Wire, output: Wire) = { + def orAction() = { + val a1Sig = a1.getSignal; + val a2Sig = a2.getSignal; + afterDelay(OrGateDelay) {() => output.setSignal(a1Sig | a2Sig) }; + } + a1 addAction orAction; + a2 addAction orAction + } + + def orGate2(a1: Wire, a2: Wire, output: Wire) = { + val w1 = new Wire(); + val w2 = new Wire(); + val w3 = new Wire(); + inverter(a1, w1); + inverter(a2, w2); + andGate(w1, w2, w3); + inverter(w3, output); + } +} + +abstract class CircuitSimulator() extends BasicCircuitSimulator() { + def demux2(in: Wire, ctrl: List[Wire], out: List[Wire]) : Unit = { + val ctrlN = ctrl.map(w => { val iw = new Wire(); inverter(w,iw); iw}); + val w0 = new Wire(); + val w1 = new Wire(); + val w2 = new Wire(); + val w3 = new Wire(); + + andGate(in, ctrl(1), w3); + andGate(in, ctrl(1), w2); + andGate(in, ctrlN(1), w1); + andGate(in, ctrlN(1), w0); + + andGate(w3, ctrl(0), out(3)); + andGate(w2, ctrlN(0), out(2)); + andGate(w1, ctrl(0), out(1)); + andGate(w0, ctrlN(0), out(0)); + } + + def connect(in: Wire, out: Wire) = { + in addAction {() => out.setSignal(in.getSignal); } + } + + def demux(in: Wire, ctrl: List[Wire], out: List[Wire]): Unit = ctrl match { + case List() => connect(in, out.head); + case c :: rest => + val c_ = new Wire(); + val w1 = new Wire(); + val w2 = new Wire(); + inverter(c, c_); + andGate(in, c_, w1); + andGate(in, c, w2); + demux(w1, rest, out.drop(out.length / 2)); + demux(w2, rest, out.take(out.length / 2)); + } +} + +class Main() extends CircuitSimulator() { + + val InverterDelay = 1; + val AndGateDelay = 3; + val OrGateDelay = 5; + + def main = { + val n = 3; + val outNum = 1 << n; + + val in = new Wire(); + val ctrl = for (x <- range(0,n)) yield { new Wire() }; + val out = for (x <- range(0,outNum)) yield { new Wire() }; + + demux(in, ctrl.reverse, out.reverse); + + probe("in", in); + for ((x,c) <- range(0,n) zip ctrl) { probe("ctrl" + x, c) } + for ((x,o) <- range(0,outNum) zip out) { probe("out" + x, o) } + + in.setSignal(true); + run; + ctrl(0).setSignal(true); + run; + ctrl(1).setSignal(true); + run; + ctrl(2).setSignal(true); + run; + ctrl(0).setSignal(false); + run; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + M3.test; + M4.test; + M5.test; + new Main().main; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-09.check b/tests/pending/run/Course-2002-09.check new file mode 100644 index 000000000000..765962aad8fc --- /dev/null +++ b/tests/pending/run/Course-2002-09.check @@ -0,0 +1,50 @@ +Probe: f = 32.0 +Probe: c = 0.0 +Probe: f = ? +Probe: c = ? + +Probe: f = 212.0 +Probe: c = 100.0 +Probe: f = ? +Probe: c = ? + +Probe: c = 0.0 +Probe: f = 32.0 +Probe: c = ? +Probe: f = ? + +Probe: c = 100.0 +Probe: f = 212.0 +Probe: c = ? +Probe: f = ? + +0.0 Celsius -> 32.0 Fahrenheits +100.0 Celsius -> 212.0 Fahrenheits +32.0 Fahrenheits -> 0.0 Celsius +212.0 Fahrenheits -> 100.0 Celsius + +a = ?, b = ?, c = ? => ? * ? = ? +a = 2, b = ?, c = ? => 2.0 * ? = ? +a = ?, b = 3, c = ? => ? * 3.0 = ? +a = ?, b = ?, c = 6 => ? * ? = 6.0 +a = 2, b = 3, c = ? => 2.0 * 3.0 = 6.0 +a = 2, b = ?, c = 6 => 2.0 * 3.0 = 6.0 +a = ?, b = 3, c = 6 => 2.0 * 3.0 = 6.0 +a = 2, b = 3, c = 6 => 2.0 * 3.0 = 6.0 + +a = 0, b = ?, c = ? => 0.0 * ? = 0.0 +a = ?, b = 0, c = ? => ? * 0.0 = 0.0 +a = ?, b = ?, c = 0 => ? * ? = 0.0 +a = 0, b = 7, c = ? => 0.0 * 7.0 = 0.0 +a = 7, b = 0, c = ? => 7.0 * 0.0 = 0.0 +a = 0, b = 0, c = ? => 0.0 * 0.0 = 0.0 +a = 0, b = ?, c = 0 => 0.0 * ? = 0.0 +a = ?, b = 0, c = 0 => ? * 0.0 = 0.0 +a = 0, b = 7, c = 0 => 0.0 * 7.0 = 0.0 +a = 7, b = 0, c = 0 => 7.0 * 0.0 = 0.0 +a = 0, b = 0, c = 0 => 0.0 * 0.0 = 0.0 + +a = 3, b = 4 => c = 5.0 +a = 3, c = 5 => b = 4.0 +b = 4, c = 5 => a = 3.0 + diff --git a/tests/pending/run/Course-2002-09.scala b/tests/pending/run/Course-2002-09.scala new file mode 100644 index 000000000000..588703ddcf68 --- /dev/null +++ b/tests/pending/run/Course-2002-09.scala @@ -0,0 +1,332 @@ +//############################################################################ +// Programmation IV - 2002 - Week 09 +//############################################################################ + +trait Constraint { + def newValue: Unit; + def dropValue: Unit +} + +object NoConstraint extends Constraint { + def newValue: Unit = sys.error("NoConstraint.newValue"); + def dropValue: Unit = sys.error("NoConstraint.dropValue"); +} + +class Adder(a1: Quantity,a2: Quantity,sum: Quantity) extends Constraint { + def newValue = (a1.getValue, a2.getValue, sum.getValue) match { + case (Some(x1), Some(x2), _ ) => sum.setValue(x1 + x2, this) + case (Some(x1), _ , Some(r)) => a2.setValue(r - x1, this) + case (_ , Some(x2), Some(r)) => a1.setValue(r - x2, this) + case _ => + } + def dropValue: Unit = { + a1.forgetValue(this); a2.forgetValue(this); sum.forgetValue(this); + } + a1 connect this; + a2 connect this; + sum connect this; +} + +class Multiplier(m1: Quantity, m2: Quantity, prod: Quantity) + extends Constraint { + def newValue = (m1.getValue, m2.getValue, prod.getValue) match { + case (Some(0d), _ , _ ) => prod.setValue(0, this); + case (_ , Some(0d), _ ) => prod.setValue(0, this); + case (Some(x1), Some(x2), _ ) => prod.setValue(x1 * x2, this) + case (Some(x1), _ , Some(r)) => m2.setValue(r / x1, this) + case (_, Some(x2), Some(r)) => m1.setValue(r / x2, this) + case _ => + } + def dropValue: Unit = { + m1.forgetValue(this); m2.forgetValue(this); prod.forgetValue(this); + } + m1 connect this; + m2 connect this; + prod connect this; +} + +class Squarer(square: Quantity, root: Quantity) extends Constraint { + def newValue: Unit = (square.getValue, root.getValue) match { + case (Some(x), _ )if (x < 0) => sys.error("Square of negative number") + case (Some(x), _ ) => root.setValue(Math.sqrt(x), this) + case (_ , Some(x)) => square.setValue(x*x, this) + case _ => + } + def dropValue: Unit = { + square.forgetValue(this); root.forgetValue(this); + } + square connect this; + root connect this; +} + +class Eq(a: Quantity, b: Quantity) extends Constraint { + def newValue = ((a.getValue, b.getValue): @unchecked) match { + case (Some(x), _ ) => b.setValue(x, this); + case (_ , Some(y)) => a.setValue(y, this); + } + def dropValue: Unit = { + a.forgetValue(this); b.forgetValue(this); + } + a connect this; + b connect this; +} + +class Constant(q: Quantity, v: Double) extends Constraint { + def newValue: Unit = sys.error("Constant.newValue"); + def dropValue: Unit = sys.error("Constant.dropValue"); + q connect this; + q.setValue(v, this); +} + +class Probe(name: String, q: Quantity) extends Constraint { + def newValue: Unit = printProbe(q.getValue); + def dropValue: Unit = printProbe(None); + private def printProbe(v: Option[Double]): Unit = { + val vstr = v match { + case Some(x) => x.toString() + case None => "?" + } + Console.println("Probe: " + name + " = " + vstr); + } + q connect this +} + +class Quantity() { + private var value: Option[Double] = None; + private var constraints: List[Constraint] = List(); + private var informant: Constraint = null; + + def getValue: Option[Double] = value; + + def setValue(v: Double, setter: Constraint) = value match { + case Some(v1) => + if (v != v1) sys.error("Error! contradiction: " + v + " and " + v1); + case None => + informant = setter; value = Some(v); + for (c <- constraints; if !(c == informant)) { + c.newValue; + } + } + def setValue(v: Double): Unit = setValue(v, NoConstraint); + + def forgetValue(retractor: Constraint): Unit = { + if (retractor == informant) { + value = None; + for (c <- constraints; if !(c == informant)) c.dropValue; + } + } + def forgetValue: Unit = forgetValue(NoConstraint); + + def connect(c: Constraint) = { + constraints = c :: constraints; + value match { + case Some(_) => c.newValue + case None => + } + } + + def +(that: Quantity): Quantity = { + val sum = new Quantity(); + new Adder(this, that, sum); + sum; + } + + def *(that: Quantity): Quantity = { + val prod = new Quantity(); + new Multiplier(this, that, prod); + prod; + } + + def square: Quantity = { + val square = new Quantity(); + new Squarer(square, this); + square; + } + + def sqrt: Quantity = { + val root = new Quantity(); + new Squarer(this, root); + root; + } + + def ===(that: Quantity): Constraint = { + new Eq(this, that); + } + + override def toString(): String = value match { + case None => " ?" + case Some(v) => v.toString() + } + + def str: String = toString(); +} + +//############################################################################ + +object M0 { + + def CFconverter(c: Quantity, f: Quantity) = { + val u = new Quantity(); + val v = new Quantity(); + val w = new Quantity(); + val x = new Quantity(); + val y = new Quantity(); + new Multiplier(c, w, u); + new Multiplier(v, x, u); + new Adder(v, y, f); + new Constant(w, 9); + new Constant(x, 5); + new Constant(y, 32); + } + + def test = { + val c = new Quantity(); new Probe("c", c); + val f = new Quantity(); new Probe("f", f); + CFconverter(c, f); + + c.setValue(0); + c.forgetValue; + Console.println; + + c.setValue(100); + c.forgetValue; + Console.println; + + f.setValue(32); + f.forgetValue; + Console.println; + + f.setValue(212); + f.forgetValue; + Console.println; + } +} + +//############################################################################ + +object M1 { + + def constant(x: Double): Quantity = { + val q = new Quantity(); + new Constant(q, x); + q + } + + def CFconverter(c: Quantity, f: Quantity) = { + val v = new Quantity(); + constant(9) * c === constant(5) * v; + v + constant(32) === f; + } + + def show_c2f(c: Quantity, f: Quantity, v: Int) = { + c.setValue(v); + Console.println(c.str + " Celsius -> " + f.str + " Fahrenheits"); + c.forgetValue; + } + + def show_f2c(c: Quantity, f: Quantity, v: Int) = { + f.setValue(v); + Console.println(f.str + " Fahrenheits -> " + c.str + " Celsius"); + f.forgetValue; + } + + def test = { + val c = new Quantity(); + val f = new Quantity(); + CFconverter(c, f); + + show_c2f(c, f, 0); + show_c2f(c, f, 100); + show_f2c(c, f, 32); + show_f2c(c, f, 212); + Console.println; + } +} + +//############################################################################ + +object M2 { + + val a = new Quantity(); + val b = new Quantity(); + val c = a * b; + + def set(q: Quantity, o: Option[Int]): String = { + o match { + case None => "?" + case Some(v) => q.setValue(v); v.toString() + }; + } + + def show(x: Option[Int], y: Option[Int], z: Option[Int]) = { + Console.print("a = " +set(a,x)+ ", b = " +set(b,y)+ ", c = " +set(c,z)); + Console.println(" => " + a.str + " * " + b.str + " = " + c.str); + a.forgetValue; b.forgetValue; c.forgetValue; + } + + def test = { + show(None , None , None ); + show(Some(2), None , None ); + show(None , Some(3), None ); + show(None , None , Some(6)); + show(Some(2), Some(3), None ); + show(Some(2), None , Some(6)); + show(None , Some(3), Some(6)); + show(Some(2), Some(3), Some(6)); + Console.println; + + show(Some(0), None , None ); + show(None , Some(0), None ); + show(None , None , Some(0)); + show(Some(0), Some(7), None ); + show(Some(7), Some(0), None ); + show(Some(0), Some(0), None ); + show(Some(0), None , Some(0)); + show(None , Some(0), Some(0)); + show(Some(0), Some(7), Some(0)); + show(Some(7), Some(0), Some(0)); + show(Some(0), Some(0), Some(0)); + Console.println; + } +} + + +//############################################################################ + +object M3 { + + def test = { + val a = new Quantity(); + val b = new Quantity(); + val c = new Quantity(); + c === (a.square + b.square).sqrt; + + a.setValue(3); b.setValue(4); + Console.println("a = 3, b = 4 => c = " + c.str); + a.forgetValue; b.forgetValue; + + a.setValue(3); c.setValue(5); + Console.println("a = 3, c = 5 => b = " + b.str); + a.forgetValue; c.forgetValue; + + b.setValue(4); c.setValue(5); + Console.println("b = 4, c = 5 => a = " + a.str); + b.forgetValue; c.forgetValue; + + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + M3.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-10.check b/tests/pending/run/Course-2002-10.check new file mode 100644 index 000000000000..207b671f05ab --- /dev/null +++ b/tests/pending/run/Course-2002-10.check @@ -0,0 +1,46 @@ +fib(0) = 0 +fib(1) = 1 +fib(2) = 1 +fib(3) = 2 +fib(4) = 3 +fib(5) = 5 +fib(6) = 8 +fib(7) = 13 +fib(8) = 21 +fib(9) = 34 +fib(10) = 55 +fib(11) = 89 +fib(12) = 144 +fib(13) = 233 +fib(14) = 377 +fib(15) = 610 +fib(16) = 987 +fib(17) = 1597 +fib(18) = 2584 +fib(19) = 4181 + +pi(0) = 4.0 , 3.166666666666667 , 4.0 +pi(1) = 2.666666666666667 , 3.1333333333333337, 3.166666666666667 +pi(2) = 3.466666666666667 , 3.1452380952380956, 3.142105263157895 +pi(3) = 2.8952380952380956, 3.1396825396825396, 3.1415993573190044 +pi(4) = 3.33968253968254 , 3.142712842712843 , 3.141592714033778 +pi(5) = 2.976046176046176 , 3.140881340881341 , 3.1415926539752923 +pi(6) = 3.283738483738484 , 3.142071817071817 , 3.141592653591176 +pi(7) = 3.017071817071817 , 3.1412548236077646, 3.141592653589777 +pi(8) = 3.252365934718876 , 3.1418396189294024, 3.141592653589794 +pi(9) = 3.0418396189294024, 3.141406718496502 , 3.1415926535897936 +pi = 3.141592653589793 , 3.141592653589793 , 3.141592653589793 + +ln(0) = 1.0 , 0.7 , 1.0 +ln(1) = 0.5 , 0.6904761904761905, 0.7 +ln(2) = 0.8333333333333333, 0.6944444444444444, 0.6932773109243697 +ln(3) = 0.5833333333333333, 0.6924242424242424, 0.6931488693329254 +ln(4) = 0.7833333333333333, 0.6935897435897436, 0.6931471960735491 +ln(5) = 0.6166666666666667, 0.6928571428571428, 0.6931471806635636 +ln(6) = 0.7595238095238095, 0.6933473389355742, 0.6931471805604038 +ln(7) = 0.6345238095238095, 0.6930033416875522, 0.6931471805599444 +ln(8) = 0.7456349206349207, 0.6932539682539682, 0.6931471805599426 +ln(9) = 0.6456349206349206, 0.6930657506744463, 0.6931471805599453 +ln = 0.6931471805599453, 0.6931471805599453, 0.6931471805599453 + +prime numbers: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 diff --git a/tests/pending/run/Course-2002-10.scala b/tests/pending/run/Course-2002-10.scala new file mode 100644 index 000000000000..4cfa1deb0462 --- /dev/null +++ b/tests/pending/run/Course-2002-10.scala @@ -0,0 +1,135 @@ +//############################################################################ +// Programmation IV - 2002 - Week 10 +//############################################################################ + +import math.{Pi, log} + +object M0 { + + def addStream (s1: Stream[Int], s2: Stream[Int]): Stream[Int] = + Stream.cons(s1.head + s2.head, addStream(s1.tail, s2.tail)); + + val fib: Stream[Int] = + Stream.cons(0, Stream.cons(1, addStream(this.fib, this.fib.tail))); + + def test = { + var i = 0; + fib.take(20).foreach(n => {Console.println("fib("+i+") = "+n); i=i+1}); + Console.println; + } +} + +//############################################################################ + +object M1 { + + def scale(x: Double, s: Stream[Double]): Stream[Double] = + s map { e: Double => e*x } + + def partialSums(s: Stream[Double]): Stream[Double] = + Stream.cons(s.head, partialSums(s.tail) map (x => x + s.head)); + + def euler(s: Stream[Double]): Stream[Double] = { + val nm1 = s apply 0; + val n = s apply 1; + val np1 = s apply 2; + Stream.cons(np1 - ((np1 - n)*(np1 - n) / (nm1 - 2*n + np1)),euler(s.tail)) + }; + + def better(s: Stream[Double], transform: Stream[Double] => Stream[Double]) + : Stream[Stream[Double]] = + Stream.cons(s, better(transform(s), transform)); + + def veryGood(s: Stream[Double], transform: Stream[Double] => Stream[Double]) + : Stream[Double] = + better(s, transform) map (x => x.head); + + def lnSummands(n: Double): Stream[Double] = + Stream.cons(1.0 / n, lnSummands(n + 1.0) map { x: Double => -x }) + + var ln0 = partialSums(lnSummands(1.0)); + var ln1 = euler(ln0); + var ln2 = veryGood(ln0, euler); + + def piSummands(n: Double): Stream[Double] = + Stream.cons(1.0 / n, piSummands(n + 2.0) map { x: Double => -x }) + + var pi0 = scale(4.0, partialSums(piSummands(1.0))); + var pi1 = euler(pi0); + var pi2 = veryGood(pi0, euler); + + def pad(s: String, n: Int): String = + if (n <= 0) s.substring(0, s.length() + n) + else pad(s + " ", n - 1); + def str(d: Double) = { val s = d.toString(); pad(s, 18 - s.length()) }; + + def test = { + var i = 0; + while (i < 10) { + Console.print("pi("+i+") = "); + Console.print(str(pi0.apply(i)) + ", "); + Console.print(str(pi1.apply(i)) + ", "); + Console.print(str(pi2.apply(i)) + "\n"); + i = i + 1; + } + Console.print("pi = "); + Console.print(str(Pi) + ", "); + Console.print(str(Pi) + ", "); + Console.print(str(Pi) + "\n"); + Console.println; + i = 0; + while (i < 10) { + Console.print("ln("+i+") = "); + Console.print(str(ln0.apply(i)) + ", "); + Console.print(str(ln1.apply(i)) + ", "); + Console.print(str(ln2.apply(i)) + "\n"); + i = i + 1; + } + Console.print("ln = "); + Console.print(str(log(2)) + ", "); + Console.print(str(log(2)) + ", "); + Console.print(str(log(2)) + "\n"); + Console.println; + } +} + +//############################################################################ + +object M2 { + + class IntIterator(start: Int) extends Iterator[Int] { + var current: Int = start; + def hasNext = true; + def next = { current = current + 1; current - 1 }; + } + + class PrimeIterator() extends Iterator[Int] { + var current: Iterator[Int] = new IntIterator(2); + def hasNext = true; + def next = { + val p = current.next; + current = current filter { x => !((x % p) == 0) }; + p + } + } + + def test = { + val i = (new PrimeIterator()).take(30); + Console.print("prime numbers:"); + while (i.hasNext) { Console.print(" " + i.next); } + Console.println; + } +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + M0.test; + M1.test; + M2.test; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Course-2002-13.check b/tests/pending/run/Course-2002-13.check new file mode 100644 index 000000000000..7664f705767a --- /dev/null +++ b/tests/pending/run/Course-2002-13.check @@ -0,0 +1,14 @@ +List(S = jean, V = mange, A = le, D = grand, N = table) +List(S = jean, V = mange, A = le, D = grand, N = cheval) + +List(S = jean, V = mange, A = le, D = grand, N = cheval) +List(S = jean, V = mange, A = la, D = belle, N = table) + +List(S = jean, V = mange, A = le, D = nil, N = cheval) +List(S = jean, V = mange, A = le, D = cons(grand,nil), N = cheval) +List(S = jean, V = mange, A = le, D = cons(grand,cons(grand,nil)), N = cheval) +List(S = jean, V = mange, A = la, D = nil, N = table) +yes +yes +no + diff --git a/tests/pending/run/Course-2002-13.scala b/tests/pending/run/Course-2002-13.scala new file mode 100644 index 000000000000..a596a33873d3 --- /dev/null +++ b/tests/pending/run/Course-2002-13.scala @@ -0,0 +1,322 @@ +//############################################################################ +// Programmation IV - 2002 - Week 13 +//############################################################################ + +class Tokenizer(s: String, delimiters: String) extends Iterator[String] { + + private var i = 0; + + def isDelimiter(ch: Char) = { + var i = 0; + while (i < delimiters.length() && delimiters.charAt(i) != ch) { i = i + 1 } + i < delimiters.length() + } + + def hasNext: Boolean = { + while (i < s.length() && s.charAt(i) <= ' ') { i = i + 1 } + i < s.length() + } + + def next: String = + if (hasNext) { + val start = i; + var ch = s.charAt(i); i = i + 1; + if (isDelimiter(ch)) ch.toString() + else { + while (i < s.length() && + s.charAt(i) > ' ' && + !isDelimiter(s.charAt(i))){ i = i + 1 } + s.substring(start, i) + } + } else ""; + +} + +object Terms { + + val debug = false; + + trait Term { + def map(s: Subst): Term; + def tyvars: List[String]; + } + + case class Binding(name: String, term: Term) { + term match { case Var(n) if (name == n) => sys.error("bad binding") case _ => () } + override def toString() = name + " = " + term; + } + + type Subst = List[Binding]; + + def lookup(s: Subst, name: String): Option[Term] = s match { + case List() => None + case b :: s1 => if (name == b.name) Some(b.term) else lookup(s1, name) + } + + case class Var(a: String) extends Term { + override def toString() = a; + def map(s: Subst): Term = lookup(s, a) match { + case Some(b) => b map s + case None => this; + } + def tyvars = List(a); + } + + case class Con(a: String, ts: List[Term]) extends Term { + override def toString() = + a + (if (ts.isEmpty) "" else ts.mkString("(", ",", ")")); + def map(s: Subst): Term = Con(a, ts map (t => t map s)); + def tyvars = (ts flatMap (t => t.tyvars)).distinct; + } + + private var count = 0; + def newVar(prefix: String) = { count = count + 1; Var(prefix + count) } + + val NoTerm = Con("", List()); + + def unify1(x: Term, y: Term, s: Subst): Option[Subst] = (x, y) match { + case (Var(a), Var(b)) if (a == b) => + Some(s) + case (Var(a), _) => lookup(s, a) match { + case Some(x1) => unify(x1, y, s) + case None => if (y.tyvars contains a) None else Some(Binding(a, y) :: s) + } + case (_, Var(b)) => lookup(s, b) match { + case Some(y1) => unify(x, y1, s) + case None => if (x.tyvars contains b) None else Some(Binding(b, x) :: s) + } + case (Con(a, xs), Con(b, ys)) if (a == b) => + unify(xs, ys, s) + case _ => None + } + + def unify(x: Term, y: Term, s: Subst): Option[Subst] = { + val ss = unify1(x, y, s); + if (debug) Console.println("unify " + x + " with " + y + " = " + ss); + ss + } + + def unify(xs: List[Term], ys: List[Term], s: Subst): Option[Subst] = (xs, ys) match { + case (List(), List()) => Some(s) + case (x :: xs1, y :: ys1) => + unify(x, y, s) match { + case Some(s1) => unify(xs1, ys1, s1) + case None => None + } + case _ => None + } +} + +import Terms._; + +object Programs { + + case class Clause(lhs: Term, rhs: List[Term]) { + def tyvars = + (lhs.tyvars ::: (rhs flatMap (t => t.tyvars))).distinct; + def newInstance = { + var s: Subst = List(); + for (a <- tyvars) { s = Binding(a, newVar(a)) :: s } + Clause(lhs map s, rhs map (t => t map s)) + } + override def toString() = + lhs.toString() + " :- " + rhs.mkString("", ",", "") + "."; + } + + def list2stream[a](xs: List[a]): Stream[a] = xs match { + case List() => Stream.empty + case x :: xs1 => Stream.cons(x, list2stream(xs1)) + } + def option2stream[a](xo: Option[a]): Stream[a] = xo match { + case None => Stream.empty + case Some(x) => Stream.cons(x, Stream.empty) + } + + def solve(query: List[Term], clauses: List[Clause]): Stream[Subst] = { + + def solve2(query: List[Term], s: Subst): Stream[Subst] = query match { + case List() => + Stream.cons(s, Stream.empty) + case Con("not", qs) :: query1 => + if (solve1(qs, s).isEmpty) Stream.cons(s, Stream.empty) + else Stream.empty + case q :: query1 => + for (clause <- list2stream(clauses); + s1 <- tryClause(clause.newInstance, q, s); + s2 <- solve1(query1, s1)) yield s2 + } + + def solve1(query: List[Term], s: Subst): Stream[Subst] = { + val ss = solve2(query, s); + if (debug) Console.println("solved " + query + " = " + ss); + ss + } + + def tryClause(c: Clause, q: Term, s: Subst): Stream[Subst] = { + if (debug) Console.println("trying " + c); + for (s1 <- option2stream(unify(q, c.lhs, s)); s2 <- solve1(c.rhs, s1)) yield s2; + } + + solve1(query, List()) + } +} + +import Programs._; + +class Parser(s: String) { + val it = new Tokenizer(s, "(),.?"); + + var token: String = it.next; + + def syntaxError(msg: String): Unit = sys.error(msg + ", but " + token + " found"); + + def rep[a](p: => a): List[a] = { + val t = p; + if (token == ",") { token = it.next; t :: rep(p) } else List(t) + } + + def constructor: Term = { + val a = token; + token = it.next; + Con(a, + if (token equals "(") { + token = it.next; + val ts: List[Term] = if (token equals ")") List() else rep(term); + if (token equals ")") token = it.next else syntaxError("`)' expected"); + ts + } else List()) + } + + def term: Term = { + val ch = token.charAt(0); + if ('A' <= ch && ch <= 'Z') { val a = token; token = it.next; Var(a) } + else if (it.isDelimiter(ch)) { syntaxError("term expected"); null } + else constructor + } + + def line: Clause = { + val result = + if (token equals "?") { + token = it.next; + Clause(NoTerm, rep(constructor)); + } else { + Clause( + constructor, + if (token equals ":-") { token = it.next; rep(constructor) } else List()) + } + if (token equals ".") token = it.next else syntaxError("`.' expected"); + result + } + + def all: List[Clause] = if (token equals "") List() else line :: all; +} + +object Prolog { + + def processor: String => Unit = { + var program: List[Clause] = List(); + var solutions: Stream[Subst] = Stream.empty; + var tvs: List[String] = List(); + { input => + new Parser(input).all foreach { c => + if (c.lhs == NoTerm) { + c.rhs match { + case List(Con("more", List())) => + solutions = solutions.tail; + case _ => + solutions = solve(c.rhs, program); + tvs = c.tyvars; + } + if (solutions.isEmpty) { + Console.println("no") + } else { + val s: Subst = solutions.head + .filter(b => tvs contains b.name) + .map(b => Binding(b.name, b.term map solutions.head)) + .reverse; + if (s.isEmpty) Console.println("yes") + else Console.println(s); + } + } else { + program = program ::: List(c); + } + } + } + } + + def process(code: String) = processor(code); +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + Prolog.process( + "sujet(jean).\n" + + "sujet(marie).\n" + + "verbe(mange).\n" + + "verbe(dort).\n" + + "article(le).\n" + + "article(la).\n" + + "adjectif(grand).\n" + + "adjectif(belle).\n" + + "nom(table).\n" + + "nom(cheval).\n" + + + "complement(A,D,N) :- article(A), adjectif(D), nom(N).\n" + + "phrase(S,V,A,D,N) :- sujet(S), verbe(V), complement(A,D,N).\n" + + + "?phrase(S,V,A,D,N).\n" + "?more.\n" + ); + Console.println; + + Prolog.process( + "sujet(jean).\n" + + "sujet(marie).\n" + + "verbe(mange).\n" + + "verbe(dort).\n" + + "article(le,m).\n" + + "article(la,f).\n" + + "adjectif(grand,m).\n" + + "adjectif(belle,f).\n" + + "nom(table,f).\n" + + "nom(cheval,m).\n" + + + "complement(A,D,N) :- article(A,G), adjectif(D,G), nom(N,G).\n" + + "phrase(S,V,A,D,N) :- sujet(S), verbe(V), complement(A,D,N).\n" + + + "?phrase(S,V,A,D,N).\n" + "?more.\n" + ); + Console.println; + + Prolog.process( + "sujet(jean).\n" + + "sujet(marie).\n" + + "verbe(mange).\n" + + "verbe(dort).\n" + + "article(le,m).\n" + + "article(la,f).\n" + + "adjectif(grand,m).\n" + + "adjectif(belle,f).\n" + + "nom(table,f).\n" + + "nom(cheval,m).\n" + + + "adjectifs(nil,G).\n" + + "adjectifs(cons(A1,nil),G) :- adjectif(A1,G).\n" + + "adjectifs(cons(A1,cons(A2,nil)),G) :- adjectif(A1,G),adjectif(A2,G).\n"+ + "complement(A,D,N) :- article(A,G), adjectifs(D,G), nom(N,G).\n" + + "phrase(S,V,A,D,N) :- sujet(S), verbe(V), complement(A,D,N).\n" + + + "?phrase(S,V,A,D,N).\n" + "?more.\n" + "?more.\n" + "?more.\n" + + + "?phrase(jean,mange,le,nil,cheval).\n" + + "?phrase(jean,mange,le,cons(grand,nil),cheval).\n" + + "?phrase(jean,mange,le,cons(grand,nil),table).\n" + ); + Console.println; + + () + } +} + +//############################################################################ diff --git a/tests/pending/run/Meter.check b/tests/pending/run/Meter.check new file mode 100644 index 000000000000..c79c51a2947e --- /dev/null +++ b/tests/pending/run/Meter.check @@ -0,0 +1,16 @@ +Meter.scala:72: warning: a.Meter and Int are unrelated: they will never compare equal + println("x == 1: "+(x == 1)) + ^ +2.0 +4.0m +false +x.isInstanceOf[Meter]: true +x.hashCode: 1072693248 +x == 1: false +x == y: true +a == b: true +testing native arrays +Array(1.0m, 2.0m) +1.0m +>>>1.0m<<< 1.0m +>>>2.0m<<< 2.0m diff --git a/tests/pending/run/Meter.scala b/tests/pending/run/Meter.scala new file mode 100644 index 000000000000..79d189f9342b --- /dev/null +++ b/tests/pending/run/Meter.scala @@ -0,0 +1,109 @@ +package a { + abstract class BoxingConversions[Boxed, Unboxed] { + def box(x: Unboxed): Boxed + def unbox(x: Boxed): Unboxed + } + + class Meter(val underlying: Double) extends AnyVal with _root_.b.Printable { + def + (other: Meter): Meter = + new Meter(this.underlying + other.underlying) + def / (other: Meter)(implicit dummy: Meter.MeterArg = null): Double = this.underlying / other.underlying + def / (factor: Double): Meter = new Meter(this.underlying / factor) + def < (other: Meter): Boolean = this.underlying < other.underlying + def toFoot: Foot = new Foot(this.underlying * 0.3048) + override def print = { Console.print(">>>"); super.print; proprint } + override def toString: String = underlying.toString+"m" + } + + object Meter extends (Double => Meter) { + + private[a] trait MeterArg + + def apply(x: Double): Meter = new Meter(x) + + implicit val boxings: a.BoxingConversions[a.Meter,Double] = new BoxingConversions[Meter, Double] { + def box(x: Double) = new Meter(x) + def unbox(m: Meter) = m.underlying + } + } + + class Foot(val unbox: Double) extends AnyVal { + def + (other: Foot): Foot = + new Foot(this.unbox + other.unbox) + override def toString = unbox.toString+"ft" + } + object Foot { + implicit val boxings: a.BoxingConversions[a.Foot,Double] = new BoxingConversions[Foot, Double] { + def box(x: Double) = new Foot(x) + def unbox(m: Foot) = m.unbox + } + } + +} +package b { + trait Printable extends Any { + def print: Unit = Console.print(this) + protected def proprint = Console.print("<<<") + } +} +import a._ +import _root_.b._ +object Test extends dotty.runtime.LegacyApp { + + { + val x: Meter = new Meter(1) + val a: Object = x.asInstanceOf[Object] + val y: Meter = a.asInstanceOf[Meter] + + val u: Double = 1 + val b: Object = u.asInstanceOf[Object] + val v: Double = b.asInstanceOf[Double] + } + + val x = new Meter(1) + val y = x + println((x + x) / x) + println((x + x) / 0.5) + println((x < x).toString) + println("x.isInstanceOf[Meter]: "+x.isInstanceOf[Meter]) + + + println("x.hashCode: "+x.hashCode) + println("x == 1: "+(x == 1)) + println("x == y: "+(x == y)) + assert(x.hashCode == (1.0).hashCode) + + val a: Any = x + val b: Any = y + println("a == b: "+(a == b)) + + { println("testing native arrays") + val arr = Array(x, y + x) + println(arr.deep) + def foo[T <: Printable](x: Array[T]): Unit = { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + } + // + // { println("testing wrapped arrays") + // import collection.mutable.FlatArray + // val arr = FlatArray(x, y + x) + // println(arr) + // def foo(x: FlatArray[Meter]) { + // for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + // } + // val m = arr(0) + // println(m) + // foo(arr) + // val ys: Seq[Meter] = arr map (_ + new Meter(1)) + // println(ys) + // val zs = arr map (_ / Meter(1)) + // println(zs) + // val fs = arr map (_.toFoot) + // println(fs) + // } + +} diff --git a/tests/pending/run/MeterCaseClass.check b/tests/pending/run/MeterCaseClass.check new file mode 100644 index 000000000000..2782704f9f70 --- /dev/null +++ b/tests/pending/run/MeterCaseClass.check @@ -0,0 +1,16 @@ +MeterCaseClass.scala:69: warning: comparing values of types a.Meter and Int using `==' will always yield false + println("x == 1: "+(x == 1)) + ^ +2.0 +Meter(4.0) +false +x.isInstanceOf[Meter]: true +x.hashCode: 1072693248 +x == 1: false +x == y: true +a == b: true +testing native arrays +Array(Meter(1.0), Meter(2.0)) +Meter(1.0) +>>>Meter(1.0)<<< Meter(1.0) +>>>Meter(2.0)<<< Meter(2.0) diff --git a/tests/pending/run/MeterCaseClass.scala b/tests/pending/run/MeterCaseClass.scala new file mode 100644 index 000000000000..1215afd4af09 --- /dev/null +++ b/tests/pending/run/MeterCaseClass.scala @@ -0,0 +1,106 @@ +package a { + abstract class BoxingConversions[Boxed, Unboxed] { + def box(x: Unboxed): Boxed + def unbox(x: Boxed): Unboxed + } + + case class Meter(underlying: Double) extends AnyVal with _root_.b.Printable { + def + (other: Meter): Meter = + new Meter(this.underlying + other.underlying) + def / (other: Meter)(implicit dummy: Meter.MeterArg = null): Double = this.underlying / other.underlying + def / (factor: Double): Meter = new Meter(this.underlying / factor) + def < (other: Meter): Boolean = this.underlying < other.underlying + def toFoot: Foot = new Foot(this.underlying * 0.3048) + override def print = { Console.print(">>>"); super.print; proprint } + } + + object Meter extends (Double => Meter) { + + private[a] trait MeterArg + + implicit val boxings: a.BoxingConversions[a.Meter,Double] = new BoxingConversions[Meter, Double] { + def box(x: Double) = new Meter(x) + def unbox(m: Meter) = m.underlying + } + } + + class Foot(val unbox: Double) extends AnyVal { + def + (other: Foot): Foot = + new Foot(this.unbox + other.unbox) + override def toString = unbox.toString+"ft" + } + object Foot { + implicit val boxings: a.BoxingConversions[a.Foot,Double] = new BoxingConversions[Foot, Double] { + def box(x: Double) = new Foot(x) + def unbox(m: Foot) = m.unbox + } + } + +} +package b { + trait Printable extends Any { + def print: Unit = Console.print(this) + protected def proprint = Console.print("<<<") + } +} +import a._ +import _root_.b._ +object Test extends dotty.runtime.LegacyApp { + + { + val x: Meter = new Meter(1) + val a: Object = x.asInstanceOf[Object] + val y: Meter = a.asInstanceOf[Meter] + + val u: Double = 1 + val b: Object = u.asInstanceOf[Object] + val v: Double = b.asInstanceOf[Double] + } + + val x = new Meter(1) + val y = x + println((x + x) / x) + println((x + x) / 0.5) + println((x < x).toString) + println("x.isInstanceOf[Meter]: "+x.isInstanceOf[Meter]) + + + println("x.hashCode: "+x.hashCode) + println("x == 1: "+(x == 1)) + println("x == y: "+(x == y)) + assert(x.hashCode == (1.0).hashCode) + + val a: Any = x + val b: Any = y + println("a == b: "+(a == b)) + + { println("testing native arrays") + val arr = Array(x, y + x) + println(arr.deep) + def foo[T <: Printable](x: Array[T]): Unit = { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + } + // + // { println("testing wrapped arrays") + // import collection.mutable.FlatArray + // val arr = FlatArray(x, y + x) + // println(arr) + // def foo(x: FlatArray[Meter]) { + // for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + // } + // val m = arr(0) + // println(m) + // foo(arr) + // val ys: Seq[Meter] = arr map (_ + new Meter(1)) + // println(ys) + // val zs = arr map (_ / Meter(1)) + // println(zs) + // val fs = arr map (_.toFoot) + // println(fs) + // } + +} diff --git a/tests/pending/run/MutableListTest.scala b/tests/pending/run/MutableListTest.scala new file mode 100644 index 000000000000..8efb8281db74 --- /dev/null +++ b/tests/pending/run/MutableListTest.scala @@ -0,0 +1,126 @@ + + + +import scala.collection.mutable.MutableList + + + +class ExtList[T] extends MutableList[T] { + def printState: Unit = { + println("Length: " + len) + println("Last elem: " + last0.elem) + println("First elem: " + first0.elem) + println("After first elem: " + first0.next.elem) + println("After first: " + first0.next) + println("Last: " + last0) + } +} + +object Test { + + def main(args: Array[String]): Unit = { + testEmpty + testAddElement + testAddFewElements + testAddMoreElements + testTraversables + } + + def testEmpty: Unit = { + val mlist = new MutableList[Int] + assert(mlist.isEmpty) + assert(mlist.get(0) == None) + } + + def testAddElement: Unit = { + val mlist = new MutableList[Int] + mlist += 17 + assert(mlist.nonEmpty) + assert(mlist.length == 1) + assert(mlist.head == 17) + assert(mlist.last == 17) + assert(mlist(0) == 17) + assert(mlist.tail.isEmpty) + assert(mlist.tail.length == 0) + mlist(0) = 101 + assert(mlist(0) == 101) + assert(mlist.toList == List(101)) + assert(mlist.tail.get(0) == None) + assert((mlist.tail += 19).head == 19) + assert(mlist.tail.length == 0) + } + + def testAddFewElements: Unit = { + val mlist = new MutableList[Int] + for (i <- 0 until 2) mlist += i +// mlist.printState + for (i <- 0 until 2) assert(mlist(i) == i) + assert(mlist.length == 2) + assert(mlist.nonEmpty) + assert(mlist.tail.length == 1) + assert(mlist.tail.tail.length == 0) + assert(mlist.tail.tail.isEmpty) + } + + def testAddMoreElements: Unit = { + val mlist = new MutableList[Int] + for (i <- 0 until 10) mlist += i * i + assert(mlist.nonEmpty) + assert(mlist.length == 10) + for (i <- 0 until 10) assert(mlist(i) == i * i) + assert(mlist(5) == 5 * 5) + assert(mlist(9) == 9 * 9) + var sometail = mlist + for (i <- 0 until 10) { + assert(sometail.head == i * i) + sometail = sometail.tail + } + mlist(5) = -25 + assert(mlist(5) == -25) + mlist(0) = -1 + assert(mlist(0) == -1) + mlist(9) = -81 + assert(mlist(9) == -81) + assert(mlist(5) == -25) + assert(mlist(0) == -1) + assert(mlist.last == -81) + mlist.clear + assert(mlist.isEmpty) + mlist += 1001 + assert(mlist.head == 1001) + mlist += 9999 + assert(mlist.tail.head == 9999) + assert(mlist.last == 9999) + } + + def testTraversables: Unit = { + val mlist = new MutableList[Int] + for (i <- 0 until 10) mlist += i * i + var lst = mlist.drop(5) + for (i <- 0 until 5) assert(lst(i) == (i + 5) * (i + 5)) + lst = lst.take(3) + for (i <- 0 until 3) assert(lst(i) == (i + 5) * (i + 5)) + lst += 129 + assert(lst(3) == 129) + assert(lst.last == 129) + assert(lst.length == 4) + lst += 7 + assert(lst.init.last == 129) + assert(lst.length == 5) + lst.clear + assert(lst.length == 0) + for (i <- 0 until 5) lst += i + assert(lst.reduceLeft(_ + _) == 10) + } + +} + + + + + + + + + + diff --git a/tests/pending/run/NestedClasses.check b/tests/pending/run/NestedClasses.check new file mode 100644 index 000000000000..a7ebc386e006 --- /dev/null +++ b/tests/pending/run/NestedClasses.check @@ -0,0 +1,9 @@ +e.e1 = 119 +cc.m = 3 +cc.am = 1 +cc.bm = 2 +aaa.f = 111 +bbb1.f = 42 +bbb2.f = 24 +bbb3.f = 24 +bbb4.f = 24 diff --git a/tests/pending/run/NestedClasses.scala b/tests/pending/run/NestedClasses.scala new file mode 100644 index 000000000000..6db713e083c3 --- /dev/null +++ b/tests/pending/run/NestedClasses.scala @@ -0,0 +1,97 @@ +//############################################################################ +// Test nested classes +//############################################################################ + +// The following set of classes tests nasty references to "outer" +// values. + +class A(pa : Int) { + def a1 = pa; + class B(pb : Int) { + def b1 = pa+pb+a1; + class C(pc : Int) extends A(b1) { + def c1 = pc+pb+pa + } + val c1 = new C(13) + } +} + +trait M { + def m1 = 1 +} + +class A1(x : Int) extends A(x) with M { + class D extends B(14) { + val c2 = new C(15); + class E extends C(16) { + def e1 = c1+b1+a1+m1; + def e2 = new D(); + } + } +} + +// The following set of classes test qualified "this" and "super" +// references. + +class AA { + def m = 1; + class BB { + def m = 2; + class CC { + def m = 3; + def am = AA.this.m; + def bm = BB.this.m; + } + } +} + +class AAA { + def f = 42; +} + +class BBB extends AAA { + override def f = 24; +} + +class AAA1 extends AAA { + override def f = 111; + class BBB1 extends BBB { + override def f = AAA1.super.f; + } + class BBB2 extends BBB { + override def f = BBB2.super.f; + } + class BBB3 extends BBB { + override def f = super.f; + } + class BBB4 extends BBB { } +} + +object Test { + def main(args: Array[String]): Unit = { + val a = new A1(12); + val d = new a.D; + val e = new d.E; + Console.println("e.e1 = " + e.e1); + + val aa = new AA; + val bb = new aa.BB; + val cc = new bb.CC; + Console.println("cc.m = " + cc.m); + Console.println("cc.am = " + cc.am); + Console.println("cc.bm = " + cc.bm); + + val aaa = new AAA1; + val bbb1 = new aaa.BBB1; + val bbb2 = new aaa.BBB2; + val bbb3 = new aaa.BBB3; + val bbb4 = new aaa.BBB4; + Console.println("aaa.f = " + aaa.f); + Console.println("bbb1.f = " + bbb1.f); + Console.println("bbb2.f = " + bbb2.f); + Console.println("bbb3.f = " + bbb3.f); + Console.println("bbb4.f = " + bbb4.f); + } +} + +//############################################################################ diff --git a/tests/pending/run/OrderingTest.scala b/tests/pending/run/OrderingTest.scala new file mode 100644 index 000000000000..ad5acfa0cb00 --- /dev/null +++ b/tests/pending/run/OrderingTest.scala @@ -0,0 +1,36 @@ +object Test extends dotty.runtime.LegacyApp { + def test[T](t1 : T, t2 : T)(implicit ord : Ordering[T]) = { + val cmp = ord.compare(t1, t2); + val cmp2 = ord.compare(t2, t1); + + assert((cmp == 0) == (cmp2 == 0)) + assert((cmp > 0) == (cmp2 < 0)) + assert((cmp < 0) == (cmp2 > 0)) + } + + def testAll[T](t1 : T, t2 : T)(implicit ord : Ordering[T]) = { + assert(ord.compare(t1, t2) < 0) + test(t1, t2); + test(t1, t1); + test(t2, t2); + } + + assert(Ordering[String].compare("australopithecus", "brontausaurus") < 0) + // assert(Ordering[Unit].compare((), ()) == 0) + + testAll("bar", "foo"); + testAll[Byte](0, 1); + testAll(false, true) + testAll(1, 2); + testAll(1.0, 2.0); + testAll(None, Some(1)); + testAll[Iterable[Int]](List(1), List(1, 2)); + testAll[Iterable[Int]](List(1, 2), List(2)); + testAll((1, "bar"), (1, "foo")) + testAll((1, "foo"), (2, "bar")) + + // sortBy + val words = "The quick brown fox jumped over the lazy dog".split(' ') + val result = words.sortBy(x => (x.length, x.head)) + assert(result sameElements Array[String]("The", "dog", "fox", "the", "lazy", "over", "brown", "quick", "jumped")) +} diff --git a/tests/pending/run/Predef.readLine.check b/tests/pending/run/Predef.readLine.check new file mode 100644 index 000000000000..4fb2bc4c6af2 --- /dev/null +++ b/tests/pending/run/Predef.readLine.check @@ -0,0 +1,3 @@ +prompt +fancy prompt +immensely fancy prompt \ No newline at end of file diff --git a/tests/pending/run/Predef.readLine.scala b/tests/pending/run/Predef.readLine.scala new file mode 100644 index 000000000000..f751949e84f1 --- /dev/null +++ b/tests/pending/run/Predef.readLine.scala @@ -0,0 +1,11 @@ +import java.io.StringReader +import scala.io.StdIn.readLine + +object Test extends dotty.runtime.LegacyApp { + Console.withIn(new StringReader("")) { + readLine() + readLine("prompt\n") + readLine("%s prompt\n", "fancy") + readLine("%s %s prompt\n", "immensely", "fancy") + } +} diff --git a/tests/pending/run/QueueTest.scala b/tests/pending/run/QueueTest.scala new file mode 100644 index 000000000000..8c35e39cb188 --- /dev/null +++ b/tests/pending/run/QueueTest.scala @@ -0,0 +1,297 @@ + + +import scala.collection.mutable.Queue + + + + +class ExtQueue[T] extends Queue[T] { + def printState: Unit = { + println("-------------------") + println("Length: " + len) + println("First: " + first0) + println("First elem: " + first0.elem) + println("After first: " + first0.next) + } +} + +object Test { + + def main(args: Array[String]): Unit = { + testEmpty + testEnqueue + testTwoEnqueues + testFewEnqueues + testMoreEnqueues + } + + def testEmpty: Unit = { + val queue = new Queue[Int] + + assert(queue.isEmpty) + assert(queue.size == 0) + assert(queue.length == 0) + assert(queue.dequeueFirst(_ > 500) == None) + assert(queue.dequeueAll(_ > 500).isEmpty) + + queue.clear + assert(queue.isEmpty) + assert(queue.size == 0) + assert(queue.length == 0) + assert(queue.dequeueFirst(_ > 500) == None) + assert(queue.dequeueAll(_ > 500).isEmpty) + } + + def testEnqueue: Unit = { + val queue = new Queue[Int] + + queue.enqueue(10) + assert(queue.nonEmpty) + assert(queue.size == 1) + assert(queue.length == 1) + assert(queue.head == 10) + assert(queue(0) == 10) + assert(queue.init.isEmpty) + assert(queue.tail.isEmpty) + + queue.clear + assert(queue.isEmpty) + assert(queue.length == 0) + + queue.enqueue(11) + assert(queue.nonEmpty) + assert(queue.length == 1) + assert(queue.head == 11) + assert(queue.front == 11) + + val deq = queue.dequeue + assert(deq == 11) + assert(queue.isEmpty) + assert(queue.length == 0) + + queue.enqueue(12) + val pdopt = queue.dequeueFirst(_ > 999) + assert(pdopt == None) + assert(queue.nonEmpty && queue.length == 1) + + val somepd = queue.dequeueFirst(_ >= 1) + assert(somepd == Some(12)) + assert(queue.isEmpty && queue.length == 0) + } + + def testTwoEnqueues: Unit = { + val queue = new ExtQueue[Int] + queue.enqueue(30) + queue.enqueue(40) + + assert(queue.length == 2) + assert(queue.size == 2) + assert(queue.nonEmpty) + assert(queue.front == 30) +// queue.printState + + val all = queue.dequeueAll(_ > 20) + assert(all.size == 2) + assert(all.contains(30)) + assert(all.contains(40)) + assert(queue.size == 0) + assert(queue.isEmpty) + } + + def testFewEnqueues: Unit = { + val queue = new ExtQueue[Int] + queue.enqueue(10) + queue.enqueue(20) + + assert(queue.length == 2) + assert(queue.nonEmpty) + assert(queue.head == 10) + assert(queue.last == 20) + assert(queue.front == 10) +// queue.printState + + val ten = queue.dequeue + assert(ten == 10) + assert(queue.length == 1) +// queue.printState + + queue.enqueue(30) +// queue.printState + val gt25 = queue.dequeueFirst(_ > 25) + assert(gt25 == Some(30)) + assert(queue.nonEmpty) + assert(queue.length == 1) + assert(queue.head == 20) + assert(queue.front == 20) +// queue.printState + + queue.enqueue(30) +// queue.printState + val lt25 = queue.dequeueFirst(_ < 25) + assert(lt25 == Some(20)) + assert(queue.nonEmpty) + assert(queue.length == 1) +// queue.printState + + queue.enqueue(40) +// queue.printState + val all = queue.dequeueAll(_ > 20) +// queue.printState + assert(all.size == 2) + assert(all.contains(30)) + assert(all.contains(40)) + assert(queue.isEmpty) + assert(queue.length == 0) + + queue.enqueue(50) + queue.enqueue(60) +// queue.printState + val allgt55 = queue.dequeueAll(_ > 55) +// println(allgt55) +// queue.printState + assert(allgt55.size == 1) + assert(allgt55.contains(60)) + assert(queue.length == 1) + + queue.enqueue(70) + queue.enqueue(80) +// queue.printState + val alllt75 = queue.dequeueAll(_ < 75) +// queue.printState + assert(alllt75.size == 2) + assert(alllt75.contains(70)) + assert(alllt75.contains(50)) + assert(queue.length == 1) + assert(queue.head == 80) + assert(queue.last == 80) + assert(queue.front == 80) + } + + def testMoreEnqueues: Unit = { + val queue = new ExtQueue[Int] + for (i <- 0 until 10) queue.enqueue(i * 2) + + for (i <- 0 until 10) { + val top = queue.dequeue + assert(top == i * 2) + assert(queue.length == 10 - i - 1) + } + assert(queue.isEmpty) + assert(queue.length == 0) + + for (i <- 0 until 10) queue.enqueue(i * i) + assert(queue.length == 10) + assert(queue.nonEmpty) + + //queue.printState + val gt5 = queue.dequeueAll(_ > 4) + //queue.printState + //println(gt5) + assert(gt5.size == 7) + assert(queue.length == 3) + assert(queue.nonEmpty) + + queue.clear + assert(queue.length == 0) + assert(queue.isEmpty) + + for (i <- 0 until 10) queue.enqueue(i) + assert(queue.length == 10) + + val even = queue.dequeueAll(_ % 2 == 0) + assert(even.size == 5) + assert(even.sameElements(List(0, 2, 4, 6, 8))) + assert(queue.length == 5) + assert(queue.head == 1) + assert(queue.last == 9) + + val odd = queue.dequeueAll(_ %2 == 1) + assert(odd.size == 5) + assert(queue.length == 0) + assert(queue.isEmpty) + assert(odd.sameElements(List(1, 3, 5, 7, 9))) + + for (i <- 0 until 10) queue.enqueue(i * i) + assert(queue.last == 81) + assert(queue.head == 0) + assert(queue.length == 10) + + val foddgt25 = queue.dequeueFirst(num => num > 25 && num % 2 == 1) + assert(foddgt25 == Some(49)) + assert(queue.length == 9) + assert(queue.nonEmpty) + + //queue.printState + val lt30 = queue.dequeueAll(_ < 30) + //println(lt30) + //queue.printState + assert(lt30.size == 6) + assert(queue.length == 3) + + val fgt60 = queue.dequeueFirst(_ > 60) + assert(fgt60 == Some(64)) + assert(queue.length == 2) + assert(queue.head == 36) + assert(queue.last == 81) + + val sgt60 = queue.dequeueFirst(_ > 60) + assert(sgt60 == Some(81)) + assert(queue.length == 1) + assert(queue.head == 36) + assert(queue.last == 36) + + val nogt60 = queue.dequeueFirst(_ > 60) + assert(nogt60 == None) + assert(queue.length == 1) + assert(queue.nonEmpty) + assert(queue.head == 36) + + val gt0 = queue.dequeueFirst(_ > 0) + assert(gt0 == Some(36)) + assert(queue.length == 0) + assert(queue.isEmpty) + + for (i <- 0 until 4) queue.enqueue(i) + val interv = queue.dequeueAll(n => n > 0 && n < 3) + assert(interv.sameElements(List(1, 2))) + assert(queue.length == 2) + assert(queue.head == 0) + assert(queue.last == 3) + + queue.dequeue + assert(queue.head == 3) + + queue.enqueue(9) + val three = queue.dequeueFirst(_ < 5) + assert(three == Some(3)) + assert(queue.length == 1) + assert(queue.head == 9) + + queue.clear + for (i <- -100 until 100) queue.enqueue(i * i + i % 7 + 5) + assert(queue.length == 200) + + val manyodds = queue.dequeueAll(_ % 2 == 1) + assert((manyodds.size + queue.length) == 200) + + queue.dequeueAll(_ > -10000) + assert(queue.isEmpty) + + for (i <- 0 until 100) queue.enqueue(i) + val multof3 = queue.dequeueAll(_ % 3 == 0) + assert(multof3.size == 34) + assert(queue.size == 66) + + val n98 = queue.dequeueFirst(_ == 98) + assert(n98 == Some(98)) + assert(queue.size == 65) + assert(queue.last == 97) + assert(queue.head == 1) + // well... seems to work + } + +} + + + + diff --git a/tests/pending/run/ReplacementMatching.scala b/tests/pending/run/ReplacementMatching.scala new file mode 100644 index 000000000000..370f7dc2530e --- /dev/null +++ b/tests/pending/run/ReplacementMatching.scala @@ -0,0 +1,47 @@ + + + +import util.matching._ + + + + +object Test { + + def main(args: Array[String]): Unit = { + replacementMatching + groupsMatching + } + + def replacementMatching: Unit = { + val regex = """\$\{(.+?)\}""".r + val replaced = regex.replaceAllIn("Replacing: ${main}. And another method: ${foo}.", + (m: util.matching.Regex.Match) => { + val identifier = m.group(1) + identifier + }) + assert(replaced == "Replacing: main. And another method: foo.") + + val regex3 = """\$\{(.+?)\}""".r + val replaced3 = regex3.replaceSomeIn("Replacing: ${main}. And another: ${foo}.", (m: util.matching.Regex.Match) => { + val id = m.group(1) + if (id.startsWith("m")) Some(id) else None + }) + assert(replaced3 == "Replacing: main. And another: ${foo}.") + } + + def groupsMatching: Unit = { + val Date = """(\d+)/(\d+)/(\d+)""".r + for (Regex.Groups(a, b, c) <- Date findFirstMatchIn "1/1/2001 marks the start of the millenium. 31/12/2000 doesn't.") { + assert(a == "1") + assert(b == "1") + assert(c == "2001") + } + for (Regex.Groups(a, b, c) <- (Date findAllIn "1/1/2001 marks the start of the millenium. 31/12/2000 doesn't.").matchData) { + assert(a == "1" || a == "31") + assert(b == "1" || b == "12") + assert(c == "2001" || c == "2000") + } + } + +} diff --git a/tests/pending/run/ReverseSeqView.scala b/tests/pending/run/ReverseSeqView.scala new file mode 100644 index 000000000000..edb2e8c28b6c --- /dev/null +++ b/tests/pending/run/ReverseSeqView.scala @@ -0,0 +1,25 @@ + + + + + + +object Test extends dotty.runtime.LegacyApp { + + val lstv = List(1, 2, 3).view + val lstvr = lstv.reverse + assert(lstvr.iterator.toList == List(3, 2, 1)) + assert(lstvr.reverse == List(1, 2, 3)) + assert(lstvr.reverseIterator.toList == List(1, 2, 3)) + assert(lstvr.reverseMap(_ + 1) == List(2, 3, 4)) + +} + + + + + + + + + diff --git a/tests/pending/run/SymbolsTest.scala b/tests/pending/run/SymbolsTest.scala new file mode 100644 index 000000000000..e7a91ead6bc0 --- /dev/null +++ b/tests/pending/run/SymbolsTest.scala @@ -0,0 +1,282 @@ + +import scala.language.reflectiveCalls + +class Slazz { + val s1 = 'myFirstSymbol + val s2 = 'mySecondSymbol + def s3 = 'myThirdSymbol + var s4: Symbol = null + + s4 = 'myFourthSymbol +} + +class Base { + val basesymbol = 'symbase +} + +class Sub extends Base { + val subsymbol = 'symsub +} + +trait Signs { + val ind = 'indication + val trace = 'trace +} + +trait Lazy1 { + lazy val v1 = "lazy v1" + lazy val s1 = 'lazySymbol1 +} + +trait Lazy2 { + lazy val v2 = "lazy v2" + lazy val s2 = 'lazySymbol2 +} + +trait Lazy3 { + lazy val v3 = "lazy v3" + lazy val s3 = 'lazySymbol3 +} + +object SingletonOfLazyness { + lazy val lazysym = 'lazySymbol + lazy val another = 'another + lazy val lastone = 'lastone +} + +/* + * Tests symbols to see if they work correct. + */ +object Test { + class Inner { + val simba = 'smba + var mfs: Symbol = null + mfs = Symbol("mfsa") + } + + object InnerObject { + val o1 = 'aaa + val o2 = 'ddd + } + + def aSymbol = 'myFirstSymbol + val anotherSymbol = 'mySecondSymbol + + def main(args: Array[String]): Unit = { + testLiterals + testForLoop + testInnerClasses + testInnerObjects + testWithHashMaps + testLists + testAnonymous + testNestedObject + testInheritance + testTraits + testLazyTraits + testLazyObjects + } + + def testLiterals: Unit = { + val scl = new Slazz + assert(scl.s1 == aSymbol) + assert(scl.s2 == anotherSymbol) + assert(scl.s3 == 'myThirdSymbol) + assert(scl.s4 == Symbol.apply("myFourthSymbol")) + assert(scl.s1 == Symbol("myFirstSymbol")) + } + + def testForLoop: Unit = { + for (i <- 0 until 100) List("Val" + i) + } + + def testInnerClasses: Unit = { + val innerPower = new Inner + assert(innerPower.simba == 'smba) + assert(innerPower.mfs == 'mfsa) + } + + def testInnerObjects: Unit = { + assert(InnerObject.o1 == 'aaa) + assert(InnerObject.o2 == 'ddd) + } + + def testWithHashMaps: Unit = { + val map = new collection.mutable.HashMap[Symbol, Symbol] + map.put(InnerObject.o1, 'smba) + map.put(InnerObject.o2, 'mfsa) + map.put(Symbol("WeirdKey" + 1), Symbol("Weird" + "Val" + 1)) + assert(map('aaa) == 'smba) + assert(map('ddd) == 'mfsa) + assert(map('WeirdKey1) == Symbol("WeirdVal1")) + + map.clear + for (i <- 0 until 100) map.put(Symbol("symKey" + i), Symbol("symVal" + i)) + assert(map(Symbol("symKey15")) == Symbol("symVal15")) + assert(map('symKey22) == 'symVal22) + assert(map('symKey73) == 'symVal73) + assert(map('symKey56) == 'symVal56) + assert(map('symKey91) == 'symVal91) + } + + def testLists: Unit = { + var lst: List[Symbol] = Nil + for (i <- 0 until 100) lst ::= Symbol("lsym" + (99 - i)) + assert(lst(0) == 'lsym0) + assert(lst(10) == 'lsym10) + assert(lst(30) == 'lsym30) + assert(lst(40) == 'lsym40) + assert(lst(65) == 'lsym65) + assert(lst(90) == 'lsym90) + } + + def testAnonymous: Unit = { // TODO complaints classdef can't be found for some reason, runs fine in my case + // val anon = () => { + // val simba = 'smba + // simba + // } + // val an2 = () => { + // object nested { + // val m = 'mfsa + // } + // nested.m + // } + // val an3 = () => { + // object nested { + // val f = () => { + // 'layered + // } + // def gets = f() + // } + // nested.gets + // } + // val inner = new Inner + // assert(anon() == inner.simba) + // assert(anon().toString == "'smba") + // assert(an2() == 'mfsa) + // assert(an3() == Symbol("layered" + "")) + } + + def testNestedObject: Unit = { + object nested { + def sign = 'sign + def insignia = 'insignia + } + assert(nested.sign == 'sign) + assert(nested.insignia == 'insignia) + assert(('insignia).toString == "'insignia") + } + + def testInheritance: Unit = { + val base = new Base + val sub = new Sub + assert(base.basesymbol == 'symbase) + assert(sub.subsymbol == 'symsub) + assert(sub.basesymbol == 'symbase) + + val anon = new Sub { + def subsubsymbol = 'symsubsub + } + assert(anon.subsubsymbol == 'symsubsub) + assert(anon.subsymbol == 'symsub) + assert(anon.basesymbol == 'symbase) + + object nested extends Sub { + def objsymbol = 'symobj + } + assert(nested.objsymbol == 'symobj) + assert(nested.subsymbol == 'symsub) + assert(nested.basesymbol == 'symbase) + assert(('symbase).toString == "'symbase") + } + + def testTraits: Unit = { + val fromTrait = new AnyRef with Signs { + def traitsymbol = 'traitSymbol + } + + assert(fromTrait.traitsymbol == 'traitSymbol) + assert(fromTrait.ind == 'indication) + assert(fromTrait.trace == 'trace) + assert(('trace).toString == "'trace") + + trait Compl { + val s1 = 's1 + def s2 = 's2 + object inner { + val s3 = 's3 + val s4 = 's4 + } + } + + val compl = new Sub with Signs with Compl + assert(compl.s1 == 's1) + assert(compl.s2 == 's2) + assert(compl.inner.s3 == 's3) + assert(compl.inner.s4 == 's4) + assert(compl.ind == 'indication) + assert(compl.trace == 'trace) + assert(compl.subsymbol == 'symsub) + assert(compl.basesymbol == 'symbase) + + object Local extends Signs with Compl { + val s5 = 's5 + def s6 = 's6 + object inner2 { + val s7 = 's7 + def s8 = 's8 + } + } + assert(Local.s5 == 's5) + assert(Local.s6 == 's6) + assert(Local.inner2.s7 == 's7) + assert(Local.inner2.s8 == 's8) + assert(Local.inner.s3 == 's3) + assert(Local.inner.s4 == 's4) + assert(Local.s1 == 's1) + assert(Local.s2 == 's2) + assert(Local.trace == 'trace) + assert(Local.ind == 'indication) + assert(('s8).toString == "'s8") + } + + def testLazyTraits: Unit = { + val l1 = new AnyRef with Lazy1 + val l2 = new AnyRef with Lazy2 + val l3 = new AnyRef with Lazy3 + + l1.v1 + l2.v2 + l3.v3 + assert((l1.s1).toString == "'lazySymbol1") + assert(l2.s2 == Symbol("lazySymbol" + 2)) + assert(l3.s3 == 'lazySymbol3) + } + + def testLazyObjects: Unit = { + assert(SingletonOfLazyness.lazysym == 'lazySymbol) + assert(SingletonOfLazyness.another == Symbol("ano" + "ther")) + assert((SingletonOfLazyness.lastone).toString == "'lastone") + + object nested { + lazy val sym1 = 'snested1 + lazy val sym2 = 'snested2 + } + + assert(nested.sym1 == 'snested1) + assert(nested.sym2 == Symbol("snested" + "2")) + } + +} + + + + + + + + + + + + diff --git a/tests/pending/run/UnrolledBuffer.scala b/tests/pending/run/UnrolledBuffer.scala new file mode 100644 index 000000000000..76201bb7cc3b --- /dev/null +++ b/tests/pending/run/UnrolledBuffer.scala @@ -0,0 +1,125 @@ + + + + +import collection.mutable.UnrolledBuffer + + + +object Test { + + def main(args: Array[String]): Unit = { + val u1 = new UnrolledBuffer[Int] + assert(u1.isEmpty) + assert(u1.size == 0) + + u1 += 1 + u1 += 2 + u1 += 3 + assert(u1 == UnrolledBuffer(1, 2, 3)) + assert(u1.toList == List(1, 2, 3)) + assert(u1.nonEmpty) + assert(u1.size == 3) + + u1.clear + assert(u1.isEmpty) + assert(u1.size == 0) + + u1 += 1 + u1 += 2 + u1 += 3 + u1.remove(1) + assert(u1.nonEmpty) + assert(u1.size == 2) + assert(u1 == UnrolledBuffer(1, 3)) + assert(u1.toList == List(1, 3)) + + u1 concat UnrolledBuffer(5, 7, 9) + assert(u1 == UnrolledBuffer(1, 3, 5, 7, 9)) + + val u2 = u1 map { x => (x - 1) / 2 } + assert(u2 == UnrolledBuffer(0, 1, 2, 3, 4)) + + u1.clear + u2.clear + assert(u1.size == 0) + assert(u2.size == 0) + + for (i <- 0 until 500) u1 += i + for (i <- 500 until 1000) u2 += i + assert(u1.size == 500) + assert(u2.size == 500) + assert(u1.iterator.toList == (0 until 500).toList) + assert((for (elem <- u1) yield elem) sameElements (0 until 500)) + + u1 concat u2 + assert(u1.size == 1000) + assert(u2.size == 0) + assertCorrect(u1) + + u1 concat UnrolledBuffer() + assertCorrect(u1) + + val u3 = u1 map { x => x } + var i = 0 + for (elem <- u1) { + assert(elem == u3(i)) + i += 1 + } + + u1.remove(999) + assert(u1.size == 999) + assertCorrect(u1) + + u1.remove(500) + assert(u1.size == 998) + assertCorrect(u1) + + u1.remove(5) + assert(u1.size == 997) + assertCorrect(u1) + + u1.remove(0) + assert(u1.size == 996) + assertCorrect(u1) + + u1.insert(0, 0) + assert(u1.size == 997) + assertCorrect(u1) + + u1.insert(5, 5) + assert(u1.size == 998) + assertCorrect(u1) + + u1.insert(500, 500) + assert(u1.size == 999) + assertCorrect(u1) + + u1.insert(999, 999) + assert(u1.size == 1000) + assertCorrect(u1) + + for (i <- -100 until 0) { + i +=: u1 + assertCorrect(u1) + } + assert(u1.size == 1100) + assertCorrect(u1) + } + + def assertCorrect(u1: UnrolledBuffer[Int]): Unit = { + val sz = u1.size + val store = new Array[Int](sz) + for (i <- 0 until sz) { + store(i) = u1(i) + u1(i) = sz - i + } + for (i <- 0 until sz) assert(u1(i) == (sz - i)) + for (i <- 0 until sz) u1(i) = store(i) + for (i <- 0 until sz) assert(store(i) == u1(i)) + + assert((u1 map { x => x }) == u1) + assert(u1.iterator.toSeq.size == u1.size) + } + +} diff --git a/tests/pending/run/WeakHashSetTest.scala b/tests/pending/run/WeakHashSetTest.scala new file mode 100644 index 000000000000..8bcb950916ed --- /dev/null +++ b/tests/pending/run/WeakHashSetTest.scala @@ -0,0 +1,174 @@ +object Test { + def main(args: Array[String]): Unit = { + val test = scala.reflect.internal.util.WeakHashSetTest + test.checkEmpty + test.checkPlusEquals + test.checkPlusEqualsCollisions + test.checkRehashing + test.checkRehashCollisions + test.checkFindOrUpdate + test.checkMinusEquals + test.checkMinusEqualsCollisions + test.checkClear + test.checkIterator + test.checkIteratorCollisions + + // This test is commented out because it relies on gc behavior which isn't reliable enough in an automated environment + // test.checkRemoveUnreferencedObjects + } +} + +// put the main test object in the same package as WeakHashSet because +// it uses the package private "diagnostics" method +package scala.reflect.internal.util { + + object WeakHashSetTest { + // a class guaranteed to provide hash collisions + case class Collider(x : String) extends Comparable[Collider] with Serializable { + override def hashCode = 0 + def compareTo(y : Collider) = this.x compareTo y.x + } + + // basic emptiness check + def checkEmpty: Unit = { + val hs = new WeakHashSet[String]() + assert(hs.size == 0) + hs.diagnostics.fullyValidate + } + + // make sure += works + def checkPlusEquals: Unit = { + val hs = new WeakHashSet[String]() + val elements = List("hello", "goodbye") + elements foreach (hs += _) + assert(hs.size == 2) + assert(hs contains "hello") + assert(hs contains "goodbye") + hs.diagnostics.fullyValidate + } + + // make sure += works when there are collisions + def checkPlusEqualsCollisions: Unit = { + val hs = new WeakHashSet[Collider]() + val elements = List("hello", "goodbye") map Collider + elements foreach (hs += _) + assert(hs.size == 2) + assert(hs contains Collider("hello")) + assert(hs contains Collider("goodbye")) + hs.diagnostics.fullyValidate + } + + // add a large number of elements to force rehashing and then validate + def checkRehashing: Unit = { + val size = 200 + val hs = new WeakHashSet[String]() + val elements = (0 until size).toList map ("a" + _) + elements foreach (hs += _) + elements foreach {i => assert(hs contains i)} + hs.diagnostics.fullyValidate + } + + // make sure rehashing works properly when the set is rehashed + def checkRehashCollisions: Unit = { + val size = 200 + val hs = new WeakHashSet[Collider]() + val elements = (0 until size).toList map {x => Collider("a" + x)} + elements foreach (hs += _) + elements foreach {i => assert(hs contains i)} + hs.diagnostics.fullyValidate + } + + // test that unreferenced objects are removed + // not run in an automated environment because gc behavior can't be relied on + def checkRemoveUnreferencedObjects: Unit = { + val size = 200 + val hs = new WeakHashSet[Collider]() + val elements = (0 until size).toList map {x => Collider("a" + x)} + elements foreach (hs += _) + // don't throw the following into a retained collection so gc + // can remove them + for (i <- 0 until size) { + hs += Collider("b" + i) + } + System.gc() + Thread.sleep(1000) + assert(hs.size == 200) + elements foreach {i => assert(hs contains i)} + for (i <- 0 until size) { + assert(!(hs contains Collider("b" + i))) + } + hs.diagnostics.fullyValidate + } + + // make sure findOrUpdate returns the originally entered element + def checkFindOrUpdate: Unit = { + val size = 200 + val hs = new WeakHashSet[Collider]() + val elements = (0 until size).toList map {x => Collider("a" + x)} + elements foreach {x => assert(hs findEntryOrUpdate x eq x)} + for (i <- 0 until size) { + // when we do a lookup the result should be the same reference we + // original put in + assert(hs findEntryOrUpdate(Collider("a" + i)) eq elements(i)) + } + hs.diagnostics.fullyValidate + } + + // check -= functionality + def checkMinusEquals: Unit = { + val hs = new WeakHashSet[String]() + val elements = List("hello", "goodbye") + elements foreach (hs += _) + hs -= "goodbye" + assert(hs.size == 1) + assert(hs contains "hello") + assert(!(hs contains "goodbye")) + hs.diagnostics.fullyValidate + } + + // check -= when there are collisions + def checkMinusEqualsCollisions: Unit = { + val hs = new WeakHashSet[Collider] + val elements = List(Collider("hello"), Collider("goodbye")) + elements foreach (hs += _) + hs -= Collider("goodbye") + assert(hs.size == 1) + assert(hs contains Collider("hello")) + assert(!(hs contains Collider("goodbye"))) + hs -= Collider("hello") + assert(hs.size == 0) + assert(!(hs contains Collider("hello"))) + hs.diagnostics.fullyValidate + } + + // check that the clear method actually cleans everything + def checkClear: Unit = { + val size = 200 + val hs = new WeakHashSet[String]() + val elements = (0 until size).toList map ("a" + _) + elements foreach (hs += _) + hs.clear() + assert(hs.size == 0) + elements foreach {i => assert(!(hs contains i))} + hs.diagnostics.fullyValidate + } + + // check that the iterator covers all the contents + def checkIterator: Unit = { + val hs = new WeakHashSet[String]() + val elements = (0 until 20).toList map ("a" + _) + elements foreach (hs += _) + assert(elements.iterator.toList.sorted == elements.sorted) + hs.diagnostics.fullyValidate + } + + // check that the iterator covers all the contents even when there is a collision + def checkIteratorCollisions: Unit = { + val hs = new WeakHashSet[Collider] + val elements = (0 until 20).toList map {x => Collider("a" + x)} + elements foreach (hs += _) + assert(elements.iterator.toList.sorted == elements.sorted) + hs.diagnostics.fullyValidate + } + } +} diff --git a/tests/pending/run/absoverride.check b/tests/pending/run/absoverride.check new file mode 100644 index 000000000000..0f4a2b9d5ff0 --- /dev/null +++ b/tests/pending/run/absoverride.check @@ -0,0 +1,15 @@ + +next: j + +log: j +j + +next: v + +log: v +v + +next: m + +log: m +m diff --git a/tests/pending/run/absoverride.scala b/tests/pending/run/absoverride.scala new file mode 100644 index 000000000000..0301498935a0 --- /dev/null +++ b/tests/pending/run/absoverride.scala @@ -0,0 +1,41 @@ +abstract class AbsIterator { + type T + def hasNext: Boolean + def next: T +} + +trait RichIterator extends AbsIterator { + def foreach(f: T => Unit): Unit = { + while (hasNext) f(next) + } +} + +class StringIterator(s: String) extends AbsIterator { + type T = Char + private var i = 0 + def hasNext = i < s.length() + def next = { val x = s.charAt(i); i += 1; println("next: " + x); x } +} + +trait SyncIterator extends AbsIterator { + abstract override def hasNext: Boolean = + synchronized(super.hasNext) + abstract override def next: T = + synchronized { + println(""); val x = super.next; println(""); x + } +} +trait LoggedIterator extends AbsIterator { + abstract override def next: T = { + val x = super.next; println("log: " + x); x + } +} +class Iter2(s: String) extends StringIterator(s) + with SyncIterator with LoggedIterator; +object Test { + def main(args: Array[String]): Unit = { + class Iter extends StringIterator(args(0)) with RichIterator with SyncIterator with LoggedIterator + val iter = new Iter + iter foreach Console.println + } +} diff --git a/tests/pending/run/abstypetags_core.check b/tests/pending/run/abstypetags_core.check new file mode 100644 index 000000000000..980b4719bf07 --- /dev/null +++ b/tests/pending/run/abstypetags_core.check @@ -0,0 +1,30 @@ +true +TypeTag[Byte] +true +TypeTag[Short] +true +TypeTag[Char] +true +TypeTag[Int] +true +TypeTag[Long] +true +TypeTag[Float] +true +TypeTag[Double] +true +TypeTag[Boolean] +true +TypeTag[Unit] +true +TypeTag[Any] +true +TypeTag[AnyVal] +true +TypeTag[AnyRef] +true +TypeTag[java.lang.Object] +true +TypeTag[Null] +true +TypeTag[Nothing] diff --git a/tests/pending/run/abstypetags_core.scala b/tests/pending/run/abstypetags_core.scala new file mode 100644 index 000000000000..ac4f07d46dad --- /dev/null +++ b/tests/pending/run/abstypetags_core.scala @@ -0,0 +1,34 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[WeakTypeTag[Byte]] eq WeakTypeTag.Byte) + println(implicitly[WeakTypeTag[Byte]]) + println(implicitly[WeakTypeTag[Short]] eq WeakTypeTag.Short) + println(implicitly[WeakTypeTag[Short]]) + println(implicitly[WeakTypeTag[Char]] eq WeakTypeTag.Char) + println(implicitly[WeakTypeTag[Char]]) + println(implicitly[WeakTypeTag[Int]] eq WeakTypeTag.Int) + println(implicitly[WeakTypeTag[Int]]) + println(implicitly[WeakTypeTag[Long]] eq WeakTypeTag.Long) + println(implicitly[WeakTypeTag[Long]]) + println(implicitly[WeakTypeTag[Float]] eq WeakTypeTag.Float) + println(implicitly[WeakTypeTag[Float]]) + println(implicitly[WeakTypeTag[Double]] eq WeakTypeTag.Double) + println(implicitly[WeakTypeTag[Double]]) + println(implicitly[WeakTypeTag[Boolean]] eq WeakTypeTag.Boolean) + println(implicitly[WeakTypeTag[Boolean]]) + println(implicitly[WeakTypeTag[Unit]] eq WeakTypeTag.Unit) + println(implicitly[WeakTypeTag[Unit]]) + println(implicitly[WeakTypeTag[Any]] eq WeakTypeTag.Any) + println(implicitly[WeakTypeTag[Any]]) + println(implicitly[WeakTypeTag[AnyVal]] eq WeakTypeTag.AnyVal) + println(implicitly[WeakTypeTag[AnyVal]]) + println(implicitly[WeakTypeTag[AnyRef]] eq WeakTypeTag.AnyRef) + println(implicitly[WeakTypeTag[AnyRef]]) + println(implicitly[WeakTypeTag[Object]] eq WeakTypeTag.Object) + println(implicitly[WeakTypeTag[Object]]) + println(implicitly[WeakTypeTag[Null]] eq WeakTypeTag.Null) + println(implicitly[WeakTypeTag[Null]]) + println(implicitly[WeakTypeTag[Nothing]] eq WeakTypeTag.Nothing) + println(implicitly[WeakTypeTag[Nothing]]) +} diff --git a/tests/pending/run/abstypetags_serialize.check b/tests/pending/run/abstypetags_serialize.check new file mode 100644 index 000000000000..1b5e2ebddf25 --- /dev/null +++ b/tests/pending/run/abstypetags_serialize.check @@ -0,0 +1,2 @@ +WeakTypeTag[T] +WeakTypeTag[U[String]] diff --git a/tests/pending/run/abstypetags_serialize.scala b/tests/pending/run/abstypetags_serialize.scala new file mode 100644 index 000000000000..23211b13443b --- /dev/null +++ b/tests/pending/run/abstypetags_serialize.scala @@ -0,0 +1,34 @@ +import scala.language.higherKinds +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + def test(tag: WeakTypeTag[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(tag) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val retag = in.readObject().asInstanceOf[ru.WeakTypeTag[_]].in(cm) + in.close() + fin.close() + + println(retag) + } catch { + case ex: Exception => + println(ex) + } + + def qwe[T, U[_]] = { + test(implicitly[WeakTypeTag[T]]) + test(implicitly[WeakTypeTag[U[String]]]) + } + + qwe +} diff --git a/tests/pending/run/adding-growing-set.scala b/tests/pending/run/adding-growing-set.scala new file mode 100644 index 000000000000..ab94b893b20a --- /dev/null +++ b/tests/pending/run/adding-growing-set.scala @@ -0,0 +1,11 @@ +/** This will run a loooong time if Set's builder copies a + * complete new Set for every element. + */ +object Test { + def main(args: Array[String]): Unit = { + val a = new Array[Long](1000000) + (1 to 10000) foreach (i => a(i) = i) + val s = collection.mutable.Set(a: _*) + assert(s.sum > 0) + } +} diff --git a/tests/pending/run/all-overridden.check b/tests/pending/run/all-overridden.check new file mode 100644 index 000000000000..1b620b1176de --- /dev/null +++ b/tests/pending/run/all-overridden.check @@ -0,0 +1 @@ +method g diff --git a/tests/pending/run/all-overridden.scala b/tests/pending/run/all-overridden.scala new file mode 100644 index 000000000000..ff51fa19bfc0 --- /dev/null +++ b/tests/pending/run/all-overridden.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test { + trait Foo { def f: Int = 5 ; def g: Int } + trait Bar extends Foo { def f: Int ; def g: Int = 5 } + + def main(args: Array[String]): Unit = { + // We should see g, but not f or $init$. + typeOf[Bar].decls.toList.flatMap(_.overrides) foreach println + } +} diff --git a/tests/pending/run/amp.check b/tests/pending/run/amp.check new file mode 100644 index 000000000000..44be9395cb9c --- /dev/null +++ b/tests/pending/run/amp.check @@ -0,0 +1,3 @@ +g called +42 +1 diff --git a/tests/pending/run/amp.scala b/tests/pending/run/amp.scala new file mode 100644 index 000000000000..da35242a9c97 --- /dev/null +++ b/tests/pending/run/amp.scala @@ -0,0 +1,15 @@ +object Test extends dotty.runtime.LegacyApp { + + def foo() = { + def f: Int = 1 + val x = f _ + x + } + + def bar(g: => Int) = { + g _ + } + + Console.println((bar{ Console.println("g called"); 42 })()) + Console.println(foo()()) +} diff --git a/tests/pending/run/analyzerPlugins.check b/tests/pending/run/analyzerPlugins.check new file mode 100644 index 000000000000..9803465ddc23 --- /dev/null +++ b/tests/pending/run/analyzerPlugins.check @@ -0,0 +1,193 @@ +adaptBoundsToAnnots(List( <: Int), List(type T), List(Int @testAnn)) [2] +annotationsConform(Boolean @testAnn, Boolean) [1] +annotationsConform(Boolean(false), Boolean @testAnn) [1] +annotationsConform(Int @testAnn, ?A) [1] +annotationsConform(Int @testAnn, Any) [1] +annotationsConform(Int @testAnn, Int) [2] +annotationsConform(Int(1) @testAnn, Int) [1] +annotationsConform(Int(1), Int @testAnn) [1] +annotationsConform(Nothing, Int @testAnn) [2] +annotationsConform(String @testAnn, String) [2] +canAdaptAnnotations(Trees$Ident, String) [1] +canAdaptAnnotations(Trees$Select, ?) [1] +canAdaptAnnotations(Trees$Select, Boolean @testAnn) [1] +canAdaptAnnotations(Trees$Select, Boolean) [1] +canAdaptAnnotations(Trees$Select, String @testAnn) [1] +canAdaptAnnotations(Trees$TypeTree, ?) [10] +canAdaptAnnotations(Trees$Typed, ?) [3] +canAdaptAnnotations(Trees$Typed, Any) [1] +canAdaptAnnotations(Trees$Typed, Int) [1] +lub(List(Int @testAnn, Int)) [1] +pluginsPt(?, Trees$Annotated) [7] +pluginsPt(?, Trees$Apply) [8] +pluginsPt(?, Trees$ApplyImplicitView) [2] +pluginsPt(?, Trees$Assign) [7] +pluginsPt(?, Trees$Block) [4] +pluginsPt(?, Trees$ClassDef) [2] +pluginsPt(?, Trees$DefDef) [14] +pluginsPt(?, Trees$Ident) [50] +pluginsPt(?, Trees$If) [2] +pluginsPt(?, Trees$Literal) [16] +pluginsPt(?, Trees$New) [5] +pluginsPt(?, Trees$PackageDef) [1] +pluginsPt(?, Trees$Return) [1] +pluginsPt(?, Trees$Select) [47] +pluginsPt(?, Trees$Super) [2] +pluginsPt(?, Trees$This) [20] +pluginsPt(?, Trees$TypeApply) [3] +pluginsPt(?, Trees$TypeBoundsTree) [2] +pluginsPt(?, Trees$TypeDef) [1] +pluginsPt(?, Trees$TypeTree) [38] +pluginsPt(?, Trees$Typed) [1] +pluginsPt(?, Trees$ValDef) [21] +pluginsPt(Any, Trees$Literal) [2] +pluginsPt(Any, Trees$Typed) [1] +pluginsPt(Array[Any], Trees$ArrayValue) [1] +pluginsPt(Boolean @testAnn, Trees$Literal) [1] +pluginsPt(Boolean @testAnn, Trees$Select) [1] +pluginsPt(Boolean, Trees$Apply) [1] +pluginsPt(Boolean, Trees$Ident) [1] +pluginsPt(Boolean, Trees$Literal) [1] +pluginsPt(Double, Trees$Select) [1] +pluginsPt(Int @testAnn, Trees$Literal) [1] +pluginsPt(Int, Trees$Apply) [1] +pluginsPt(Int, Trees$Ident) [2] +pluginsPt(Int, Trees$If) [1] +pluginsPt(Int, Trees$Literal) [5] +pluginsPt(Int, Trees$Select) [3] +pluginsPt(List, Trees$Apply) [1] +pluginsPt(List[Any], Trees$Select) [1] +pluginsPt(String @testAnn, Trees$Select) [1] +pluginsPt(String, Trees$Apply) [1] +pluginsPt(String, Trees$Block) [2] +pluginsPt(String, Trees$Ident) [4] +pluginsPt(String, Trees$Literal) [1] +pluginsPt(String, Trees$Select) [1] +pluginsPt(String, Trees$Typed) [1] +pluginsPt(Unit, Trees$Assign) [1] +pluginsPt(testAnn, Trees$Apply) [5] +pluginsTypeSig(, Trees$Template) [2] +pluginsTypeSig(class A, Trees$ClassDef) [1] +pluginsTypeSig(class testAnn, Trees$ClassDef) [1] +pluginsTypeSig(constructor A, Trees$DefDef) [2] +pluginsTypeSig(constructor testAnn, Trees$DefDef) [1] +pluginsTypeSig(method foo, Trees$DefDef) [1] +pluginsTypeSig(method method, Trees$DefDef) [1] +pluginsTypeSig(method nested, Trees$DefDef) [1] +pluginsTypeSig(type T, Trees$TypeDef) [2] +pluginsTypeSig(value annotField, Trees$ValDef) [2] +pluginsTypeSig(value f, Trees$ValDef) [1] +pluginsTypeSig(value inferField, Trees$ValDef) [2] +pluginsTypeSig(value lub1, Trees$ValDef) [2] +pluginsTypeSig(value lub2, Trees$ValDef) [2] +pluginsTypeSig(value param, Trees$ValDef) [2] +pluginsTypeSig(value str, Trees$ValDef) [1] +pluginsTypeSig(value x, Trees$ValDef) [4] +pluginsTypeSig(value y, Trees$ValDef) [4] +pluginsTypeSig(variable count, Trees$ValDef) [3] +pluginsTypeSigAccessor(value annotField) [1] +pluginsTypeSigAccessor(value inferField) [1] +pluginsTypeSigAccessor(value lub1) [1] +pluginsTypeSigAccessor(value lub2) [1] +pluginsTypeSigAccessor(value x) [1] +pluginsTypeSigAccessor(value y) [1] +pluginsTypeSigAccessor(variable count) [2] +pluginsTyped( <: Int, Trees$TypeBoundsTree) [2] +pluginsTyped(()Object, Trees$Select) [1] +pluginsTyped(()String, Trees$Ident) [1] +pluginsTyped(()String, Trees$TypeApply) [1] +pluginsTyped(()scala.annotation.Annotation, Trees$Select) [1] +pluginsTyped(()testAnn, Trees$Select) [10] +pluginsTyped((str: String)A (param: Double)A, Trees$Select) [1] +pluginsTyped((x$1: Any)Boolean (x: Double)Boolean (x: Float)Boolean (x: Long)Boolean (x: Int)Boolean (x: Char)Boolean (x: Short)Boolean (x: Byte)Boolean, Trees$Select) [1] +pluginsTyped((x$1: Int)Unit, Trees$Select) [1] +pluginsTyped((x: Double)Double (x: Float)Float (x: Long)Long (x: Int)Int (x: Char)Int (x: Short)Int (x: Byte)Int (x: String)String, Trees$Select) [1] +pluginsTyped((x: String)scala.collection.immutable.StringOps, Trees$Select) [2] +pluginsTyped((xs: Array[Any])scala.collection.mutable.WrappedArray[Any], Trees$TypeApply) [1] +pluginsTyped(.type, Trees$Ident) [1] +pluginsTyped(, Trees$Select) [1] +pluginsTyped(, Trees$ClassDef) [2] +pluginsTyped(, Trees$DefDef) [14] +pluginsTyped(, Trees$PackageDef) [1] +pluginsTyped(, Trees$TypeDef) [1] +pluginsTyped(, Trees$ValDef) [21] +pluginsTyped(=> Boolean @testAnn, Trees$Select) [1] +pluginsTyped(=> Double, Trees$Select) [4] +pluginsTyped(=> Int, Trees$Select) [5] +pluginsTyped(=> Int, Trees$TypeApply) [1] +pluginsTyped(=> String @testAnn, Trees$Select) [1] +pluginsTyped(A, Trees$Apply) [1] +pluginsTyped(A, Trees$Ident) [2] +pluginsTyped(A, Trees$This) [8] +pluginsTyped(A, Trees$TypeTree) [4] +pluginsTyped(A.super.type, Trees$Super) [1] +pluginsTyped(A.this.type, Trees$This) [11] +pluginsTyped(Any, Trees$TypeTree) [1] +pluginsTyped(AnyRef, Trees$Select) [4] +pluginsTyped(Array[Any], Trees$ArrayValue) [1] +pluginsTyped(Boolean @testAnn, Trees$Select) [1] +pluginsTyped(Boolean @testAnn, Trees$TypeTree) [4] +pluginsTyped(Boolean(false), Trees$Literal) [2] +pluginsTyped(Boolean, Trees$Apply) [1] +pluginsTyped(Boolean, Trees$Select) [4] +pluginsTyped(Char('c'), Trees$Literal) [2] +pluginsTyped(Double, Trees$Select) [6] +pluginsTyped(Int @testAnn, Trees$TypeTree) [2] +pluginsTyped(Int @testAnn, Trees$Typed) [2] +pluginsTyped(Int(0), Trees$Literal) [3] +pluginsTyped(Int(1) @testAnn, Trees$Typed) [1] +pluginsTyped(Int(1), Trees$Literal) [8] +pluginsTyped(Int(2), Trees$Literal) [1] +pluginsTyped(Int, Trees$Apply) [1] +pluginsTyped(Int, Trees$Ident) [2] +pluginsTyped(Int, Trees$If) [2] +pluginsTyped(Int, Trees$Select) [15] +pluginsTyped(Int, Trees$TypeTree) [13] +pluginsTyped(List, Trees$Apply) [1] +pluginsTyped(List, Trees$Select) [1] +pluginsTyped(List[Any], Trees$Apply) [1] +pluginsTyped(List[Any], Trees$Select) [1] +pluginsTyped(List[Any], Trees$TypeTree) [3] +pluginsTyped(Nothing, Trees$Return) [1] +pluginsTyped(Object, Trees$Apply) [1] +pluginsTyped(String @testAnn, Trees$Ident) [1] +pluginsTyped(String @testAnn, Trees$Select) [1] +pluginsTyped(String @testAnn, Trees$TypeTree) [4] +pluginsTyped(String(""), Trees$Literal) [2] +pluginsTyped(String("huhu"), Trees$Literal) [1] +pluginsTyped(String("str") @testAnn, Trees$Typed) [1] +pluginsTyped(String("str"), Trees$Literal) [1] +pluginsTyped(String("str"), Trees$Typed) [1] +pluginsTyped(String("two"), Trees$Literal) [2] +pluginsTyped(String, Trees$Apply) [2] +pluginsTyped(String, Trees$Block) [2] +pluginsTyped(String, Trees$Ident) [1] +pluginsTyped(String, Trees$Select) [9] +pluginsTyped(String, Trees$TypeTree) [7] +pluginsTyped(Unit, Trees$Apply) [2] +pluginsTyped(Unit, Trees$Assign) [8] +pluginsTyped(Unit, Trees$Block) [4] +pluginsTyped(Unit, Trees$If) [1] +pluginsTyped(Unit, Trees$Literal) [5] +pluginsTyped(Unit, Trees$TypeTree) [1] +pluginsTyped([A](xs: A*)List[A], Trees$Select) [1] +pluginsTyped([T <: Int]=> Int, Trees$Select) [1] +pluginsTyped([T0]()T0, Trees$Select) [1] +pluginsTyped([T](xs: Array[T])scala.collection.mutable.WrappedArray[T], Trees$Select) [1] +pluginsTyped(annotation.type, Trees$Select) [4] +pluginsTyped(math.type, Trees$Select) [9] +pluginsTyped(scala.annotation.Annotation, Trees$Apply) [1] +pluginsTyped(scala.annotation.TypeConstraint, Trees$Select) [4] +pluginsTyped(scala.annotation.TypeConstraint, Trees$TypeTree) [2] +pluginsTyped(scala.collection.immutable.List.type, Trees$Select) [2] +pluginsTyped(scala.collection.immutable.StringOps, Trees$ApplyImplicitView) [2] +pluginsTyped(scala.collection.mutable.WrappedArray[Any], Trees$Apply) [1] +pluginsTyped(str.type, Trees$Ident) [3] +pluginsTyped(testAnn, Trees$Apply) [5] +pluginsTyped(testAnn, Trees$Ident) [5] +pluginsTyped(testAnn, Trees$New) [5] +pluginsTyped(testAnn, Trees$This) [1] +pluginsTyped(testAnn, Trees$TypeTree) [2] +pluginsTyped(testAnn.super.type, Trees$Super) [1] +pluginsTyped(type, Trees$Select) [1] +pluginsTypedReturn(return f, String) [1] diff --git a/tests/pending/run/analyzerPlugins.scala b/tests/pending/run/analyzerPlugins.scala new file mode 100644 index 000000000000..4b297ff2206e --- /dev/null +++ b/tests/pending/run/analyzerPlugins.scala @@ -0,0 +1,123 @@ +import scala.tools.partest._ +import scala.tools.nsc._ + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp" + + def code = """ + class testAnn extends annotation.TypeConstraint + + class A(param: Double) extends { val x: Int = 1; val y = "two" } with AnyRef { + type T = A + + val inferField = ("str": @testAnn) + val annotField: Boolean @testAnn = false + + val lub1 = List('c', (1: Int @testAnn), "") + val lub2 = if (annotField) (1: @testAnn) else 2 + + def foo[T <: Int] = 0 + foo[Int @testAnn] + + var count = 0 + + math.random // some statement + + def method: String = { + math.random + val f = inferField + + def nested(): String = { + if(count == 1) + return f + "huhu" + } + nested() + } + + def this(str: String) { + this(str.toDouble) + math.random + count += 1 + } + } + """.trim + + + def show() { + val global = newCompiler() + import global._ + import analyzer._ + + val output = collection.mutable.ListBuffer[String]() + + object annotChecker extends AnnotationChecker { + def hasTestAnn(tps: Type*) = { + tps exists (_.annotations.map(_.toString) contains "testAnn") + } + + def annotationsConform(tpe1: Type, tpe2: Type): Boolean = { + if (hasTestAnn(tpe1, tpe2)) + output += s"annotationsConform($tpe1, $tpe2)" + true + } + + override def annotationsLub(tp: Type, ts: List[Type]): Type = { + if (hasTestAnn(ts: _*)) + output += s"lub($ts)" + tp + } + + override def adaptBoundsToAnnotations(bounds: List[TypeBounds], tparams: List[Symbol], targs: List[Type]): List[TypeBounds] = { + if (hasTestAnn(targs: _*)) + output += s"adaptBoundsToAnnots($bounds, $tparams, $targs)" + bounds + } + } + + object analyzerPlugin extends AnalyzerPlugin { + def treeClass(t: Tree) = t.getClass.toString.split('.').last + + override def pluginsPt(pt: Type, typer: Typer, tree: Tree, mode: Mode): Type = { + output += s"pluginsPt($pt, ${treeClass(tree)})" + pt + } + + override def pluginsTyped(tpe: Type, typer: Typer, tree: Tree, mode: Mode, pt: Type): Type = { + output += s"pluginsTyped($tpe, ${treeClass(tree)})" + tpe + } + + override def pluginsTypeSig(tpe: Type, typer: Typer, defTree: Tree, pt: Type): Type = { + output += s"pluginsTypeSig(${defTree.symbol}, ${treeClass(defTree)})" + tpe + } + + override def pluginsTypeSigAccessor(tpe: Type, typer: Typer, tree: ValDef, sym: Symbol): Type = { + output += s"pluginsTypeSigAccessor(${tree.symbol})" + tpe + } + + + override def canAdaptAnnotations(tree: Tree, typer: Typer, mode: Mode, pt: Type): Boolean = { + output += s"canAdaptAnnotations(${treeClass(tree)}, $pt)" + false + } + + override def pluginsTypedReturn(tpe: Type, typer: Typer, tree: Return, pt: Type): Type = { + output += s"pluginsTypedReturn($tree, $pt)" + tpe + } + + } + + addAnnotationChecker(annotChecker) + addAnalyzerPlugin(analyzerPlugin) + compileString(global)(code) + + val res = output.groupBy(identity).mapValues(_.size).map { case (k,v) => s"$k [$v]" }.toList.sorted + println(res.mkString("\n")) + } + +} diff --git a/tests/pending/run/annotatedRetyping.check b/tests/pending/run/annotatedRetyping.check new file mode 100644 index 000000000000..b296a805267c --- /dev/null +++ b/tests/pending/run/annotatedRetyping.check @@ -0,0 +1,6 @@ +typing List(1, 2).map(((x) => { + val another = scala.Tuple2(t.nt, t.tr): @testAnn match { + case scala.Tuple2(_, _) => 1 + }; + x +})) diff --git a/tests/pending/run/annotatedRetyping.scala b/tests/pending/run/annotatedRetyping.scala new file mode 100644 index 000000000000..9b9ebd5a1ebd --- /dev/null +++ b/tests/pending/run/annotatedRetyping.scala @@ -0,0 +1,62 @@ +import scala.tools.partest._ +import scala.tools.nsc._ + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp" + + def code = """ + class testAnn extends annotation.Annotation + + object t { + def nt = 1 + def tr = "a" + } + + class Test { + List(1,2).map(x => { + val another = ((t.nt, t.tr): @testAnn) match { case (_, _) => 1 } + x + }) + } + """.trim + + + // point of this test: type-check the "Annotated" tree twice. first time the analyzer plugin types it, + // second time the typer. + + // bug was that typedAnnotated assigned a type to the Annotated tree. The second type check would consider + // the tree as alreadyTyped, which is not cool, the Annotated needs to be transformed into a Typed tree. + + def show() { + val global = newCompiler() + import global._ + import analyzer._ + import collection.{mutable => m} + + object analyzerPlugin extends AnalyzerPlugin { + val templates: m.Map[Symbol, (Template, Typer)] = m.Map() + override def pluginsTypeSig(tpe: Type, typer: Typer, defTree: Tree, pt: Type): Type = { + defTree match { + case impl: Template => + templates += typer.context.owner -> (impl, typer) + + case dd: DefDef if dd.symbol.isPrimaryConstructor && templates.contains(dd.symbol.owner) => + val (impl, templTyper) = templates(dd.symbol.owner) + for (stat <- impl.body.filterNot(_.isDef)) { + println("typing "+ stat) + val statsOwner = impl.symbol orElse templTyper.context.owner.newLocalDummy(impl.pos) + val tpr = analyzer.newTyper(templTyper.context.make(stat, statsOwner)) + tpr.typed(stat) + } + + case _ => + } + tpe + } + } + + addAnalyzerPlugin(analyzerPlugin) + compileString(global)(code) + } +} diff --git a/tests/pending/run/applydynamic_sip.check b/tests/pending/run/applydynamic_sip.check new file mode 100644 index 000000000000..6d04dc45245f --- /dev/null +++ b/tests/pending/run/applydynamic_sip.check @@ -0,0 +1,29 @@ +qual.applyDynamic(sel)() +qual.applyDynamic(sel)(a) +qual.applyDynamic(sel)(a) +.apply(a2) +qual.applyDynamic(sel)(a) +qual.applyDynamic(sel)(a) +.apply(a2) +qual.applyDynamicNamed(sel)((arg,a)) +qual.applyDynamicNamed(sel)((arg,a)) +qual.applyDynamicNamed(sel)((,a), (arg2,a2)) +qual.updateDynamic(sel)(expr) +qual.selectDynamic(sel) +qual.selectDynamic(sel) +qual.selectDynamic(sel) +.update(1, expr) +qual.selectDynamic(sel) +.update(expr) +qual.selectDynamic(sel) +.apply(1) +qual.selectDynamic(sel) +.apply +.update(1, 1) +qual.applyDynamic(apply)(a) +qual.applyDynamic(apply)(a) +qual.applyDynamic(apply)(a) +qual.applyDynamic(apply)(a) +qual.applyDynamicNamed(apply)((arg,a)) +qual.applyDynamicNamed(apply)((,a), (arg2,a2)) +qual.applyDynamic(update)(a, a2) diff --git a/tests/pending/run/applydynamic_sip.flags b/tests/pending/run/applydynamic_sip.flags new file mode 100644 index 000000000000..ba6d37305e99 --- /dev/null +++ b/tests/pending/run/applydynamic_sip.flags @@ -0,0 +1,2 @@ +-Yrangepos:false +-language:dynamics diff --git a/tests/pending/run/applydynamic_sip.scala b/tests/pending/run/applydynamic_sip.scala new file mode 100644 index 000000000000..a163ab960771 --- /dev/null +++ b/tests/pending/run/applydynamic_sip.scala @@ -0,0 +1,66 @@ +object Test extends dotty.runtime.LegacyApp { + object stubUpdate { + def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")")) + } + + object stub { + def apply = {println(".apply"); stubUpdate} + def apply(as: Any*) = println(".apply"+as.toList.mkString("(",", ", ")")) + def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")")) + } + class MyDynamic extends Dynamic { + def applyDynamic[T](n: String)(as: Any*) = {println("qual.applyDynamic("+ n +")"+ as.toList.mkString("(",", ", ")")); stub} + def applyDynamicNamed[T](n: String)(as: (String, Any)*) = {println("qual.applyDynamicNamed("+ n +")"+ as.toList.mkString("(",", ", ")")); stub} + def selectDynamic[T](n: String) = {println("qual.selectDynamic("+ n +")"); stub} + def updateDynamic(n: String)(x: Any): Unit = {println("qual.updateDynamic("+ n +")("+ x +")")} + } + val qual = new MyDynamic + val expr = "expr" + val a = "a" + val a2 = "a2" + type T = String + + // If qual.sel is followed by a potential type argument list [Ts] and an argument list (arg1, …, argn) where none of the arguments argi are named: + // qual.applyDynamic(“sel”)(arg1, …, argn) + qual.sel() + qual.sel(a) + // qual.sel(a, a2: _*) -- should not accept varargs? + qual.sel(a)(a2) + qual.sel[T](a) + qual.sel[T](a)(a2) + + // If qual.sel is followed by a potential type argument list [Ts] + // and a non-empty named argument list (x1 = arg1, …, xn = argn) where some name prefixes xi = might be missing: + // qual.applyDynamicNamed(“sel”)(xs1 -> arg1, …, xsn -> argn) + qual.sel(arg = a) + qual.sel[T](arg = a) + qual.sel(a, arg2 = "a2") + // qual.sel(a)(a2, arg2 = "a2") + // qual.sel[T](a)(a2, arg2 = "a2") + // qual.sel(arg = a, a2: _*) + // qual.sel(arg, arg2 = "a2", a2: _*) + + // If qual.sel appears immediately on the left-hand side of an assigment + // qual.updateDynamic(“sel”)(expr) + qual.sel = expr + + // If qual.sel, possibly applied to type arguments, but is + // not applied to explicit value arguments, + // nor immediately followed by an assignment operator: + // qual.selectDynamic[Ts](“sel”) + qual.sel + qual.sel[T] + + qual.sel(1) = expr // parser turns this into qual.sel.update(1, expr) + qual.sel() = expr // parser turns this into qual.sel.update(expr) + qual.sel.apply(1) + qual.sel.apply(1) = 1 + + qual.apply(a) + qual.apply[String](a) + qual(a) + qual[String](a) + qual[T](arg = a) + qual(a, arg2 = "a2") + qual(a) = a2 +} diff --git a/tests/pending/run/array-addition.check b/tests/pending/run/array-addition.check new file mode 100644 index 000000000000..7bfbd9c7114b --- /dev/null +++ b/tests/pending/run/array-addition.check @@ -0,0 +1,4 @@ +Array(1, 2, 3, 4) +Array(1, 2, 3, 4) +Array(1) +Array(1) diff --git a/tests/pending/run/array-addition.scala b/tests/pending/run/array-addition.scala new file mode 100644 index 000000000000..8def48e85cd4 --- /dev/null +++ b/tests/pending/run/array-addition.scala @@ -0,0 +1,11 @@ +object Test { + def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")") + + def main(args: Array[String]): Unit = { + prettyPrintArray(Array(1,2,3) :+ 4) + prettyPrintArray(1 +: Array(2,3,4)) + prettyPrintArray(Array() :+ 1) + prettyPrintArray(1 +: Array()) + } +} + diff --git a/tests/pending/run/array-charSeq.check b/tests/pending/run/array-charSeq.check new file mode 100644 index 000000000000..f1f374f63ec5 --- /dev/null +++ b/tests/pending/run/array-charSeq.check @@ -0,0 +1,248 @@ + +[check 'abcdefghi'] len = 9 +sub(0, 9) == 'abcdefghi' +sub(0, 0) == '' +sub(1, 9) == 'bcdefghi' +sub(0, 1) == 'a' +sub(2, 9) == 'cdefghi' +sub(0, 2) == 'ab' +sub(3, 9) == 'defghi' +sub(0, 3) == 'abc' +sub(4, 9) == 'efghi' +sub(0, 4) == 'abcd' +sub(5, 9) == 'fghi' +sub(0, 5) == 'abcde' +sub(6, 9) == 'ghi' +sub(0, 6) == 'abcdef' +sub(7, 9) == 'hi' +sub(0, 7) == 'abcdefg' +sub(8, 9) == 'i' +sub(0, 8) == 'abcdefgh' + +[check 'bcdefgh'] len = 7 +sub(0, 7) == 'bcdefgh' +sub(0, 0) == '' +sub(1, 7) == 'cdefgh' +sub(0, 1) == 'b' +sub(2, 7) == 'defgh' +sub(0, 2) == 'bc' +sub(3, 7) == 'efgh' +sub(0, 3) == 'bcd' +sub(4, 7) == 'fgh' +sub(0, 4) == 'bcde' +sub(5, 7) == 'gh' +sub(0, 5) == 'bcdef' +sub(6, 7) == 'h' +sub(0, 6) == 'bcdefg' + +[check 'cdefg'] len = 5 +sub(0, 5) == 'cdefg' +sub(0, 0) == '' +sub(1, 5) == 'defg' +sub(0, 1) == 'c' +sub(2, 5) == 'efg' +sub(0, 2) == 'cd' +sub(3, 5) == 'fg' +sub(0, 3) == 'cde' +sub(4, 5) == 'g' +sub(0, 4) == 'cdef' + +[check 'def'] len = 3 +sub(0, 3) == 'def' +sub(0, 0) == '' +sub(1, 3) == 'ef' +sub(0, 1) == 'd' +sub(2, 3) == 'f' +sub(0, 2) == 'de' + +[check 'e'] len = 1 +sub(0, 1) == 'e' +sub(0, 0) == '' + +[check 'abcdefgh'] len = 8 +sub(0, 8) == 'abcdefgh' +sub(0, 0) == '' +sub(1, 8) == 'bcdefgh' +sub(0, 1) == 'a' +sub(2, 8) == 'cdefgh' +sub(0, 2) == 'ab' +sub(3, 8) == 'defgh' +sub(0, 3) == 'abc' +sub(4, 8) == 'efgh' +sub(0, 4) == 'abcd' +sub(5, 8) == 'fgh' +sub(0, 5) == 'abcde' +sub(6, 8) == 'gh' +sub(0, 6) == 'abcdef' +sub(7, 8) == 'h' +sub(0, 7) == 'abcdefg' + +[check 'bcdefg'] len = 6 +sub(0, 6) == 'bcdefg' +sub(0, 0) == '' +sub(1, 6) == 'cdefg' +sub(0, 1) == 'b' +sub(2, 6) == 'defg' +sub(0, 2) == 'bc' +sub(3, 6) == 'efg' +sub(0, 3) == 'bcd' +sub(4, 6) == 'fg' +sub(0, 4) == 'bcde' +sub(5, 6) == 'g' +sub(0, 5) == 'bcdef' + +[check 'cdef'] len = 4 +sub(0, 4) == 'cdef' +sub(0, 0) == '' +sub(1, 4) == 'def' +sub(0, 1) == 'c' +sub(2, 4) == 'ef' +sub(0, 2) == 'cd' +sub(3, 4) == 'f' +sub(0, 3) == 'cde' + +[check 'de'] len = 2 +sub(0, 2) == 'de' +sub(0, 0) == '' +sub(1, 2) == 'e' +sub(0, 1) == 'd' + +[check ''] len = 0 + +[check 'abcdefg'] len = 7 +sub(0, 7) == 'abcdefg' +sub(0, 0) == '' +sub(1, 7) == 'bcdefg' +sub(0, 1) == 'a' +sub(2, 7) == 'cdefg' +sub(0, 2) == 'ab' +sub(3, 7) == 'defg' +sub(0, 3) == 'abc' +sub(4, 7) == 'efg' +sub(0, 4) == 'abcd' +sub(5, 7) == 'fg' +sub(0, 5) == 'abcde' +sub(6, 7) == 'g' +sub(0, 6) == 'abcdef' + +[check 'bcdef'] len = 5 +sub(0, 5) == 'bcdef' +sub(0, 0) == '' +sub(1, 5) == 'cdef' +sub(0, 1) == 'b' +sub(2, 5) == 'def' +sub(0, 2) == 'bc' +sub(3, 5) == 'ef' +sub(0, 3) == 'bcd' +sub(4, 5) == 'f' +sub(0, 4) == 'bcde' + +[check 'cde'] len = 3 +sub(0, 3) == 'cde' +sub(0, 0) == '' +sub(1, 3) == 'de' +sub(0, 1) == 'c' +sub(2, 3) == 'e' +sub(0, 2) == 'cd' + +[check 'd'] len = 1 +sub(0, 1) == 'd' +sub(0, 0) == '' + +[check 'abcdef'] len = 6 +sub(0, 6) == 'abcdef' +sub(0, 0) == '' +sub(1, 6) == 'bcdef' +sub(0, 1) == 'a' +sub(2, 6) == 'cdef' +sub(0, 2) == 'ab' +sub(3, 6) == 'def' +sub(0, 3) == 'abc' +sub(4, 6) == 'ef' +sub(0, 4) == 'abcd' +sub(5, 6) == 'f' +sub(0, 5) == 'abcde' + +[check 'bcde'] len = 4 +sub(0, 4) == 'bcde' +sub(0, 0) == '' +sub(1, 4) == 'cde' +sub(0, 1) == 'b' +sub(2, 4) == 'de' +sub(0, 2) == 'bc' +sub(3, 4) == 'e' +sub(0, 3) == 'bcd' + +[check 'cd'] len = 2 +sub(0, 2) == 'cd' +sub(0, 0) == '' +sub(1, 2) == 'd' +sub(0, 1) == 'c' + +[check ''] len = 0 + +[check 'abcde'] len = 5 +sub(0, 5) == 'abcde' +sub(0, 0) == '' +sub(1, 5) == 'bcde' +sub(0, 1) == 'a' +sub(2, 5) == 'cde' +sub(0, 2) == 'ab' +sub(3, 5) == 'de' +sub(0, 3) == 'abc' +sub(4, 5) == 'e' +sub(0, 4) == 'abcd' + +[check 'bcd'] len = 3 +sub(0, 3) == 'bcd' +sub(0, 0) == '' +sub(1, 3) == 'cd' +sub(0, 1) == 'b' +sub(2, 3) == 'd' +sub(0, 2) == 'bc' + +[check 'c'] len = 1 +sub(0, 1) == 'c' +sub(0, 0) == '' + +[check 'abcd'] len = 4 +sub(0, 4) == 'abcd' +sub(0, 0) == '' +sub(1, 4) == 'bcd' +sub(0, 1) == 'a' +sub(2, 4) == 'cd' +sub(0, 2) == 'ab' +sub(3, 4) == 'd' +sub(0, 3) == 'abc' + +[check 'bc'] len = 2 +sub(0, 2) == 'bc' +sub(0, 0) == '' +sub(1, 2) == 'c' +sub(0, 1) == 'b' + +[check ''] len = 0 + +[check 'abc'] len = 3 +sub(0, 3) == 'abc' +sub(0, 0) == '' +sub(1, 3) == 'bc' +sub(0, 1) == 'a' +sub(2, 3) == 'c' +sub(0, 2) == 'ab' + +[check 'b'] len = 1 +sub(0, 1) == 'b' +sub(0, 0) == '' + +[check 'ab'] len = 2 +sub(0, 2) == 'ab' +sub(0, 0) == '' +sub(1, 2) == 'b' +sub(0, 1) == 'a' + +[check ''] len = 0 + +[check 'a'] len = 1 +sub(0, 1) == 'a' +sub(0, 0) == '' diff --git a/tests/pending/run/array-charSeq.scala b/tests/pending/run/array-charSeq.scala new file mode 100644 index 000000000000..64055c6406ba --- /dev/null +++ b/tests/pending/run/array-charSeq.scala @@ -0,0 +1,28 @@ +object Test { + val arr = Array[Char]('a' to 'i': _*) + var xs: CharSequence = arr + val hash = xs.hashCode + + def check(chars: CharSequence): Unit = { + println("\n[check '" + chars + "'] len = " + chars.length) + chars match { + case x: Predef.ArrayCharSequence => assert(x.__arrayOfChars eq arr, ((x.__arrayOfChars, arr))) + case x: runtime.ArrayCharSequence => assert(x.xs eq arr, ((x.xs, arr))) + case x => assert(false, x) + } + + 0 until chars.length foreach { i => + println("sub(%s, %s) == '%s'".format(i, chars.length, chars.subSequence(i, chars.length))) + println("sub(%s, %s) == '%s'".format(0, i, chars.subSequence(0, i))) + } + if (chars.length >= 2) + check(chars.subSequence(1, chars.length - 1)) + } + + def main(args: Array[String]): Unit = { + while (xs.length > 0) { + check(xs) + xs = xs.subSequence(0, xs.length - 1) + } + } +} diff --git a/tests/pending/run/array-existential-bound.check b/tests/pending/run/array-existential-bound.check new file mode 100644 index 000000000000..f5cca843e30c --- /dev/null +++ b/tests/pending/run/array-existential-bound.check @@ -0,0 +1,4 @@ +2 +1000 +1000 +26 diff --git a/tests/pending/run/array-existential-bound.scala b/tests/pending/run/array-existential-bound.scala new file mode 100644 index 000000000000..cc105d8fcdd2 --- /dev/null +++ b/tests/pending/run/array-existential-bound.scala @@ -0,0 +1,17 @@ +trait Fooz[Q <: Array[_]] { + def f0(x: Q) = x.length +} + +object Test extends Fooz[Array[Int]] { + val f1 = new Fooz[Array[String]] { } + val f2 = new Fooz[Array[Int]] { } + val f3 = new Fooz[Array[Any]] { } + val f4 = new Fooz[Array[_]] { } + + def main(args: Array[String]): Unit = { + println(f1.f0(Array[String]("a", "b"))) + println(f2.f0((1 to 1000).toArray)) + println(f3.f0((1 to 1000).toArray[Any])) + println(f4.f0(('a' to 'z').toArray)) + } +} diff --git a/tests/pending/run/arrayclone-new.scala b/tests/pending/run/arrayclone-new.scala new file mode 100644 index 000000000000..5f09cd73a1e4 --- /dev/null +++ b/tests/pending/run/arrayclone-new.scala @@ -0,0 +1,108 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp{ + BooleanArrayClone; + ByteArrayClone; + ShortArrayClone; + CharArrayClone; + IntArrayClone; + LongArrayClone; + FloatArrayClone; + DoubleArrayClone; + ObjectArrayClone; + PolymorphicArrayClone; +} + +object BooleanArrayClone{ + val it : Array[Boolean] = Array(true, false); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = false; + assert(it(0) == true) +} + +object ByteArrayClone{ + val it : Array[Byte] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object ShortArrayClone{ + val it : Array[Short] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object CharArrayClone{ + val it : Array[Char] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object IntArrayClone{ + val it : Array[Int] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object LongArrayClone{ + val it : Array[Long] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object FloatArrayClone{ + val it : Array[Float] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object DoubleArrayClone{ + val it : Array[Double] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object ObjectArrayClone{ + val it : Array[String] = Array("1", "0"); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = "0"; + assert(it(0) == "1") +} + +object PolymorphicArrayClone{ + def testIt[T](it : Array[T], one : T, zero : T) = { + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = zero; + assert(it(0) == one) + } + + testIt(Array("one", "two"), "one", "two"); + + class Mangler[T: ClassTag](ts : T*){ + // this will always be a BoxedAnyArray even after we've unboxed its contents. + val it = ts.toArray[T]; + } + + val mangled = new Mangler[Int](0, 1); + + val y : Array[Int] = mangled.it; // make sure it's unboxed + + testIt(mangled.it, 0, 1); +} diff --git a/tests/pending/run/arrayclone-old.scala b/tests/pending/run/arrayclone-old.scala new file mode 100644 index 000000000000..d216e36f26df --- /dev/null +++ b/tests/pending/run/arrayclone-old.scala @@ -0,0 +1,106 @@ +object Test extends dotty.runtime.LegacyApp{ + BooleanArrayClone; + ByteArrayClone; + ShortArrayClone; + CharArrayClone; + IntArrayClone; + LongArrayClone; + FloatArrayClone; + DoubleArrayClone; + ObjectArrayClone; + PolymorphicArrayClone; +} + +object BooleanArrayClone{ + val it : Array[Boolean] = Array(true, false); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = false; + assert(it(0) == true) +} + +object ByteArrayClone{ + val it : Array[Byte] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object ShortArrayClone{ + val it : Array[Short] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object CharArrayClone{ + val it : Array[Char] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object IntArrayClone{ + val it : Array[Int] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object LongArrayClone{ + val it : Array[Long] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object FloatArrayClone{ + val it : Array[Float] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object DoubleArrayClone{ + val it : Array[Double] = Array(1, 0); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = 0; + assert(it(0) == 1) +} + +object ObjectArrayClone{ + val it : Array[String] = Array("1", "0"); + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = "0"; + assert(it(0) == "1") +} + +object PolymorphicArrayClone{ + def testIt[T](it : Array[T], one : T, zero : T) = { + val cloned = it.clone(); + assert(cloned.sameElements(it)); + cloned(0) = zero; + assert(it(0) == one) + } + + testIt(Array("one", "two"), "one", "two"); + + class Mangler[T: Manifest](ts : T*){ + // this will always be a BoxedAnyArray even after we've unboxed its contents. + val it = ts.toArray[T]; + } + + val mangled = new Mangler[Int](0, 1); + + val y : Array[Int] = mangled.it; // make sure it's unboxed + + testIt(mangled.it, 0, 1); +} diff --git a/tests/pending/run/arraycopy.scala b/tests/pending/run/arraycopy.scala new file mode 100644 index 000000000000..77a8809a13e8 --- /dev/null +++ b/tests/pending/run/arraycopy.scala @@ -0,0 +1,31 @@ + + +object Test { + def main(args: Array[String]): Unit = { + val a = new Array[Int](10) + val b = new Array[Any](10) + for (i <- 0 until 10) b(i) = i + + Array.copy(b, 3, a, 3, 7) + assert(a.toSeq == List(0, 0, 0, 3, 4, 5, 6, 7, 8, 9)) + } +} + + + + + + + + + + + + + + + + + + + diff --git a/tests/pending/run/arrays.check b/tests/pending/run/arrays.check new file mode 100644 index 000000000000..c9a3a87268ef --- /dev/null +++ b/tests/pending/run/arrays.check @@ -0,0 +1,7 @@ +arrays.scala:248: warning: comparing values of types Unit and Unit using `==' will always yield true + check(xs(0) == u0, xs(0), u0); + ^ +arrays.scala:249: warning: comparing values of types Unit and Unit using `==' will always yield true + check(xs(1) == u1, xs(1), u1); + ^ +checks: 2302 diff --git a/tests/pending/run/arrays.scala b/tests/pending/run/arrays.scala new file mode 100644 index 000000000000..1a77a191cbcf --- /dev/null +++ b/tests/pending/run/arrays.scala @@ -0,0 +1,937 @@ +//############################################################################ +// Arrays +//############################################################################ + +//############################################################################ + +object Test { + + //########################################################################## + // Types + + type Strings = List[String] + type Map = scala.collection.Map[Int, Any] + type HashMap = scala.collection.mutable.HashMap[Int, Any] + type TreeMap = scala.collection.immutable.TreeMap[Int, Any] + + //########################################################################## + // Identity Functions + + def id_Ta_T[T <: Any ](x: T): T = x; + def id_Tr_T[T <: AnyRef ](x: T): T = x; + def id_To_T[T <: Object ](x: T): T = x; + + def id_Ta_a[T <: Any ](x: T): Any = x; + def id_Tr_a[T <: AnyRef ](x: T): Any = x; + def id_To_a[T <: Object ](x: T): Any = x; + + def id_Tr_r[T <: AnyRef ](x: T): AnyRef = x; + def id_To_r[T <: Object ](x: T): AnyRef = x; + + def id_To_o[T <: Object ](x: T): Object = x; + + def id_TSa_T [S <: Any , T <: Array[S]](x: T): T = x; + def id_TSv_T [S <: AnyVal , T <: Array[S]](x: T): T = x; + def id_TSr_T [S <: AnyRef , T <: Array[S]](x: T): T = x; + def id_TSo_T [S <: Object , T <: Array[S]](x: T): T = x; + def id_TSm_T [S <: Map , T <: Array[S]](x: T): T = x; + def id_TSn_T [S <: Strings, T <: Array[S]](x: T): T = x; + + def id_TSa_Ss[S <: Any , T <: Array[S]](x: T): Array[S] = x; + def id_TSv_Ss[S <: AnyVal , T <: Array[S]](x: T): Array[S] = x; + def id_TSr_Ss[S <: AnyRef , T <: Array[S]](x: T): Array[S] = x; + def id_TSo_Ss[S <: Object , T <: Array[S]](x: T): Array[S] = x; + def id_TSm_Ss[S <: Map , T <: Array[S]](x: T): Array[S] = x; + def id_TSn_Ss[S <: Strings, T <: Array[S]](x: T): Array[S] = x; + + def id_TSa_a [S <: Any , T <: Array[S]](x: T): Any = x; + def id_TSv_a [S <: AnyVal , T <: Array[S]](x: T): Any = x; + def id_TSr_a [S <: AnyRef , T <: Array[S]](x: T): Any = x; + def id_TSo_a [S <: Object , T <: Array[S]](x: T): Any = x; + def id_TSm_a [S <: Map , T <: Array[S]](x: T): Any = x; + def id_TSn_a [S <: Strings, T <: Array[S]](x: T): Any = x; + + def id_TSa_r [S <: Any , T <: Array[S]](x: T): AnyRef = x; + def id_TSv_r [S <: AnyVal , T <: Array[S]](x: T): AnyRef = x; + def id_TSr_r [S <: AnyRef , T <: Array[S]](x: T): AnyRef = x; + def id_TSo_r [S <: Object , T <: Array[S]](x: T): AnyRef = x; + def id_TSm_r [S <: Map , T <: Array[S]](x: T): AnyRef = x; + def id_TSn_r [S <: Strings, T <: Array[S]](x: T): AnyRef = x; + + def id_TSa_o [S <: Any , T <: Array[S]](x: T): Object = x; + def id_TSv_o [S <: AnyVal , T <: Array[S]](x: T): Object = x; + def id_TSr_o [S <: AnyRef , T <: Array[S]](x: T): Object = x; + def id_TSo_o [S <: Object , T <: Array[S]](x: T): Object = x; + def id_TSm_o [S <: Map , T <: Array[S]](x: T): Object = x; + def id_TSn_o [S <: Strings, T <: Array[S]](x: T): Object = x; + + def id_Sas_Ss[S <: Any ](xs: Array[S]): Array[S] = xs; + def id_Svs_Ss[S <: AnyVal ](xs: Array[S]): Array[S] = xs; + def id_Srs_Ss[S <: AnyRef ](xs: Array[S]): Array[S] = xs; + def id_Sos_Ss[S <: Object ](xs: Array[S]): Array[S] = xs; + def id_Sms_Ss[S <: Map ](xs: Array[S]): Array[S] = xs; + def id_Sns_Ss[S <: Strings](xs: Array[S]): Array[S] = xs; + + def id_Sas_a [S <: Any ](xs: Array[S]): Any = xs; + def id_Svs_a [S <: AnyVal ](xs: Array[S]): Any = xs; + def id_Srs_a [S <: AnyRef ](xs: Array[S]): Any = xs; + def id_Sos_a [S <: Object ](xs: Array[S]): Any = xs; + def id_Sms_a [S <: Map ](xs: Array[S]): Any = xs; + def id_Sns_a [S <: Strings](xs: Array[S]): Any = xs; + + def id_Sas_r [S <: Any ](xs: Array[S]): AnyRef = xs; + def id_Svs_r [S <: AnyVal ](xs: Array[S]): AnyRef = xs; + def id_Srs_r [S <: AnyRef ](xs: Array[S]): AnyRef = xs; + def id_Sos_r [S <: Object ](xs: Array[S]): AnyRef = xs; + def id_Sms_r [S <: Map ](xs: Array[S]): AnyRef = xs; + def id_Sns_r [S <: Strings](xs: Array[S]): AnyRef = xs; + + def id_Sas_o [S <: Any ](xs: Array[S]): Object = xs; + def id_Svs_o [S <: AnyVal ](xs: Array[S]): Object = xs; + def id_Srs_o [S <: AnyRef ](xs: Array[S]): Object = xs; + def id_Sos_o [S <: Object ](xs: Array[S]): Object = xs; + def id_Sms_o [S <: Map ](xs: Array[S]): Object = xs; + def id_Sns_o [S <: Strings](xs: Array[S]): Object = xs; + + //########################################################################## + // Generic Checks + + type Check[T] = Array[T] => Unit; + + var checks: Int = 0; + + def check(test0: Boolean, actual: Any, expected: Any): Unit = { + val test1: Boolean = actual == expected; + if (!test0 || !test1) { + val s0 = if (test0) "ok" else "KO"; + val s1 = if (test1) "ok" else "KO"; + val s2 = actual.toString(); + val s3 = expected.toString(); + sys.error(s0 + " - " + s1 + ": " + s2 + " != " + s3); + } + checks += 1 + } + + def check_Ta[T <: Any ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l); + check(xs(0) == x0, xs(0), x0); + c(xs); + } + + def check_Tv[T <: AnyVal ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l); + check(xs(0) == x0, xs(0), x0); + check_Ta(xs, l, x0, c); + c(xs); + } + + def check_Tr[T <: AnyRef ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l); + check(xs(0) == x0, xs(0), x0); + check_Ta(xs, l, x0, c); + c(xs); + } + + def check_To[T <: Object ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l); + check(xs(0) == x0, xs(0), x0); + check_Ta(xs, l, x0, c); + check_Tr(xs, l, x0, c); + c(xs); + } + + def check_Tm[T <: Map ](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l) + check(xs(0) == x0, xs(0), x0) + check_Ta(xs, l, x0, c) + check_Tr(xs, l, x0, c) + check_To(xs, l, x0, c) + c(xs) + } + + def check_Tn[T <: Strings](xs: Array[T], l: Int, x0: T, c: Check[T]): Unit = { + check(xs.length == l, xs.length, l) + check(xs(0) == x0, xs(0), x0) + check_Ta(xs, l, x0, c) + check_Tr(xs, l, x0, c) + check_To(xs, l, x0, c) + c(xs) + } + + def checkT2368(): Unit = { + val arr = Array(1, 2, 3) + arr(0) += 1 + assert(arr(0) == 2) + } + + //########################################################################## + // Values + + val u0: Unit = (); + val u1: Unit = (); + + val z0: Boolean = false; + val z1: Boolean = true; + + val b0: Byte = Byte.MinValue; + val b1: Byte = 1; + val b2: Byte = Byte.MaxValue; + + val s0: Short = Short.MinValue; + val s1: Short = 2; + val s2: Short = Short.MaxValue; + + val c0: Char = Char.MinValue; + val c1: Char = '3'; + val c2: Char = Char.MaxValue; + + val i0: Int = Int.MinValue; + val i1: Int = 4; + val i2: Int = Int.MinValue; + + val l0: Long = Long.MinValue; + val l1: Int = 5; + val l2: Long = Long.MaxValue; + + val f0: Float = Float.MinValue; + val f1: Int = 6; + val f2: Float = Float.MaxValue; + + val d0: Double = Double.MinValue; + val d1: Int = 7; + val d2: Double = Double.MaxValue; + + val a0: Unit = (); + val a1: Boolean = false; + val a2: Int = 0; + val a3: Null = null; + val a4: String = "a-z"; + val a5: Symbol = 'token; + val a6: HashMap = new HashMap(); + val a7: TreeMap = scala.collection.immutable.TreeMap.empty[Int, Any]; + val a8: Strings = List("a", "z"); + + val v0: Unit = (); + val v1: Boolean = false; + val v2: Int = 0; + val v3: Long = l2; + val v4: Float = f2; + val v5: Double = d2; + + val r0: Null = a3; + val r1: String = a4; + val r2: Symbol = a5; + val r3: HashMap = a6; + val r4: TreeMap = a7; + val r5: Strings = a8; + + val o0: Null = r0; + val o1: String = r1; + val o2: Symbol = r2; + val o3: HashMap = r3; + val o4: TreeMap = r4; + val o5: Strings = r5; + + val m0: Null = r0; + val m1: HashMap = r3; + val m2: TreeMap = r4; + + val n0: Null = r0; + val n1: Strings = r5; + val n2: Nil.type= Nil; + + //########################################################################## + // Specific Checks + + def ucheck(xs: Array[Unit ]): Unit = { + check(xs.length == 2, xs.length, 2); + check(xs(0) == u0, xs(0), u0); + check(xs(1) == u1, xs(1), u1); + } + + def zcheck(xs: Array[Boolean]): Unit = { + check(xs.length == 2, xs.length, 2); + check(xs(0) == z0, xs(0), z0); + check(xs(1) == z1, xs(1), z1); + } + + def bcheck(xs: Array[Byte ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == b0, xs(0), b0); + check(xs(1) == b1, xs(1), b1); + check(xs(2) == b2, xs(2), b2); + } + + def scheck(xs: Array[Short ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == s0, xs(0), s0); + check(xs(1) == s1, xs(1), s1); + check(xs(2) == s2, xs(2), s2); + } + + def ccheck(xs: Array[Char ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == c0, xs(0), c0); + check(xs(1) == c1, xs(1), c1); + check(xs(2) == c2, xs(2), c2); + } + + def icheck(xs: Array[Int ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == i0, xs(0), i0); + check(xs(1) == i1, xs(1), i1); + check(xs(2) == i2, xs(2), i2); + } + + def lcheck(xs: Array[Long ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == l0, xs(0), l0); + check(xs(1) == l1, xs(1), l1: Long); // !!! : Long + check(xs(2) == l2, xs(2), l2); + } + + def fcheck(xs: Array[Float ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == f0, xs(0), f0); + check(xs(1) == f1, xs(1), f1: Float); // !!! : Float + check(xs(2) == f2, xs(2), f2); + } + + def dcheck(xs: Array[Double ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == d0, xs(0), d0); + check(xs(1) == d1, xs(1), d1: Double); // !!! : Double + check(xs(2) == d2, xs(2), d2); + } + + def rcheck(xs: Array[AnyRef ]): Unit = { + check(xs.length == 6, xs.length, 6); + check(xs(0) == r0, xs(0), r0); + check(xs(1) == r1, xs(1), r1); + check(xs(2) == r2, xs(2), r2); + check(xs(3) == r3, xs(3), r3); + check(xs(4) == r4, xs(4), r4); + check(xs(5) == r5, xs(5), r5); + } + + def ocheck(xs: Array[Object ]): Unit = { + check(xs.length == 6, xs.length, 6); + check(xs(0) == o0, xs(0), o0); + check(xs(1) == o1, xs(1), o1); + check(xs(2) == o2, xs(2), o2); + check(xs(3) == o3, xs(3), o3); + check(xs(4) == o4, xs(4), o4); + check(xs(5) == o5, xs(5), o5); + } + + def mcheck(xs: Array[Map ]): Unit = { + check(xs.length == 3, xs.length, 3); + check(xs(0) == m0, xs(0), m0); + check(xs(1) == m1, xs(1), m1); + check(xs(2) == m2, xs(2), m2); + } + + def ncheck(xs: Array[Strings]): Unit = { + check(xs.length == 3, xs.length, 3) + check(xs(0) == n0, xs(0), n0) + check(xs(1) == n1, xs(1), n1) + check(xs(2) == n2, xs(2), n2) + } + + //########################################################################## + // Miscellaneous checks + + def checkZip: Unit = { + val zipped = Array("a", "b", "c").zip(Array(1, 2)) + val expected = Array(("a",1), ("b",2)) + check(zipped sameElements expected, zipped.toList, expected.toList) + } + + def checkConcat: Unit = { // ticket #713 + val x1 = Array.concat(Array(1, 2), Array(3, 4)) + val y1 = Array(1, 2, 3, 4) + check(x1 sameElements y1, x1.toList, y1.toList) + } + + //########################################################################## + // Arrays + + val uarray: Array[Unit ] = Array(u0, u1); + val zarray: Array[Boolean] = Array(z0, z1); + val barray: Array[Byte ] = Array(b0, b1, b2); + val sarray: Array[Short ] = Array(s0, s1, s2); + val carray: Array[Char ] = Array(c0, c1, c2); + val iarray: Array[Int ] = Array(i0, i1, i2); + val larray: Array[Long ] = Array(l0, l1, l2); + val farray: Array[Float ] = Array(f0, f1, f2); + val darray: Array[Double ] = Array(d0, d1, d2); + val rarray: Array[AnyRef ] = Array(r0, r1, r2, r4, r4, r5); + val oarray: Array[Object ] = Array(o0, o1, o2, o4, o4, o5); + val marray: Array[Map ] = Array(m0, m1, m2); + val narray: Array[Strings] = Array(n0, n1, n2); + + //########################################################################## + // Main + + def main(args: Array[String]): Unit = { + + //###################################################################### + + ucheck(uarray); + zcheck(zarray); + bcheck(barray); + scheck(sarray); + ccheck(carray); + icheck(iarray); + lcheck(larray); + fcheck(farray); + dcheck(darray); + rcheck(rarray); + ocheck(oarray); + mcheck(marray); + ncheck(narray); + + //###################################################################### + + ucheck(id_Ta_T(uarray)); + zcheck(id_Ta_T(zarray)); + bcheck(id_Ta_T(barray)); + scheck(id_Ta_T(sarray)); + ccheck(id_Ta_T(carray)); + icheck(id_Ta_T(iarray)); + lcheck(id_Ta_T(larray)); + fcheck(id_Ta_T(farray)); + dcheck(id_Ta_T(darray)); + rcheck(id_Ta_T(rarray)); + ocheck(id_Ta_T(oarray)); + mcheck(id_Ta_T(marray)); + ncheck(id_Ta_T(narray)); + + ucheck(id_Tr_T(uarray)); + zcheck(id_Tr_T(zarray)); + bcheck(id_Tr_T(barray)); + scheck(id_Tr_T(sarray)); + ccheck(id_Tr_T(carray)); + icheck(id_Tr_T(iarray)); + lcheck(id_Tr_T(larray)); + fcheck(id_Tr_T(farray)); + dcheck(id_Tr_T(darray)); + rcheck(id_Tr_T(rarray)); + ocheck(id_Tr_T(oarray)); + mcheck(id_Tr_T(marray)); + ncheck(id_Tr_T(narray)); + + ucheck(id_To_T(uarray)); + zcheck(id_To_T(zarray)); + bcheck(id_To_T(barray)); + scheck(id_To_T(sarray)); + ccheck(id_To_T(carray)); + icheck(id_To_T(iarray)); + lcheck(id_To_T(larray)); + fcheck(id_To_T(farray)); + dcheck(id_To_T(darray)); + rcheck(id_To_T(rarray)); + ocheck(id_To_T(oarray)); + mcheck(id_To_T(marray)); + ncheck(id_To_T(narray)); + + ucheck(id_Ta_a(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_Ta_a(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_Ta_a(barray).asInstanceOf[Array[Byte ]]); + scheck(id_Ta_a(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_Ta_a(carray).asInstanceOf[Array[Char ]]); + icheck(id_Ta_a(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_Ta_a(larray).asInstanceOf[Array[Long ]]); + fcheck(id_Ta_a(farray).asInstanceOf[Array[Float ]]); + dcheck(id_Ta_a(darray).asInstanceOf[Array[Double ]]); + rcheck(id_Ta_a(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_Ta_a(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_Ta_a(marray).asInstanceOf[Array[Map ]]); + ncheck(id_Ta_a(narray).asInstanceOf[Array[Strings]]); + + ucheck(id_Tr_a(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_Tr_a(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_Tr_a(barray).asInstanceOf[Array[Byte ]]); + scheck(id_Tr_a(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_Tr_a(carray).asInstanceOf[Array[Char ]]); + icheck(id_Tr_a(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_Tr_a(larray).asInstanceOf[Array[Long ]]); + fcheck(id_Tr_a(farray).asInstanceOf[Array[Float ]]); + dcheck(id_Tr_a(darray).asInstanceOf[Array[Double ]]); + rcheck(id_Tr_a(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_Tr_a(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_Tr_a(marray).asInstanceOf[Array[Map ]]); + ncheck(id_Tr_a(narray).asInstanceOf[Array[Strings]]); + + ucheck(id_To_a(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_To_a(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_To_a(barray).asInstanceOf[Array[Byte ]]); + scheck(id_To_a(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_To_a(carray).asInstanceOf[Array[Char ]]); + icheck(id_To_a(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_To_a(larray).asInstanceOf[Array[Long ]]); + fcheck(id_To_a(farray).asInstanceOf[Array[Float ]]); + dcheck(id_To_a(darray).asInstanceOf[Array[Double ]]); + rcheck(id_To_a(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_To_a(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_To_a(marray).asInstanceOf[Array[Map ]]); + ncheck(id_To_a(narray).asInstanceOf[Array[Strings]]); + + ucheck(id_Tr_r(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_Tr_r(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_Tr_r(barray).asInstanceOf[Array[Byte ]]); + scheck(id_Tr_r(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_Tr_r(carray).asInstanceOf[Array[Char ]]); + icheck(id_Tr_r(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_Tr_r(larray).asInstanceOf[Array[Long ]]); + fcheck(id_Tr_r(farray).asInstanceOf[Array[Float ]]); + dcheck(id_Tr_r(darray).asInstanceOf[Array[Double ]]); + rcheck(id_Tr_r(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_Tr_r(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_Tr_r(marray).asInstanceOf[Array[Map ]]); + ncheck(id_Tr_r(narray).asInstanceOf[Array[Strings]]); + + ucheck(id_To_r(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_To_r(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_To_r(barray).asInstanceOf[Array[Byte ]]); + scheck(id_To_r(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_To_r(carray).asInstanceOf[Array[Char ]]); + icheck(id_To_r(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_To_r(larray).asInstanceOf[Array[Long ]]); + fcheck(id_To_r(farray).asInstanceOf[Array[Float ]]); + dcheck(id_To_r(darray).asInstanceOf[Array[Double ]]); + rcheck(id_To_r(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_To_r(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_To_r(marray).asInstanceOf[Array[Map ]]); + ncheck(id_To_r(narray).asInstanceOf[Array[Strings]]); + + ucheck(id_To_o(uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_To_o(zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_To_o(barray).asInstanceOf[Array[Byte ]]); + scheck(id_To_o(sarray).asInstanceOf[Array[Short ]]); + ccheck(id_To_o(carray).asInstanceOf[Array[Char ]]); + icheck(id_To_o(iarray).asInstanceOf[Array[Int ]]); + lcheck(id_To_o(larray).asInstanceOf[Array[Long ]]); + fcheck(id_To_o(farray).asInstanceOf[Array[Float ]]); + dcheck(id_To_o(darray).asInstanceOf[Array[Double ]]); + rcheck(id_To_o(rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_To_o(oarray).asInstanceOf[Array[Object ]]); + mcheck(id_To_o(marray).asInstanceOf[Array[Map ]]); + ncheck(id_To_o(narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_TSa_T [Unit , Array[Unit ]](uarray)); + zcheck(id_TSa_T [Boolean, Array[Boolean]](zarray)); + bcheck(id_TSa_T [Byte , Array[Byte ]](barray)); + scheck(id_TSa_T [Short , Array[Short ]](sarray)); + ccheck(id_TSa_T [Char , Array[Char ]](carray)); + icheck(id_TSa_T [Int , Array[Int ]](iarray)); + lcheck(id_TSa_T [Long , Array[Long ]](larray)); + fcheck(id_TSa_T [Float , Array[Float ]](farray)); + dcheck(id_TSa_T [Double , Array[Double ]](darray)); + rcheck(id_TSa_T [AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSa_T [Object , Array[Object ]](oarray)); + mcheck(id_TSa_T [Map , Array[Map ]](marray)); + ncheck(id_TSa_T [Strings, Array[Strings]](narray)); + + ucheck(id_TSv_T [Unit , Array[Unit ]](uarray)); + zcheck(id_TSv_T [Boolean, Array[Boolean]](zarray)); + bcheck(id_TSv_T [Byte , Array[Byte ]](barray)); + scheck(id_TSv_T [Short , Array[Short ]](sarray)); + ccheck(id_TSv_T [Char , Array[Char ]](carray)); + icheck(id_TSv_T [Int , Array[Int ]](iarray)); + lcheck(id_TSv_T [Long , Array[Long ]](larray)); + fcheck(id_TSv_T [Float , Array[Float ]](farray)); + dcheck(id_TSv_T [Double , Array[Double ]](darray)); + + rcheck(id_TSr_T [AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSr_T [Object , Array[Object ]](oarray)); + mcheck(id_TSr_T [Map , Array[Map ]](marray)); + ncheck(id_TSr_T [Strings, Array[Strings]](narray)); + + rcheck(id_TSo_T [AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSo_T [Object , Array[Object ]](oarray)); + mcheck(id_TSo_T [Map , Array[Map ]](marray)); + ncheck(id_TSo_T [Strings, Array[Strings]](narray)); + + mcheck(id_TSm_T [Map , Array[Map ]](marray)); + + ncheck(id_TSn_T [Strings, Array[Strings]](narray)); + + //###################################################################### + + ucheck(id_TSa_Ss[Unit , Array[Unit ]](uarray)); + zcheck(id_TSa_Ss[Boolean, Array[Boolean]](zarray)); + bcheck(id_TSa_Ss[Byte , Array[Byte ]](barray)); + scheck(id_TSa_Ss[Short , Array[Short ]](sarray)); + ccheck(id_TSa_Ss[Char , Array[Char ]](carray)); + icheck(id_TSa_Ss[Int , Array[Int ]](iarray)); + lcheck(id_TSa_Ss[Long , Array[Long ]](larray)); + fcheck(id_TSa_Ss[Float , Array[Float ]](farray)); + dcheck(id_TSa_Ss[Double , Array[Double ]](darray)); + rcheck(id_TSa_Ss[AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSa_Ss[Object , Array[Object ]](oarray)); + mcheck(id_TSa_Ss[Map , Array[Map ]](marray)); + ncheck(id_TSa_Ss[Strings, Array[Strings]](narray)); + + ucheck(id_TSv_Ss[Unit , Array[Unit ]](uarray)); + zcheck(id_TSv_Ss[Boolean, Array[Boolean]](zarray)); + bcheck(id_TSv_Ss[Byte , Array[Byte ]](barray)); + scheck(id_TSv_Ss[Short , Array[Short ]](sarray)); + ccheck(id_TSv_Ss[Char , Array[Char ]](carray)); + icheck(id_TSv_Ss[Int , Array[Int ]](iarray)); + lcheck(id_TSv_Ss[Long , Array[Long ]](larray)); + fcheck(id_TSv_Ss[Float , Array[Float ]](farray)); + dcheck(id_TSv_Ss[Double , Array[Double ]](darray)); + + rcheck(id_TSr_Ss[AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSr_Ss[Object , Array[Object ]](oarray)); + mcheck(id_TSr_Ss[Map , Array[Map ]](marray)); + ncheck(id_TSr_Ss[Strings, Array[Strings]](narray)); + + rcheck(id_TSo_Ss[AnyRef , Array[AnyRef ]](rarray)); + ocheck(id_TSo_Ss[Object , Array[Object ]](oarray)); + mcheck(id_TSo_Ss[Map , Array[Map ]](marray)); + ncheck(id_TSo_Ss[Strings, Array[Strings]](narray)); + + mcheck(id_TSm_Ss[Map , Array[Map ]](marray)); + + ncheck(id_TSn_Ss[Strings, Array[Strings]](narray)); + + //###################################################################### + + ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_Sas_Ss[Unit ](uarray)); + zcheck(id_Sas_Ss[Boolean](zarray)); + bcheck(id_Sas_Ss[Byte ](barray)); + scheck(id_Sas_Ss[Short ](sarray)); + ccheck(id_Sas_Ss[Char ](carray)); + icheck(id_Sas_Ss[Int ](iarray)); + lcheck(id_Sas_Ss[Long ](larray)); + fcheck(id_Sas_Ss[Float ](farray)); + dcheck(id_Sas_Ss[Double ](darray)); + rcheck(id_Sas_Ss[AnyRef ](rarray)); + ocheck(id_Sas_Ss[Object ](oarray)); + mcheck(id_Sas_Ss[Map ](marray)); + ncheck(id_Sas_Ss[Strings](narray)); + + ucheck(id_Svs_Ss[Unit ](uarray)); + zcheck(id_Svs_Ss[Boolean](zarray)); + bcheck(id_Svs_Ss[Byte ](barray)); + scheck(id_Svs_Ss[Short ](sarray)); + ccheck(id_Svs_Ss[Char ](carray)); + icheck(id_Svs_Ss[Int ](iarray)); + lcheck(id_Svs_Ss[Long ](larray)); + fcheck(id_Svs_Ss[Float ](farray)); + dcheck(id_Svs_Ss[Double ](darray)); + + rcheck(id_Srs_Ss[AnyRef ](rarray)); + ocheck(id_Srs_Ss[Object ](oarray)); + mcheck(id_Srs_Ss[Map ](marray)); + ncheck(id_Srs_Ss[Strings](narray)); + + rcheck(id_Sos_Ss[AnyRef ](rarray)); + ocheck(id_Sos_Ss[Object ](oarray)); + mcheck(id_Sos_Ss[Map ](marray)); + ncheck(id_Sos_Ss[Strings](narray)); + + mcheck(id_Sms_Ss[Map ](marray)); + + ncheck(id_Sns_Ss[Strings](narray)); + + //###################################################################### + + ucheck(id_TSa_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_a [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_a [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_a [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_a [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_a [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_a [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_a [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_a [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_a [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_a [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_a [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_a [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_a [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_TSa_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_r [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_r [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_r [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_r [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_r [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_r [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_r [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_r [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_r [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_r [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_r [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_r [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_r [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + ucheck(id_TSa_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSa_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSa_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSa_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSa_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSa_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSa_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSa_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSa_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + rcheck(id_TSa_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSa_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSa_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSa_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + ucheck(id_TSv_o [Unit , Array[Unit ]](uarray).asInstanceOf[Array[Unit ]]); + zcheck(id_TSv_o [Boolean, Array[Boolean]](zarray).asInstanceOf[Array[Boolean]]); + bcheck(id_TSv_o [Byte , Array[Byte ]](barray).asInstanceOf[Array[Byte ]]); + scheck(id_TSv_o [Short , Array[Short ]](sarray).asInstanceOf[Array[Short ]]); + ccheck(id_TSv_o [Char , Array[Char ]](carray).asInstanceOf[Array[Char ]]); + icheck(id_TSv_o [Int , Array[Int ]](iarray).asInstanceOf[Array[Int ]]); + lcheck(id_TSv_o [Long , Array[Long ]](larray).asInstanceOf[Array[Long ]]); + fcheck(id_TSv_o [Float , Array[Float ]](farray).asInstanceOf[Array[Float ]]); + dcheck(id_TSv_o [Double , Array[Double ]](darray).asInstanceOf[Array[Double ]]); + + rcheck(id_TSr_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSr_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSr_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSr_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + rcheck(id_TSo_o [AnyRef , Array[AnyRef ]](rarray).asInstanceOf[Array[AnyRef ]]); + ocheck(id_TSo_o [Object , Array[Object ]](oarray).asInstanceOf[Array[Object ]]); + mcheck(id_TSo_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + ncheck(id_TSo_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + mcheck(id_TSm_o [Map , Array[Map ]](marray).asInstanceOf[Array[Map ]]); + + ncheck(id_TSn_o [Strings, Array[Strings]](narray).asInstanceOf[Array[Strings]]); + + //###################################################################### + + check_Ta(uarray, 2, u0, ucheck) + check_Ta(zarray, 2, z0, zcheck) + check_Ta(barray, 3, b0, bcheck) + check_Ta(sarray, 3, s0, scheck) + check_Ta(carray, 3, c0, ccheck) + check_Ta(iarray, 3, i0, icheck) + check_Ta(larray, 3, l0, lcheck) + check_Ta(farray, 3, f0, fcheck) + check_Ta(darray, 3, d0, dcheck) + check_Ta(rarray, 6, r0, rcheck) + check_Ta(oarray, 6, o0, ocheck) + check_Ta(marray, 3, m0, mcheck) + check_Ta(narray, 3, n0, ncheck) + + check_Tv(uarray, 2, u0, ucheck) + check_Tv(zarray, 2, z0, zcheck) + check_Tv(barray, 3, b0, bcheck) + check_Tv(sarray, 3, s0, scheck) + check_Tv(carray, 3, c0, ccheck) + check_Tv(iarray, 3, i0, icheck) + check_Tv(larray, 3, l0, lcheck) + check_Tv(farray, 3, f0, fcheck) + check_Tv(darray, 3, d0, dcheck) + + check_Tr(rarray, 6, r0, rcheck) + check_Tr(oarray, 6, o0, ocheck) + check_Tr(marray, 3, m0, mcheck) + check_Tr(narray, 3, n0, ncheck) + + check_To(rarray, 6, r0, rcheck) + check_To(oarray, 6, o0, ocheck) + check_To(marray, 3, m0, mcheck) + check_To(narray, 3, n0, ncheck) + + check_Tm(marray, 3, m0, mcheck) + + check_Tn(narray, 3, n0, ncheck) + + //###################################################################### + + checkZip + checkConcat + checkT2368() + + //###################################################################### + + println("checks: " + checks) + + //###################################################################### + } + + //########################################################################## +} + diff --git a/tests/pending/run/arrayview.scala b/tests/pending/run/arrayview.scala new file mode 100644 index 000000000000..97e840f5e946 --- /dev/null +++ b/tests/pending/run/arrayview.scala @@ -0,0 +1,11 @@ +object Test { + def f = (1 to 100).toArray.view + + def main(args: Array[String]): Unit = { + val xs = (f filter (_ < 50)).reverse.filter(_ % 2 == 0).map(_ / 2).flatMap(x => Array(1, x)) + assert(xs.size == 48) + val ys = xs.toArray + assert(ys.size == 48) + assert(xs.sum == ys.sum) + } +} diff --git a/tests/pending/run/arybufgrow.check b/tests/pending/run/arybufgrow.check new file mode 100644 index 000000000000..ce71841c7763 --- /dev/null +++ b/tests/pending/run/arybufgrow.check @@ -0,0 +1 @@ +1000 = 1000 diff --git a/tests/pending/run/arybufgrow.scala b/tests/pending/run/arybufgrow.scala new file mode 100644 index 000000000000..b0e06166b919 --- /dev/null +++ b/tests/pending/run/arybufgrow.scala @@ -0,0 +1,10 @@ +import scala.collection.mutable._; + +object Test extends dotty.runtime.LegacyApp { + val buf = new ArrayBuffer[String]; + for (i <- List.range(0,1000)) { + buf += "hello"; + } + + Console.println("1000 = " + buf.length); +} diff --git a/tests/pending/run/backreferences.check b/tests/pending/run/backreferences.check new file mode 100644 index 000000000000..1d474d525571 --- /dev/null +++ b/tests/pending/run/backreferences.check @@ -0,0 +1,2 @@ +false +true diff --git a/tests/pending/run/backreferences.scala b/tests/pending/run/backreferences.scala new file mode 100644 index 000000000000..335cd6c7dec6 --- /dev/null +++ b/tests/pending/run/backreferences.scala @@ -0,0 +1,13 @@ +case class Elem[T](x: T, y: T) + +object Test { + def unrolled[T](x: Any, y: Any, z: Any) = (x, y, z) match { + case (el: Elem[_], el.x, el.y) => true + case _ => false + } + + def main(args: Array[String]): Unit = { + println(unrolled(Elem("bippy", 5), "bippy", 6)) + println(unrolled(Elem("bippy", 5), "bippy", 5)) + } +} diff --git a/tests/pending/run/bigDecimalCache.scala b/tests/pending/run/bigDecimalCache.scala new file mode 100644 index 000000000000..c0c709a50f7d --- /dev/null +++ b/tests/pending/run/bigDecimalCache.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + val bd5a = BigDecimal(5) + val mc = java.math.MathContext.DECIMAL32 + val bd5b = BigDecimal(5,mc) + + assert(bd5b.mc == mc) + } +} diff --git a/tests/pending/run/bigDecimalTest.check b/tests/pending/run/bigDecimalTest.check new file mode 100644 index 000000000000..36db6aaafe81 --- /dev/null +++ b/tests/pending/run/bigDecimalTest.check @@ -0,0 +1,6 @@ +34 +83 +0 +0 +0 +15 diff --git a/tests/pending/run/bigDecimalTest.scala b/tests/pending/run/bigDecimalTest.scala new file mode 100644 index 000000000000..480305d7d4b1 --- /dev/null +++ b/tests/pending/run/bigDecimalTest.scala @@ -0,0 +1,35 @@ +object Test { + def main(args: Array[String]): Unit = { + + // SI-4981: avoid being limited by math context when not needed + val big = BigDecimal("32432875832753287583275382753288325325328532875325") + val f = big % BigDecimal(scala.math.Pi) + + // SI-1812: use math context to limit decimal expansion + val a = BigDecimal(1) / BigDecimal(3) + val b = BigDecimal(1) / big + + // SI-2199: implicit conversions from java.math.BigDecimal to BigDecimal + val c = BigDecimal(1) + (new java.math.BigDecimal(3)) + + // SI-2024: correctly use BigDecimal.valueOf + assert(BigDecimal(123) + 1.1 == BigDecimal("124.1")) + + // SI-3206: BigDecimal cache errors + val d = BigDecimal(2, new java.math.MathContext(33)) + val e = BigDecimal(2, new java.math.MathContext(34)) + assert(d.mc != e.mc) + + // SI-921 + assert(BigDecimal(2) / BigDecimal(0.5) == BigDecimal(4)) + + // SI-2304: enforce equals/hashCode contract + assert(BigDecimal("2").hashCode == BigDecimal("2.00").hashCode) + + // SI-4547: implicit conversion + assert(5 + BigDecimal(3) == BigDecimal(8)) + + // meaningless sanity check + List[BigDecimal](a, b, c, d, e, f) map (_.scale) foreach println + } +} diff --git a/tests/pending/run/bitsets.check b/tests/pending/run/bitsets.check new file mode 100644 index 000000000000..41c2ccdcb87c --- /dev/null +++ b/tests/pending/run/bitsets.check @@ -0,0 +1,84 @@ +ms0 = BitSet(2) +ms1 = BitSet(2) +ms2 = BitSet(2) +mb0 = false +mb1 = true +mb2 = false +xs0 = List(2) +xs1 = List(2) +xs2 = List(2) +ma0 = List(2) +ma1 = List(2) +ma2 = List(2) +mi0 = BitSet(2) +mi1 = BitSet(2) +mi2 = BitSet(2) + +m2_m0 = List(1010101010101010101010101) +m2_m2 = List(ffffffffffffffff, ffffffffffffffff, ffffffffffffffff, ffffffffffffffff, 1, 0, 0, 0) +m2_m0c = true +m2_m1c = true +m2_m2c = true +m2_m3c = true +m2_i0 = true +m2_i1 = true +m2_i2 = true +m2_i3 = true +m2_f0 = true +m2_f1 = true +m2_f2 = true +m2_f3 = true +m2_t0 = true +m2_t1 = true +m2_t2 = true +m2_t3 = true +m2_r0 = true +m2_r1 = true +m2_r2 = true +m2_r3 = true + +b1:BitSet(5, 6, 7) +b2:BitSet(5) +b3:BitSet(5, 7) +b4:BitSet(7) +b0:BitSet(5, 6, 7) +is0 = BitSet() +is1 = BitSet() +is2 = BitSet(2) +is3 = BitSet() +ib0 = false +ib1 = false +ib2 = true +ib3 = false +ys0 = List() +ys1 = List() +ys2 = List(2) +ys3 = List() +ia0 = List() +ia1 = List() +ia2 = List(2) +ia3 = List() + +i2_m0 = List(1010101010101010101010101) +i2_m2 = List(ffffffffffffffff, ffffffffffffffff, ffffffffffffffff, ffffffffffffffff, 1) +i2_m0c = true +i2_m1c = true +i2_m2c = true +i2_m3c = true +i2_i0 = true +i2_i1 = true +i2_i2 = true +i2_i3 = true +i2_f0 = true +i2_f1 = true +i2_f2 = true +i2_f3 = true +i2_t0 = true +i2_t1 = true +i2_t2 = true +i2_t3 = true +i2_r0 = true +i2_r1 = true +i2_r2 = true +i2_r3 = true + diff --git a/tests/pending/run/bitsets.scala b/tests/pending/run/bitsets.scala new file mode 100644 index 000000000000..05c1625ed932 --- /dev/null +++ b/tests/pending/run/bitsets.scala @@ -0,0 +1,218 @@ +//############################################################################ +// Bitsets +//############################################################################ + +//############################################################################ + +import scala.language.postfixOps + +object TestMutable { + import scala.collection.mutable.BitSet + + val ms0 = new BitSet + val ms1 = new BitSet(8) + val ms2 = new BitSet(0) + ms0 += 2 + ms1 ++= List(1, 2) + ms1 -= 1 + ms1 --= List(1) + ms2(2) = true + ms2(3) = false + + Console.println("ms0 = " + ms0) + Console.println("ms1 = " + ms1) + Console.println("ms2 = " + ms2) + + Console.println("mb0 = " + ms0.contains(-1)) + Console.println("mb1 = " + ms1.contains(2)) + Console.println("mb2 = " + ms2.contains(3)) + + Console.println("xs0 = " + ms0.iterator.toList) + Console.println("xs1 = " + ms1.iterator.toList) + Console.println("xs2 = " + ms2.iterator.toList) + + Console.println("ma0 = " + ms0.toList) + Console.println("ma1 = " + ms1.toList) + Console.println("ma2 = " + ms2.toList) + + Console.println("mi0 = " + ms0.toImmutable) + Console.println("mi1 = " + ms1.toImmutable) + Console.println("mi2 = " + ms2.toImmutable) + Console.println + + val N = 257 + val gen = 3 + val bs = BitSet((1 until N): _*) + (1 until N).foldLeft(gen) { + case (acc, i) => + assert(bs.size == N-i, s"Bad size for $bs, expected ${N-i} actual ${bs.size}") + assert(!bs.isEmpty, s"Unexpected isEmpty for $bs") + bs -= acc + acc*gen % N + } + assert(bs.size == 0, s"Expected size == 0 for $bs") + assert(bs.isEmpty, s"Expected isEmpty for $bs") +} + +object TestMutable2 { + import scala.collection.mutable.BitSet + import scala.collection.immutable.TreeSet + + val l0 = 0 to 24 by 2 toList + val l1 = (190 to 255 toList) reverse + val l2 = (0 to 256 toList) + val l3 = (1 to 200 by 2 toList) reverse + val t0 = TreeSet(l0: _*) + val t1 = TreeSet(l1: _*) + val t2 = TreeSet(l2: _*) + val t3 = TreeSet(l3: _*) + val b0 = BitSet(l0: _*) + val b1 = BitSet(l1: _*) + val b2 = BitSet(l2: _*) + val b3 = BitSet(l3: _*) + + println("m2_m0 = " + b0.toBitMask.toList.map(_.toBinaryString)) + println("m2_m2 = " + b2.toBitMask.toList.map(_.toHexString)) + println("m2_m0c = " + (BitSet.fromBitMask(b0.toBitMask) == b0)) + println("m2_m1c = " + (BitSet.fromBitMask(b1.toBitMask) == b1)) + println("m2_m2c = " + (BitSet.fromBitMask(b2.toBitMask) == b2)) + println("m2_m3c = " + (BitSet.fromBitMask(b3.toBitMask) == b3)) + println("m2_i0 = " + (t0 == b0)) + println("m2_i1 = " + (t1 == b1)) + println("m2_i2 = " + (t2 == b2)) + println("m2_i3 = " + (t3 == b3)) + println("m2_f0 = " + (t0.from(42) == b0.from(42))) + println("m2_f1 = " + (t1.from(42) == b1.from(42))) + println("m2_f2 = " + (t2.from(42) == b2.from(42))) + println("m2_f3 = " + (t3.from(42) == b3.from(42))) + println("m2_t0 = " + (t0.to(195) == b0.to(195))) + println("m2_t1 = " + (t1.to(195) == b1.to(195))) + println("m2_t2 = " + (t2.to(195) == b2.to(195))) + println("m2_t3 = " + (t3.to(195) == b3.to(195))) + println("m2_r0 = " + (t0.range(43,194) == b0.range(43,194))) + println("m2_r1 = " + (t1.range(43,194) == b1.range(43,194))) + println("m2_r2 = " + (t2.range(43,194) == b2.range(43,194))) + println("m2_r3 = " + (t3.range(43,194) == b3.range(43,194))) + println +} + +object TestMutable3 { + import scala.collection.mutable.BitSet + + val b0 = BitSet(5, 6) + val b1 = BitSet(7) + val b2 = BitSet(1, 5) + val b3 = BitSet(6, 7) + val b4 = BitSet(6, 7) + + b1 |= b0 + println(s"b1:$b1") + b2 &= b0 + println(s"b2:$b2") + b3 ^= b0 + println(s"b3:$b3") + b4 &~= b0 + println(s"b4:$b4") + b0 ^= b0 |= b1 + println(s"b0:$b0") +} + +/*** +The memory requirements here are way beyond +what a test should exercise. + +object TestMutable4 { + import scala.collection.mutable.BitSet + + val bMax = BitSet(Int.MaxValue) + println(s"bMax:$bMax") + bMax.foreach(println) + + val bLarge = BitSet(2000000001) + println(s"bLarge:$bLarge") + + println(bMax == bLarge) +} +***/ + +object TestImmutable { + import scala.collection.immutable.BitSet + + val is0 = BitSet() + val is1 = BitSet.fromBitMask(Array()) + val is2 = BitSet.fromBitMask(Array(4)) + val is3 = BitSet.empty + + Console.println("is0 = " + is0) + Console.println("is1 = " + is1) + Console.println("is2 = " + is2) + Console.println("is3 = " + is3) + + Console.println("ib0 = " + is0.contains(-1)) + Console.println("ib1 = " + is1.contains(0)) + Console.println("ib2 = " + is2.contains(2)) + Console.println("ib3 = " + is3.contains(2)) + + Console.println("ys0 = " + is0.iterator.toList) + Console.println("ys1 = " + is1.iterator.toList) + Console.println("ys2 = " + is2.iterator.toList) + Console.println("ys3 = " + is3.iterator.toList) + + Console.println("ia0 = " + is0.toList) + Console.println("ia1 = " + is1.toList) + Console.println("ia2 = " + is2.toList) + Console.println("ia3 = " + is3.toList) + Console.println +} + +object TestImmutable2 { + import scala.collection.immutable.{BitSet, TreeSet} + + val l0 = 0 to 24 by 2 toList + val l1 = (190 to 255 toList) reverse + val l2 = (0 to 256 toList) + val l3 = (1 to 200 by 2 toList) reverse + val t0 = TreeSet(l0: _*) + val t1 = TreeSet(l1: _*) + val t2 = TreeSet(l2: _*) + val t3 = TreeSet(l3: _*) + val b0 = BitSet(l0: _*) + val b1 = BitSet(l1: _*) + val b2 = BitSet(l2: _*) + val b3 = BitSet(l3: _*) + + println("i2_m0 = " + b0.toBitMask.toList.map(_.toBinaryString)) + println("i2_m2 = " + b2.toBitMask.toList.map(_.toHexString)) + println("i2_m0c = " + (BitSet.fromBitMask(b0.toBitMask) == b0)) + println("i2_m1c = " + (BitSet.fromBitMask(b1.toBitMask) == b1)) + println("i2_m2c = " + (BitSet.fromBitMask(b2.toBitMask) == b2)) + println("i2_m3c = " + (BitSet.fromBitMask(b3.toBitMask) == b3)) + println("i2_i0 = " + (t0 == b0)) + println("i2_i1 = " + (t1 == b1)) + println("i2_i2 = " + (t2 == b2)) + println("i2_i3 = " + (t3 == b3)) + println("i2_f0 = " + (t0.from(42) == b0.from(42))) + println("i2_f1 = " + (t1.from(42) == b1.from(42))) + println("i2_f2 = " + (t2.from(42) == b2.from(42))) + println("i2_f3 = " + (t3.from(42) == b3.from(42))) + println("i2_t0 = " + (t0.to(195) == b0.to(195))) + println("i2_t1 = " + (t1.to(195) == b1.to(195))) + println("i2_t2 = " + (t2.to(195) == b2.to(195))) + println("i2_t3 = " + (t3.to(195) == b3.to(195))) + println("i2_r0 = " + (t0.range(77,194) == b0.range(77,194))) + println("i2_r1 = " + (t1.range(77,194) == b1.range(77,194))) + println("i2_r2 = " + (t2.range(77,194) == b2.range(77,194))) + println("i2_r3 = " + (t3.range(77,194) == b3.range(77,194))) + println +} + +object Test extends dotty.runtime.LegacyApp { + TestMutable + TestMutable2 + TestMutable3 + // TestMutable4 + TestImmutable + TestImmutable2 +} + +//############################################################################ diff --git a/tests/pending/run/blame_eye_triple_eee-double.check b/tests/pending/run/blame_eye_triple_eee-double.check new file mode 100644 index 000000000000..5e46d91a8f22 --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-double.check @@ -0,0 +1,9 @@ +if (NaN == NaN) is good +if (x == x) is good +if (x == NaN) is good +if (NaN != NaN) is good +if (x != x) is good +if (NaN != x) is good +x matching was good +NaN matching was good +loop with NaN was goood diff --git a/tests/pending/run/blame_eye_triple_eee-double.flags b/tests/pending/run/blame_eye_triple_eee-double.flags new file mode 100644 index 000000000000..c9b68d70dc6a --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-double.flags @@ -0,0 +1 @@ +-optimise diff --git a/tests/pending/run/blame_eye_triple_eee-double.scala b/tests/pending/run/blame_eye_triple_eee-double.scala new file mode 100644 index 000000000000..406fc960a70f --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-double.scala @@ -0,0 +1,61 @@ +object Test extends dotty.runtime.LegacyApp { + import Double.NaN + + // NaN must not equal NaN no matter what optimizations are applied + // All the following will seem redundant, but to an optimizer + // they can appear different + + val x = NaN + + if (NaN == NaN) + println("if (NaN == NaN) is broken") + else + println("if (NaN == NaN) is good") + + if (x == x) + println("if (x == x) is broken") + else + println("if (x == x) is good") + + if (x == NaN) + println("if (x == NaN) is broken") + else + println("if (x == NaN) is good") + + if (NaN != NaN) + println("if (NaN != NaN) is good") + else + println("if (NaN != NaN) broken") + + if (x != x) + println("if (x != x) is good") + else + println("if (x != x) broken") + + if (NaN != x) + println("if (NaN != x) is good") + else + println("if (NaN != x) is broken") + + x match { + case 0.0d => println("x matched 0!") + case NaN => println("x matched NaN!") + case _ => println("x matching was good") + } + + NaN match { + case 0.0d => println("NaN matched 0!") + case NaN => println("NaN matched NaN!") + case _ => println("NaN matching was good") + } + + var z = 0.0d + var i = 0 + while (i < 10) { + if (i % 2 == 0) z = NaN + else z = NaN + i += 1 + } + if (z.isNaN && i == 10) println("loop with NaN was goood") + else println("loop with NaN was broken") +} diff --git a/tests/pending/run/blame_eye_triple_eee-float.check b/tests/pending/run/blame_eye_triple_eee-float.check new file mode 100644 index 000000000000..5e46d91a8f22 --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-float.check @@ -0,0 +1,9 @@ +if (NaN == NaN) is good +if (x == x) is good +if (x == NaN) is good +if (NaN != NaN) is good +if (x != x) is good +if (NaN != x) is good +x matching was good +NaN matching was good +loop with NaN was goood diff --git a/tests/pending/run/blame_eye_triple_eee-float.flags b/tests/pending/run/blame_eye_triple_eee-float.flags new file mode 100644 index 000000000000..c9b68d70dc6a --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-float.flags @@ -0,0 +1 @@ +-optimise diff --git a/tests/pending/run/blame_eye_triple_eee-float.scala b/tests/pending/run/blame_eye_triple_eee-float.scala new file mode 100644 index 000000000000..e62461828799 --- /dev/null +++ b/tests/pending/run/blame_eye_triple_eee-float.scala @@ -0,0 +1,61 @@ +object Test extends dotty.runtime.LegacyApp { + import Float.NaN + + // NaN must not equal NaN no matter what optimizations are applied + // All the following will seem redundant, but to an optimizer + // they can appear different + + val x = NaN + + if (NaN == NaN) + println("if (NaN == NaN) is broken") + else + println("if (NaN == NaN) is good") + + if (x == x) + println("if (x == x) is broken") + else + println("if (x == x) is good") + + if (x == NaN) + println("if (x == NaN) is broken") + else + println("if (x == NaN) is good") + + if (NaN != NaN) + println("if (NaN != NaN) is good") + else + println("if (NaN != NaN) broken") + + if (x != x) + println("if (x != x) is good") + else + println("if (x != x) broken") + + if (NaN != x) + println("if (NaN != x) is good") + else + println("if (NaN != x) is broken") + + x match { + case 0.0f => println("x matched 0!") + case NaN => println("x matched NaN!") + case _ => println("x matching was good") + } + + NaN match { + case 0.0f => println("NaN matched 0!") + case NaN => println("NaN matched NaN!") + case _ => println("NaN matching was good") + } + + var z = 0.0f + var i = 0 + while (i < 10) { + if (i % 2 == 0) z = NaN + else z = NaN + i += 1 + } + if (z.isNaN && i == 10) println("loop with NaN was goood") + else println("loop with NaN was broken") +} diff --git a/tests/pending/run/boolexprs.check b/tests/pending/run/boolexprs.check new file mode 100644 index 000000000000..cd2c7358941d --- /dev/null +++ b/tests/pending/run/boolexprs.check @@ -0,0 +1,3 @@ +test Test1 was successful +test Test2 was successful + diff --git a/tests/pending/run/boolexprs.scala b/tests/pending/run/boolexprs.scala new file mode 100644 index 000000000000..94313d9c8e9a --- /dev/null +++ b/tests/pending/run/boolexprs.scala @@ -0,0 +1,59 @@ +//############################################################################ +// Boolean Expressions +//############################################################################ + +class Counter { + private var n: Int = 0; + def incrThen(b: Boolean) = if (b) n += 1; + def value = n; +} + +object Test1 { + var flag = false; + def flip: Boolean = { val tmp = flag; flag = !flag; tmp } + def run: Int = { + val c = new Counter; + c.incrThen(flip || flip); + c.value + } +} + +object Test2 { + val a = Array(false); + + def run: Int = { + val c = new Counter; + c.incrThen(true && a(0)); + c.incrThen(false || Nil.length > 0); + c.value + } +} + +//############################################################################ +// Test code + +object Test { + def check_success(name: String, closure: => Int, expected: Int): Unit = { + Console.print("test " + name); + try { + val actual: Int = closure; + if (actual == expected) { + Console.print(" was successful"); + } else { + Console.print(" failed: expected "+ expected +", found "+ actual); + } + } catch { + case exception: Throwable => + Console.print(" raised exception " + exception); + } + Console.println; + } + + def main(args: Array[String]): Unit = { + check_success("Test1", Test1.run, 1); + check_success("Test2", Test2.run, 0); + Console.println; + } +} + +//############################################################################ diff --git a/tests/pending/run/boolord.check b/tests/pending/run/boolord.check new file mode 100644 index 000000000000..d1b11c0cde77 --- /dev/null +++ b/tests/pending/run/boolord.check @@ -0,0 +1,4 @@ +false < false = false +false < true = true +true < false = false +true < true = false diff --git a/tests/pending/run/boolord.scala b/tests/pending/run/boolord.scala new file mode 100644 index 000000000000..7a827ffc39c0 --- /dev/null +++ b/tests/pending/run/boolord.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + Console.println("false < false = " + (false < false)) + Console.println("false < true = " + (false < true)) + Console.println("true < false = " + (true < false)) + Console.println("true < true = " + (true < true)) + } +} diff --git a/tests/pending/run/breakout.check b/tests/pending/run/breakout.check new file mode 100644 index 000000000000..7971496d1f0c --- /dev/null +++ b/tests/pending/run/breakout.check @@ -0,0 +1 @@ +2, 3, 4 diff --git a/tests/pending/run/breakout.scala b/tests/pending/run/breakout.scala new file mode 100644 index 000000000000..a58191046aaf --- /dev/null +++ b/tests/pending/run/breakout.scala @@ -0,0 +1,9 @@ +import scala.collection.generic._ +import scala.collection._ +import scala.collection.mutable._ + +object Test extends dotty.runtime.LegacyApp { + val l = List(1, 2, 3) + val a: Array[Int] = l.map(_ + 1)(breakOut) + println(a.mkString(", ")) +} diff --git a/tests/pending/run/bridges.javaopts b/tests/pending/run/bridges.javaopts new file mode 100644 index 000000000000..3a63111bf2fd --- /dev/null +++ b/tests/pending/run/bridges.javaopts @@ -0,0 +1 @@ +-Xss128M diff --git a/tests/pending/run/bridges.scala b/tests/pending/run/bridges.scala new file mode 100644 index 000000000000..eb036bd781dc --- /dev/null +++ b/tests/pending/run/bridges.scala @@ -0,0 +1,7122 @@ +//############################################################################ +// Test bridge methods +//############################################################################ + +class A; +class B; +class C; +class D; + +object Help { + val max: Int = 4; + var next: Int = 0; + var vars: Array[String] = new Array[String](max); + def init: Unit = { + var i = 0; + while (i < max) { vars(i) = null; i = i + 1; } + next = 0; + } + def check(count: Int, value: String): Boolean = { + var b: Boolean = true; + var i: Int = 0; + while (i < count) { if (vars(i) != value) b = false; i = i + 1; } + while (i < max) { if (vars(i) != null) b = false; i = i + 1; } + b; + } + def print: Unit = { + var i = 0; + while (i < max) { if (i > 0) Console.print(", "); Console.print(vars(i)); i = i + 1; } + } + def foo = { vars(next) = "foo"; next = next + 1; } + def bar = { vars(next) = "bar"; next = next + 1; } + def mix = { vars(next) = "mix"; next = next + 1; } + def sub = { vars(next) = "sub"; next = next + 1; } +} + +import Help.foo; +import Help.bar; +import Help.mix; +import Help.sub; + +abstract class Foo___ { type I>:Null<:AnyRef; def f: I ; f; } +abstract class Foo__f { type I>:Null<:AnyRef; def f: I = {foo; null}; f; } +abstract class Foo_I_ { class I ; def f: I ; f; } +abstract class Foo_If { class I ; def f: I = {foo; null}; f; } +abstract class FooX__[X] { type I>:Null<:AnyRef; def f: I ; f; } +abstract class FooX_f[X] { type I>:Null<:AnyRef; def f: I = {foo; null}; f; } +abstract class FooXI_[X] { class I ; def f: I ; f; } +abstract class FooXIf[X] { class I ; def f: I = {foo; null}; f; } + +trait Bar___ { type I>:Null<:AnyRef; def f: I ; f; } +trait Bar__f { type I>:Null<:AnyRef; def f: I = {bar; null}; f; } +trait Bar_I_ { class I ; def f: I ; f; } +trait Bar_If { class I ; def f: I = {bar; null}; f; } +trait BarY__[Y] { type I>:Null<:AnyRef; def f: I ; f; } +trait BarY_f[Y] { type I>:Null<:AnyRef; def f: I = {bar; null}; f; } +trait BarYI_[Y] { class I ; def f: I ; f; } +trait BarYIf[Y] { class I ; def f: I = {bar; null}; f; } + + +/* */abstract class Mix___eFoo___ extends Foo___ { ; ; f; } +/* */abstract class Mix___eFoo___wBar___ extends Foo___ with Bar___ { ; ; f; } +/* */abstract class Mix___eFoo___wBar__f extends Foo___ with Bar__f { ; ; f; } +/* */abstract class Mix___eFoo___wBar_I_ extends Foo___ with Bar_I_ { ; ; f; } +/* *//* */ class Mix___eFoo___wBar_If extends Foo___ with Bar_If { ; ; f; } +/* */abstract class Mix___eFoo___wBarY__ extends Foo___ with BarY__[B] { ; ; f; } +/* */abstract class Mix___eFoo___wBarY_f extends Foo___ with BarY_f[B] { ; ; f; } +/* */abstract class Mix___eFoo___wBarYI_ extends Foo___ with BarYI_[B] { ; ; f; } +/* *//* */ class Mix___eFoo___wBarYIf extends Foo___ with BarYIf[B] { ; ; f; } +/* */abstract class Mix___eFoo__f extends Foo__f { ; ; f; } +/* */abstract class Mix___eFoo__fwBar___ extends Foo__f with Bar___ { ; ; f; } +// */abstract class Mix___eFoo__fwBar__f extends Foo__f with Bar__f { ; ; f; } +/* *//* */ class Mix___eFoo__fwBar_I_ extends Foo__f with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFoo__fwBar_If extends Foo__f with Bar_If { ; ; f; } +/* */abstract class Mix___eFoo__fwBarY__ extends Foo__f with BarY__[B] { ; ; f; } +// */abstract class Mix___eFoo__fwBarY_f extends Foo__f with BarY_f[B] { ; ; f; } +/* *//* */ class Mix___eFoo__fwBarYI_ extends Foo__f with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFoo__fwBarYIf extends Foo__f with BarYIf[B] { ; ; f; } +/* */abstract class Mix___eFoo_I_ extends Foo_I_ { ; ; f; } +/* */abstract class Mix___eFoo_I_wBar___ extends Foo_I_ with Bar___ { ; ; f; } +/* *//* */ class Mix___eFoo_I_wBar__f extends Foo_I_ with Bar__f { ; ; f; } +// */abstract class Mix___eFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFoo_I_wBar_If extends Foo_I_ with Bar_If { ; ; f; } +/* */abstract class Mix___eFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { ; ; f; } +/* *//* */ class Mix___eFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { ; ; f; } +// */abstract class Mix___eFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { ; ; f; } +/* *//* */ class Mix___eFoo_If extends Foo_If { ; ; f; } +/* *//* */ class Mix___eFoo_IfwBar___ extends Foo_If with Bar___ { ; ; f; } +// *//* */ class Mix___eFoo_IfwBar__f extends Foo_If with Bar__f { ; ; f; } +// *//* */ class Mix___eFoo_IfwBar_I_ extends Foo_If with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFoo_IfwBar_If extends Foo_If with Bar_If { ; ; f; } +/* *//* */ class Mix___eFoo_IfwBarY__ extends Foo_If with BarY__[B] { ; ; f; } +// *//* */ class Mix___eFoo_IfwBarY_f extends Foo_If with BarY_f[B] { ; ; f; } +// *//* */ class Mix___eFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFoo_IfwBarYIf extends Foo_If with BarYIf[B] { ; ; f; } +/* */abstract class Mix___eFooX__ extends FooX__[A] { ; ; f; } +/* */abstract class Mix___eFooX__wBar___ extends FooX__[A] with Bar___ { ; ; f; } +/* */abstract class Mix___eFooX__wBar__f extends FooX__[A] with Bar__f { ; ; f; } +/* */abstract class Mix___eFooX__wBar_I_ extends FooX__[A] with Bar_I_ { ; ; f; } +/* *//* */ class Mix___eFooX__wBar_If extends FooX__[A] with Bar_If { ; ; f; } +/* */abstract class Mix___eFooX__wBarY__ extends FooX__[A] with BarY__[B] { ; ; f; } +/* */abstract class Mix___eFooX__wBarY_f extends FooX__[A] with BarY_f[B] { ; ; f; } +/* */abstract class Mix___eFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { ; ; f; } +/* *//* */ class Mix___eFooX__wBarYIf extends FooX__[A] with BarYIf[B] { ; ; f; } +/* */abstract class Mix___eFooX_f extends FooX_f[A] { ; ; f; } +/* */abstract class Mix___eFooX_fwBar___ extends FooX_f[A] with Bar___ { ; ; f; } +// */abstract class Mix___eFooX_fwBar__f extends FooX_f[A] with Bar__f { ; ; f; } +/* *//* */ class Mix___eFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFooX_fwBar_If extends FooX_f[A] with Bar_If { ; ; f; } +/* */abstract class Mix___eFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { ; ; f; } +// */abstract class Mix___eFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { ; ; f; } +/* *//* */ class Mix___eFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { ; ; f; } +/* */abstract class Mix___eFooXI_ extends FooXI_[A] { ; ; f; } +/* */abstract class Mix___eFooXI_wBar___ extends FooXI_[A] with Bar___ { ; ; f; } +/* *//* */ class Mix___eFooXI_wBar__f extends FooXI_[A] with Bar__f { ; ; f; } +// */abstract class Mix___eFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFooXI_wBar_If extends FooXI_[A] with Bar_If { ; ; f; } +/* */abstract class Mix___eFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { ; ; f; } +/* *//* */ class Mix___eFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { ; ; f; } +// */abstract class Mix___eFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { ; ; f; } +/* *//* */ class Mix___eFooXIf extends FooXIf[A] { ; ; f; } +/* *//* */ class Mix___eFooXIfwBar___ extends FooXIf[A] with Bar___ { ; ; f; } +// *//* */ class Mix___eFooXIfwBar__f extends FooXIf[A] with Bar__f { ; ; f; } +// *//* */ class Mix___eFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___eFooXIfwBar_If extends FooXIf[A] with Bar_If { ; ; f; } +/* *//* */ class Mix___eFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { ; ; f; } +// *//* */ class Mix___eFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { ; ; f; } +// *//* */ class Mix___eFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___eFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { ; ; f; } + +/* */abstract class Mix__feFoo___ extends Foo___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo___wBar___ extends Foo___ with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo___wBar__f extends Foo___ with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo___wBar_I_ extends Foo___ with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo___wBar_If extends Foo___ with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo___wBarY__ extends Foo___ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo___wBarY_f extends Foo___ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo___wBarYI_ extends Foo___ with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo___wBarYIf extends Foo___ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo__f extends Foo__f { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo__fwBar___ extends Foo__f with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo__fwBar__f extends Foo__f with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo__fwBar_I_ extends Foo__f with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo__fwBar_If extends Foo__f with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo__fwBarY__ extends Foo__f with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFoo__fwBarY_f extends Foo__f with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo__fwBarYI_ extends Foo__f with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo__fwBarYIf extends Foo__f with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_I_ extends Foo_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_I_wBar___ extends Foo_I_ with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_I_wBar__f extends Foo_I_ with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_I_wBar_If extends Foo_I_ with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_If extends Foo_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_IfwBar___ extends Foo_If with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_IfwBar__f extends Foo_If with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_IfwBar_I_ extends Foo_If with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_IfwBar_If extends Foo_If with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_IfwBarY__ extends Foo_If with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFoo_IfwBarY_f extends Foo_If with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFoo_IfwBarYIf extends Foo_If with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX__ extends FooX__[A] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX__wBar___ extends FooX__[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX__wBar__f extends FooX__[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX__wBar_I_ extends FooX__[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX__wBar_If extends FooX__[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX__wBarY__ extends FooX__[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX__wBarY_f extends FooX__[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX__wBarYIf extends FooX__[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX_f extends FooX_f[A] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX_fwBar___ extends FooX_f[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX_fwBar__f extends FooX_f[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX_fwBar_If extends FooX_f[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__feFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXI_ extends FooXI_[A] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXI_wBar___ extends FooXI_[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXI_wBar__f extends FooXI_[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXI_wBar_If extends FooXI_[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXIf extends FooXIf[A] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXIfwBar___ extends FooXIf[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXIfwBar__f extends FooXIf[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXIfwBar_If extends FooXIf[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__feFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__feFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } + +/* */abstract class Mix_I_eFoo___ extends Foo___ { class I; ; f; } +/* */abstract class Mix_I_eFoo___wBar___ extends Foo___ with Bar___ { class I; ; f; } +/* *//* */ class Mix_I_eFoo___wBar__f extends Foo___ with Bar__f { class I; ; f; } +// */abstract class Mix_I_eFoo___wBar_I_ extends Foo___ with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFoo___wBar_If extends Foo___ with Bar_If { class I; ; f; } +/* */abstract class Mix_I_eFoo___wBarY__ extends Foo___ with BarY__[B] { class I; ; f; } +/* *//* */ class Mix_I_eFoo___wBarY_f extends Foo___ with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_eFoo___wBarYI_ extends Foo___ with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo___wBarYIf extends Foo___ with BarYIf[B] { class I; ; f; } +/* *//* */ class Mix_I_eFoo__f extends Foo__f { class I; ; f; } +/* *//* */ class Mix_I_eFoo__fwBar___ extends Foo__f with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBar__f extends Foo__f with Bar__f { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBar_I_ extends Foo__f with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBar_If extends Foo__f with Bar_If { class I; ; f; } +/* *//* */ class Mix_I_eFoo__fwBarY__ extends Foo__f with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBarY_f extends Foo__f with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBarYI_ extends Foo__f with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo__fwBarYIf extends Foo__f with BarYIf[B] { class I; ; f; } +// */abstract class Mix_I_eFoo_I_ extends Foo_I_ { class I; ; f; } +// */abstract class Mix_I_eFoo_I_wBar___ extends Foo_I_ with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFoo_I_wBar__f extends Foo_I_ with Bar__f { class I; ; f; } +// */abstract class Mix_I_eFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFoo_I_wBar_If extends Foo_I_ with Bar_If { class I; ; f; } +// */abstract class Mix_I_eFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_eFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_If extends Foo_If { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBar___ extends Foo_If with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBar__f extends Foo_If with Bar__f { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBar_I_ extends Foo_If with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBar_If extends Foo_If with Bar_If { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBarY__ extends Foo_If with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBarY_f extends Foo_If with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFoo_IfwBarYIf extends Foo_If with BarYIf[B] { class I; ; f; } +/* */abstract class Mix_I_eFooX__ extends FooX__[A] { class I; ; f; } +/* */abstract class Mix_I_eFooX__wBar___ extends FooX__[A] with Bar___ { class I; ; f; } +/* *//* */ class Mix_I_eFooX__wBar__f extends FooX__[A] with Bar__f { class I; ; f; } +// */abstract class Mix_I_eFooX__wBar_I_ extends FooX__[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFooX__wBar_If extends FooX__[A] with Bar_If { class I; ; f; } +/* */abstract class Mix_I_eFooX__wBarY__ extends FooX__[A] with BarY__[B] { class I; ; f; } +/* *//* */ class Mix_I_eFooX__wBarY_f extends FooX__[A] with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_eFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFooX__wBarYIf extends FooX__[A] with BarYIf[B] { class I; ; f; } +/* *//* */ class Mix_I_eFooX_f extends FooX_f[A] { class I; ; f; } +/* *//* */ class Mix_I_eFooX_fwBar___ extends FooX_f[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBar__f extends FooX_f[A] with Bar__f { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBar_If extends FooX_f[A] with Bar_If { class I; ; f; } +/* *//* */ class Mix_I_eFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { class I; ; f; } +// */abstract class Mix_I_eFooXI_ extends FooXI_[A] { class I; ; f; } +// */abstract class Mix_I_eFooXI_wBar___ extends FooXI_[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFooXI_wBar__f extends FooXI_[A] with Bar__f { class I; ; f; } +// */abstract class Mix_I_eFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFooXI_wBar_If extends FooXI_[A] with Bar_If { class I; ; f; } +// */abstract class Mix_I_eFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_eFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXIf extends FooXIf[A] { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBar___ extends FooXIf[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBar__f extends FooXIf[A] with Bar__f { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBar_If extends FooXIf[A] with Bar_If { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_eFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { class I; ; f; } + +/* *//* */ class Mix_IfeFoo___ extends Foo___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo___wBar___ extends Foo___ with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo___wBar__f extends Foo___ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo___wBar_I_ extends Foo___ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo___wBar_If extends Foo___ with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo___wBarY__ extends Foo___ with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo___wBarY_f extends Foo___ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo___wBarYI_ extends Foo___ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo___wBarYIf extends Foo___ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo__f extends Foo__f { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo__fwBar___ extends Foo__f with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo__fwBar__f extends Foo__f with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo__fwBar_I_ extends Foo__f with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo__fwBar_If extends Foo__f with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo__fwBarY__ extends Foo__f with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFoo__fwBarY_f extends Foo__f with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo__fwBarYI_ extends Foo__f with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo__fwBarYIf extends Foo__f with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_ extends Foo_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBar___ extends Foo_I_ with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBar__f extends Foo_I_ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBar_If extends Foo_I_ with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_If extends Foo_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBar___ extends Foo_If with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBar__f extends Foo_If with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBar_I_ extends Foo_If with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBar_If extends Foo_If with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBarY__ extends Foo_If with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBarY_f extends Foo_If with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFoo_IfwBarYIf extends Foo_If with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX__ extends FooX__[A] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX__wBar___ extends FooX__[A] with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX__wBar__f extends FooX__[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX__wBar_I_ extends FooX__[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX__wBar_If extends FooX__[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX__wBarY__ extends FooX__[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX__wBarY_f extends FooX__[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX__wBarYIf extends FooX__[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX_f extends FooX_f[A] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX_fwBar___ extends FooX_f[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX_fwBar__f extends FooX_f[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX_fwBar_If extends FooX_f[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfeFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_ extends FooXI_[A] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBar___ extends FooXI_[A] with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBar__f extends FooXI_[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBar_If extends FooXI_[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIf extends FooXIf[A] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBar___ extends FooXIf[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBar__f extends FooXIf[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBar_If extends FooXIf[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfeFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } + +/* */abstract class MixZ__eFoo___ [Z] extends Foo___ { ; ; f; } +/* */abstract class MixZ__eFoo___wBar___[Z] extends Foo___ with Bar___ { ; ; f; } +/* */abstract class MixZ__eFoo___wBar__f[Z] extends Foo___ with Bar__f { ; ; f; } +/* */abstract class MixZ__eFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { ; ; f; } +/* *//* */ class MixZ__eFoo___wBar_If[Z] extends Foo___ with Bar_If { ; ; f; } +/* */abstract class MixZ__eFoo___wBarY__[Z] extends Foo___ with BarY__[B] { ; ; f; } +/* */abstract class MixZ__eFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { ; ; f; } +/* */abstract class MixZ__eFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { ; ; f; } +/* *//* */ class MixZ__eFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__eFoo__f [Z] extends Foo__f { ; ; f; } +/* */abstract class MixZ__eFoo__fwBar___[Z] extends Foo__f with Bar___ { ; ; f; } +// */abstract class MixZ__eFoo__fwBar__f[Z] extends Foo__f with Bar__f { ; ; f; } +/* *//* */ class MixZ__eFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFoo__fwBar_If[Z] extends Foo__f with Bar_If { ; ; f; } +/* */abstract class MixZ__eFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { ; ; f; } +// */abstract class MixZ__eFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { ; ; f; } +/* *//* */ class MixZ__eFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__eFoo_I_ [Z] extends Foo_I_ { ; ; f; } +/* */abstract class MixZ__eFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { ; ; f; } +/* *//* */ class MixZ__eFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { ; ; f; } +// */abstract class MixZ__eFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { ; ; f; } +/* */abstract class MixZ__eFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { ; ; f; } +/* *//* */ class MixZ__eFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { ; ; f; } +// */abstract class MixZ__eFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { ; ; f; } +/* *//* */ class MixZ__eFoo_If [Z] extends Foo_If { ; ; f; } +/* *//* */ class MixZ__eFoo_IfwBar___[Z] extends Foo_If with Bar___ { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBar__f[Z] extends Foo_If with Bar__f { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBar_If[Z] extends Foo_If with Bar_If { ; ; f; } +/* *//* */ class MixZ__eFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__eFooX__ [Z] extends FooX__[A] { ; ; f; } +/* */abstract class MixZ__eFooX__wBar___[Z] extends FooX__[A] with Bar___ { ; ; f; } +/* */abstract class MixZ__eFooX__wBar__f[Z] extends FooX__[A] with Bar__f { ; ; f; } +/* */abstract class MixZ__eFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { ; ; f; } +/* *//* */ class MixZ__eFooX__wBar_If[Z] extends FooX__[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__eFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { ; ; f; } +/* */abstract class MixZ__eFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { ; ; f; } +/* */abstract class MixZ__eFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { ; ; f; } +/* *//* */ class MixZ__eFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__eFooX_f [Z] extends FooX_f[A] { ; ; f; } +/* */abstract class MixZ__eFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { ; ; f; } +// */abstract class MixZ__eFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { ; ; f; } +/* *//* */ class MixZ__eFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__eFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { ; ; f; } +// */abstract class MixZ__eFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { ; ; f; } +/* *//* */ class MixZ__eFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__eFooXI_ [Z] extends FooXI_[A] { ; ; f; } +/* */abstract class MixZ__eFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { ; ; f; } +/* *//* */ class MixZ__eFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { ; ; f; } +// */abstract class MixZ__eFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__eFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { ; ; f; } +/* *//* */ class MixZ__eFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { ; ; f; } +// */abstract class MixZ__eFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { ; ; f; } +/* *//* */ class MixZ__eFooXIf [Z] extends FooXIf[A] { ; ; f; } +/* *//* */ class MixZ__eFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { ; ; f; } +// *//* */ class MixZ__eFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { ; ; f; } +// *//* */ class MixZ__eFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__eFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { ; ; f; } +/* *//* */ class MixZ__eFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { ; ; f; } +// *//* */ class MixZ__eFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { ; ; f; } +// *//* */ class MixZ__eFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__eFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { ; ; f; } + +/* */abstract class MixZ_feFoo___ [Z] extends Foo___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo___wBar___[Z] extends Foo___ with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo___wBar__f[Z] extends Foo___ with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo___wBar_If[Z] extends Foo___ with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo___wBarY__[Z] extends Foo___ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo__f [Z] extends Foo__f { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo__fwBar___[Z] extends Foo__f with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo__fwBar__f[Z] extends Foo__f with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo__fwBar_If[Z] extends Foo__f with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_I_ [Z] extends Foo_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_If [Z] extends Foo_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_IfwBar___[Z] extends Foo_If with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_IfwBar__f[Z] extends Foo_If with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_IfwBar_If[Z] extends Foo_If with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX__ [Z] extends FooX__[A] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX__wBar___[Z] extends FooX__[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX__wBar__f[Z] extends FooX__[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX__wBar_If[Z] extends FooX__[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX_f [Z] extends FooX_f[A] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_feFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXI_ [Z] extends FooXI_[A] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXIf [Z] extends FooXIf[A] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_feFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_feFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } + +/* */abstract class MixZI_eFoo___ [Z] extends Foo___ { class I; ; f; } +/* */abstract class MixZI_eFoo___wBar___[Z] extends Foo___ with Bar___ { class I; ; f; } +/* *//* */ class MixZI_eFoo___wBar__f[Z] extends Foo___ with Bar__f { class I; ; f; } +// */abstract class MixZI_eFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFoo___wBar_If[Z] extends Foo___ with Bar_If { class I; ; f; } +/* */abstract class MixZI_eFoo___wBarY__[Z] extends Foo___ with BarY__[B] { class I; ; f; } +/* *//* */ class MixZI_eFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_eFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { class I; ; f; } +/* *//* */ class MixZI_eFoo__f [Z] extends Foo__f { class I; ; f; } +/* *//* */ class MixZI_eFoo__fwBar___[Z] extends Foo__f with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBar__f[Z] extends Foo__f with Bar__f { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBar_If[Z] extends Foo__f with Bar_If { class I; ; f; } +/* *//* */ class MixZI_eFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { class I; ; f; } +// */abstract class MixZI_eFoo_I_ [Z] extends Foo_I_ { class I; ; f; } +// */abstract class MixZI_eFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { class I; ; f; } +// */abstract class MixZI_eFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { class I; ; f; } +// */abstract class MixZI_eFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_eFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_If [Z] extends Foo_If { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBar___[Z] extends Foo_If with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBar__f[Z] extends Foo_If with Bar__f { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBar_If[Z] extends Foo_If with Bar_If { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { class I; ; f; } +/* */abstract class MixZI_eFooX__ [Z] extends FooX__[A] { class I; ; f; } +/* */abstract class MixZI_eFooX__wBar___[Z] extends FooX__[A] with Bar___ { class I; ; f; } +/* *//* */ class MixZI_eFooX__wBar__f[Z] extends FooX__[A] with Bar__f { class I; ; f; } +// */abstract class MixZI_eFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFooX__wBar_If[Z] extends FooX__[A] with Bar_If { class I; ; f; } +/* */abstract class MixZI_eFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { class I; ; f; } +/* *//* */ class MixZI_eFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_eFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { class I; ; f; } +/* *//* */ class MixZI_eFooX_f [Z] extends FooX_f[A] { class I; ; f; } +/* *//* */ class MixZI_eFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { class I; ; f; } +/* *//* */ class MixZI_eFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { class I; ; f; } +// */abstract class MixZI_eFooXI_ [Z] extends FooXI_[A] { class I; ; f; } +// */abstract class MixZI_eFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { class I; ; f; } +// */abstract class MixZI_eFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { class I; ; f; } +// */abstract class MixZI_eFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_eFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { class I; ; f; } +// *//* */ class MixZI_eFooXIf [Z] extends FooXIf[A] { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_eFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { class I; ; f; } + +/* *//* */ class MixZIfeFoo___ [Z] extends Foo___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo___wBar___[Z] extends Foo___ with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo___wBar__f[Z] extends Foo___ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo___wBar_If[Z] extends Foo___ with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo___wBarY__[Z] extends Foo___ with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo__f [Z] extends Foo__f { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo__fwBar___[Z] extends Foo__f with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo__fwBar__f[Z] extends Foo__f with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo__fwBar_If[Z] extends Foo__f with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_ [Z] extends Foo_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_If [Z] extends Foo_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBar___[Z] extends Foo_If with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBar__f[Z] extends Foo_If with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBar_If[Z] extends Foo_If with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX__ [Z] extends FooX__[A] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX__wBar___[Z] extends FooX__[A] with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX__wBar__f[Z] extends FooX__[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX__wBar_If[Z] extends FooX__[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX_f [Z] extends FooX_f[A] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfeFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_ [Z] extends FooXI_[A] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIf [Z] extends FooXIf[A] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfeFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } + + + +/* */abstract class Mix___wFoo___ extends Foo___ { ; ; f; } +/* */abstract class Mix___wFoo___wBar___ extends Foo___ with Bar___ { ; ; f; } +/* */abstract class Mix___wFoo___wBar__f extends Foo___ with Bar__f { ; ; f; } +/* */abstract class Mix___wFoo___wBar_I_ extends Foo___ with Bar_I_ { ; ; f; } +/* *//* */ class Mix___wFoo___wBar_If extends Foo___ with Bar_If { ; ; f; } +/* */abstract class Mix___wFoo___wBarY__ extends Foo___ with BarY__[B] { ; ; f; } +/* */abstract class Mix___wFoo___wBarY_f extends Foo___ with BarY_f[B] { ; ; f; } +/* */abstract class Mix___wFoo___wBarYI_ extends Foo___ with BarYI_[B] { ; ; f; } +/* *//* */ class Mix___wFoo___wBarYIf extends Foo___ with BarYIf[B] { ; ; f; } +/* */abstract class Mix___wFoo__f extends Foo__f { ; ; f; } +/* */abstract class Mix___wFoo__fwBar___ extends Foo__f with Bar___ { ; ; f; } +// */abstract class Mix___wFoo__fwBar__f extends Foo__f with Bar__f { ; ; f; } +/* *//* */ class Mix___wFoo__fwBar_I_ extends Foo__f with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFoo__fwBar_If extends Foo__f with Bar_If { ; ; f; } +/* */abstract class Mix___wFoo__fwBarY__ extends Foo__f with BarY__[B] { ; ; f; } +// */abstract class Mix___wFoo__fwBarY_f extends Foo__f with BarY_f[B] { ; ; f; } +/* *//* */ class Mix___wFoo__fwBarYI_ extends Foo__f with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFoo__fwBarYIf extends Foo__f with BarYIf[B] { ; ; f; } +/* */abstract class Mix___wFoo_I_ extends Foo_I_ { ; ; f; } +/* */abstract class Mix___wFoo_I_wBar___ extends Foo_I_ with Bar___ { ; ; f; } +/* *//* */ class Mix___wFoo_I_wBar__f extends Foo_I_ with Bar__f { ; ; f; } +// */abstract class Mix___wFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFoo_I_wBar_If extends Foo_I_ with Bar_If { ; ; f; } +/* */abstract class Mix___wFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { ; ; f; } +/* *//* */ class Mix___wFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { ; ; f; } +// */abstract class Mix___wFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { ; ; f; } +/* *//* */ class Mix___wFoo_If extends Foo_If { ; ; f; } +/* *//* */ class Mix___wFoo_IfwBar___ extends Foo_If with Bar___ { ; ; f; } +// *//* */ class Mix___wFoo_IfwBar__f extends Foo_If with Bar__f { ; ; f; } +// *//* */ class Mix___wFoo_IfwBar_I_ extends Foo_If with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFoo_IfwBar_If extends Foo_If with Bar_If { ; ; f; } +/* *//* */ class Mix___wFoo_IfwBarY__ extends Foo_If with BarY__[B] { ; ; f; } +// *//* */ class Mix___wFoo_IfwBarY_f extends Foo_If with BarY_f[B] { ; ; f; } +// *//* */ class Mix___wFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFoo_IfwBarYIf extends Foo_If with BarYIf[B] { ; ; f; } +/* */abstract class Mix___wFooX__ extends FooX__[A] { ; ; f; } +/* */abstract class Mix___wFooX__wBar___ extends FooX__[A] with Bar___ { ; ; f; } +/* */abstract class Mix___wFooX__wBar__f extends FooX__[A] with Bar__f { ; ; f; } +/* */abstract class Mix___wFooX__wBar_I_ extends FooX__[A] with Bar_I_ { ; ; f; } +/* *//* */ class Mix___wFooX__wBar_If extends FooX__[A] with Bar_If { ; ; f; } +/* */abstract class Mix___wFooX__wBarY__ extends FooX__[A] with BarY__[B] { ; ; f; } +/* */abstract class Mix___wFooX__wBarY_f extends FooX__[A] with BarY_f[B] { ; ; f; } +/* */abstract class Mix___wFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { ; ; f; } +/* *//* */ class Mix___wFooX__wBarYIf extends FooX__[A] with BarYIf[B] { ; ; f; } +/* */abstract class Mix___wFooX_f extends FooX_f[A] { ; ; f; } +/* */abstract class Mix___wFooX_fwBar___ extends FooX_f[A] with Bar___ { ; ; f; } +// */abstract class Mix___wFooX_fwBar__f extends FooX_f[A] with Bar__f { ; ; f; } +/* *//* */ class Mix___wFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFooX_fwBar_If extends FooX_f[A] with Bar_If { ; ; f; } +/* */abstract class Mix___wFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { ; ; f; } +// */abstract class Mix___wFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { ; ; f; } +/* *//* */ class Mix___wFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { ; ; f; } +/* */abstract class Mix___wFooXI_ extends FooXI_[A] { ; ; f; } +/* */abstract class Mix___wFooXI_wBar___ extends FooXI_[A] with Bar___ { ; ; f; } +/* *//* */ class Mix___wFooXI_wBar__f extends FooXI_[A] with Bar__f { ; ; f; } +// */abstract class Mix___wFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFooXI_wBar_If extends FooXI_[A] with Bar_If { ; ; f; } +/* */abstract class Mix___wFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { ; ; f; } +/* *//* */ class Mix___wFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { ; ; f; } +// */abstract class Mix___wFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { ; ; f; } +/* *//* */ class Mix___wFooXIf extends FooXIf[A] { ; ; f; } +/* *//* */ class Mix___wFooXIfwBar___ extends FooXIf[A] with Bar___ { ; ; f; } +// *//* */ class Mix___wFooXIfwBar__f extends FooXIf[A] with Bar__f { ; ; f; } +// *//* */ class Mix___wFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { ; ; f; } +// *//* */ class Mix___wFooXIfwBar_If extends FooXIf[A] with Bar_If { ; ; f; } +/* *//* */ class Mix___wFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { ; ; f; } +// *//* */ class Mix___wFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { ; ; f; } +// *//* */ class Mix___wFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { ; ; f; } +// *//* */ class Mix___wFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { ; ; f; } + +/* */abstract class Mix__fwFoo___ extends Foo___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo___wBar___ extends Foo___ with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo___wBar__f extends Foo___ with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo___wBar_I_ extends Foo___ with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo___wBar_If extends Foo___ with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo___wBarY__ extends Foo___ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo___wBarY_f extends Foo___ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo___wBarYI_ extends Foo___ with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo___wBarYIf extends Foo___ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo__f extends Foo__f { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo__fwBar___ extends Foo__f with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo__fwBar__f extends Foo__f with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo__fwBar_I_ extends Foo__f with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo__fwBar_If extends Foo__f with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo__fwBarY__ extends Foo__f with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFoo__fwBarY_f extends Foo__f with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo__fwBarYI_ extends Foo__f with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo__fwBarYIf extends Foo__f with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_I_ extends Foo_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_I_wBar___ extends Foo_I_ with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_I_wBar__f extends Foo_I_ with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_I_wBar_If extends Foo_I_ with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_If extends Foo_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_IfwBar___ extends Foo_If with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_IfwBar__f extends Foo_If with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_IfwBar_I_ extends Foo_If with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_IfwBar_If extends Foo_If with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_IfwBarY__ extends Foo_If with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFoo_IfwBarY_f extends Foo_If with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFoo_IfwBarYIf extends Foo_If with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX__ extends FooX__[A] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX__wBar___ extends FooX__[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX__wBar__f extends FooX__[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX__wBar_I_ extends FooX__[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX__wBar_If extends FooX__[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX__wBarY__ extends FooX__[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX__wBarY_f extends FooX__[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX__wBarYIf extends FooX__[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX_f extends FooX_f[A] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX_fwBar___ extends FooX_f[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX_fwBar__f extends FooX_f[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX_fwBar_If extends FooX_f[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class Mix__fwFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXI_ extends FooXI_[A] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXI_wBar___ extends FooXI_[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXI_wBar__f extends FooXI_[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXI_wBar_If extends FooXI_[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXIf extends FooXIf[A] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXIfwBar___ extends FooXIf[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXIfwBar__f extends FooXIf[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXIfwBar_If extends FooXIf[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class Mix__fwFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class Mix__fwFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } + +/* */abstract class Mix_I_wFoo___ extends Foo___ { class I; ; f; } +/* */abstract class Mix_I_wFoo___wBar___ extends Foo___ with Bar___ { class I; ; f; } +/* *//* */ class Mix_I_wFoo___wBar__f extends Foo___ with Bar__f { class I; ; f; } +// */abstract class Mix_I_wFoo___wBar_I_ extends Foo___ with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFoo___wBar_If extends Foo___ with Bar_If { class I; ; f; } +/* */abstract class Mix_I_wFoo___wBarY__ extends Foo___ with BarY__[B] { class I; ; f; } +/* *//* */ class Mix_I_wFoo___wBarY_f extends Foo___ with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_wFoo___wBarYI_ extends Foo___ with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo___wBarYIf extends Foo___ with BarYIf[B] { class I; ; f; } +/* *//* */ class Mix_I_wFoo__f extends Foo__f { class I; ; f; } +/* *//* */ class Mix_I_wFoo__fwBar___ extends Foo__f with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBar__f extends Foo__f with Bar__f { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBar_I_ extends Foo__f with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBar_If extends Foo__f with Bar_If { class I; ; f; } +/* *//* */ class Mix_I_wFoo__fwBarY__ extends Foo__f with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBarY_f extends Foo__f with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBarYI_ extends Foo__f with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo__fwBarYIf extends Foo__f with BarYIf[B] { class I; ; f; } +// */abstract class Mix_I_wFoo_I_ extends Foo_I_ { class I; ; f; } +// */abstract class Mix_I_wFoo_I_wBar___ extends Foo_I_ with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFoo_I_wBar__f extends Foo_I_ with Bar__f { class I; ; f; } +// */abstract class Mix_I_wFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFoo_I_wBar_If extends Foo_I_ with Bar_If { class I; ; f; } +// */abstract class Mix_I_wFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_wFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_If extends Foo_If { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBar___ extends Foo_If with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBar__f extends Foo_If with Bar__f { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBar_I_ extends Foo_If with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBar_If extends Foo_If with Bar_If { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBarY__ extends Foo_If with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBarY_f extends Foo_If with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFoo_IfwBarYIf extends Foo_If with BarYIf[B] { class I; ; f; } +/* */abstract class Mix_I_wFooX__ extends FooX__[A] { class I; ; f; } +/* */abstract class Mix_I_wFooX__wBar___ extends FooX__[A] with Bar___ { class I; ; f; } +/* *//* */ class Mix_I_wFooX__wBar__f extends FooX__[A] with Bar__f { class I; ; f; } +// */abstract class Mix_I_wFooX__wBar_I_ extends FooX__[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFooX__wBar_If extends FooX__[A] with Bar_If { class I; ; f; } +/* */abstract class Mix_I_wFooX__wBarY__ extends FooX__[A] with BarY__[B] { class I; ; f; } +/* *//* */ class Mix_I_wFooX__wBarY_f extends FooX__[A] with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_wFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFooX__wBarYIf extends FooX__[A] with BarYIf[B] { class I; ; f; } +/* *//* */ class Mix_I_wFooX_f extends FooX_f[A] { class I; ; f; } +/* *//* */ class Mix_I_wFooX_fwBar___ extends FooX_f[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBar__f extends FooX_f[A] with Bar__f { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBar_If extends FooX_f[A] with Bar_If { class I; ; f; } +/* *//* */ class Mix_I_wFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { class I; ; f; } +// */abstract class Mix_I_wFooXI_ extends FooXI_[A] { class I; ; f; } +// */abstract class Mix_I_wFooXI_wBar___ extends FooXI_[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFooXI_wBar__f extends FooXI_[A] with Bar__f { class I; ; f; } +// */abstract class Mix_I_wFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFooXI_wBar_If extends FooXI_[A] with Bar_If { class I; ; f; } +// */abstract class Mix_I_wFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { class I; ; f; } +// */abstract class Mix_I_wFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXIf extends FooXIf[A] { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBar___ extends FooXIf[A] with Bar___ { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBar__f extends FooXIf[A] with Bar__f { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBar_If extends FooXIf[A] with Bar_If { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { class I; ; f; } +// *//* */ class Mix_I_wFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { class I; ; f; } + +/* *//* */ class Mix_IfwFoo___ extends Foo___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo___wBar___ extends Foo___ with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo___wBar__f extends Foo___ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo___wBar_I_ extends Foo___ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo___wBar_If extends Foo___ with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo___wBarY__ extends Foo___ with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo___wBarY_f extends Foo___ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo___wBarYI_ extends Foo___ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo___wBarYIf extends Foo___ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo__f extends Foo__f { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo__fwBar___ extends Foo__f with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo__fwBar__f extends Foo__f with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo__fwBar_I_ extends Foo__f with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo__fwBar_If extends Foo__f with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo__fwBarY__ extends Foo__f with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFoo__fwBarY_f extends Foo__f with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo__fwBarYI_ extends Foo__f with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo__fwBarYIf extends Foo__f with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_ extends Foo_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBar___ extends Foo_I_ with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBar__f extends Foo_I_ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBar_I_ extends Foo_I_ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBar_If extends Foo_I_ with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBarY__ extends Foo_I_ with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBarY_f extends Foo_I_ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBarYI_ extends Foo_I_ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_I_wBarYIf extends Foo_I_ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_If extends Foo_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBar___ extends Foo_If with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBar__f extends Foo_If with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBar_I_ extends Foo_If with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBar_If extends Foo_If with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBarY__ extends Foo_If with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBarY_f extends Foo_If with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBarYI_ extends Foo_If with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFoo_IfwBarYIf extends Foo_If with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX__ extends FooX__[A] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX__wBar___ extends FooX__[A] with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX__wBar__f extends FooX__[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX__wBar_I_ extends FooX__[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX__wBar_If extends FooX__[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX__wBarY__ extends FooX__[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX__wBarY_f extends FooX__[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX__wBarYI_ extends FooX__[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX__wBarYIf extends FooX__[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX_f extends FooX_f[A] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX_fwBar___ extends FooX_f[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX_fwBar__f extends FooX_f[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX_fwBar_I_ extends FooX_f[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX_fwBar_If extends FooX_f[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX_fwBarY__ extends FooX_f[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class Mix_IfwFooX_fwBarY_f extends FooX_f[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX_fwBarYI_ extends FooX_f[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooX_fwBarYIf extends FooX_f[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_ extends FooXI_[A] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBar___ extends FooXI_[A] with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBar__f extends FooXI_[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBar_I_ extends FooXI_[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBar_If extends FooXI_[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBarY__ extends FooXI_[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBarY_f extends FooXI_[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBarYI_ extends FooXI_[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXI_wBarYIf extends FooXI_[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIf extends FooXIf[A] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBar___ extends FooXIf[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBar__f extends FooXIf[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBar_I_ extends FooXIf[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBar_If extends FooXIf[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBarY__ extends FooXIf[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBarY_f extends FooXIf[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBarYI_ extends FooXIf[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class Mix_IfwFooXIfwBarYIf extends FooXIf[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } + +/* */abstract class MixZ__wFoo___ [Z] extends Foo___ { ; ; f; } +/* */abstract class MixZ__wFoo___wBar___[Z] extends Foo___ with Bar___ { ; ; f; } +/* */abstract class MixZ__wFoo___wBar__f[Z] extends Foo___ with Bar__f { ; ; f; } +/* */abstract class MixZ__wFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { ; ; f; } +/* *//* */ class MixZ__wFoo___wBar_If[Z] extends Foo___ with Bar_If { ; ; f; } +/* */abstract class MixZ__wFoo___wBarY__[Z] extends Foo___ with BarY__[B] { ; ; f; } +/* */abstract class MixZ__wFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { ; ; f; } +/* */abstract class MixZ__wFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { ; ; f; } +/* *//* */ class MixZ__wFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__wFoo__f [Z] extends Foo__f { ; ; f; } +/* */abstract class MixZ__wFoo__fwBar___[Z] extends Foo__f with Bar___ { ; ; f; } +// */abstract class MixZ__wFoo__fwBar__f[Z] extends Foo__f with Bar__f { ; ; f; } +/* *//* */ class MixZ__wFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFoo__fwBar_If[Z] extends Foo__f with Bar_If { ; ; f; } +/* */abstract class MixZ__wFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { ; ; f; } +// */abstract class MixZ__wFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { ; ; f; } +/* *//* */ class MixZ__wFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__wFoo_I_ [Z] extends Foo_I_ { ; ; f; } +/* */abstract class MixZ__wFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { ; ; f; } +/* *//* */ class MixZ__wFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { ; ; f; } +// */abstract class MixZ__wFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { ; ; f; } +/* */abstract class MixZ__wFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { ; ; f; } +/* *//* */ class MixZ__wFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { ; ; f; } +// */abstract class MixZ__wFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { ; ; f; } +/* *//* */ class MixZ__wFoo_If [Z] extends Foo_If { ; ; f; } +/* *//* */ class MixZ__wFoo_IfwBar___[Z] extends Foo_If with Bar___ { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBar__f[Z] extends Foo_If with Bar__f { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBar_If[Z] extends Foo_If with Bar_If { ; ; f; } +/* *//* */ class MixZ__wFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__wFooX__ [Z] extends FooX__[A] { ; ; f; } +/* */abstract class MixZ__wFooX__wBar___[Z] extends FooX__[A] with Bar___ { ; ; f; } +/* */abstract class MixZ__wFooX__wBar__f[Z] extends FooX__[A] with Bar__f { ; ; f; } +/* */abstract class MixZ__wFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { ; ; f; } +/* *//* */ class MixZ__wFooX__wBar_If[Z] extends FooX__[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__wFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { ; ; f; } +/* */abstract class MixZ__wFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { ; ; f; } +/* */abstract class MixZ__wFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { ; ; f; } +/* *//* */ class MixZ__wFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__wFooX_f [Z] extends FooX_f[A] { ; ; f; } +/* */abstract class MixZ__wFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { ; ; f; } +// */abstract class MixZ__wFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { ; ; f; } +/* *//* */ class MixZ__wFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__wFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { ; ; f; } +// */abstract class MixZ__wFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { ; ; f; } +/* *//* */ class MixZ__wFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { ; ; f; } +/* */abstract class MixZ__wFooXI_ [Z] extends FooXI_[A] { ; ; f; } +/* */abstract class MixZ__wFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { ; ; f; } +/* *//* */ class MixZ__wFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { ; ; f; } +// */abstract class MixZ__wFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { ; ; f; } +/* */abstract class MixZ__wFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { ; ; f; } +/* *//* */ class MixZ__wFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { ; ; f; } +// */abstract class MixZ__wFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { ; ; f; } +/* *//* */ class MixZ__wFooXIf [Z] extends FooXIf[A] { ; ; f; } +/* *//* */ class MixZ__wFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { ; ; f; } +// *//* */ class MixZ__wFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { ; ; f; } +// *//* */ class MixZ__wFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { ; ; f; } +// *//* */ class MixZ__wFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { ; ; f; } +/* *//* */ class MixZ__wFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { ; ; f; } +// *//* */ class MixZ__wFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { ; ; f; } +// *//* */ class MixZ__wFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { ; ; f; } +// *//* */ class MixZ__wFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { ; ; f; } + +/* */abstract class MixZ_fwFoo___ [Z] extends Foo___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo___wBar___[Z] extends Foo___ with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo___wBar__f[Z] extends Foo___ with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo___wBar_If[Z] extends Foo___ with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo___wBarY__[Z] extends Foo___ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo__f [Z] extends Foo__f { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo__fwBar___[Z] extends Foo__f with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo__fwBar__f[Z] extends Foo__f with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo__fwBar_If[Z] extends Foo__f with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_I_ [Z] extends Foo_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_If [Z] extends Foo_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_IfwBar___[Z] extends Foo_If with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_IfwBar__f[Z] extends Foo_If with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_IfwBar_If[Z] extends Foo_If with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX__ [Z] extends FooX__[A] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX__wBar___[Z] extends FooX__[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX__wBar__f[Z] extends FooX__[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX__wBar_If[Z] extends FooX__[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX_f [Z] extends FooX_f[A] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* */abstract class MixZ_fwFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXI_ [Z] extends FooXI_[A] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { ; def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { ; def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXIf [Z] extends FooXIf[A] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { ; override def f: I = {mix; null}; f; } +/* *//* */ class MixZ_fwFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { ; override def f: I = {mix; null}; f; } +// *//* */ class MixZ_fwFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { ; override def f: I = {mix; null}; f; } + +/* */abstract class MixZI_wFoo___ [Z] extends Foo___ { class I; ; f; } +/* */abstract class MixZI_wFoo___wBar___[Z] extends Foo___ with Bar___ { class I; ; f; } +/* *//* */ class MixZI_wFoo___wBar__f[Z] extends Foo___ with Bar__f { class I; ; f; } +// */abstract class MixZI_wFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFoo___wBar_If[Z] extends Foo___ with Bar_If { class I; ; f; } +/* */abstract class MixZI_wFoo___wBarY__[Z] extends Foo___ with BarY__[B] { class I; ; f; } +/* *//* */ class MixZI_wFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_wFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { class I; ; f; } +/* *//* */ class MixZI_wFoo__f [Z] extends Foo__f { class I; ; f; } +/* *//* */ class MixZI_wFoo__fwBar___[Z] extends Foo__f with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBar__f[Z] extends Foo__f with Bar__f { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBar_If[Z] extends Foo__f with Bar_If { class I; ; f; } +/* *//* */ class MixZI_wFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { class I; ; f; } +// */abstract class MixZI_wFoo_I_ [Z] extends Foo_I_ { class I; ; f; } +// */abstract class MixZI_wFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { class I; ; f; } +// */abstract class MixZI_wFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { class I; ; f; } +// */abstract class MixZI_wFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_wFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_If [Z] extends Foo_If { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBar___[Z] extends Foo_If with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBar__f[Z] extends Foo_If with Bar__f { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBar_If[Z] extends Foo_If with Bar_If { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { class I; ; f; } +/* */abstract class MixZI_wFooX__ [Z] extends FooX__[A] { class I; ; f; } +/* */abstract class MixZI_wFooX__wBar___[Z] extends FooX__[A] with Bar___ { class I; ; f; } +/* *//* */ class MixZI_wFooX__wBar__f[Z] extends FooX__[A] with Bar__f { class I; ; f; } +// */abstract class MixZI_wFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFooX__wBar_If[Z] extends FooX__[A] with Bar_If { class I; ; f; } +/* */abstract class MixZI_wFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { class I; ; f; } +/* *//* */ class MixZI_wFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_wFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { class I; ; f; } +/* *//* */ class MixZI_wFooX_f [Z] extends FooX_f[A] { class I; ; f; } +/* *//* */ class MixZI_wFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { class I; ; f; } +/* *//* */ class MixZI_wFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { class I; ; f; } +// */abstract class MixZI_wFooXI_ [Z] extends FooXI_[A] { class I; ; f; } +// */abstract class MixZI_wFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { class I; ; f; } +// */abstract class MixZI_wFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { class I; ; f; } +// */abstract class MixZI_wFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { class I; ; f; } +// */abstract class MixZI_wFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { class I; ; f; } +// *//* */ class MixZI_wFooXIf [Z] extends FooXIf[A] { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { class I; ; f; } +// *//* */ class MixZI_wFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { class I; ; f; } + +/* *//* */ class MixZIfwFoo___ [Z] extends Foo___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo___wBar___[Z] extends Foo___ with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo___wBar__f[Z] extends Foo___ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo___wBar_I_[Z] extends Foo___ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo___wBar_If[Z] extends Foo___ with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo___wBarY__[Z] extends Foo___ with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo___wBarY_f[Z] extends Foo___ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo___wBarYI_[Z] extends Foo___ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo___wBarYIf[Z] extends Foo___ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo__f [Z] extends Foo__f { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo__fwBar___[Z] extends Foo__f with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo__fwBar__f[Z] extends Foo__f with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo__fwBar_I_[Z] extends Foo__f with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo__fwBar_If[Z] extends Foo__f with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo__fwBarY__[Z] extends Foo__f with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFoo__fwBarY_f[Z] extends Foo__f with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo__fwBarYI_[Z] extends Foo__f with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo__fwBarYIf[Z] extends Foo__f with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_ [Z] extends Foo_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBar___[Z] extends Foo_I_ with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBar__f[Z] extends Foo_I_ with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBar_I_[Z] extends Foo_I_ with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBar_If[Z] extends Foo_I_ with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBarY__[Z] extends Foo_I_ with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBarY_f[Z] extends Foo_I_ with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBarYI_[Z] extends Foo_I_ with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_I_wBarYIf[Z] extends Foo_I_ with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_If [Z] extends Foo_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBar___[Z] extends Foo_If with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBar__f[Z] extends Foo_If with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBar_I_[Z] extends Foo_If with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBar_If[Z] extends Foo_If with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBarY__[Z] extends Foo_If with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBarY_f[Z] extends Foo_If with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBarYI_[Z] extends Foo_If with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFoo_IfwBarYIf[Z] extends Foo_If with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX__ [Z] extends FooX__[A] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX__wBar___[Z] extends FooX__[A] with Bar___ { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX__wBar__f[Z] extends FooX__[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX__wBar_I_[Z] extends FooX__[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX__wBar_If[Z] extends FooX__[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX__wBarY__[Z] extends FooX__[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX__wBarY_f[Z] extends FooX__[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX__wBarYI_[Z] extends FooX__[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX__wBarYIf[Z] extends FooX__[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX_f [Z] extends FooX_f[A] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX_fwBar___[Z] extends FooX_f[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX_fwBar__f[Z] extends FooX_f[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX_fwBar_I_[Z] extends FooX_f[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX_fwBar_If[Z] extends FooX_f[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX_fwBarY__[Z] extends FooX_f[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +/* *//* */ class MixZIfwFooX_fwBarY_f[Z] extends FooX_f[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX_fwBarYI_[Z] extends FooX_f[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooX_fwBarYIf[Z] extends FooX_f[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_ [Z] extends FooXI_[A] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBar___[Z] extends FooXI_[A] with Bar___ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBar__f[Z] extends FooXI_[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBar_I_[Z] extends FooXI_[A] with Bar_I_ { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBar_If[Z] extends FooXI_[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBarY__[Z] extends FooXI_[A] with BarY__[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBarY_f[Z] extends FooXI_[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBarYI_[Z] extends FooXI_[A] with BarYI_[B] { class I; def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXI_wBarYIf[Z] extends FooXI_[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIf [Z] extends FooXIf[A] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBar___[Z] extends FooXIf[A] with Bar___ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBar__f[Z] extends FooXIf[A] with Bar__f { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBar_I_[Z] extends FooXIf[A] with Bar_I_ { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBar_If[Z] extends FooXIf[A] with Bar_If { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBarY__[Z] extends FooXIf[A] with BarY__[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBarY_f[Z] extends FooXIf[A] with BarY_f[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBarYI_[Z] extends FooXIf[A] with BarYI_[B] { class I; override def f: I = {mix; null}; f; } +// *//* */ class MixZIfwFooXIfwBarYIf[Z] extends FooXIf[A] with BarYIf[B] { class I; override def f: I = {mix; null}; f; } + + + + + +/* */class S_____eFoo___ extends Mix___eFoo___ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFoo___wBar___ extends Mix___eFoo___wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFoo___wBar__f extends Mix___eFoo___wBar__f { class I; ; f; } +/* */class S_____eFoo___wBar_I_ extends Mix___eFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFoo___wBar_If extends Mix___eFoo___wBar_If { ; ; f; } +/* */class S_____eFoo___wBarY__ extends Mix___eFoo___wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFoo___wBarY_f extends Mix___eFoo___wBarY_f { class I; ; f; } +/* */class S_____eFoo___wBarYI_ extends Mix___eFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFoo___wBarYIf extends Mix___eFoo___wBarYIf { ; ; f; } +/* */class S_____eFoo__f extends Mix___eFoo__f { class I; ; f; } +/* */class S_____eFoo__fwBar___ extends Mix___eFoo__fwBar___ { class I; ; f; } +// */class S_____eFoo__fwBar__f extends Mix___eFoo__fwBar__f { class I; ; f; } +/* */class S_____eFoo__fwBar_I_ extends Mix___eFoo__fwBar_I_ { ; ; f; } +// */class S_____eFoo__fwBar_If extends Mix___eFoo__fwBar_If { ; ; f; } +/* */class S_____eFoo__fwBarY__ extends Mix___eFoo__fwBarY__ { class I; ; f; } +// */class S_____eFoo__fwBarY_f extends Mix___eFoo__fwBarY_f { class I; ; f; } +/* */class S_____eFoo__fwBarYI_ extends Mix___eFoo__fwBarYI_ { ; ; f; } +// */class S_____eFoo__fwBarYIf extends Mix___eFoo__fwBarYIf { ; ; f; } +/* */class S_____eFoo_I_ extends Mix___eFoo_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFoo_I_wBar___ extends Mix___eFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_____eFoo_I_wBar__f extends Mix___eFoo_I_wBar__f { ; ; f; } +// */class S_____eFoo_I_wBar_I_ extends Mix___eFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_____eFoo_I_wBar_If extends Mix___eFoo_I_wBar_If { ; ; f; } +/* */class S_____eFoo_I_wBarY__ extends Mix___eFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_____eFoo_I_wBarY_f extends Mix___eFoo_I_wBarY_f { ; ; f; } +// */class S_____eFoo_I_wBarYI_ extends Mix___eFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_____eFoo_I_wBarYIf extends Mix___eFoo_I_wBarYIf { ; ; f; } +/* */class S_____eFoo_If extends Mix___eFoo_If { ; ; f; } +/* */class S_____eFoo_IfwBar___ extends Mix___eFoo_IfwBar___ { ; ; f; } +// */class S_____eFoo_IfwBar__f extends Mix___eFoo_IfwBar__f { ; ; f; } +// */class S_____eFoo_IfwBar_I_ extends Mix___eFoo_IfwBar_I_ { ; ; f; } +// */class S_____eFoo_IfwBar_If extends Mix___eFoo_IfwBar_If { ; ; f; } +/* */class S_____eFoo_IfwBarY__ extends Mix___eFoo_IfwBarY__ { ; ; f; } +// */class S_____eFoo_IfwBarY_f extends Mix___eFoo_IfwBarY_f { ; ; f; } +// */class S_____eFoo_IfwBarYI_ extends Mix___eFoo_IfwBarYI_ { ; ; f; } +// */class S_____eFoo_IfwBarYIf extends Mix___eFoo_IfwBarYIf { ; ; f; } +/* */class S_____eFooX__ extends Mix___eFooX__ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFooX__wBar___ extends Mix___eFooX__wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFooX__wBar__f extends Mix___eFooX__wBar__f { class I; ; f; } +/* */class S_____eFooX__wBar_I_ extends Mix___eFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFooX__wBar_If extends Mix___eFooX__wBar_If { ; ; f; } +/* */class S_____eFooX__wBarY__ extends Mix___eFooX__wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_____eFooX__wBarY_f extends Mix___eFooX__wBarY_f { class I; ; f; } +/* */class S_____eFooX__wBarYI_ extends Mix___eFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFooX__wBarYIf extends Mix___eFooX__wBarYIf { ; ; f; } +/* */class S_____eFooX_f extends Mix___eFooX_f { class I; ; f; } +/* */class S_____eFooX_fwBar___ extends Mix___eFooX_fwBar___ { class I; ; f; } +// */class S_____eFooX_fwBar__f extends Mix___eFooX_fwBar__f { class I; ; f; } +/* */class S_____eFooX_fwBar_I_ extends Mix___eFooX_fwBar_I_ { ; ; f; } +// */class S_____eFooX_fwBar_If extends Mix___eFooX_fwBar_If { ; ; f; } +/* */class S_____eFooX_fwBarY__ extends Mix___eFooX_fwBarY__ { class I; ; f; } +// */class S_____eFooX_fwBarY_f extends Mix___eFooX_fwBarY_f { class I; ; f; } +/* */class S_____eFooX_fwBarYI_ extends Mix___eFooX_fwBarYI_ { ; ; f; } +// */class S_____eFooX_fwBarYIf extends Mix___eFooX_fwBarYIf { ; ; f; } +/* */class S_____eFooXI_ extends Mix___eFooXI_ { ; def f: I = {sub; null}; f; } +/* */class S_____eFooXI_wBar___ extends Mix___eFooXI_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_____eFooXI_wBar__f extends Mix___eFooXI_wBar__f { ; ; f; } +// */class S_____eFooXI_wBar_I_ extends Mix___eFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_____eFooXI_wBar_If extends Mix___eFooXI_wBar_If { ; ; f; } +/* */class S_____eFooXI_wBarY__ extends Mix___eFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_____eFooXI_wBarY_f extends Mix___eFooXI_wBarY_f { ; ; f; } +// */class S_____eFooXI_wBarYI_ extends Mix___eFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_____eFooXI_wBarYIf extends Mix___eFooXI_wBarYIf { ; ; f; } +/* */class S_____eFooXIf extends Mix___eFooXIf { ; ; f; } +/* */class S_____eFooXIfwBar___ extends Mix___eFooXIfwBar___ { ; ; f; } +// */class S_____eFooXIfwBar__f extends Mix___eFooXIfwBar__f { ; ; f; } +// */class S_____eFooXIfwBar_I_ extends Mix___eFooXIfwBar_I_ { ; ; f; } +// */class S_____eFooXIfwBar_If extends Mix___eFooXIfwBar_If { ; ; f; } +/* */class S_____eFooXIfwBarY__ extends Mix___eFooXIfwBarY__ { ; ; f; } +// */class S_____eFooXIfwBarY_f extends Mix___eFooXIfwBarY_f { ; ; f; } +// */class S_____eFooXIfwBarYI_ extends Mix___eFooXIfwBarYI_ { ; ; f; } +// */class S_____eFooXIfwBarYIf extends Mix___eFooXIfwBarYIf { ; ; f; } + +/* */class S____feFoo___ extends Mix__feFoo___ { class I; ; f; } +/* */class S____feFoo___wBar___ extends Mix__feFoo___wBar___ { class I; ; f; } +/* */class S____feFoo___wBar__f extends Mix__feFoo___wBar__f { class I; ; f; } +/* */class S____feFoo___wBar_I_ extends Mix__feFoo___wBar_I_ { ; ; f; } +/* */class S____feFoo___wBar_If extends Mix__feFoo___wBar_If { ; ; f; } +/* */class S____feFoo___wBarY__ extends Mix__feFoo___wBarY__ { class I; ; f; } +/* */class S____feFoo___wBarY_f extends Mix__feFoo___wBarY_f { class I; ; f; } +/* */class S____feFoo___wBarYI_ extends Mix__feFoo___wBarYI_ { ; ; f; } +/* */class S____feFoo___wBarYIf extends Mix__feFoo___wBarYIf { ; ; f; } +/* */class S____feFoo__f extends Mix__feFoo__f { class I; ; f; } +/* */class S____feFoo__fwBar___ extends Mix__feFoo__fwBar___ { class I; ; f; } +/* */class S____feFoo__fwBar__f extends Mix__feFoo__fwBar__f { class I; ; f; } +/* */class S____feFoo__fwBar_I_ extends Mix__feFoo__fwBar_I_ { ; ; f; } +/* */class S____feFoo__fwBar_If extends Mix__feFoo__fwBar_If { ; ; f; } +/* */class S____feFoo__fwBarY__ extends Mix__feFoo__fwBarY__ { class I; ; f; } +/* */class S____feFoo__fwBarY_f extends Mix__feFoo__fwBarY_f { class I; ; f; } +/* */class S____feFoo__fwBarYI_ extends Mix__feFoo__fwBarYI_ { ; ; f; } +/* */class S____feFoo__fwBarYIf extends Mix__feFoo__fwBarYIf { ; ; f; } +/* */class S____feFoo_I_ extends Mix__feFoo_I_ { ; ; f; } +/* */class S____feFoo_I_wBar___ extends Mix__feFoo_I_wBar___ { ; ; f; } +/* */class S____feFoo_I_wBar__f extends Mix__feFoo_I_wBar__f { ; ; f; } +// */class S____feFoo_I_wBar_I_ extends Mix__feFoo_I_wBar_I_ { ; ; f; } +// */class S____feFoo_I_wBar_If extends Mix__feFoo_I_wBar_If { ; ; f; } +/* */class S____feFoo_I_wBarY__ extends Mix__feFoo_I_wBarY__ { ; ; f; } +/* */class S____feFoo_I_wBarY_f extends Mix__feFoo_I_wBarY_f { ; ; f; } +// */class S____feFoo_I_wBarYI_ extends Mix__feFoo_I_wBarYI_ { ; ; f; } +// */class S____feFoo_I_wBarYIf extends Mix__feFoo_I_wBarYIf { ; ; f; } +/* */class S____feFoo_If extends Mix__feFoo_If { ; ; f; } +/* */class S____feFoo_IfwBar___ extends Mix__feFoo_IfwBar___ { ; ; f; } +/* */class S____feFoo_IfwBar__f extends Mix__feFoo_IfwBar__f { ; ; f; } +// */class S____feFoo_IfwBar_I_ extends Mix__feFoo_IfwBar_I_ { ; ; f; } +// */class S____feFoo_IfwBar_If extends Mix__feFoo_IfwBar_If { ; ; f; } +/* */class S____feFoo_IfwBarY__ extends Mix__feFoo_IfwBarY__ { ; ; f; } +/* */class S____feFoo_IfwBarY_f extends Mix__feFoo_IfwBarY_f { ; ; f; } +// */class S____feFoo_IfwBarYI_ extends Mix__feFoo_IfwBarYI_ { ; ; f; } +// */class S____feFoo_IfwBarYIf extends Mix__feFoo_IfwBarYIf { ; ; f; } +/* */class S____feFooX__ extends Mix__feFooX__ { class I; ; f; } +/* */class S____feFooX__wBar___ extends Mix__feFooX__wBar___ { class I; ; f; } +/* */class S____feFooX__wBar__f extends Mix__feFooX__wBar__f { class I; ; f; } +/* */class S____feFooX__wBar_I_ extends Mix__feFooX__wBar_I_ { ; ; f; } +/* */class S____feFooX__wBar_If extends Mix__feFooX__wBar_If { ; ; f; } +/* */class S____feFooX__wBarY__ extends Mix__feFooX__wBarY__ { class I; ; f; } +/* */class S____feFooX__wBarY_f extends Mix__feFooX__wBarY_f { class I; ; f; } +/* */class S____feFooX__wBarYI_ extends Mix__feFooX__wBarYI_ { ; ; f; } +/* */class S____feFooX__wBarYIf extends Mix__feFooX__wBarYIf { ; ; f; } +/* */class S____feFooX_f extends Mix__feFooX_f { class I; ; f; } +/* */class S____feFooX_fwBar___ extends Mix__feFooX_fwBar___ { class I; ; f; } +/* */class S____feFooX_fwBar__f extends Mix__feFooX_fwBar__f { class I; ; f; } +/* */class S____feFooX_fwBar_I_ extends Mix__feFooX_fwBar_I_ { ; ; f; } +/* */class S____feFooX_fwBar_If extends Mix__feFooX_fwBar_If { ; ; f; } +/* */class S____feFooX_fwBarY__ extends Mix__feFooX_fwBarY__ { class I; ; f; } +/* */class S____feFooX_fwBarY_f extends Mix__feFooX_fwBarY_f { class I; ; f; } +/* */class S____feFooX_fwBarYI_ extends Mix__feFooX_fwBarYI_ { ; ; f; } +/* */class S____feFooX_fwBarYIf extends Mix__feFooX_fwBarYIf { ; ; f; } +/* */class S____feFooXI_ extends Mix__feFooXI_ { ; ; f; } +/* */class S____feFooXI_wBar___ extends Mix__feFooXI_wBar___ { ; ; f; } +/* */class S____feFooXI_wBar__f extends Mix__feFooXI_wBar__f { ; ; f; } +// */class S____feFooXI_wBar_I_ extends Mix__feFooXI_wBar_I_ { ; ; f; } +// */class S____feFooXI_wBar_If extends Mix__feFooXI_wBar_If { ; ; f; } +/* */class S____feFooXI_wBarY__ extends Mix__feFooXI_wBarY__ { ; ; f; } +/* */class S____feFooXI_wBarY_f extends Mix__feFooXI_wBarY_f { ; ; f; } +// */class S____feFooXI_wBarYI_ extends Mix__feFooXI_wBarYI_ { ; ; f; } +// */class S____feFooXI_wBarYIf extends Mix__feFooXI_wBarYIf { ; ; f; } +/* */class S____feFooXIf extends Mix__feFooXIf { ; ; f; } +/* */class S____feFooXIfwBar___ extends Mix__feFooXIfwBar___ { ; ; f; } +/* */class S____feFooXIfwBar__f extends Mix__feFooXIfwBar__f { ; ; f; } +// */class S____feFooXIfwBar_I_ extends Mix__feFooXIfwBar_I_ { ; ; f; } +// */class S____feFooXIfwBar_If extends Mix__feFooXIfwBar_If { ; ; f; } +/* */class S____feFooXIfwBarY__ extends Mix__feFooXIfwBarY__ { ; ; f; } +/* */class S____feFooXIfwBarY_f extends Mix__feFooXIfwBarY_f { ; ; f; } +// */class S____feFooXIfwBarYI_ extends Mix__feFooXIfwBarYI_ { ; ; f; } +// */class S____feFooXIfwBarYIf extends Mix__feFooXIfwBarYIf { ; ; f; } + +/* */class S___I_eFoo___ extends Mix_I_eFoo___ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFoo___wBar___ extends Mix_I_eFoo___wBar___ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFoo___wBar__f extends Mix_I_eFoo___wBar__f { ; ; f; } +// */class S___I_eFoo___wBar_I_ extends Mix_I_eFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo___wBar_If extends Mix_I_eFoo___wBar_If { ; ; f; } +/* */class S___I_eFoo___wBarY__ extends Mix_I_eFoo___wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFoo___wBarY_f extends Mix_I_eFoo___wBarY_f { ; ; f; } +// */class S___I_eFoo___wBarYI_ extends Mix_I_eFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo___wBarYIf extends Mix_I_eFoo___wBarYIf { ; ; f; } +/* */class S___I_eFoo__f extends Mix_I_eFoo__f { ; ; f; } +/* */class S___I_eFoo__fwBar___ extends Mix_I_eFoo__fwBar___ { ; ; f; } +// */class S___I_eFoo__fwBar__f extends Mix_I_eFoo__fwBar__f { ; ; f; } +// */class S___I_eFoo__fwBar_I_ extends Mix_I_eFoo__fwBar_I_ { ; ; f; } +// */class S___I_eFoo__fwBar_If extends Mix_I_eFoo__fwBar_If { ; ; f; } +/* */class S___I_eFoo__fwBarY__ extends Mix_I_eFoo__fwBarY__ { ; ; f; } +// */class S___I_eFoo__fwBarY_f extends Mix_I_eFoo__fwBarY_f { ; ; f; } +// */class S___I_eFoo__fwBarYI_ extends Mix_I_eFoo__fwBarYI_ { ; ; f; } +// */class S___I_eFoo__fwBarYIf extends Mix_I_eFoo__fwBarYIf { ; ; f; } +// */class S___I_eFoo_I_ extends Mix_I_eFoo_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo_I_wBar___ extends Mix_I_eFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo_I_wBar__f extends Mix_I_eFoo_I_wBar__f { ; ; f; } +// */class S___I_eFoo_I_wBar_I_ extends Mix_I_eFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo_I_wBar_If extends Mix_I_eFoo_I_wBar_If { ; ; f; } +// */class S___I_eFoo_I_wBarY__ extends Mix_I_eFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo_I_wBarY_f extends Mix_I_eFoo_I_wBarY_f { ; ; f; } +// */class S___I_eFoo_I_wBarYI_ extends Mix_I_eFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFoo_I_wBarYIf extends Mix_I_eFoo_I_wBarYIf { ; ; f; } +// */class S___I_eFoo_If extends Mix_I_eFoo_If { ; ; f; } +// */class S___I_eFoo_IfwBar___ extends Mix_I_eFoo_IfwBar___ { ; ; f; } +// */class S___I_eFoo_IfwBar__f extends Mix_I_eFoo_IfwBar__f { ; ; f; } +// */class S___I_eFoo_IfwBar_I_ extends Mix_I_eFoo_IfwBar_I_ { ; ; f; } +// */class S___I_eFoo_IfwBar_If extends Mix_I_eFoo_IfwBar_If { ; ; f; } +// */class S___I_eFoo_IfwBarY__ extends Mix_I_eFoo_IfwBarY__ { ; ; f; } +// */class S___I_eFoo_IfwBarY_f extends Mix_I_eFoo_IfwBarY_f { ; ; f; } +// */class S___I_eFoo_IfwBarYI_ extends Mix_I_eFoo_IfwBarYI_ { ; ; f; } +// */class S___I_eFoo_IfwBarYIf extends Mix_I_eFoo_IfwBarYIf { ; ; f; } +/* */class S___I_eFooX__ extends Mix_I_eFooX__ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFooX__wBar___ extends Mix_I_eFooX__wBar___ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFooX__wBar__f extends Mix_I_eFooX__wBar__f { ; ; f; } +// */class S___I_eFooX__wBar_I_ extends Mix_I_eFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooX__wBar_If extends Mix_I_eFooX__wBar_If { ; ; f; } +/* */class S___I_eFooX__wBarY__ extends Mix_I_eFooX__wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S___I_eFooX__wBarY_f extends Mix_I_eFooX__wBarY_f { ; ; f; } +// */class S___I_eFooX__wBarYI_ extends Mix_I_eFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooX__wBarYIf extends Mix_I_eFooX__wBarYIf { ; ; f; } +/* */class S___I_eFooX_f extends Mix_I_eFooX_f { ; ; f; } +/* */class S___I_eFooX_fwBar___ extends Mix_I_eFooX_fwBar___ { ; ; f; } +// */class S___I_eFooX_fwBar__f extends Mix_I_eFooX_fwBar__f { ; ; f; } +// */class S___I_eFooX_fwBar_I_ extends Mix_I_eFooX_fwBar_I_ { ; ; f; } +// */class S___I_eFooX_fwBar_If extends Mix_I_eFooX_fwBar_If { ; ; f; } +/* */class S___I_eFooX_fwBarY__ extends Mix_I_eFooX_fwBarY__ { ; ; f; } +// */class S___I_eFooX_fwBarY_f extends Mix_I_eFooX_fwBarY_f { ; ; f; } +// */class S___I_eFooX_fwBarYI_ extends Mix_I_eFooX_fwBarYI_ { ; ; f; } +// */class S___I_eFooX_fwBarYIf extends Mix_I_eFooX_fwBarYIf { ; ; f; } +// */class S___I_eFooXI_ extends Mix_I_eFooXI_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooXI_wBar___ extends Mix_I_eFooXI_wBar___ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooXI_wBar__f extends Mix_I_eFooXI_wBar__f { ; ; f; } +// */class S___I_eFooXI_wBar_I_ extends Mix_I_eFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooXI_wBar_If extends Mix_I_eFooXI_wBar_If { ; ; f; } +// */class S___I_eFooXI_wBarY__ extends Mix_I_eFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooXI_wBarY_f extends Mix_I_eFooXI_wBarY_f { ; ; f; } +// */class S___I_eFooXI_wBarYI_ extends Mix_I_eFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_eFooXI_wBarYIf extends Mix_I_eFooXI_wBarYIf { ; ; f; } +// */class S___I_eFooXIf extends Mix_I_eFooXIf { ; ; f; } +// */class S___I_eFooXIfwBar___ extends Mix_I_eFooXIfwBar___ { ; ; f; } +// */class S___I_eFooXIfwBar__f extends Mix_I_eFooXIfwBar__f { ; ; f; } +// */class S___I_eFooXIfwBar_I_ extends Mix_I_eFooXIfwBar_I_ { ; ; f; } +// */class S___I_eFooXIfwBar_If extends Mix_I_eFooXIfwBar_If { ; ; f; } +// */class S___I_eFooXIfwBarY__ extends Mix_I_eFooXIfwBarY__ { ; ; f; } +// */class S___I_eFooXIfwBarY_f extends Mix_I_eFooXIfwBarY_f { ; ; f; } +// */class S___I_eFooXIfwBarYI_ extends Mix_I_eFooXIfwBarYI_ { ; ; f; } +// */class S___I_eFooXIfwBarYIf extends Mix_I_eFooXIfwBarYIf { ; ; f; } + +/* */class S___IfeFoo___ extends Mix_IfeFoo___ { ; ; f; } +/* */class S___IfeFoo___wBar___ extends Mix_IfeFoo___wBar___ { ; ; f; } +/* */class S___IfeFoo___wBar__f extends Mix_IfeFoo___wBar__f { ; ; f; } +// */class S___IfeFoo___wBar_I_ extends Mix_IfeFoo___wBar_I_ { ; ; f; } +// */class S___IfeFoo___wBar_If extends Mix_IfeFoo___wBar_If { ; ; f; } +/* */class S___IfeFoo___wBarY__ extends Mix_IfeFoo___wBarY__ { ; ; f; } +/* */class S___IfeFoo___wBarY_f extends Mix_IfeFoo___wBarY_f { ; ; f; } +// */class S___IfeFoo___wBarYI_ extends Mix_IfeFoo___wBarYI_ { ; ; f; } +// */class S___IfeFoo___wBarYIf extends Mix_IfeFoo___wBarYIf { ; ; f; } +/* */class S___IfeFoo__f extends Mix_IfeFoo__f { ; ; f; } +/* */class S___IfeFoo__fwBar___ extends Mix_IfeFoo__fwBar___ { ; ; f; } +/* */class S___IfeFoo__fwBar__f extends Mix_IfeFoo__fwBar__f { ; ; f; } +// */class S___IfeFoo__fwBar_I_ extends Mix_IfeFoo__fwBar_I_ { ; ; f; } +// */class S___IfeFoo__fwBar_If extends Mix_IfeFoo__fwBar_If { ; ; f; } +/* */class S___IfeFoo__fwBarY__ extends Mix_IfeFoo__fwBarY__ { ; ; f; } +/* */class S___IfeFoo__fwBarY_f extends Mix_IfeFoo__fwBarY_f { ; ; f; } +// */class S___IfeFoo__fwBarYI_ extends Mix_IfeFoo__fwBarYI_ { ; ; f; } +// */class S___IfeFoo__fwBarYIf extends Mix_IfeFoo__fwBarYIf { ; ; f; } +// */class S___IfeFoo_I_ extends Mix_IfeFoo_I_ { ; ; f; } +// */class S___IfeFoo_I_wBar___ extends Mix_IfeFoo_I_wBar___ { ; ; f; } +// */class S___IfeFoo_I_wBar__f extends Mix_IfeFoo_I_wBar__f { ; ; f; } +// */class S___IfeFoo_I_wBar_I_ extends Mix_IfeFoo_I_wBar_I_ { ; ; f; } +// */class S___IfeFoo_I_wBar_If extends Mix_IfeFoo_I_wBar_If { ; ; f; } +// */class S___IfeFoo_I_wBarY__ extends Mix_IfeFoo_I_wBarY__ { ; ; f; } +// */class S___IfeFoo_I_wBarY_f extends Mix_IfeFoo_I_wBarY_f { ; ; f; } +// */class S___IfeFoo_I_wBarYI_ extends Mix_IfeFoo_I_wBarYI_ { ; ; f; } +// */class S___IfeFoo_I_wBarYIf extends Mix_IfeFoo_I_wBarYIf { ; ; f; } +// */class S___IfeFoo_If extends Mix_IfeFoo_If { ; ; f; } +// */class S___IfeFoo_IfwBar___ extends Mix_IfeFoo_IfwBar___ { ; ; f; } +// */class S___IfeFoo_IfwBar__f extends Mix_IfeFoo_IfwBar__f { ; ; f; } +// */class S___IfeFoo_IfwBar_I_ extends Mix_IfeFoo_IfwBar_I_ { ; ; f; } +// */class S___IfeFoo_IfwBar_If extends Mix_IfeFoo_IfwBar_If { ; ; f; } +// */class S___IfeFoo_IfwBarY__ extends Mix_IfeFoo_IfwBarY__ { ; ; f; } +// */class S___IfeFoo_IfwBarY_f extends Mix_IfeFoo_IfwBarY_f { ; ; f; } +// */class S___IfeFoo_IfwBarYI_ extends Mix_IfeFoo_IfwBarYI_ { ; ; f; } +// */class S___IfeFoo_IfwBarYIf extends Mix_IfeFoo_IfwBarYIf { ; ; f; } +/* */class S___IfeFooX__ extends Mix_IfeFooX__ { ; ; f; } +/* */class S___IfeFooX__wBar___ extends Mix_IfeFooX__wBar___ { ; ; f; } +/* */class S___IfeFooX__wBar__f extends Mix_IfeFooX__wBar__f { ; ; f; } +// */class S___IfeFooX__wBar_I_ extends Mix_IfeFooX__wBar_I_ { ; ; f; } +// */class S___IfeFooX__wBar_If extends Mix_IfeFooX__wBar_If { ; ; f; } +/* */class S___IfeFooX__wBarY__ extends Mix_IfeFooX__wBarY__ { ; ; f; } +/* */class S___IfeFooX__wBarY_f extends Mix_IfeFooX__wBarY_f { ; ; f; } +// */class S___IfeFooX__wBarYI_ extends Mix_IfeFooX__wBarYI_ { ; ; f; } +// */class S___IfeFooX__wBarYIf extends Mix_IfeFooX__wBarYIf { ; ; f; } +/* */class S___IfeFooX_f extends Mix_IfeFooX_f { ; ; f; } +/* */class S___IfeFooX_fwBar___ extends Mix_IfeFooX_fwBar___ { ; ; f; } +/* */class S___IfeFooX_fwBar__f extends Mix_IfeFooX_fwBar__f { ; ; f; } +// */class S___IfeFooX_fwBar_I_ extends Mix_IfeFooX_fwBar_I_ { ; ; f; } +// */class S___IfeFooX_fwBar_If extends Mix_IfeFooX_fwBar_If { ; ; f; } +/* */class S___IfeFooX_fwBarY__ extends Mix_IfeFooX_fwBarY__ { ; ; f; } +/* */class S___IfeFooX_fwBarY_f extends Mix_IfeFooX_fwBarY_f { ; ; f; } +// */class S___IfeFooX_fwBarYI_ extends Mix_IfeFooX_fwBarYI_ { ; ; f; } +// */class S___IfeFooX_fwBarYIf extends Mix_IfeFooX_fwBarYIf { ; ; f; } +// */class S___IfeFooXI_ extends Mix_IfeFooXI_ { ; ; f; } +// */class S___IfeFooXI_wBar___ extends Mix_IfeFooXI_wBar___ { ; ; f; } +// */class S___IfeFooXI_wBar__f extends Mix_IfeFooXI_wBar__f { ; ; f; } +// */class S___IfeFooXI_wBar_I_ extends Mix_IfeFooXI_wBar_I_ { ; ; f; } +// */class S___IfeFooXI_wBar_If extends Mix_IfeFooXI_wBar_If { ; ; f; } +// */class S___IfeFooXI_wBarY__ extends Mix_IfeFooXI_wBarY__ { ; ; f; } +// */class S___IfeFooXI_wBarY_f extends Mix_IfeFooXI_wBarY_f { ; ; f; } +// */class S___IfeFooXI_wBarYI_ extends Mix_IfeFooXI_wBarYI_ { ; ; f; } +// */class S___IfeFooXI_wBarYIf extends Mix_IfeFooXI_wBarYIf { ; ; f; } +// */class S___IfeFooXIf extends Mix_IfeFooXIf { ; ; f; } +// */class S___IfeFooXIfwBar___ extends Mix_IfeFooXIfwBar___ { ; ; f; } +// */class S___IfeFooXIfwBar__f extends Mix_IfeFooXIfwBar__f { ; ; f; } +// */class S___IfeFooXIfwBar_I_ extends Mix_IfeFooXIfwBar_I_ { ; ; f; } +// */class S___IfeFooXIfwBar_If extends Mix_IfeFooXIfwBar_If { ; ; f; } +// */class S___IfeFooXIfwBarY__ extends Mix_IfeFooXIfwBarY__ { ; ; f; } +// */class S___IfeFooXIfwBarY_f extends Mix_IfeFooXIfwBarY_f { ; ; f; } +// */class S___IfeFooXIfwBarYI_ extends Mix_IfeFooXIfwBarYI_ { ; ; f; } +// */class S___IfeFooXIfwBarYIf extends Mix_IfeFooXIfwBarYIf { ; ; f; } + +/* */class S__Z__eFoo___ extends MixZ__eFoo___ [C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo___wBar___ extends MixZ__eFoo___wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo___wBar__f extends MixZ__eFoo___wBar__f[C] { class I; ; f; } +/* */class S__Z__eFoo___wBar_I_ extends MixZ__eFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo___wBar_If extends MixZ__eFoo___wBar_If[C] { ; ; f; } +/* */class S__Z__eFoo___wBarY__ extends MixZ__eFoo___wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo___wBarY_f extends MixZ__eFoo___wBarY_f[C] { class I; ; f; } +/* */class S__Z__eFoo___wBarYI_ extends MixZ__eFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo___wBarYIf extends MixZ__eFoo___wBarYIf[C] { ; ; f; } +/* */class S__Z__eFoo__f extends MixZ__eFoo__f [C] { class I; ; f; } +/* */class S__Z__eFoo__fwBar___ extends MixZ__eFoo__fwBar___[C] { class I; ; f; } +// */class S__Z__eFoo__fwBar__f extends MixZ__eFoo__fwBar__f[C] { class I; ; f; } +/* */class S__Z__eFoo__fwBar_I_ extends MixZ__eFoo__fwBar_I_[C] { ; ; f; } +// */class S__Z__eFoo__fwBar_If extends MixZ__eFoo__fwBar_If[C] { ; ; f; } +/* */class S__Z__eFoo__fwBarY__ extends MixZ__eFoo__fwBarY__[C] { class I; ; f; } +// */class S__Z__eFoo__fwBarY_f extends MixZ__eFoo__fwBarY_f[C] { class I; ; f; } +/* */class S__Z__eFoo__fwBarYI_ extends MixZ__eFoo__fwBarYI_[C] { ; ; f; } +// */class S__Z__eFoo__fwBarYIf extends MixZ__eFoo__fwBarYIf[C] { ; ; f; } +/* */class S__Z__eFoo_I_ extends MixZ__eFoo_I_ [C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo_I_wBar___ extends MixZ__eFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo_I_wBar__f extends MixZ__eFoo_I_wBar__f[C] { ; ; f; } +// */class S__Z__eFoo_I_wBar_I_ extends MixZ__eFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__eFoo_I_wBar_If extends MixZ__eFoo_I_wBar_If[C] { ; ; f; } +/* */class S__Z__eFoo_I_wBarY__ extends MixZ__eFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFoo_I_wBarY_f extends MixZ__eFoo_I_wBarY_f[C] { ; ; f; } +// */class S__Z__eFoo_I_wBarYI_ extends MixZ__eFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__eFoo_I_wBarYIf extends MixZ__eFoo_I_wBarYIf[C] { ; ; f; } +/* */class S__Z__eFoo_If extends MixZ__eFoo_If [C] { ; ; f; } +/* */class S__Z__eFoo_IfwBar___ extends MixZ__eFoo_IfwBar___[C] { ; ; f; } +// */class S__Z__eFoo_IfwBar__f extends MixZ__eFoo_IfwBar__f[C] { ; ; f; } +// */class S__Z__eFoo_IfwBar_I_ extends MixZ__eFoo_IfwBar_I_[C] { ; ; f; } +// */class S__Z__eFoo_IfwBar_If extends MixZ__eFoo_IfwBar_If[C] { ; ; f; } +/* */class S__Z__eFoo_IfwBarY__ extends MixZ__eFoo_IfwBarY__[C] { ; ; f; } +// */class S__Z__eFoo_IfwBarY_f extends MixZ__eFoo_IfwBarY_f[C] { ; ; f; } +// */class S__Z__eFoo_IfwBarYI_ extends MixZ__eFoo_IfwBarYI_[C] { ; ; f; } +// */class S__Z__eFoo_IfwBarYIf extends MixZ__eFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__Z__eFooX__ extends MixZ__eFooX__ [C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFooX__wBar___ extends MixZ__eFooX__wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFooX__wBar__f extends MixZ__eFooX__wBar__f[C] { class I; ; f; } +/* */class S__Z__eFooX__wBar_I_ extends MixZ__eFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFooX__wBar_If extends MixZ__eFooX__wBar_If[C] { ; ; f; } +/* */class S__Z__eFooX__wBarY__ extends MixZ__eFooX__wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__eFooX__wBarY_f extends MixZ__eFooX__wBarY_f[C] { class I; ; f; } +/* */class S__Z__eFooX__wBarYI_ extends MixZ__eFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFooX__wBarYIf extends MixZ__eFooX__wBarYIf[C] { ; ; f; } +/* */class S__Z__eFooX_f extends MixZ__eFooX_f [C] { class I; ; f; } +/* */class S__Z__eFooX_fwBar___ extends MixZ__eFooX_fwBar___[C] { class I; ; f; } +// */class S__Z__eFooX_fwBar__f extends MixZ__eFooX_fwBar__f[C] { class I; ; f; } +/* */class S__Z__eFooX_fwBar_I_ extends MixZ__eFooX_fwBar_I_[C] { ; ; f; } +// */class S__Z__eFooX_fwBar_If extends MixZ__eFooX_fwBar_If[C] { ; ; f; } +/* */class S__Z__eFooX_fwBarY__ extends MixZ__eFooX_fwBarY__[C] { class I; ; f; } +// */class S__Z__eFooX_fwBarY_f extends MixZ__eFooX_fwBarY_f[C] { class I; ; f; } +/* */class S__Z__eFooX_fwBarYI_ extends MixZ__eFooX_fwBarYI_[C] { ; ; f; } +// */class S__Z__eFooX_fwBarYIf extends MixZ__eFooX_fwBarYIf[C] { ; ; f; } +/* */class S__Z__eFooXI_ extends MixZ__eFooXI_ [C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFooXI_wBar___ extends MixZ__eFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFooXI_wBar__f extends MixZ__eFooXI_wBar__f[C] { ; ; f; } +// */class S__Z__eFooXI_wBar_I_ extends MixZ__eFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__eFooXI_wBar_If extends MixZ__eFooXI_wBar_If[C] { ; ; f; } +/* */class S__Z__eFooXI_wBarY__ extends MixZ__eFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__eFooXI_wBarY_f extends MixZ__eFooXI_wBarY_f[C] { ; ; f; } +// */class S__Z__eFooXI_wBarYI_ extends MixZ__eFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__eFooXI_wBarYIf extends MixZ__eFooXI_wBarYIf[C] { ; ; f; } +/* */class S__Z__eFooXIf extends MixZ__eFooXIf [C] { ; ; f; } +/* */class S__Z__eFooXIfwBar___ extends MixZ__eFooXIfwBar___[C] { ; ; f; } +// */class S__Z__eFooXIfwBar__f extends MixZ__eFooXIfwBar__f[C] { ; ; f; } +// */class S__Z__eFooXIfwBar_I_ extends MixZ__eFooXIfwBar_I_[C] { ; ; f; } +// */class S__Z__eFooXIfwBar_If extends MixZ__eFooXIfwBar_If[C] { ; ; f; } +/* */class S__Z__eFooXIfwBarY__ extends MixZ__eFooXIfwBarY__[C] { ; ; f; } +// */class S__Z__eFooXIfwBarY_f extends MixZ__eFooXIfwBarY_f[C] { ; ; f; } +// */class S__Z__eFooXIfwBarYI_ extends MixZ__eFooXIfwBarYI_[C] { ; ; f; } +// */class S__Z__eFooXIfwBarYIf extends MixZ__eFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__Z_feFoo___ extends MixZ_feFoo___ [C] { class I; ; f; } +/* */class S__Z_feFoo___wBar___ extends MixZ_feFoo___wBar___[C] { class I; ; f; } +/* */class S__Z_feFoo___wBar__f extends MixZ_feFoo___wBar__f[C] { class I; ; f; } +/* */class S__Z_feFoo___wBar_I_ extends MixZ_feFoo___wBar_I_[C] { ; ; f; } +/* */class S__Z_feFoo___wBar_If extends MixZ_feFoo___wBar_If[C] { ; ; f; } +/* */class S__Z_feFoo___wBarY__ extends MixZ_feFoo___wBarY__[C] { class I; ; f; } +/* */class S__Z_feFoo___wBarY_f extends MixZ_feFoo___wBarY_f[C] { class I; ; f; } +/* */class S__Z_feFoo___wBarYI_ extends MixZ_feFoo___wBarYI_[C] { ; ; f; } +/* */class S__Z_feFoo___wBarYIf extends MixZ_feFoo___wBarYIf[C] { ; ; f; } +/* */class S__Z_feFoo__f extends MixZ_feFoo__f [C] { class I; ; f; } +/* */class S__Z_feFoo__fwBar___ extends MixZ_feFoo__fwBar___[C] { class I; ; f; } +/* */class S__Z_feFoo__fwBar__f extends MixZ_feFoo__fwBar__f[C] { class I; ; f; } +/* */class S__Z_feFoo__fwBar_I_ extends MixZ_feFoo__fwBar_I_[C] { ; ; f; } +/* */class S__Z_feFoo__fwBar_If extends MixZ_feFoo__fwBar_If[C] { ; ; f; } +/* */class S__Z_feFoo__fwBarY__ extends MixZ_feFoo__fwBarY__[C] { class I; ; f; } +/* */class S__Z_feFoo__fwBarY_f extends MixZ_feFoo__fwBarY_f[C] { class I; ; f; } +/* */class S__Z_feFoo__fwBarYI_ extends MixZ_feFoo__fwBarYI_[C] { ; ; f; } +/* */class S__Z_feFoo__fwBarYIf extends MixZ_feFoo__fwBarYIf[C] { ; ; f; } +/* */class S__Z_feFoo_I_ extends MixZ_feFoo_I_ [C] { ; ; f; } +/* */class S__Z_feFoo_I_wBar___ extends MixZ_feFoo_I_wBar___[C] { ; ; f; } +/* */class S__Z_feFoo_I_wBar__f extends MixZ_feFoo_I_wBar__f[C] { ; ; f; } +// */class S__Z_feFoo_I_wBar_I_ extends MixZ_feFoo_I_wBar_I_[C] { ; ; f; } +// */class S__Z_feFoo_I_wBar_If extends MixZ_feFoo_I_wBar_If[C] { ; ; f; } +/* */class S__Z_feFoo_I_wBarY__ extends MixZ_feFoo_I_wBarY__[C] { ; ; f; } +/* */class S__Z_feFoo_I_wBarY_f extends MixZ_feFoo_I_wBarY_f[C] { ; ; f; } +// */class S__Z_feFoo_I_wBarYI_ extends MixZ_feFoo_I_wBarYI_[C] { ; ; f; } +// */class S__Z_feFoo_I_wBarYIf extends MixZ_feFoo_I_wBarYIf[C] { ; ; f; } +/* */class S__Z_feFoo_If extends MixZ_feFoo_If [C] { ; ; f; } +/* */class S__Z_feFoo_IfwBar___ extends MixZ_feFoo_IfwBar___[C] { ; ; f; } +/* */class S__Z_feFoo_IfwBar__f extends MixZ_feFoo_IfwBar__f[C] { ; ; f; } +// */class S__Z_feFoo_IfwBar_I_ extends MixZ_feFoo_IfwBar_I_[C] { ; ; f; } +// */class S__Z_feFoo_IfwBar_If extends MixZ_feFoo_IfwBar_If[C] { ; ; f; } +/* */class S__Z_feFoo_IfwBarY__ extends MixZ_feFoo_IfwBarY__[C] { ; ; f; } +/* */class S__Z_feFoo_IfwBarY_f extends MixZ_feFoo_IfwBarY_f[C] { ; ; f; } +// */class S__Z_feFoo_IfwBarYI_ extends MixZ_feFoo_IfwBarYI_[C] { ; ; f; } +// */class S__Z_feFoo_IfwBarYIf extends MixZ_feFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__Z_feFooX__ extends MixZ_feFooX__ [C] { class I; ; f; } +/* */class S__Z_feFooX__wBar___ extends MixZ_feFooX__wBar___[C] { class I; ; f; } +/* */class S__Z_feFooX__wBar__f extends MixZ_feFooX__wBar__f[C] { class I; ; f; } +/* */class S__Z_feFooX__wBar_I_ extends MixZ_feFooX__wBar_I_[C] { ; ; f; } +/* */class S__Z_feFooX__wBar_If extends MixZ_feFooX__wBar_If[C] { ; ; f; } +/* */class S__Z_feFooX__wBarY__ extends MixZ_feFooX__wBarY__[C] { class I; ; f; } +/* */class S__Z_feFooX__wBarY_f extends MixZ_feFooX__wBarY_f[C] { class I; ; f; } +/* */class S__Z_feFooX__wBarYI_ extends MixZ_feFooX__wBarYI_[C] { ; ; f; } +/* */class S__Z_feFooX__wBarYIf extends MixZ_feFooX__wBarYIf[C] { ; ; f; } +/* */class S__Z_feFooX_f extends MixZ_feFooX_f [C] { class I; ; f; } +/* */class S__Z_feFooX_fwBar___ extends MixZ_feFooX_fwBar___[C] { class I; ; f; } +/* */class S__Z_feFooX_fwBar__f extends MixZ_feFooX_fwBar__f[C] { class I; ; f; } +/* */class S__Z_feFooX_fwBar_I_ extends MixZ_feFooX_fwBar_I_[C] { ; ; f; } +/* */class S__Z_feFooX_fwBar_If extends MixZ_feFooX_fwBar_If[C] { ; ; f; } +/* */class S__Z_feFooX_fwBarY__ extends MixZ_feFooX_fwBarY__[C] { class I; ; f; } +/* */class S__Z_feFooX_fwBarY_f extends MixZ_feFooX_fwBarY_f[C] { class I; ; f; } +/* */class S__Z_feFooX_fwBarYI_ extends MixZ_feFooX_fwBarYI_[C] { ; ; f; } +/* */class S__Z_feFooX_fwBarYIf extends MixZ_feFooX_fwBarYIf[C] { ; ; f; } +/* */class S__Z_feFooXI_ extends MixZ_feFooXI_ [C] { ; ; f; } +/* */class S__Z_feFooXI_wBar___ extends MixZ_feFooXI_wBar___[C] { ; ; f; } +/* */class S__Z_feFooXI_wBar__f extends MixZ_feFooXI_wBar__f[C] { ; ; f; } +// */class S__Z_feFooXI_wBar_I_ extends MixZ_feFooXI_wBar_I_[C] { ; ; f; } +// */class S__Z_feFooXI_wBar_If extends MixZ_feFooXI_wBar_If[C] { ; ; f; } +/* */class S__Z_feFooXI_wBarY__ extends MixZ_feFooXI_wBarY__[C] { ; ; f; } +/* */class S__Z_feFooXI_wBarY_f extends MixZ_feFooXI_wBarY_f[C] { ; ; f; } +// */class S__Z_feFooXI_wBarYI_ extends MixZ_feFooXI_wBarYI_[C] { ; ; f; } +// */class S__Z_feFooXI_wBarYIf extends MixZ_feFooXI_wBarYIf[C] { ; ; f; } +/* */class S__Z_feFooXIf extends MixZ_feFooXIf [C] { ; ; f; } +/* */class S__Z_feFooXIfwBar___ extends MixZ_feFooXIfwBar___[C] { ; ; f; } +/* */class S__Z_feFooXIfwBar__f extends MixZ_feFooXIfwBar__f[C] { ; ; f; } +// */class S__Z_feFooXIfwBar_I_ extends MixZ_feFooXIfwBar_I_[C] { ; ; f; } +// */class S__Z_feFooXIfwBar_If extends MixZ_feFooXIfwBar_If[C] { ; ; f; } +/* */class S__Z_feFooXIfwBarY__ extends MixZ_feFooXIfwBarY__[C] { ; ; f; } +/* */class S__Z_feFooXIfwBarY_f extends MixZ_feFooXIfwBarY_f[C] { ; ; f; } +// */class S__Z_feFooXIfwBarYI_ extends MixZ_feFooXIfwBarYI_[C] { ; ; f; } +// */class S__Z_feFooXIfwBarYIf extends MixZ_feFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__ZI_eFoo___ extends MixZI_eFoo___ [C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFoo___wBar___ extends MixZI_eFoo___wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFoo___wBar__f extends MixZI_eFoo___wBar__f[C] { ; ; f; } +// */class S__ZI_eFoo___wBar_I_ extends MixZI_eFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo___wBar_If extends MixZI_eFoo___wBar_If[C] { ; ; f; } +/* */class S__ZI_eFoo___wBarY__ extends MixZI_eFoo___wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFoo___wBarY_f extends MixZI_eFoo___wBarY_f[C] { ; ; f; } +// */class S__ZI_eFoo___wBarYI_ extends MixZI_eFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo___wBarYIf extends MixZI_eFoo___wBarYIf[C] { ; ; f; } +/* */class S__ZI_eFoo__f extends MixZI_eFoo__f [C] { ; ; f; } +/* */class S__ZI_eFoo__fwBar___ extends MixZI_eFoo__fwBar___[C] { ; ; f; } +// */class S__ZI_eFoo__fwBar__f extends MixZI_eFoo__fwBar__f[C] { ; ; f; } +// */class S__ZI_eFoo__fwBar_I_ extends MixZI_eFoo__fwBar_I_[C] { ; ; f; } +// */class S__ZI_eFoo__fwBar_If extends MixZI_eFoo__fwBar_If[C] { ; ; f; } +/* */class S__ZI_eFoo__fwBarY__ extends MixZI_eFoo__fwBarY__[C] { ; ; f; } +// */class S__ZI_eFoo__fwBarY_f extends MixZI_eFoo__fwBarY_f[C] { ; ; f; } +// */class S__ZI_eFoo__fwBarYI_ extends MixZI_eFoo__fwBarYI_[C] { ; ; f; } +// */class S__ZI_eFoo__fwBarYIf extends MixZI_eFoo__fwBarYIf[C] { ; ; f; } +// */class S__ZI_eFoo_I_ extends MixZI_eFoo_I_ [C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo_I_wBar___ extends MixZI_eFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo_I_wBar__f extends MixZI_eFoo_I_wBar__f[C] { ; ; f; } +// */class S__ZI_eFoo_I_wBar_I_ extends MixZI_eFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo_I_wBar_If extends MixZI_eFoo_I_wBar_If[C] { ; ; f; } +// */class S__ZI_eFoo_I_wBarY__ extends MixZI_eFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo_I_wBarY_f extends MixZI_eFoo_I_wBarY_f[C] { ; ; f; } +// */class S__ZI_eFoo_I_wBarYI_ extends MixZI_eFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFoo_I_wBarYIf extends MixZI_eFoo_I_wBarYIf[C] { ; ; f; } +// */class S__ZI_eFoo_If extends MixZI_eFoo_If [C] { ; ; f; } +// */class S__ZI_eFoo_IfwBar___ extends MixZI_eFoo_IfwBar___[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBar__f extends MixZI_eFoo_IfwBar__f[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBar_I_ extends MixZI_eFoo_IfwBar_I_[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBar_If extends MixZI_eFoo_IfwBar_If[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBarY__ extends MixZI_eFoo_IfwBarY__[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBarY_f extends MixZI_eFoo_IfwBarY_f[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBarYI_ extends MixZI_eFoo_IfwBarYI_[C] { ; ; f; } +// */class S__ZI_eFoo_IfwBarYIf extends MixZI_eFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__ZI_eFooX__ extends MixZI_eFooX__ [C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFooX__wBar___ extends MixZI_eFooX__wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFooX__wBar__f extends MixZI_eFooX__wBar__f[C] { ; ; f; } +// */class S__ZI_eFooX__wBar_I_ extends MixZI_eFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooX__wBar_If extends MixZI_eFooX__wBar_If[C] { ; ; f; } +/* */class S__ZI_eFooX__wBarY__ extends MixZI_eFooX__wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_eFooX__wBarY_f extends MixZI_eFooX__wBarY_f[C] { ; ; f; } +// */class S__ZI_eFooX__wBarYI_ extends MixZI_eFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooX__wBarYIf extends MixZI_eFooX__wBarYIf[C] { ; ; f; } +/* */class S__ZI_eFooX_f extends MixZI_eFooX_f [C] { ; ; f; } +/* */class S__ZI_eFooX_fwBar___ extends MixZI_eFooX_fwBar___[C] { ; ; f; } +// */class S__ZI_eFooX_fwBar__f extends MixZI_eFooX_fwBar__f[C] { ; ; f; } +// */class S__ZI_eFooX_fwBar_I_ extends MixZI_eFooX_fwBar_I_[C] { ; ; f; } +// */class S__ZI_eFooX_fwBar_If extends MixZI_eFooX_fwBar_If[C] { ; ; f; } +/* */class S__ZI_eFooX_fwBarY__ extends MixZI_eFooX_fwBarY__[C] { ; ; f; } +// */class S__ZI_eFooX_fwBarY_f extends MixZI_eFooX_fwBarY_f[C] { ; ; f; } +// */class S__ZI_eFooX_fwBarYI_ extends MixZI_eFooX_fwBarYI_[C] { ; ; f; } +// */class S__ZI_eFooX_fwBarYIf extends MixZI_eFooX_fwBarYIf[C] { ; ; f; } +// */class S__ZI_eFooXI_ extends MixZI_eFooXI_ [C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooXI_wBar___ extends MixZI_eFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooXI_wBar__f extends MixZI_eFooXI_wBar__f[C] { ; ; f; } +// */class S__ZI_eFooXI_wBar_I_ extends MixZI_eFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooXI_wBar_If extends MixZI_eFooXI_wBar_If[C] { ; ; f; } +// */class S__ZI_eFooXI_wBarY__ extends MixZI_eFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooXI_wBarY_f extends MixZI_eFooXI_wBarY_f[C] { ; ; f; } +// */class S__ZI_eFooXI_wBarYI_ extends MixZI_eFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_eFooXI_wBarYIf extends MixZI_eFooXI_wBarYIf[C] { ; ; f; } +// */class S__ZI_eFooXIf extends MixZI_eFooXIf [C] { ; ; f; } +// */class S__ZI_eFooXIfwBar___ extends MixZI_eFooXIfwBar___[C] { ; ; f; } +// */class S__ZI_eFooXIfwBar__f extends MixZI_eFooXIfwBar__f[C] { ; ; f; } +// */class S__ZI_eFooXIfwBar_I_ extends MixZI_eFooXIfwBar_I_[C] { ; ; f; } +// */class S__ZI_eFooXIfwBar_If extends MixZI_eFooXIfwBar_If[C] { ; ; f; } +// */class S__ZI_eFooXIfwBarY__ extends MixZI_eFooXIfwBarY__[C] { ; ; f; } +// */class S__ZI_eFooXIfwBarY_f extends MixZI_eFooXIfwBarY_f[C] { ; ; f; } +// */class S__ZI_eFooXIfwBarYI_ extends MixZI_eFooXIfwBarYI_[C] { ; ; f; } +// */class S__ZI_eFooXIfwBarYIf extends MixZI_eFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__ZIfeFoo___ extends MixZIfeFoo___ [C] { ; ; f; } +/* */class S__ZIfeFoo___wBar___ extends MixZIfeFoo___wBar___[C] { ; ; f; } +/* */class S__ZIfeFoo___wBar__f extends MixZIfeFoo___wBar__f[C] { ; ; f; } +// */class S__ZIfeFoo___wBar_I_ extends MixZIfeFoo___wBar_I_[C] { ; ; f; } +// */class S__ZIfeFoo___wBar_If extends MixZIfeFoo___wBar_If[C] { ; ; f; } +/* */class S__ZIfeFoo___wBarY__ extends MixZIfeFoo___wBarY__[C] { ; ; f; } +/* */class S__ZIfeFoo___wBarY_f extends MixZIfeFoo___wBarY_f[C] { ; ; f; } +// */class S__ZIfeFoo___wBarYI_ extends MixZIfeFoo___wBarYI_[C] { ; ; f; } +// */class S__ZIfeFoo___wBarYIf extends MixZIfeFoo___wBarYIf[C] { ; ; f; } +/* */class S__ZIfeFoo__f extends MixZIfeFoo__f [C] { ; ; f; } +/* */class S__ZIfeFoo__fwBar___ extends MixZIfeFoo__fwBar___[C] { ; ; f; } +/* */class S__ZIfeFoo__fwBar__f extends MixZIfeFoo__fwBar__f[C] { ; ; f; } +// */class S__ZIfeFoo__fwBar_I_ extends MixZIfeFoo__fwBar_I_[C] { ; ; f; } +// */class S__ZIfeFoo__fwBar_If extends MixZIfeFoo__fwBar_If[C] { ; ; f; } +/* */class S__ZIfeFoo__fwBarY__ extends MixZIfeFoo__fwBarY__[C] { ; ; f; } +/* */class S__ZIfeFoo__fwBarY_f extends MixZIfeFoo__fwBarY_f[C] { ; ; f; } +// */class S__ZIfeFoo__fwBarYI_ extends MixZIfeFoo__fwBarYI_[C] { ; ; f; } +// */class S__ZIfeFoo__fwBarYIf extends MixZIfeFoo__fwBarYIf[C] { ; ; f; } +// */class S__ZIfeFoo_I_ extends MixZIfeFoo_I_ [C] { ; ; f; } +// */class S__ZIfeFoo_I_wBar___ extends MixZIfeFoo_I_wBar___[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBar__f extends MixZIfeFoo_I_wBar__f[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBar_I_ extends MixZIfeFoo_I_wBar_I_[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBar_If extends MixZIfeFoo_I_wBar_If[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBarY__ extends MixZIfeFoo_I_wBarY__[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBarY_f extends MixZIfeFoo_I_wBarY_f[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBarYI_ extends MixZIfeFoo_I_wBarYI_[C] { ; ; f; } +// */class S__ZIfeFoo_I_wBarYIf extends MixZIfeFoo_I_wBarYIf[C] { ; ; f; } +// */class S__ZIfeFoo_If extends MixZIfeFoo_If [C] { ; ; f; } +// */class S__ZIfeFoo_IfwBar___ extends MixZIfeFoo_IfwBar___[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBar__f extends MixZIfeFoo_IfwBar__f[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBar_I_ extends MixZIfeFoo_IfwBar_I_[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBar_If extends MixZIfeFoo_IfwBar_If[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBarY__ extends MixZIfeFoo_IfwBarY__[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBarY_f extends MixZIfeFoo_IfwBarY_f[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBarYI_ extends MixZIfeFoo_IfwBarYI_[C] { ; ; f; } +// */class S__ZIfeFoo_IfwBarYIf extends MixZIfeFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__ZIfeFooX__ extends MixZIfeFooX__ [C] { ; ; f; } +/* */class S__ZIfeFooX__wBar___ extends MixZIfeFooX__wBar___[C] { ; ; f; } +/* */class S__ZIfeFooX__wBar__f extends MixZIfeFooX__wBar__f[C] { ; ; f; } +// */class S__ZIfeFooX__wBar_I_ extends MixZIfeFooX__wBar_I_[C] { ; ; f; } +// */class S__ZIfeFooX__wBar_If extends MixZIfeFooX__wBar_If[C] { ; ; f; } +/* */class S__ZIfeFooX__wBarY__ extends MixZIfeFooX__wBarY__[C] { ; ; f; } +/* */class S__ZIfeFooX__wBarY_f extends MixZIfeFooX__wBarY_f[C] { ; ; f; } +// */class S__ZIfeFooX__wBarYI_ extends MixZIfeFooX__wBarYI_[C] { ; ; f; } +// */class S__ZIfeFooX__wBarYIf extends MixZIfeFooX__wBarYIf[C] { ; ; f; } +/* */class S__ZIfeFooX_f extends MixZIfeFooX_f [C] { ; ; f; } +/* */class S__ZIfeFooX_fwBar___ extends MixZIfeFooX_fwBar___[C] { ; ; f; } +/* */class S__ZIfeFooX_fwBar__f extends MixZIfeFooX_fwBar__f[C] { ; ; f; } +// */class S__ZIfeFooX_fwBar_I_ extends MixZIfeFooX_fwBar_I_[C] { ; ; f; } +// */class S__ZIfeFooX_fwBar_If extends MixZIfeFooX_fwBar_If[C] { ; ; f; } +/* */class S__ZIfeFooX_fwBarY__ extends MixZIfeFooX_fwBarY__[C] { ; ; f; } +/* */class S__ZIfeFooX_fwBarY_f extends MixZIfeFooX_fwBarY_f[C] { ; ; f; } +// */class S__ZIfeFooX_fwBarYI_ extends MixZIfeFooX_fwBarYI_[C] { ; ; f; } +// */class S__ZIfeFooX_fwBarYIf extends MixZIfeFooX_fwBarYIf[C] { ; ; f; } +// */class S__ZIfeFooXI_ extends MixZIfeFooXI_ [C] { ; ; f; } +// */class S__ZIfeFooXI_wBar___ extends MixZIfeFooXI_wBar___[C] { ; ; f; } +// */class S__ZIfeFooXI_wBar__f extends MixZIfeFooXI_wBar__f[C] { ; ; f; } +// */class S__ZIfeFooXI_wBar_I_ extends MixZIfeFooXI_wBar_I_[C] { ; ; f; } +// */class S__ZIfeFooXI_wBar_If extends MixZIfeFooXI_wBar_If[C] { ; ; f; } +// */class S__ZIfeFooXI_wBarY__ extends MixZIfeFooXI_wBarY__[C] { ; ; f; } +// */class S__ZIfeFooXI_wBarY_f extends MixZIfeFooXI_wBarY_f[C] { ; ; f; } +// */class S__ZIfeFooXI_wBarYI_ extends MixZIfeFooXI_wBarYI_[C] { ; ; f; } +// */class S__ZIfeFooXI_wBarYIf extends MixZIfeFooXI_wBarYIf[C] { ; ; f; } +// */class S__ZIfeFooXIf extends MixZIfeFooXIf [C] { ; ; f; } +// */class S__ZIfeFooXIfwBar___ extends MixZIfeFooXIfwBar___[C] { ; ; f; } +// */class S__ZIfeFooXIfwBar__f extends MixZIfeFooXIfwBar__f[C] { ; ; f; } +// */class S__ZIfeFooXIfwBar_I_ extends MixZIfeFooXIfwBar_I_[C] { ; ; f; } +// */class S__ZIfeFooXIfwBar_If extends MixZIfeFooXIfwBar_If[C] { ; ; f; } +// */class S__ZIfeFooXIfwBarY__ extends MixZIfeFooXIfwBarY__[C] { ; ; f; } +// */class S__ZIfeFooXIfwBarY_f extends MixZIfeFooXIfwBarY_f[C] { ; ; f; } +// */class S__ZIfeFooXIfwBarYI_ extends MixZIfeFooXIfwBarYI_[C] { ; ; f; } +// */class S__ZIfeFooXIfwBarYIf extends MixZIfeFooXIfwBarYIf[C] { ; ; f; } + + + +/* */class S_____wFoo___ extends Mix___wFoo___ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFoo___wBar___ extends Mix___wFoo___wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFoo___wBar__f extends Mix___wFoo___wBar__f { class I; ; f; } +/* */class S_____wFoo___wBar_I_ extends Mix___wFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFoo___wBar_If extends Mix___wFoo___wBar_If { ; ; f; } +/* */class S_____wFoo___wBarY__ extends Mix___wFoo___wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFoo___wBarY_f extends Mix___wFoo___wBarY_f { class I; ; f; } +/* */class S_____wFoo___wBarYI_ extends Mix___wFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFoo___wBarYIf extends Mix___wFoo___wBarYIf { ; ; f; } +/* */class S_____wFoo__f extends Mix___wFoo__f { class I; ; f; } +/* */class S_____wFoo__fwBar___ extends Mix___wFoo__fwBar___ { class I; ; f; } +// */class S_____wFoo__fwBar__f extends Mix___wFoo__fwBar__f { class I; ; f; } +/* */class S_____wFoo__fwBar_I_ extends Mix___wFoo__fwBar_I_ { ; ; f; } +// */class S_____wFoo__fwBar_If extends Mix___wFoo__fwBar_If { ; ; f; } +/* */class S_____wFoo__fwBarY__ extends Mix___wFoo__fwBarY__ { class I; ; f; } +// */class S_____wFoo__fwBarY_f extends Mix___wFoo__fwBarY_f { class I; ; f; } +/* */class S_____wFoo__fwBarYI_ extends Mix___wFoo__fwBarYI_ { ; ; f; } +// */class S_____wFoo__fwBarYIf extends Mix___wFoo__fwBarYIf { ; ; f; } +/* */class S_____wFoo_I_ extends Mix___wFoo_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFoo_I_wBar___ extends Mix___wFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_____wFoo_I_wBar__f extends Mix___wFoo_I_wBar__f { ; ; f; } +// */class S_____wFoo_I_wBar_I_ extends Mix___wFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_____wFoo_I_wBar_If extends Mix___wFoo_I_wBar_If { ; ; f; } +/* */class S_____wFoo_I_wBarY__ extends Mix___wFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_____wFoo_I_wBarY_f extends Mix___wFoo_I_wBarY_f { ; ; f; } +// */class S_____wFoo_I_wBarYI_ extends Mix___wFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_____wFoo_I_wBarYIf extends Mix___wFoo_I_wBarYIf { ; ; f; } +/* */class S_____wFoo_If extends Mix___wFoo_If { ; ; f; } +/* */class S_____wFoo_IfwBar___ extends Mix___wFoo_IfwBar___ { ; ; f; } +// */class S_____wFoo_IfwBar__f extends Mix___wFoo_IfwBar__f { ; ; f; } +// */class S_____wFoo_IfwBar_I_ extends Mix___wFoo_IfwBar_I_ { ; ; f; } +// */class S_____wFoo_IfwBar_If extends Mix___wFoo_IfwBar_If { ; ; f; } +/* */class S_____wFoo_IfwBarY__ extends Mix___wFoo_IfwBarY__ { ; ; f; } +// */class S_____wFoo_IfwBarY_f extends Mix___wFoo_IfwBarY_f { ; ; f; } +// */class S_____wFoo_IfwBarYI_ extends Mix___wFoo_IfwBarYI_ { ; ; f; } +// */class S_____wFoo_IfwBarYIf extends Mix___wFoo_IfwBarYIf { ; ; f; } +/* */class S_____wFooX__ extends Mix___wFooX__ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFooX__wBar___ extends Mix___wFooX__wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFooX__wBar__f extends Mix___wFooX__wBar__f { class I; ; f; } +/* */class S_____wFooX__wBar_I_ extends Mix___wFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFooX__wBar_If extends Mix___wFooX__wBar_If { ; ; f; } +/* */class S_____wFooX__wBarY__ extends Mix___wFooX__wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_____wFooX__wBarY_f extends Mix___wFooX__wBarY_f { class I; ; f; } +/* */class S_____wFooX__wBarYI_ extends Mix___wFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFooX__wBarYIf extends Mix___wFooX__wBarYIf { ; ; f; } +/* */class S_____wFooX_f extends Mix___wFooX_f { class I; ; f; } +/* */class S_____wFooX_fwBar___ extends Mix___wFooX_fwBar___ { class I; ; f; } +// */class S_____wFooX_fwBar__f extends Mix___wFooX_fwBar__f { class I; ; f; } +/* */class S_____wFooX_fwBar_I_ extends Mix___wFooX_fwBar_I_ { ; ; f; } +// */class S_____wFooX_fwBar_If extends Mix___wFooX_fwBar_If { ; ; f; } +/* */class S_____wFooX_fwBarY__ extends Mix___wFooX_fwBarY__ { class I; ; f; } +// */class S_____wFooX_fwBarY_f extends Mix___wFooX_fwBarY_f { class I; ; f; } +/* */class S_____wFooX_fwBarYI_ extends Mix___wFooX_fwBarYI_ { ; ; f; } +// */class S_____wFooX_fwBarYIf extends Mix___wFooX_fwBarYIf { ; ; f; } +/* */class S_____wFooXI_ extends Mix___wFooXI_ { ; def f: I = {sub; null}; f; } +/* */class S_____wFooXI_wBar___ extends Mix___wFooXI_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_____wFooXI_wBar__f extends Mix___wFooXI_wBar__f { ; ; f; } +// */class S_____wFooXI_wBar_I_ extends Mix___wFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_____wFooXI_wBar_If extends Mix___wFooXI_wBar_If { ; ; f; } +/* */class S_____wFooXI_wBarY__ extends Mix___wFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_____wFooXI_wBarY_f extends Mix___wFooXI_wBarY_f { ; ; f; } +// */class S_____wFooXI_wBarYI_ extends Mix___wFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_____wFooXI_wBarYIf extends Mix___wFooXI_wBarYIf { ; ; f; } +/* */class S_____wFooXIf extends Mix___wFooXIf { ; ; f; } +/* */class S_____wFooXIfwBar___ extends Mix___wFooXIfwBar___ { ; ; f; } +// */class S_____wFooXIfwBar__f extends Mix___wFooXIfwBar__f { ; ; f; } +// */class S_____wFooXIfwBar_I_ extends Mix___wFooXIfwBar_I_ { ; ; f; } +// */class S_____wFooXIfwBar_If extends Mix___wFooXIfwBar_If { ; ; f; } +/* */class S_____wFooXIfwBarY__ extends Mix___wFooXIfwBarY__ { ; ; f; } +// */class S_____wFooXIfwBarY_f extends Mix___wFooXIfwBarY_f { ; ; f; } +// */class S_____wFooXIfwBarYI_ extends Mix___wFooXIfwBarYI_ { ; ; f; } +// */class S_____wFooXIfwBarYIf extends Mix___wFooXIfwBarYIf { ; ; f; } + +/* */class S____fwFoo___ extends Mix__fwFoo___ { class I; ; f; } +/* */class S____fwFoo___wBar___ extends Mix__fwFoo___wBar___ { class I; ; f; } +/* */class S____fwFoo___wBar__f extends Mix__fwFoo___wBar__f { class I; ; f; } +/* */class S____fwFoo___wBar_I_ extends Mix__fwFoo___wBar_I_ { ; ; f; } +/* */class S____fwFoo___wBar_If extends Mix__fwFoo___wBar_If { ; ; f; } +/* */class S____fwFoo___wBarY__ extends Mix__fwFoo___wBarY__ { class I; ; f; } +/* */class S____fwFoo___wBarY_f extends Mix__fwFoo___wBarY_f { class I; ; f; } +/* */class S____fwFoo___wBarYI_ extends Mix__fwFoo___wBarYI_ { ; ; f; } +/* */class S____fwFoo___wBarYIf extends Mix__fwFoo___wBarYIf { ; ; f; } +/* */class S____fwFoo__f extends Mix__fwFoo__f { class I; ; f; } +/* */class S____fwFoo__fwBar___ extends Mix__fwFoo__fwBar___ { class I; ; f; } +/* */class S____fwFoo__fwBar__f extends Mix__fwFoo__fwBar__f { class I; ; f; } +/* */class S____fwFoo__fwBar_I_ extends Mix__fwFoo__fwBar_I_ { ; ; f; } +/* */class S____fwFoo__fwBar_If extends Mix__fwFoo__fwBar_If { ; ; f; } +/* */class S____fwFoo__fwBarY__ extends Mix__fwFoo__fwBarY__ { class I; ; f; } +/* */class S____fwFoo__fwBarY_f extends Mix__fwFoo__fwBarY_f { class I; ; f; } +/* */class S____fwFoo__fwBarYI_ extends Mix__fwFoo__fwBarYI_ { ; ; f; } +/* */class S____fwFoo__fwBarYIf extends Mix__fwFoo__fwBarYIf { ; ; f; } +/* */class S____fwFoo_I_ extends Mix__fwFoo_I_ { ; ; f; } +/* */class S____fwFoo_I_wBar___ extends Mix__fwFoo_I_wBar___ { ; ; f; } +/* */class S____fwFoo_I_wBar__f extends Mix__fwFoo_I_wBar__f { ; ; f; } +// */class S____fwFoo_I_wBar_I_ extends Mix__fwFoo_I_wBar_I_ { ; ; f; } +// */class S____fwFoo_I_wBar_If extends Mix__fwFoo_I_wBar_If { ; ; f; } +/* */class S____fwFoo_I_wBarY__ extends Mix__fwFoo_I_wBarY__ { ; ; f; } +/* */class S____fwFoo_I_wBarY_f extends Mix__fwFoo_I_wBarY_f { ; ; f; } +// */class S____fwFoo_I_wBarYI_ extends Mix__fwFoo_I_wBarYI_ { ; ; f; } +// */class S____fwFoo_I_wBarYIf extends Mix__fwFoo_I_wBarYIf { ; ; f; } +/* */class S____fwFoo_If extends Mix__fwFoo_If { ; ; f; } +/* */class S____fwFoo_IfwBar___ extends Mix__fwFoo_IfwBar___ { ; ; f; } +/* */class S____fwFoo_IfwBar__f extends Mix__fwFoo_IfwBar__f { ; ; f; } +// */class S____fwFoo_IfwBar_I_ extends Mix__fwFoo_IfwBar_I_ { ; ; f; } +// */class S____fwFoo_IfwBar_If extends Mix__fwFoo_IfwBar_If { ; ; f; } +/* */class S____fwFoo_IfwBarY__ extends Mix__fwFoo_IfwBarY__ { ; ; f; } +/* */class S____fwFoo_IfwBarY_f extends Mix__fwFoo_IfwBarY_f { ; ; f; } +// */class S____fwFoo_IfwBarYI_ extends Mix__fwFoo_IfwBarYI_ { ; ; f; } +// */class S____fwFoo_IfwBarYIf extends Mix__fwFoo_IfwBarYIf { ; ; f; } +/* */class S____fwFooX__ extends Mix__fwFooX__ { class I; ; f; } +/* */class S____fwFooX__wBar___ extends Mix__fwFooX__wBar___ { class I; ; f; } +/* */class S____fwFooX__wBar__f extends Mix__fwFooX__wBar__f { class I; ; f; } +/* */class S____fwFooX__wBar_I_ extends Mix__fwFooX__wBar_I_ { ; ; f; } +/* */class S____fwFooX__wBar_If extends Mix__fwFooX__wBar_If { ; ; f; } +/* */class S____fwFooX__wBarY__ extends Mix__fwFooX__wBarY__ { class I; ; f; } +/* */class S____fwFooX__wBarY_f extends Mix__fwFooX__wBarY_f { class I; ; f; } +/* */class S____fwFooX__wBarYI_ extends Mix__fwFooX__wBarYI_ { ; ; f; } +/* */class S____fwFooX__wBarYIf extends Mix__fwFooX__wBarYIf { ; ; f; } +/* */class S____fwFooX_f extends Mix__fwFooX_f { class I; ; f; } +/* */class S____fwFooX_fwBar___ extends Mix__fwFooX_fwBar___ { class I; ; f; } +/* */class S____fwFooX_fwBar__f extends Mix__fwFooX_fwBar__f { class I; ; f; } +/* */class S____fwFooX_fwBar_I_ extends Mix__fwFooX_fwBar_I_ { ; ; f; } +/* */class S____fwFooX_fwBar_If extends Mix__fwFooX_fwBar_If { ; ; f; } +/* */class S____fwFooX_fwBarY__ extends Mix__fwFooX_fwBarY__ { class I; ; f; } +/* */class S____fwFooX_fwBarY_f extends Mix__fwFooX_fwBarY_f { class I; ; f; } +/* */class S____fwFooX_fwBarYI_ extends Mix__fwFooX_fwBarYI_ { ; ; f; } +/* */class S____fwFooX_fwBarYIf extends Mix__fwFooX_fwBarYIf { ; ; f; } +/* */class S____fwFooXI_ extends Mix__fwFooXI_ { ; ; f; } +/* */class S____fwFooXI_wBar___ extends Mix__fwFooXI_wBar___ { ; ; f; } +/* */class S____fwFooXI_wBar__f extends Mix__fwFooXI_wBar__f { ; ; f; } +// */class S____fwFooXI_wBar_I_ extends Mix__fwFooXI_wBar_I_ { ; ; f; } +// */class S____fwFooXI_wBar_If extends Mix__fwFooXI_wBar_If { ; ; f; } +/* */class S____fwFooXI_wBarY__ extends Mix__fwFooXI_wBarY__ { ; ; f; } +/* */class S____fwFooXI_wBarY_f extends Mix__fwFooXI_wBarY_f { ; ; f; } +// */class S____fwFooXI_wBarYI_ extends Mix__fwFooXI_wBarYI_ { ; ; f; } +// */class S____fwFooXI_wBarYIf extends Mix__fwFooXI_wBarYIf { ; ; f; } +/* */class S____fwFooXIf extends Mix__fwFooXIf { ; ; f; } +/* */class S____fwFooXIfwBar___ extends Mix__fwFooXIfwBar___ { ; ; f; } +/* */class S____fwFooXIfwBar__f extends Mix__fwFooXIfwBar__f { ; ; f; } +// */class S____fwFooXIfwBar_I_ extends Mix__fwFooXIfwBar_I_ { ; ; f; } +// */class S____fwFooXIfwBar_If extends Mix__fwFooXIfwBar_If { ; ; f; } +/* */class S____fwFooXIfwBarY__ extends Mix__fwFooXIfwBarY__ { ; ; f; } +/* */class S____fwFooXIfwBarY_f extends Mix__fwFooXIfwBarY_f { ; ; f; } +// */class S____fwFooXIfwBarYI_ extends Mix__fwFooXIfwBarYI_ { ; ; f; } +// */class S____fwFooXIfwBarYIf extends Mix__fwFooXIfwBarYIf { ; ; f; } + +/* */class S___I_wFoo___ extends Mix_I_wFoo___ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFoo___wBar___ extends Mix_I_wFoo___wBar___ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFoo___wBar__f extends Mix_I_wFoo___wBar__f { ; ; f; } +// */class S___I_wFoo___wBar_I_ extends Mix_I_wFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo___wBar_If extends Mix_I_wFoo___wBar_If { ; ; f; } +/* */class S___I_wFoo___wBarY__ extends Mix_I_wFoo___wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFoo___wBarY_f extends Mix_I_wFoo___wBarY_f { ; ; f; } +// */class S___I_wFoo___wBarYI_ extends Mix_I_wFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo___wBarYIf extends Mix_I_wFoo___wBarYIf { ; ; f; } +/* */class S___I_wFoo__f extends Mix_I_wFoo__f { ; ; f; } +/* */class S___I_wFoo__fwBar___ extends Mix_I_wFoo__fwBar___ { ; ; f; } +// */class S___I_wFoo__fwBar__f extends Mix_I_wFoo__fwBar__f { ; ; f; } +// */class S___I_wFoo__fwBar_I_ extends Mix_I_wFoo__fwBar_I_ { ; ; f; } +// */class S___I_wFoo__fwBar_If extends Mix_I_wFoo__fwBar_If { ; ; f; } +/* */class S___I_wFoo__fwBarY__ extends Mix_I_wFoo__fwBarY__ { ; ; f; } +// */class S___I_wFoo__fwBarY_f extends Mix_I_wFoo__fwBarY_f { ; ; f; } +// */class S___I_wFoo__fwBarYI_ extends Mix_I_wFoo__fwBarYI_ { ; ; f; } +// */class S___I_wFoo__fwBarYIf extends Mix_I_wFoo__fwBarYIf { ; ; f; } +// */class S___I_wFoo_I_ extends Mix_I_wFoo_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo_I_wBar___ extends Mix_I_wFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo_I_wBar__f extends Mix_I_wFoo_I_wBar__f { ; ; f; } +// */class S___I_wFoo_I_wBar_I_ extends Mix_I_wFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo_I_wBar_If extends Mix_I_wFoo_I_wBar_If { ; ; f; } +// */class S___I_wFoo_I_wBarY__ extends Mix_I_wFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo_I_wBarY_f extends Mix_I_wFoo_I_wBarY_f { ; ; f; } +// */class S___I_wFoo_I_wBarYI_ extends Mix_I_wFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFoo_I_wBarYIf extends Mix_I_wFoo_I_wBarYIf { ; ; f; } +// */class S___I_wFoo_If extends Mix_I_wFoo_If { ; ; f; } +// */class S___I_wFoo_IfwBar___ extends Mix_I_wFoo_IfwBar___ { ; ; f; } +// */class S___I_wFoo_IfwBar__f extends Mix_I_wFoo_IfwBar__f { ; ; f; } +// */class S___I_wFoo_IfwBar_I_ extends Mix_I_wFoo_IfwBar_I_ { ; ; f; } +// */class S___I_wFoo_IfwBar_If extends Mix_I_wFoo_IfwBar_If { ; ; f; } +// */class S___I_wFoo_IfwBarY__ extends Mix_I_wFoo_IfwBarY__ { ; ; f; } +// */class S___I_wFoo_IfwBarY_f extends Mix_I_wFoo_IfwBarY_f { ; ; f; } +// */class S___I_wFoo_IfwBarYI_ extends Mix_I_wFoo_IfwBarYI_ { ; ; f; } +// */class S___I_wFoo_IfwBarYIf extends Mix_I_wFoo_IfwBarYIf { ; ; f; } +/* */class S___I_wFooX__ extends Mix_I_wFooX__ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFooX__wBar___ extends Mix_I_wFooX__wBar___ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFooX__wBar__f extends Mix_I_wFooX__wBar__f { ; ; f; } +// */class S___I_wFooX__wBar_I_ extends Mix_I_wFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooX__wBar_If extends Mix_I_wFooX__wBar_If { ; ; f; } +/* */class S___I_wFooX__wBarY__ extends Mix_I_wFooX__wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S___I_wFooX__wBarY_f extends Mix_I_wFooX__wBarY_f { ; ; f; } +// */class S___I_wFooX__wBarYI_ extends Mix_I_wFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooX__wBarYIf extends Mix_I_wFooX__wBarYIf { ; ; f; } +/* */class S___I_wFooX_f extends Mix_I_wFooX_f { ; ; f; } +/* */class S___I_wFooX_fwBar___ extends Mix_I_wFooX_fwBar___ { ; ; f; } +// */class S___I_wFooX_fwBar__f extends Mix_I_wFooX_fwBar__f { ; ; f; } +// */class S___I_wFooX_fwBar_I_ extends Mix_I_wFooX_fwBar_I_ { ; ; f; } +// */class S___I_wFooX_fwBar_If extends Mix_I_wFooX_fwBar_If { ; ; f; } +/* */class S___I_wFooX_fwBarY__ extends Mix_I_wFooX_fwBarY__ { ; ; f; } +// */class S___I_wFooX_fwBarY_f extends Mix_I_wFooX_fwBarY_f { ; ; f; } +// */class S___I_wFooX_fwBarYI_ extends Mix_I_wFooX_fwBarYI_ { ; ; f; } +// */class S___I_wFooX_fwBarYIf extends Mix_I_wFooX_fwBarYIf { ; ; f; } +// */class S___I_wFooXI_ extends Mix_I_wFooXI_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooXI_wBar___ extends Mix_I_wFooXI_wBar___ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooXI_wBar__f extends Mix_I_wFooXI_wBar__f { ; ; f; } +// */class S___I_wFooXI_wBar_I_ extends Mix_I_wFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooXI_wBar_If extends Mix_I_wFooXI_wBar_If { ; ; f; } +// */class S___I_wFooXI_wBarY__ extends Mix_I_wFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooXI_wBarY_f extends Mix_I_wFooXI_wBarY_f { ; ; f; } +// */class S___I_wFooXI_wBarYI_ extends Mix_I_wFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S___I_wFooXI_wBarYIf extends Mix_I_wFooXI_wBarYIf { ; ; f; } +// */class S___I_wFooXIf extends Mix_I_wFooXIf { ; ; f; } +// */class S___I_wFooXIfwBar___ extends Mix_I_wFooXIfwBar___ { ; ; f; } +// */class S___I_wFooXIfwBar__f extends Mix_I_wFooXIfwBar__f { ; ; f; } +// */class S___I_wFooXIfwBar_I_ extends Mix_I_wFooXIfwBar_I_ { ; ; f; } +// */class S___I_wFooXIfwBar_If extends Mix_I_wFooXIfwBar_If { ; ; f; } +// */class S___I_wFooXIfwBarY__ extends Mix_I_wFooXIfwBarY__ { ; ; f; } +// */class S___I_wFooXIfwBarY_f extends Mix_I_wFooXIfwBarY_f { ; ; f; } +// */class S___I_wFooXIfwBarYI_ extends Mix_I_wFooXIfwBarYI_ { ; ; f; } +// */class S___I_wFooXIfwBarYIf extends Mix_I_wFooXIfwBarYIf { ; ; f; } + +/* */class S___IfwFoo___ extends Mix_IfwFoo___ { ; ; f; } +/* */class S___IfwFoo___wBar___ extends Mix_IfwFoo___wBar___ { ; ; f; } +/* */class S___IfwFoo___wBar__f extends Mix_IfwFoo___wBar__f { ; ; f; } +// */class S___IfwFoo___wBar_I_ extends Mix_IfwFoo___wBar_I_ { ; ; f; } +// */class S___IfwFoo___wBar_If extends Mix_IfwFoo___wBar_If { ; ; f; } +/* */class S___IfwFoo___wBarY__ extends Mix_IfwFoo___wBarY__ { ; ; f; } +/* */class S___IfwFoo___wBarY_f extends Mix_IfwFoo___wBarY_f { ; ; f; } +// */class S___IfwFoo___wBarYI_ extends Mix_IfwFoo___wBarYI_ { ; ; f; } +// */class S___IfwFoo___wBarYIf extends Mix_IfwFoo___wBarYIf { ; ; f; } +/* */class S___IfwFoo__f extends Mix_IfwFoo__f { ; ; f; } +/* */class S___IfwFoo__fwBar___ extends Mix_IfwFoo__fwBar___ { ; ; f; } +/* */class S___IfwFoo__fwBar__f extends Mix_IfwFoo__fwBar__f { ; ; f; } +// */class S___IfwFoo__fwBar_I_ extends Mix_IfwFoo__fwBar_I_ { ; ; f; } +// */class S___IfwFoo__fwBar_If extends Mix_IfwFoo__fwBar_If { ; ; f; } +/* */class S___IfwFoo__fwBarY__ extends Mix_IfwFoo__fwBarY__ { ; ; f; } +/* */class S___IfwFoo__fwBarY_f extends Mix_IfwFoo__fwBarY_f { ; ; f; } +// */class S___IfwFoo__fwBarYI_ extends Mix_IfwFoo__fwBarYI_ { ; ; f; } +// */class S___IfwFoo__fwBarYIf extends Mix_IfwFoo__fwBarYIf { ; ; f; } +// */class S___IfwFoo_I_ extends Mix_IfwFoo_I_ { ; ; f; } +// */class S___IfwFoo_I_wBar___ extends Mix_IfwFoo_I_wBar___ { ; ; f; } +// */class S___IfwFoo_I_wBar__f extends Mix_IfwFoo_I_wBar__f { ; ; f; } +// */class S___IfwFoo_I_wBar_I_ extends Mix_IfwFoo_I_wBar_I_ { ; ; f; } +// */class S___IfwFoo_I_wBar_If extends Mix_IfwFoo_I_wBar_If { ; ; f; } +// */class S___IfwFoo_I_wBarY__ extends Mix_IfwFoo_I_wBarY__ { ; ; f; } +// */class S___IfwFoo_I_wBarY_f extends Mix_IfwFoo_I_wBarY_f { ; ; f; } +// */class S___IfwFoo_I_wBarYI_ extends Mix_IfwFoo_I_wBarYI_ { ; ; f; } +// */class S___IfwFoo_I_wBarYIf extends Mix_IfwFoo_I_wBarYIf { ; ; f; } +// */class S___IfwFoo_If extends Mix_IfwFoo_If { ; ; f; } +// */class S___IfwFoo_IfwBar___ extends Mix_IfwFoo_IfwBar___ { ; ; f; } +// */class S___IfwFoo_IfwBar__f extends Mix_IfwFoo_IfwBar__f { ; ; f; } +// */class S___IfwFoo_IfwBar_I_ extends Mix_IfwFoo_IfwBar_I_ { ; ; f; } +// */class S___IfwFoo_IfwBar_If extends Mix_IfwFoo_IfwBar_If { ; ; f; } +// */class S___IfwFoo_IfwBarY__ extends Mix_IfwFoo_IfwBarY__ { ; ; f; } +// */class S___IfwFoo_IfwBarY_f extends Mix_IfwFoo_IfwBarY_f { ; ; f; } +// */class S___IfwFoo_IfwBarYI_ extends Mix_IfwFoo_IfwBarYI_ { ; ; f; } +// */class S___IfwFoo_IfwBarYIf extends Mix_IfwFoo_IfwBarYIf { ; ; f; } +/* */class S___IfwFooX__ extends Mix_IfwFooX__ { ; ; f; } +/* */class S___IfwFooX__wBar___ extends Mix_IfwFooX__wBar___ { ; ; f; } +/* */class S___IfwFooX__wBar__f extends Mix_IfwFooX__wBar__f { ; ; f; } +// */class S___IfwFooX__wBar_I_ extends Mix_IfwFooX__wBar_I_ { ; ; f; } +// */class S___IfwFooX__wBar_If extends Mix_IfwFooX__wBar_If { ; ; f; } +/* */class S___IfwFooX__wBarY__ extends Mix_IfwFooX__wBarY__ { ; ; f; } +/* */class S___IfwFooX__wBarY_f extends Mix_IfwFooX__wBarY_f { ; ; f; } +// */class S___IfwFooX__wBarYI_ extends Mix_IfwFooX__wBarYI_ { ; ; f; } +// */class S___IfwFooX__wBarYIf extends Mix_IfwFooX__wBarYIf { ; ; f; } +/* */class S___IfwFooX_f extends Mix_IfwFooX_f { ; ; f; } +/* */class S___IfwFooX_fwBar___ extends Mix_IfwFooX_fwBar___ { ; ; f; } +/* */class S___IfwFooX_fwBar__f extends Mix_IfwFooX_fwBar__f { ; ; f; } +// */class S___IfwFooX_fwBar_I_ extends Mix_IfwFooX_fwBar_I_ { ; ; f; } +// */class S___IfwFooX_fwBar_If extends Mix_IfwFooX_fwBar_If { ; ; f; } +/* */class S___IfwFooX_fwBarY__ extends Mix_IfwFooX_fwBarY__ { ; ; f; } +/* */class S___IfwFooX_fwBarY_f extends Mix_IfwFooX_fwBarY_f { ; ; f; } +// */class S___IfwFooX_fwBarYI_ extends Mix_IfwFooX_fwBarYI_ { ; ; f; } +// */class S___IfwFooX_fwBarYIf extends Mix_IfwFooX_fwBarYIf { ; ; f; } +// */class S___IfwFooXI_ extends Mix_IfwFooXI_ { ; ; f; } +// */class S___IfwFooXI_wBar___ extends Mix_IfwFooXI_wBar___ { ; ; f; } +// */class S___IfwFooXI_wBar__f extends Mix_IfwFooXI_wBar__f { ; ; f; } +// */class S___IfwFooXI_wBar_I_ extends Mix_IfwFooXI_wBar_I_ { ; ; f; } +// */class S___IfwFooXI_wBar_If extends Mix_IfwFooXI_wBar_If { ; ; f; } +// */class S___IfwFooXI_wBarY__ extends Mix_IfwFooXI_wBarY__ { ; ; f; } +// */class S___IfwFooXI_wBarY_f extends Mix_IfwFooXI_wBarY_f { ; ; f; } +// */class S___IfwFooXI_wBarYI_ extends Mix_IfwFooXI_wBarYI_ { ; ; f; } +// */class S___IfwFooXI_wBarYIf extends Mix_IfwFooXI_wBarYIf { ; ; f; } +// */class S___IfwFooXIf extends Mix_IfwFooXIf { ; ; f; } +// */class S___IfwFooXIfwBar___ extends Mix_IfwFooXIfwBar___ { ; ; f; } +// */class S___IfwFooXIfwBar__f extends Mix_IfwFooXIfwBar__f { ; ; f; } +// */class S___IfwFooXIfwBar_I_ extends Mix_IfwFooXIfwBar_I_ { ; ; f; } +// */class S___IfwFooXIfwBar_If extends Mix_IfwFooXIfwBar_If { ; ; f; } +// */class S___IfwFooXIfwBarY__ extends Mix_IfwFooXIfwBarY__ { ; ; f; } +// */class S___IfwFooXIfwBarY_f extends Mix_IfwFooXIfwBarY_f { ; ; f; } +// */class S___IfwFooXIfwBarYI_ extends Mix_IfwFooXIfwBarYI_ { ; ; f; } +// */class S___IfwFooXIfwBarYIf extends Mix_IfwFooXIfwBarYIf { ; ; f; } + +/* */class S__Z__wFoo___ extends MixZ__wFoo___ [C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo___wBar___ extends MixZ__wFoo___wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo___wBar__f extends MixZ__wFoo___wBar__f[C] { class I; ; f; } +/* */class S__Z__wFoo___wBar_I_ extends MixZ__wFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo___wBar_If extends MixZ__wFoo___wBar_If[C] { ; ; f; } +/* */class S__Z__wFoo___wBarY__ extends MixZ__wFoo___wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo___wBarY_f extends MixZ__wFoo___wBarY_f[C] { class I; ; f; } +/* */class S__Z__wFoo___wBarYI_ extends MixZ__wFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo___wBarYIf extends MixZ__wFoo___wBarYIf[C] { ; ; f; } +/* */class S__Z__wFoo__f extends MixZ__wFoo__f [C] { class I; ; f; } +/* */class S__Z__wFoo__fwBar___ extends MixZ__wFoo__fwBar___[C] { class I; ; f; } +// */class S__Z__wFoo__fwBar__f extends MixZ__wFoo__fwBar__f[C] { class I; ; f; } +/* */class S__Z__wFoo__fwBar_I_ extends MixZ__wFoo__fwBar_I_[C] { ; ; f; } +// */class S__Z__wFoo__fwBar_If extends MixZ__wFoo__fwBar_If[C] { ; ; f; } +/* */class S__Z__wFoo__fwBarY__ extends MixZ__wFoo__fwBarY__[C] { class I; ; f; } +// */class S__Z__wFoo__fwBarY_f extends MixZ__wFoo__fwBarY_f[C] { class I; ; f; } +/* */class S__Z__wFoo__fwBarYI_ extends MixZ__wFoo__fwBarYI_[C] { ; ; f; } +// */class S__Z__wFoo__fwBarYIf extends MixZ__wFoo__fwBarYIf[C] { ; ; f; } +/* */class S__Z__wFoo_I_ extends MixZ__wFoo_I_ [C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo_I_wBar___ extends MixZ__wFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo_I_wBar__f extends MixZ__wFoo_I_wBar__f[C] { ; ; f; } +// */class S__Z__wFoo_I_wBar_I_ extends MixZ__wFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__wFoo_I_wBar_If extends MixZ__wFoo_I_wBar_If[C] { ; ; f; } +/* */class S__Z__wFoo_I_wBarY__ extends MixZ__wFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFoo_I_wBarY_f extends MixZ__wFoo_I_wBarY_f[C] { ; ; f; } +// */class S__Z__wFoo_I_wBarYI_ extends MixZ__wFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__wFoo_I_wBarYIf extends MixZ__wFoo_I_wBarYIf[C] { ; ; f; } +/* */class S__Z__wFoo_If extends MixZ__wFoo_If [C] { ; ; f; } +/* */class S__Z__wFoo_IfwBar___ extends MixZ__wFoo_IfwBar___[C] { ; ; f; } +// */class S__Z__wFoo_IfwBar__f extends MixZ__wFoo_IfwBar__f[C] { ; ; f; } +// */class S__Z__wFoo_IfwBar_I_ extends MixZ__wFoo_IfwBar_I_[C] { ; ; f; } +// */class S__Z__wFoo_IfwBar_If extends MixZ__wFoo_IfwBar_If[C] { ; ; f; } +/* */class S__Z__wFoo_IfwBarY__ extends MixZ__wFoo_IfwBarY__[C] { ; ; f; } +// */class S__Z__wFoo_IfwBarY_f extends MixZ__wFoo_IfwBarY_f[C] { ; ; f; } +// */class S__Z__wFoo_IfwBarYI_ extends MixZ__wFoo_IfwBarYI_[C] { ; ; f; } +// */class S__Z__wFoo_IfwBarYIf extends MixZ__wFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__Z__wFooX__ extends MixZ__wFooX__ [C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFooX__wBar___ extends MixZ__wFooX__wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFooX__wBar__f extends MixZ__wFooX__wBar__f[C] { class I; ; f; } +/* */class S__Z__wFooX__wBar_I_ extends MixZ__wFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFooX__wBar_If extends MixZ__wFooX__wBar_If[C] { ; ; f; } +/* */class S__Z__wFooX__wBarY__ extends MixZ__wFooX__wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S__Z__wFooX__wBarY_f extends MixZ__wFooX__wBarY_f[C] { class I; ; f; } +/* */class S__Z__wFooX__wBarYI_ extends MixZ__wFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFooX__wBarYIf extends MixZ__wFooX__wBarYIf[C] { ; ; f; } +/* */class S__Z__wFooX_f extends MixZ__wFooX_f [C] { class I; ; f; } +/* */class S__Z__wFooX_fwBar___ extends MixZ__wFooX_fwBar___[C] { class I; ; f; } +// */class S__Z__wFooX_fwBar__f extends MixZ__wFooX_fwBar__f[C] { class I; ; f; } +/* */class S__Z__wFooX_fwBar_I_ extends MixZ__wFooX_fwBar_I_[C] { ; ; f; } +// */class S__Z__wFooX_fwBar_If extends MixZ__wFooX_fwBar_If[C] { ; ; f; } +/* */class S__Z__wFooX_fwBarY__ extends MixZ__wFooX_fwBarY__[C] { class I; ; f; } +// */class S__Z__wFooX_fwBarY_f extends MixZ__wFooX_fwBarY_f[C] { class I; ; f; } +/* */class S__Z__wFooX_fwBarYI_ extends MixZ__wFooX_fwBarYI_[C] { ; ; f; } +// */class S__Z__wFooX_fwBarYIf extends MixZ__wFooX_fwBarYIf[C] { ; ; f; } +/* */class S__Z__wFooXI_ extends MixZ__wFooXI_ [C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFooXI_wBar___ extends MixZ__wFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFooXI_wBar__f extends MixZ__wFooXI_wBar__f[C] { ; ; f; } +// */class S__Z__wFooXI_wBar_I_ extends MixZ__wFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__wFooXI_wBar_If extends MixZ__wFooXI_wBar_If[C] { ; ; f; } +/* */class S__Z__wFooXI_wBarY__ extends MixZ__wFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__Z__wFooXI_wBarY_f extends MixZ__wFooXI_wBarY_f[C] { ; ; f; } +// */class S__Z__wFooXI_wBarYI_ extends MixZ__wFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__Z__wFooXI_wBarYIf extends MixZ__wFooXI_wBarYIf[C] { ; ; f; } +/* */class S__Z__wFooXIf extends MixZ__wFooXIf [C] { ; ; f; } +/* */class S__Z__wFooXIfwBar___ extends MixZ__wFooXIfwBar___[C] { ; ; f; } +// */class S__Z__wFooXIfwBar__f extends MixZ__wFooXIfwBar__f[C] { ; ; f; } +// */class S__Z__wFooXIfwBar_I_ extends MixZ__wFooXIfwBar_I_[C] { ; ; f; } +// */class S__Z__wFooXIfwBar_If extends MixZ__wFooXIfwBar_If[C] { ; ; f; } +/* */class S__Z__wFooXIfwBarY__ extends MixZ__wFooXIfwBarY__[C] { ; ; f; } +// */class S__Z__wFooXIfwBarY_f extends MixZ__wFooXIfwBarY_f[C] { ; ; f; } +// */class S__Z__wFooXIfwBarYI_ extends MixZ__wFooXIfwBarYI_[C] { ; ; f; } +// */class S__Z__wFooXIfwBarYIf extends MixZ__wFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__Z_fwFoo___ extends MixZ_fwFoo___ [C] { class I; ; f; } +/* */class S__Z_fwFoo___wBar___ extends MixZ_fwFoo___wBar___[C] { class I; ; f; } +/* */class S__Z_fwFoo___wBar__f extends MixZ_fwFoo___wBar__f[C] { class I; ; f; } +/* */class S__Z_fwFoo___wBar_I_ extends MixZ_fwFoo___wBar_I_[C] { ; ; f; } +/* */class S__Z_fwFoo___wBar_If extends MixZ_fwFoo___wBar_If[C] { ; ; f; } +/* */class S__Z_fwFoo___wBarY__ extends MixZ_fwFoo___wBarY__[C] { class I; ; f; } +/* */class S__Z_fwFoo___wBarY_f extends MixZ_fwFoo___wBarY_f[C] { class I; ; f; } +/* */class S__Z_fwFoo___wBarYI_ extends MixZ_fwFoo___wBarYI_[C] { ; ; f; } +/* */class S__Z_fwFoo___wBarYIf extends MixZ_fwFoo___wBarYIf[C] { ; ; f; } +/* */class S__Z_fwFoo__f extends MixZ_fwFoo__f [C] { class I; ; f; } +/* */class S__Z_fwFoo__fwBar___ extends MixZ_fwFoo__fwBar___[C] { class I; ; f; } +/* */class S__Z_fwFoo__fwBar__f extends MixZ_fwFoo__fwBar__f[C] { class I; ; f; } +/* */class S__Z_fwFoo__fwBar_I_ extends MixZ_fwFoo__fwBar_I_[C] { ; ; f; } +/* */class S__Z_fwFoo__fwBar_If extends MixZ_fwFoo__fwBar_If[C] { ; ; f; } +/* */class S__Z_fwFoo__fwBarY__ extends MixZ_fwFoo__fwBarY__[C] { class I; ; f; } +/* */class S__Z_fwFoo__fwBarY_f extends MixZ_fwFoo__fwBarY_f[C] { class I; ; f; } +/* */class S__Z_fwFoo__fwBarYI_ extends MixZ_fwFoo__fwBarYI_[C] { ; ; f; } +/* */class S__Z_fwFoo__fwBarYIf extends MixZ_fwFoo__fwBarYIf[C] { ; ; f; } +/* */class S__Z_fwFoo_I_ extends MixZ_fwFoo_I_ [C] { ; ; f; } +/* */class S__Z_fwFoo_I_wBar___ extends MixZ_fwFoo_I_wBar___[C] { ; ; f; } +/* */class S__Z_fwFoo_I_wBar__f extends MixZ_fwFoo_I_wBar__f[C] { ; ; f; } +// */class S__Z_fwFoo_I_wBar_I_ extends MixZ_fwFoo_I_wBar_I_[C] { ; ; f; } +// */class S__Z_fwFoo_I_wBar_If extends MixZ_fwFoo_I_wBar_If[C] { ; ; f; } +/* */class S__Z_fwFoo_I_wBarY__ extends MixZ_fwFoo_I_wBarY__[C] { ; ; f; } +/* */class S__Z_fwFoo_I_wBarY_f extends MixZ_fwFoo_I_wBarY_f[C] { ; ; f; } +// */class S__Z_fwFoo_I_wBarYI_ extends MixZ_fwFoo_I_wBarYI_[C] { ; ; f; } +// */class S__Z_fwFoo_I_wBarYIf extends MixZ_fwFoo_I_wBarYIf[C] { ; ; f; } +/* */class S__Z_fwFoo_If extends MixZ_fwFoo_If [C] { ; ; f; } +/* */class S__Z_fwFoo_IfwBar___ extends MixZ_fwFoo_IfwBar___[C] { ; ; f; } +/* */class S__Z_fwFoo_IfwBar__f extends MixZ_fwFoo_IfwBar__f[C] { ; ; f; } +// */class S__Z_fwFoo_IfwBar_I_ extends MixZ_fwFoo_IfwBar_I_[C] { ; ; f; } +// */class S__Z_fwFoo_IfwBar_If extends MixZ_fwFoo_IfwBar_If[C] { ; ; f; } +/* */class S__Z_fwFoo_IfwBarY__ extends MixZ_fwFoo_IfwBarY__[C] { ; ; f; } +/* */class S__Z_fwFoo_IfwBarY_f extends MixZ_fwFoo_IfwBarY_f[C] { ; ; f; } +// */class S__Z_fwFoo_IfwBarYI_ extends MixZ_fwFoo_IfwBarYI_[C] { ; ; f; } +// */class S__Z_fwFoo_IfwBarYIf extends MixZ_fwFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__Z_fwFooX__ extends MixZ_fwFooX__ [C] { class I; ; f; } +/* */class S__Z_fwFooX__wBar___ extends MixZ_fwFooX__wBar___[C] { class I; ; f; } +/* */class S__Z_fwFooX__wBar__f extends MixZ_fwFooX__wBar__f[C] { class I; ; f; } +/* */class S__Z_fwFooX__wBar_I_ extends MixZ_fwFooX__wBar_I_[C] { ; ; f; } +/* */class S__Z_fwFooX__wBar_If extends MixZ_fwFooX__wBar_If[C] { ; ; f; } +/* */class S__Z_fwFooX__wBarY__ extends MixZ_fwFooX__wBarY__[C] { class I; ; f; } +/* */class S__Z_fwFooX__wBarY_f extends MixZ_fwFooX__wBarY_f[C] { class I; ; f; } +/* */class S__Z_fwFooX__wBarYI_ extends MixZ_fwFooX__wBarYI_[C] { ; ; f; } +/* */class S__Z_fwFooX__wBarYIf extends MixZ_fwFooX__wBarYIf[C] { ; ; f; } +/* */class S__Z_fwFooX_f extends MixZ_fwFooX_f [C] { class I; ; f; } +/* */class S__Z_fwFooX_fwBar___ extends MixZ_fwFooX_fwBar___[C] { class I; ; f; } +/* */class S__Z_fwFooX_fwBar__f extends MixZ_fwFooX_fwBar__f[C] { class I; ; f; } +/* */class S__Z_fwFooX_fwBar_I_ extends MixZ_fwFooX_fwBar_I_[C] { ; ; f; } +/* */class S__Z_fwFooX_fwBar_If extends MixZ_fwFooX_fwBar_If[C] { ; ; f; } +/* */class S__Z_fwFooX_fwBarY__ extends MixZ_fwFooX_fwBarY__[C] { class I; ; f; } +/* */class S__Z_fwFooX_fwBarY_f extends MixZ_fwFooX_fwBarY_f[C] { class I; ; f; } +/* */class S__Z_fwFooX_fwBarYI_ extends MixZ_fwFooX_fwBarYI_[C] { ; ; f; } +/* */class S__Z_fwFooX_fwBarYIf extends MixZ_fwFooX_fwBarYIf[C] { ; ; f; } +/* */class S__Z_fwFooXI_ extends MixZ_fwFooXI_ [C] { ; ; f; } +/* */class S__Z_fwFooXI_wBar___ extends MixZ_fwFooXI_wBar___[C] { ; ; f; } +/* */class S__Z_fwFooXI_wBar__f extends MixZ_fwFooXI_wBar__f[C] { ; ; f; } +// */class S__Z_fwFooXI_wBar_I_ extends MixZ_fwFooXI_wBar_I_[C] { ; ; f; } +// */class S__Z_fwFooXI_wBar_If extends MixZ_fwFooXI_wBar_If[C] { ; ; f; } +/* */class S__Z_fwFooXI_wBarY__ extends MixZ_fwFooXI_wBarY__[C] { ; ; f; } +/* */class S__Z_fwFooXI_wBarY_f extends MixZ_fwFooXI_wBarY_f[C] { ; ; f; } +// */class S__Z_fwFooXI_wBarYI_ extends MixZ_fwFooXI_wBarYI_[C] { ; ; f; } +// */class S__Z_fwFooXI_wBarYIf extends MixZ_fwFooXI_wBarYIf[C] { ; ; f; } +/* */class S__Z_fwFooXIf extends MixZ_fwFooXIf [C] { ; ; f; } +/* */class S__Z_fwFooXIfwBar___ extends MixZ_fwFooXIfwBar___[C] { ; ; f; } +/* */class S__Z_fwFooXIfwBar__f extends MixZ_fwFooXIfwBar__f[C] { ; ; f; } +// */class S__Z_fwFooXIfwBar_I_ extends MixZ_fwFooXIfwBar_I_[C] { ; ; f; } +// */class S__Z_fwFooXIfwBar_If extends MixZ_fwFooXIfwBar_If[C] { ; ; f; } +/* */class S__Z_fwFooXIfwBarY__ extends MixZ_fwFooXIfwBarY__[C] { ; ; f; } +/* */class S__Z_fwFooXIfwBarY_f extends MixZ_fwFooXIfwBarY_f[C] { ; ; f; } +// */class S__Z_fwFooXIfwBarYI_ extends MixZ_fwFooXIfwBarYI_[C] { ; ; f; } +// */class S__Z_fwFooXIfwBarYIf extends MixZ_fwFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__ZI_wFoo___ extends MixZI_wFoo___ [C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFoo___wBar___ extends MixZI_wFoo___wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFoo___wBar__f extends MixZI_wFoo___wBar__f[C] { ; ; f; } +// */class S__ZI_wFoo___wBar_I_ extends MixZI_wFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo___wBar_If extends MixZI_wFoo___wBar_If[C] { ; ; f; } +/* */class S__ZI_wFoo___wBarY__ extends MixZI_wFoo___wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFoo___wBarY_f extends MixZI_wFoo___wBarY_f[C] { ; ; f; } +// */class S__ZI_wFoo___wBarYI_ extends MixZI_wFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo___wBarYIf extends MixZI_wFoo___wBarYIf[C] { ; ; f; } +/* */class S__ZI_wFoo__f extends MixZI_wFoo__f [C] { ; ; f; } +/* */class S__ZI_wFoo__fwBar___ extends MixZI_wFoo__fwBar___[C] { ; ; f; } +// */class S__ZI_wFoo__fwBar__f extends MixZI_wFoo__fwBar__f[C] { ; ; f; } +// */class S__ZI_wFoo__fwBar_I_ extends MixZI_wFoo__fwBar_I_[C] { ; ; f; } +// */class S__ZI_wFoo__fwBar_If extends MixZI_wFoo__fwBar_If[C] { ; ; f; } +/* */class S__ZI_wFoo__fwBarY__ extends MixZI_wFoo__fwBarY__[C] { ; ; f; } +// */class S__ZI_wFoo__fwBarY_f extends MixZI_wFoo__fwBarY_f[C] { ; ; f; } +// */class S__ZI_wFoo__fwBarYI_ extends MixZI_wFoo__fwBarYI_[C] { ; ; f; } +// */class S__ZI_wFoo__fwBarYIf extends MixZI_wFoo__fwBarYIf[C] { ; ; f; } +// */class S__ZI_wFoo_I_ extends MixZI_wFoo_I_ [C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo_I_wBar___ extends MixZI_wFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo_I_wBar__f extends MixZI_wFoo_I_wBar__f[C] { ; ; f; } +// */class S__ZI_wFoo_I_wBar_I_ extends MixZI_wFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo_I_wBar_If extends MixZI_wFoo_I_wBar_If[C] { ; ; f; } +// */class S__ZI_wFoo_I_wBarY__ extends MixZI_wFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo_I_wBarY_f extends MixZI_wFoo_I_wBarY_f[C] { ; ; f; } +// */class S__ZI_wFoo_I_wBarYI_ extends MixZI_wFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFoo_I_wBarYIf extends MixZI_wFoo_I_wBarYIf[C] { ; ; f; } +// */class S__ZI_wFoo_If extends MixZI_wFoo_If [C] { ; ; f; } +// */class S__ZI_wFoo_IfwBar___ extends MixZI_wFoo_IfwBar___[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBar__f extends MixZI_wFoo_IfwBar__f[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBar_I_ extends MixZI_wFoo_IfwBar_I_[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBar_If extends MixZI_wFoo_IfwBar_If[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBarY__ extends MixZI_wFoo_IfwBarY__[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBarY_f extends MixZI_wFoo_IfwBarY_f[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBarYI_ extends MixZI_wFoo_IfwBarYI_[C] { ; ; f; } +// */class S__ZI_wFoo_IfwBarYIf extends MixZI_wFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__ZI_wFooX__ extends MixZI_wFooX__ [C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFooX__wBar___ extends MixZI_wFooX__wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFooX__wBar__f extends MixZI_wFooX__wBar__f[C] { ; ; f; } +// */class S__ZI_wFooX__wBar_I_ extends MixZI_wFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooX__wBar_If extends MixZI_wFooX__wBar_If[C] { ; ; f; } +/* */class S__ZI_wFooX__wBarY__ extends MixZI_wFooX__wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S__ZI_wFooX__wBarY_f extends MixZI_wFooX__wBarY_f[C] { ; ; f; } +// */class S__ZI_wFooX__wBarYI_ extends MixZI_wFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooX__wBarYIf extends MixZI_wFooX__wBarYIf[C] { ; ; f; } +/* */class S__ZI_wFooX_f extends MixZI_wFooX_f [C] { ; ; f; } +/* */class S__ZI_wFooX_fwBar___ extends MixZI_wFooX_fwBar___[C] { ; ; f; } +// */class S__ZI_wFooX_fwBar__f extends MixZI_wFooX_fwBar__f[C] { ; ; f; } +// */class S__ZI_wFooX_fwBar_I_ extends MixZI_wFooX_fwBar_I_[C] { ; ; f; } +// */class S__ZI_wFooX_fwBar_If extends MixZI_wFooX_fwBar_If[C] { ; ; f; } +/* */class S__ZI_wFooX_fwBarY__ extends MixZI_wFooX_fwBarY__[C] { ; ; f; } +// */class S__ZI_wFooX_fwBarY_f extends MixZI_wFooX_fwBarY_f[C] { ; ; f; } +// */class S__ZI_wFooX_fwBarYI_ extends MixZI_wFooX_fwBarYI_[C] { ; ; f; } +// */class S__ZI_wFooX_fwBarYIf extends MixZI_wFooX_fwBarYIf[C] { ; ; f; } +// */class S__ZI_wFooXI_ extends MixZI_wFooXI_ [C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooXI_wBar___ extends MixZI_wFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooXI_wBar__f extends MixZI_wFooXI_wBar__f[C] { ; ; f; } +// */class S__ZI_wFooXI_wBar_I_ extends MixZI_wFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooXI_wBar_If extends MixZI_wFooXI_wBar_If[C] { ; ; f; } +// */class S__ZI_wFooXI_wBarY__ extends MixZI_wFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooXI_wBarY_f extends MixZI_wFooXI_wBarY_f[C] { ; ; f; } +// */class S__ZI_wFooXI_wBarYI_ extends MixZI_wFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S__ZI_wFooXI_wBarYIf extends MixZI_wFooXI_wBarYIf[C] { ; ; f; } +// */class S__ZI_wFooXIf extends MixZI_wFooXIf [C] { ; ; f; } +// */class S__ZI_wFooXIfwBar___ extends MixZI_wFooXIfwBar___[C] { ; ; f; } +// */class S__ZI_wFooXIfwBar__f extends MixZI_wFooXIfwBar__f[C] { ; ; f; } +// */class S__ZI_wFooXIfwBar_I_ extends MixZI_wFooXIfwBar_I_[C] { ; ; f; } +// */class S__ZI_wFooXIfwBar_If extends MixZI_wFooXIfwBar_If[C] { ; ; f; } +// */class S__ZI_wFooXIfwBarY__ extends MixZI_wFooXIfwBarY__[C] { ; ; f; } +// */class S__ZI_wFooXIfwBarY_f extends MixZI_wFooXIfwBarY_f[C] { ; ; f; } +// */class S__ZI_wFooXIfwBarYI_ extends MixZI_wFooXIfwBarYI_[C] { ; ; f; } +// */class S__ZI_wFooXIfwBarYIf extends MixZI_wFooXIfwBarYIf[C] { ; ; f; } + +/* */class S__ZIfwFoo___ extends MixZIfwFoo___ [C] { ; ; f; } +/* */class S__ZIfwFoo___wBar___ extends MixZIfwFoo___wBar___[C] { ; ; f; } +/* */class S__ZIfwFoo___wBar__f extends MixZIfwFoo___wBar__f[C] { ; ; f; } +// */class S__ZIfwFoo___wBar_I_ extends MixZIfwFoo___wBar_I_[C] { ; ; f; } +// */class S__ZIfwFoo___wBar_If extends MixZIfwFoo___wBar_If[C] { ; ; f; } +/* */class S__ZIfwFoo___wBarY__ extends MixZIfwFoo___wBarY__[C] { ; ; f; } +/* */class S__ZIfwFoo___wBarY_f extends MixZIfwFoo___wBarY_f[C] { ; ; f; } +// */class S__ZIfwFoo___wBarYI_ extends MixZIfwFoo___wBarYI_[C] { ; ; f; } +// */class S__ZIfwFoo___wBarYIf extends MixZIfwFoo___wBarYIf[C] { ; ; f; } +/* */class S__ZIfwFoo__f extends MixZIfwFoo__f [C] { ; ; f; } +/* */class S__ZIfwFoo__fwBar___ extends MixZIfwFoo__fwBar___[C] { ; ; f; } +/* */class S__ZIfwFoo__fwBar__f extends MixZIfwFoo__fwBar__f[C] { ; ; f; } +// */class S__ZIfwFoo__fwBar_I_ extends MixZIfwFoo__fwBar_I_[C] { ; ; f; } +// */class S__ZIfwFoo__fwBar_If extends MixZIfwFoo__fwBar_If[C] { ; ; f; } +/* */class S__ZIfwFoo__fwBarY__ extends MixZIfwFoo__fwBarY__[C] { ; ; f; } +/* */class S__ZIfwFoo__fwBarY_f extends MixZIfwFoo__fwBarY_f[C] { ; ; f; } +// */class S__ZIfwFoo__fwBarYI_ extends MixZIfwFoo__fwBarYI_[C] { ; ; f; } +// */class S__ZIfwFoo__fwBarYIf extends MixZIfwFoo__fwBarYIf[C] { ; ; f; } +// */class S__ZIfwFoo_I_ extends MixZIfwFoo_I_ [C] { ; ; f; } +// */class S__ZIfwFoo_I_wBar___ extends MixZIfwFoo_I_wBar___[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBar__f extends MixZIfwFoo_I_wBar__f[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBar_I_ extends MixZIfwFoo_I_wBar_I_[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBar_If extends MixZIfwFoo_I_wBar_If[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBarY__ extends MixZIfwFoo_I_wBarY__[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBarY_f extends MixZIfwFoo_I_wBarY_f[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBarYI_ extends MixZIfwFoo_I_wBarYI_[C] { ; ; f; } +// */class S__ZIfwFoo_I_wBarYIf extends MixZIfwFoo_I_wBarYIf[C] { ; ; f; } +// */class S__ZIfwFoo_If extends MixZIfwFoo_If [C] { ; ; f; } +// */class S__ZIfwFoo_IfwBar___ extends MixZIfwFoo_IfwBar___[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBar__f extends MixZIfwFoo_IfwBar__f[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBar_I_ extends MixZIfwFoo_IfwBar_I_[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBar_If extends MixZIfwFoo_IfwBar_If[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBarY__ extends MixZIfwFoo_IfwBarY__[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBarY_f extends MixZIfwFoo_IfwBarY_f[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBarYI_ extends MixZIfwFoo_IfwBarYI_[C] { ; ; f; } +// */class S__ZIfwFoo_IfwBarYIf extends MixZIfwFoo_IfwBarYIf[C] { ; ; f; } +/* */class S__ZIfwFooX__ extends MixZIfwFooX__ [C] { ; ; f; } +/* */class S__ZIfwFooX__wBar___ extends MixZIfwFooX__wBar___[C] { ; ; f; } +/* */class S__ZIfwFooX__wBar__f extends MixZIfwFooX__wBar__f[C] { ; ; f; } +// */class S__ZIfwFooX__wBar_I_ extends MixZIfwFooX__wBar_I_[C] { ; ; f; } +// */class S__ZIfwFooX__wBar_If extends MixZIfwFooX__wBar_If[C] { ; ; f; } +/* */class S__ZIfwFooX__wBarY__ extends MixZIfwFooX__wBarY__[C] { ; ; f; } +/* */class S__ZIfwFooX__wBarY_f extends MixZIfwFooX__wBarY_f[C] { ; ; f; } +// */class S__ZIfwFooX__wBarYI_ extends MixZIfwFooX__wBarYI_[C] { ; ; f; } +// */class S__ZIfwFooX__wBarYIf extends MixZIfwFooX__wBarYIf[C] { ; ; f; } +/* */class S__ZIfwFooX_f extends MixZIfwFooX_f [C] { ; ; f; } +/* */class S__ZIfwFooX_fwBar___ extends MixZIfwFooX_fwBar___[C] { ; ; f; } +/* */class S__ZIfwFooX_fwBar__f extends MixZIfwFooX_fwBar__f[C] { ; ; f; } +// */class S__ZIfwFooX_fwBar_I_ extends MixZIfwFooX_fwBar_I_[C] { ; ; f; } +// */class S__ZIfwFooX_fwBar_If extends MixZIfwFooX_fwBar_If[C] { ; ; f; } +/* */class S__ZIfwFooX_fwBarY__ extends MixZIfwFooX_fwBarY__[C] { ; ; f; } +/* */class S__ZIfwFooX_fwBarY_f extends MixZIfwFooX_fwBarY_f[C] { ; ; f; } +// */class S__ZIfwFooX_fwBarYI_ extends MixZIfwFooX_fwBarYI_[C] { ; ; f; } +// */class S__ZIfwFooX_fwBarYIf extends MixZIfwFooX_fwBarYIf[C] { ; ; f; } +// */class S__ZIfwFooXI_ extends MixZIfwFooXI_ [C] { ; ; f; } +// */class S__ZIfwFooXI_wBar___ extends MixZIfwFooXI_wBar___[C] { ; ; f; } +// */class S__ZIfwFooXI_wBar__f extends MixZIfwFooXI_wBar__f[C] { ; ; f; } +// */class S__ZIfwFooXI_wBar_I_ extends MixZIfwFooXI_wBar_I_[C] { ; ; f; } +// */class S__ZIfwFooXI_wBar_If extends MixZIfwFooXI_wBar_If[C] { ; ; f; } +// */class S__ZIfwFooXI_wBarY__ extends MixZIfwFooXI_wBarY__[C] { ; ; f; } +// */class S__ZIfwFooXI_wBarY_f extends MixZIfwFooXI_wBarY_f[C] { ; ; f; } +// */class S__ZIfwFooXI_wBarYI_ extends MixZIfwFooXI_wBarYI_[C] { ; ; f; } +// */class S__ZIfwFooXI_wBarYIf extends MixZIfwFooXI_wBarYIf[C] { ; ; f; } +// */class S__ZIfwFooXIf extends MixZIfwFooXIf [C] { ; ; f; } +// */class S__ZIfwFooXIfwBar___ extends MixZIfwFooXIfwBar___[C] { ; ; f; } +// */class S__ZIfwFooXIfwBar__f extends MixZIfwFooXIfwBar__f[C] { ; ; f; } +// */class S__ZIfwFooXIfwBar_I_ extends MixZIfwFooXIfwBar_I_[C] { ; ; f; } +// */class S__ZIfwFooXIfwBar_If extends MixZIfwFooXIfwBar_If[C] { ; ; f; } +// */class S__ZIfwFooXIfwBarY__ extends MixZIfwFooXIfwBarY__[C] { ; ; f; } +// */class S__ZIfwFooXIfwBarY_f extends MixZIfwFooXIfwBarY_f[C] { ; ; f; } +// */class S__ZIfwFooXIfwBarYI_ extends MixZIfwFooXIfwBarYI_[C] { ; ; f; } +// */class S__ZIfwFooXIfwBarYIf extends MixZIfwFooXIfwBarYIf[C] { ; ; f; } + + + +/* */class S_T___eFoo___ [T] extends Mix___eFoo___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFoo___wBar___[T] extends Mix___eFoo___wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFoo___wBar__f[T] extends Mix___eFoo___wBar__f { class I; ; f; } +/* */class S_T___eFoo___wBar_I_[T] extends Mix___eFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFoo___wBar_If[T] extends Mix___eFoo___wBar_If { ; ; f; } +/* */class S_T___eFoo___wBarY__[T] extends Mix___eFoo___wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFoo___wBarY_f[T] extends Mix___eFoo___wBarY_f { class I; ; f; } +/* */class S_T___eFoo___wBarYI_[T] extends Mix___eFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFoo___wBarYIf[T] extends Mix___eFoo___wBarYIf { ; ; f; } +/* */class S_T___eFoo__f [T] extends Mix___eFoo__f { class I; ; f; } +/* */class S_T___eFoo__fwBar___[T] extends Mix___eFoo__fwBar___ { class I; ; f; } +// */class S_T___eFoo__fwBar__f[T] extends Mix___eFoo__fwBar__f { class I; ; f; } +/* */class S_T___eFoo__fwBar_I_[T] extends Mix___eFoo__fwBar_I_ { ; ; f; } +// */class S_T___eFoo__fwBar_If[T] extends Mix___eFoo__fwBar_If { ; ; f; } +/* */class S_T___eFoo__fwBarY__[T] extends Mix___eFoo__fwBarY__ { class I; ; f; } +// */class S_T___eFoo__fwBarY_f[T] extends Mix___eFoo__fwBarY_f { class I; ; f; } +/* */class S_T___eFoo__fwBarYI_[T] extends Mix___eFoo__fwBarYI_ { ; ; f; } +// */class S_T___eFoo__fwBarYIf[T] extends Mix___eFoo__fwBarYIf { ; ; f; } +/* */class S_T___eFoo_I_ [T] extends Mix___eFoo_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFoo_I_wBar___[T] extends Mix___eFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFoo_I_wBar__f[T] extends Mix___eFoo_I_wBar__f { ; ; f; } +// */class S_T___eFoo_I_wBar_I_[T] extends Mix___eFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T___eFoo_I_wBar_If[T] extends Mix___eFoo_I_wBar_If { ; ; f; } +/* */class S_T___eFoo_I_wBarY__[T] extends Mix___eFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFoo_I_wBarY_f[T] extends Mix___eFoo_I_wBarY_f { ; ; f; } +// */class S_T___eFoo_I_wBarYI_[T] extends Mix___eFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T___eFoo_I_wBarYIf[T] extends Mix___eFoo_I_wBarYIf { ; ; f; } +/* */class S_T___eFoo_If [T] extends Mix___eFoo_If { ; ; f; } +/* */class S_T___eFoo_IfwBar___[T] extends Mix___eFoo_IfwBar___ { ; ; f; } +// */class S_T___eFoo_IfwBar__f[T] extends Mix___eFoo_IfwBar__f { ; ; f; } +// */class S_T___eFoo_IfwBar_I_[T] extends Mix___eFoo_IfwBar_I_ { ; ; f; } +// */class S_T___eFoo_IfwBar_If[T] extends Mix___eFoo_IfwBar_If { ; ; f; } +/* */class S_T___eFoo_IfwBarY__[T] extends Mix___eFoo_IfwBarY__ { ; ; f; } +// */class S_T___eFoo_IfwBarY_f[T] extends Mix___eFoo_IfwBarY_f { ; ; f; } +// */class S_T___eFoo_IfwBarYI_[T] extends Mix___eFoo_IfwBarYI_ { ; ; f; } +// */class S_T___eFoo_IfwBarYIf[T] extends Mix___eFoo_IfwBarYIf { ; ; f; } +/* */class S_T___eFooX__ [T] extends Mix___eFooX__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFooX__wBar___[T] extends Mix___eFooX__wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFooX__wBar__f[T] extends Mix___eFooX__wBar__f { class I; ; f; } +/* */class S_T___eFooX__wBar_I_[T] extends Mix___eFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFooX__wBar_If[T] extends Mix___eFooX__wBar_If { ; ; f; } +/* */class S_T___eFooX__wBarY__[T] extends Mix___eFooX__wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___eFooX__wBarY_f[T] extends Mix___eFooX__wBarY_f { class I; ; f; } +/* */class S_T___eFooX__wBarYI_[T] extends Mix___eFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFooX__wBarYIf[T] extends Mix___eFooX__wBarYIf { ; ; f; } +/* */class S_T___eFooX_f [T] extends Mix___eFooX_f { class I; ; f; } +/* */class S_T___eFooX_fwBar___[T] extends Mix___eFooX_fwBar___ { class I; ; f; } +// */class S_T___eFooX_fwBar__f[T] extends Mix___eFooX_fwBar__f { class I; ; f; } +/* */class S_T___eFooX_fwBar_I_[T] extends Mix___eFooX_fwBar_I_ { ; ; f; } +// */class S_T___eFooX_fwBar_If[T] extends Mix___eFooX_fwBar_If { ; ; f; } +/* */class S_T___eFooX_fwBarY__[T] extends Mix___eFooX_fwBarY__ { class I; ; f; } +// */class S_T___eFooX_fwBarY_f[T] extends Mix___eFooX_fwBarY_f { class I; ; f; } +/* */class S_T___eFooX_fwBarYI_[T] extends Mix___eFooX_fwBarYI_ { ; ; f; } +// */class S_T___eFooX_fwBarYIf[T] extends Mix___eFooX_fwBarYIf { ; ; f; } +/* */class S_T___eFooXI_ [T] extends Mix___eFooXI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFooXI_wBar___[T] extends Mix___eFooXI_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFooXI_wBar__f[T] extends Mix___eFooXI_wBar__f { ; ; f; } +// */class S_T___eFooXI_wBar_I_[T] extends Mix___eFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T___eFooXI_wBar_If[T] extends Mix___eFooXI_wBar_If { ; ; f; } +/* */class S_T___eFooXI_wBarY__[T] extends Mix___eFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T___eFooXI_wBarY_f[T] extends Mix___eFooXI_wBarY_f { ; ; f; } +// */class S_T___eFooXI_wBarYI_[T] extends Mix___eFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T___eFooXI_wBarYIf[T] extends Mix___eFooXI_wBarYIf { ; ; f; } +/* */class S_T___eFooXIf [T] extends Mix___eFooXIf { ; ; f; } +/* */class S_T___eFooXIfwBar___[T] extends Mix___eFooXIfwBar___ { ; ; f; } +// */class S_T___eFooXIfwBar__f[T] extends Mix___eFooXIfwBar__f { ; ; f; } +// */class S_T___eFooXIfwBar_I_[T] extends Mix___eFooXIfwBar_I_ { ; ; f; } +// */class S_T___eFooXIfwBar_If[T] extends Mix___eFooXIfwBar_If { ; ; f; } +/* */class S_T___eFooXIfwBarY__[T] extends Mix___eFooXIfwBarY__ { ; ; f; } +// */class S_T___eFooXIfwBarY_f[T] extends Mix___eFooXIfwBarY_f { ; ; f; } +// */class S_T___eFooXIfwBarYI_[T] extends Mix___eFooXIfwBarYI_ { ; ; f; } +// */class S_T___eFooXIfwBarYIf[T] extends Mix___eFooXIfwBarYIf { ; ; f; } + +/* */class S_T__feFoo___ [T] extends Mix__feFoo___ { class I; ; f; } +/* */class S_T__feFoo___wBar___[T] extends Mix__feFoo___wBar___ { class I; ; f; } +/* */class S_T__feFoo___wBar__f[T] extends Mix__feFoo___wBar__f { class I; ; f; } +/* */class S_T__feFoo___wBar_I_[T] extends Mix__feFoo___wBar_I_ { ; ; f; } +/* */class S_T__feFoo___wBar_If[T] extends Mix__feFoo___wBar_If { ; ; f; } +/* */class S_T__feFoo___wBarY__[T] extends Mix__feFoo___wBarY__ { class I; ; f; } +/* */class S_T__feFoo___wBarY_f[T] extends Mix__feFoo___wBarY_f { class I; ; f; } +/* */class S_T__feFoo___wBarYI_[T] extends Mix__feFoo___wBarYI_ { ; ; f; } +/* */class S_T__feFoo___wBarYIf[T] extends Mix__feFoo___wBarYIf { ; ; f; } +/* */class S_T__feFoo__f [T] extends Mix__feFoo__f { class I; ; f; } +/* */class S_T__feFoo__fwBar___[T] extends Mix__feFoo__fwBar___ { class I; ; f; } +/* */class S_T__feFoo__fwBar__f[T] extends Mix__feFoo__fwBar__f { class I; ; f; } +/* */class S_T__feFoo__fwBar_I_[T] extends Mix__feFoo__fwBar_I_ { ; ; f; } +/* */class S_T__feFoo__fwBar_If[T] extends Mix__feFoo__fwBar_If { ; ; f; } +/* */class S_T__feFoo__fwBarY__[T] extends Mix__feFoo__fwBarY__ { class I; ; f; } +/* */class S_T__feFoo__fwBarY_f[T] extends Mix__feFoo__fwBarY_f { class I; ; f; } +/* */class S_T__feFoo__fwBarYI_[T] extends Mix__feFoo__fwBarYI_ { ; ; f; } +/* */class S_T__feFoo__fwBarYIf[T] extends Mix__feFoo__fwBarYIf { ; ; f; } +/* */class S_T__feFoo_I_ [T] extends Mix__feFoo_I_ { ; ; f; } +/* */class S_T__feFoo_I_wBar___[T] extends Mix__feFoo_I_wBar___ { ; ; f; } +/* */class S_T__feFoo_I_wBar__f[T] extends Mix__feFoo_I_wBar__f { ; ; f; } +// */class S_T__feFoo_I_wBar_I_[T] extends Mix__feFoo_I_wBar_I_ { ; ; f; } +// */class S_T__feFoo_I_wBar_If[T] extends Mix__feFoo_I_wBar_If { ; ; f; } +/* */class S_T__feFoo_I_wBarY__[T] extends Mix__feFoo_I_wBarY__ { ; ; f; } +/* */class S_T__feFoo_I_wBarY_f[T] extends Mix__feFoo_I_wBarY_f { ; ; f; } +// */class S_T__feFoo_I_wBarYI_[T] extends Mix__feFoo_I_wBarYI_ { ; ; f; } +// */class S_T__feFoo_I_wBarYIf[T] extends Mix__feFoo_I_wBarYIf { ; ; f; } +/* */class S_T__feFoo_If [T] extends Mix__feFoo_If { ; ; f; } +/* */class S_T__feFoo_IfwBar___[T] extends Mix__feFoo_IfwBar___ { ; ; f; } +/* */class S_T__feFoo_IfwBar__f[T] extends Mix__feFoo_IfwBar__f { ; ; f; } +// */class S_T__feFoo_IfwBar_I_[T] extends Mix__feFoo_IfwBar_I_ { ; ; f; } +// */class S_T__feFoo_IfwBar_If[T] extends Mix__feFoo_IfwBar_If { ; ; f; } +/* */class S_T__feFoo_IfwBarY__[T] extends Mix__feFoo_IfwBarY__ { ; ; f; } +/* */class S_T__feFoo_IfwBarY_f[T] extends Mix__feFoo_IfwBarY_f { ; ; f; } +// */class S_T__feFoo_IfwBarYI_[T] extends Mix__feFoo_IfwBarYI_ { ; ; f; } +// */class S_T__feFoo_IfwBarYIf[T] extends Mix__feFoo_IfwBarYIf { ; ; f; } +/* */class S_T__feFooX__ [T] extends Mix__feFooX__ { class I; ; f; } +/* */class S_T__feFooX__wBar___[T] extends Mix__feFooX__wBar___ { class I; ; f; } +/* */class S_T__feFooX__wBar__f[T] extends Mix__feFooX__wBar__f { class I; ; f; } +/* */class S_T__feFooX__wBar_I_[T] extends Mix__feFooX__wBar_I_ { ; ; f; } +/* */class S_T__feFooX__wBar_If[T] extends Mix__feFooX__wBar_If { ; ; f; } +/* */class S_T__feFooX__wBarY__[T] extends Mix__feFooX__wBarY__ { class I; ; f; } +/* */class S_T__feFooX__wBarY_f[T] extends Mix__feFooX__wBarY_f { class I; ; f; } +/* */class S_T__feFooX__wBarYI_[T] extends Mix__feFooX__wBarYI_ { ; ; f; } +/* */class S_T__feFooX__wBarYIf[T] extends Mix__feFooX__wBarYIf { ; ; f; } +/* */class S_T__feFooX_f [T] extends Mix__feFooX_f { class I; ; f; } +/* */class S_T__feFooX_fwBar___[T] extends Mix__feFooX_fwBar___ { class I; ; f; } +/* */class S_T__feFooX_fwBar__f[T] extends Mix__feFooX_fwBar__f { class I; ; f; } +/* */class S_T__feFooX_fwBar_I_[T] extends Mix__feFooX_fwBar_I_ { ; ; f; } +/* */class S_T__feFooX_fwBar_If[T] extends Mix__feFooX_fwBar_If { ; ; f; } +/* */class S_T__feFooX_fwBarY__[T] extends Mix__feFooX_fwBarY__ { class I; ; f; } +/* */class S_T__feFooX_fwBarY_f[T] extends Mix__feFooX_fwBarY_f { class I; ; f; } +/* */class S_T__feFooX_fwBarYI_[T] extends Mix__feFooX_fwBarYI_ { ; ; f; } +/* */class S_T__feFooX_fwBarYIf[T] extends Mix__feFooX_fwBarYIf { ; ; f; } +/* */class S_T__feFooXI_ [T] extends Mix__feFooXI_ { ; ; f; } +/* */class S_T__feFooXI_wBar___[T] extends Mix__feFooXI_wBar___ { ; ; f; } +/* */class S_T__feFooXI_wBar__f[T] extends Mix__feFooXI_wBar__f { ; ; f; } +// */class S_T__feFooXI_wBar_I_[T] extends Mix__feFooXI_wBar_I_ { ; ; f; } +// */class S_T__feFooXI_wBar_If[T] extends Mix__feFooXI_wBar_If { ; ; f; } +/* */class S_T__feFooXI_wBarY__[T] extends Mix__feFooXI_wBarY__ { ; ; f; } +/* */class S_T__feFooXI_wBarY_f[T] extends Mix__feFooXI_wBarY_f { ; ; f; } +// */class S_T__feFooXI_wBarYI_[T] extends Mix__feFooXI_wBarYI_ { ; ; f; } +// */class S_T__feFooXI_wBarYIf[T] extends Mix__feFooXI_wBarYIf { ; ; f; } +/* */class S_T__feFooXIf [T] extends Mix__feFooXIf { ; ; f; } +/* */class S_T__feFooXIfwBar___[T] extends Mix__feFooXIfwBar___ { ; ; f; } +/* */class S_T__feFooXIfwBar__f[T] extends Mix__feFooXIfwBar__f { ; ; f; } +// */class S_T__feFooXIfwBar_I_[T] extends Mix__feFooXIfwBar_I_ { ; ; f; } +// */class S_T__feFooXIfwBar_If[T] extends Mix__feFooXIfwBar_If { ; ; f; } +/* */class S_T__feFooXIfwBarY__[T] extends Mix__feFooXIfwBarY__ { ; ; f; } +/* */class S_T__feFooXIfwBarY_f[T] extends Mix__feFooXIfwBarY_f { ; ; f; } +// */class S_T__feFooXIfwBarYI_[T] extends Mix__feFooXIfwBarYI_ { ; ; f; } +// */class S_T__feFooXIfwBarYIf[T] extends Mix__feFooXIfwBarYIf { ; ; f; } + +/* */class S_T_I_eFoo___ [T] extends Mix_I_eFoo___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFoo___wBar___[T] extends Mix_I_eFoo___wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFoo___wBar__f[T] extends Mix_I_eFoo___wBar__f { ; ; f; } +// */class S_T_I_eFoo___wBar_I_[T] extends Mix_I_eFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo___wBar_If[T] extends Mix_I_eFoo___wBar_If { ; ; f; } +/* */class S_T_I_eFoo___wBarY__[T] extends Mix_I_eFoo___wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFoo___wBarY_f[T] extends Mix_I_eFoo___wBarY_f { ; ; f; } +// */class S_T_I_eFoo___wBarYI_[T] extends Mix_I_eFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo___wBarYIf[T] extends Mix_I_eFoo___wBarYIf { ; ; f; } +/* */class S_T_I_eFoo__f [T] extends Mix_I_eFoo__f { ; ; f; } +/* */class S_T_I_eFoo__fwBar___[T] extends Mix_I_eFoo__fwBar___ { ; ; f; } +// */class S_T_I_eFoo__fwBar__f[T] extends Mix_I_eFoo__fwBar__f { ; ; f; } +// */class S_T_I_eFoo__fwBar_I_[T] extends Mix_I_eFoo__fwBar_I_ { ; ; f; } +// */class S_T_I_eFoo__fwBar_If[T] extends Mix_I_eFoo__fwBar_If { ; ; f; } +/* */class S_T_I_eFoo__fwBarY__[T] extends Mix_I_eFoo__fwBarY__ { ; ; f; } +// */class S_T_I_eFoo__fwBarY_f[T] extends Mix_I_eFoo__fwBarY_f { ; ; f; } +// */class S_T_I_eFoo__fwBarYI_[T] extends Mix_I_eFoo__fwBarYI_ { ; ; f; } +// */class S_T_I_eFoo__fwBarYIf[T] extends Mix_I_eFoo__fwBarYIf { ; ; f; } +// */class S_T_I_eFoo_I_ [T] extends Mix_I_eFoo_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo_I_wBar___[T] extends Mix_I_eFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo_I_wBar__f[T] extends Mix_I_eFoo_I_wBar__f { ; ; f; } +// */class S_T_I_eFoo_I_wBar_I_[T] extends Mix_I_eFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo_I_wBar_If[T] extends Mix_I_eFoo_I_wBar_If { ; ; f; } +// */class S_T_I_eFoo_I_wBarY__[T] extends Mix_I_eFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo_I_wBarY_f[T] extends Mix_I_eFoo_I_wBarY_f { ; ; f; } +// */class S_T_I_eFoo_I_wBarYI_[T] extends Mix_I_eFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFoo_I_wBarYIf[T] extends Mix_I_eFoo_I_wBarYIf { ; ; f; } +// */class S_T_I_eFoo_If [T] extends Mix_I_eFoo_If { ; ; f; } +// */class S_T_I_eFoo_IfwBar___[T] extends Mix_I_eFoo_IfwBar___ { ; ; f; } +// */class S_T_I_eFoo_IfwBar__f[T] extends Mix_I_eFoo_IfwBar__f { ; ; f; } +// */class S_T_I_eFoo_IfwBar_I_[T] extends Mix_I_eFoo_IfwBar_I_ { ; ; f; } +// */class S_T_I_eFoo_IfwBar_If[T] extends Mix_I_eFoo_IfwBar_If { ; ; f; } +// */class S_T_I_eFoo_IfwBarY__[T] extends Mix_I_eFoo_IfwBarY__ { ; ; f; } +// */class S_T_I_eFoo_IfwBarY_f[T] extends Mix_I_eFoo_IfwBarY_f { ; ; f; } +// */class S_T_I_eFoo_IfwBarYI_[T] extends Mix_I_eFoo_IfwBarYI_ { ; ; f; } +// */class S_T_I_eFoo_IfwBarYIf[T] extends Mix_I_eFoo_IfwBarYIf { ; ; f; } +/* */class S_T_I_eFooX__ [T] extends Mix_I_eFooX__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFooX__wBar___[T] extends Mix_I_eFooX__wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFooX__wBar__f[T] extends Mix_I_eFooX__wBar__f { ; ; f; } +// */class S_T_I_eFooX__wBar_I_[T] extends Mix_I_eFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooX__wBar_If[T] extends Mix_I_eFooX__wBar_If { ; ; f; } +/* */class S_T_I_eFooX__wBarY__[T] extends Mix_I_eFooX__wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_eFooX__wBarY_f[T] extends Mix_I_eFooX__wBarY_f { ; ; f; } +// */class S_T_I_eFooX__wBarYI_[T] extends Mix_I_eFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooX__wBarYIf[T] extends Mix_I_eFooX__wBarYIf { ; ; f; } +/* */class S_T_I_eFooX_f [T] extends Mix_I_eFooX_f { ; ; f; } +/* */class S_T_I_eFooX_fwBar___[T] extends Mix_I_eFooX_fwBar___ { ; ; f; } +// */class S_T_I_eFooX_fwBar__f[T] extends Mix_I_eFooX_fwBar__f { ; ; f; } +// */class S_T_I_eFooX_fwBar_I_[T] extends Mix_I_eFooX_fwBar_I_ { ; ; f; } +// */class S_T_I_eFooX_fwBar_If[T] extends Mix_I_eFooX_fwBar_If { ; ; f; } +/* */class S_T_I_eFooX_fwBarY__[T] extends Mix_I_eFooX_fwBarY__ { ; ; f; } +// */class S_T_I_eFooX_fwBarY_f[T] extends Mix_I_eFooX_fwBarY_f { ; ; f; } +// */class S_T_I_eFooX_fwBarYI_[T] extends Mix_I_eFooX_fwBarYI_ { ; ; f; } +// */class S_T_I_eFooX_fwBarYIf[T] extends Mix_I_eFooX_fwBarYIf { ; ; f; } +// */class S_T_I_eFooXI_ [T] extends Mix_I_eFooXI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooXI_wBar___[T] extends Mix_I_eFooXI_wBar___ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooXI_wBar__f[T] extends Mix_I_eFooXI_wBar__f { ; ; f; } +// */class S_T_I_eFooXI_wBar_I_[T] extends Mix_I_eFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooXI_wBar_If[T] extends Mix_I_eFooXI_wBar_If { ; ; f; } +// */class S_T_I_eFooXI_wBarY__[T] extends Mix_I_eFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooXI_wBarY_f[T] extends Mix_I_eFooXI_wBarY_f { ; ; f; } +// */class S_T_I_eFooXI_wBarYI_[T] extends Mix_I_eFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_eFooXI_wBarYIf[T] extends Mix_I_eFooXI_wBarYIf { ; ; f; } +// */class S_T_I_eFooXIf [T] extends Mix_I_eFooXIf { ; ; f; } +// */class S_T_I_eFooXIfwBar___[T] extends Mix_I_eFooXIfwBar___ { ; ; f; } +// */class S_T_I_eFooXIfwBar__f[T] extends Mix_I_eFooXIfwBar__f { ; ; f; } +// */class S_T_I_eFooXIfwBar_I_[T] extends Mix_I_eFooXIfwBar_I_ { ; ; f; } +// */class S_T_I_eFooXIfwBar_If[T] extends Mix_I_eFooXIfwBar_If { ; ; f; } +// */class S_T_I_eFooXIfwBarY__[T] extends Mix_I_eFooXIfwBarY__ { ; ; f; } +// */class S_T_I_eFooXIfwBarY_f[T] extends Mix_I_eFooXIfwBarY_f { ; ; f; } +// */class S_T_I_eFooXIfwBarYI_[T] extends Mix_I_eFooXIfwBarYI_ { ; ; f; } +// */class S_T_I_eFooXIfwBarYIf[T] extends Mix_I_eFooXIfwBarYIf { ; ; f; } + +/* */class S_T_IfeFoo___ [T] extends Mix_IfeFoo___ { ; ; f; } +/* */class S_T_IfeFoo___wBar___[T] extends Mix_IfeFoo___wBar___ { ; ; f; } +/* */class S_T_IfeFoo___wBar__f[T] extends Mix_IfeFoo___wBar__f { ; ; f; } +// */class S_T_IfeFoo___wBar_I_[T] extends Mix_IfeFoo___wBar_I_ { ; ; f; } +// */class S_T_IfeFoo___wBar_If[T] extends Mix_IfeFoo___wBar_If { ; ; f; } +/* */class S_T_IfeFoo___wBarY__[T] extends Mix_IfeFoo___wBarY__ { ; ; f; } +/* */class S_T_IfeFoo___wBarY_f[T] extends Mix_IfeFoo___wBarY_f { ; ; f; } +// */class S_T_IfeFoo___wBarYI_[T] extends Mix_IfeFoo___wBarYI_ { ; ; f; } +// */class S_T_IfeFoo___wBarYIf[T] extends Mix_IfeFoo___wBarYIf { ; ; f; } +/* */class S_T_IfeFoo__f [T] extends Mix_IfeFoo__f { ; ; f; } +/* */class S_T_IfeFoo__fwBar___[T] extends Mix_IfeFoo__fwBar___ { ; ; f; } +/* */class S_T_IfeFoo__fwBar__f[T] extends Mix_IfeFoo__fwBar__f { ; ; f; } +// */class S_T_IfeFoo__fwBar_I_[T] extends Mix_IfeFoo__fwBar_I_ { ; ; f; } +// */class S_T_IfeFoo__fwBar_If[T] extends Mix_IfeFoo__fwBar_If { ; ; f; } +/* */class S_T_IfeFoo__fwBarY__[T] extends Mix_IfeFoo__fwBarY__ { ; ; f; } +/* */class S_T_IfeFoo__fwBarY_f[T] extends Mix_IfeFoo__fwBarY_f { ; ; f; } +// */class S_T_IfeFoo__fwBarYI_[T] extends Mix_IfeFoo__fwBarYI_ { ; ; f; } +// */class S_T_IfeFoo__fwBarYIf[T] extends Mix_IfeFoo__fwBarYIf { ; ; f; } +// */class S_T_IfeFoo_I_ [T] extends Mix_IfeFoo_I_ { ; ; f; } +// */class S_T_IfeFoo_I_wBar___[T] extends Mix_IfeFoo_I_wBar___ { ; ; f; } +// */class S_T_IfeFoo_I_wBar__f[T] extends Mix_IfeFoo_I_wBar__f { ; ; f; } +// */class S_T_IfeFoo_I_wBar_I_[T] extends Mix_IfeFoo_I_wBar_I_ { ; ; f; } +// */class S_T_IfeFoo_I_wBar_If[T] extends Mix_IfeFoo_I_wBar_If { ; ; f; } +// */class S_T_IfeFoo_I_wBarY__[T] extends Mix_IfeFoo_I_wBarY__ { ; ; f; } +// */class S_T_IfeFoo_I_wBarY_f[T] extends Mix_IfeFoo_I_wBarY_f { ; ; f; } +// */class S_T_IfeFoo_I_wBarYI_[T] extends Mix_IfeFoo_I_wBarYI_ { ; ; f; } +// */class S_T_IfeFoo_I_wBarYIf[T] extends Mix_IfeFoo_I_wBarYIf { ; ; f; } +// */class S_T_IfeFoo_If [T] extends Mix_IfeFoo_If { ; ; f; } +// */class S_T_IfeFoo_IfwBar___[T] extends Mix_IfeFoo_IfwBar___ { ; ; f; } +// */class S_T_IfeFoo_IfwBar__f[T] extends Mix_IfeFoo_IfwBar__f { ; ; f; } +// */class S_T_IfeFoo_IfwBar_I_[T] extends Mix_IfeFoo_IfwBar_I_ { ; ; f; } +// */class S_T_IfeFoo_IfwBar_If[T] extends Mix_IfeFoo_IfwBar_If { ; ; f; } +// */class S_T_IfeFoo_IfwBarY__[T] extends Mix_IfeFoo_IfwBarY__ { ; ; f; } +// */class S_T_IfeFoo_IfwBarY_f[T] extends Mix_IfeFoo_IfwBarY_f { ; ; f; } +// */class S_T_IfeFoo_IfwBarYI_[T] extends Mix_IfeFoo_IfwBarYI_ { ; ; f; } +// */class S_T_IfeFoo_IfwBarYIf[T] extends Mix_IfeFoo_IfwBarYIf { ; ; f; } +/* */class S_T_IfeFooX__ [T] extends Mix_IfeFooX__ { ; ; f; } +/* */class S_T_IfeFooX__wBar___[T] extends Mix_IfeFooX__wBar___ { ; ; f; } +/* */class S_T_IfeFooX__wBar__f[T] extends Mix_IfeFooX__wBar__f { ; ; f; } +// */class S_T_IfeFooX__wBar_I_[T] extends Mix_IfeFooX__wBar_I_ { ; ; f; } +// */class S_T_IfeFooX__wBar_If[T] extends Mix_IfeFooX__wBar_If { ; ; f; } +/* */class S_T_IfeFooX__wBarY__[T] extends Mix_IfeFooX__wBarY__ { ; ; f; } +/* */class S_T_IfeFooX__wBarY_f[T] extends Mix_IfeFooX__wBarY_f { ; ; f; } +// */class S_T_IfeFooX__wBarYI_[T] extends Mix_IfeFooX__wBarYI_ { ; ; f; } +// */class S_T_IfeFooX__wBarYIf[T] extends Mix_IfeFooX__wBarYIf { ; ; f; } +/* */class S_T_IfeFooX_f [T] extends Mix_IfeFooX_f { ; ; f; } +/* */class S_T_IfeFooX_fwBar___[T] extends Mix_IfeFooX_fwBar___ { ; ; f; } +/* */class S_T_IfeFooX_fwBar__f[T] extends Mix_IfeFooX_fwBar__f { ; ; f; } +// */class S_T_IfeFooX_fwBar_I_[T] extends Mix_IfeFooX_fwBar_I_ { ; ; f; } +// */class S_T_IfeFooX_fwBar_If[T] extends Mix_IfeFooX_fwBar_If { ; ; f; } +/* */class S_T_IfeFooX_fwBarY__[T] extends Mix_IfeFooX_fwBarY__ { ; ; f; } +/* */class S_T_IfeFooX_fwBarY_f[T] extends Mix_IfeFooX_fwBarY_f { ; ; f; } +// */class S_T_IfeFooX_fwBarYI_[T] extends Mix_IfeFooX_fwBarYI_ { ; ; f; } +// */class S_T_IfeFooX_fwBarYIf[T] extends Mix_IfeFooX_fwBarYIf { ; ; f; } +// */class S_T_IfeFooXI_ [T] extends Mix_IfeFooXI_ { ; ; f; } +// */class S_T_IfeFooXI_wBar___[T] extends Mix_IfeFooXI_wBar___ { ; ; f; } +// */class S_T_IfeFooXI_wBar__f[T] extends Mix_IfeFooXI_wBar__f { ; ; f; } +// */class S_T_IfeFooXI_wBar_I_[T] extends Mix_IfeFooXI_wBar_I_ { ; ; f; } +// */class S_T_IfeFooXI_wBar_If[T] extends Mix_IfeFooXI_wBar_If { ; ; f; } +// */class S_T_IfeFooXI_wBarY__[T] extends Mix_IfeFooXI_wBarY__ { ; ; f; } +// */class S_T_IfeFooXI_wBarY_f[T] extends Mix_IfeFooXI_wBarY_f { ; ; f; } +// */class S_T_IfeFooXI_wBarYI_[T] extends Mix_IfeFooXI_wBarYI_ { ; ; f; } +// */class S_T_IfeFooXI_wBarYIf[T] extends Mix_IfeFooXI_wBarYIf { ; ; f; } +// */class S_T_IfeFooXIf [T] extends Mix_IfeFooXIf { ; ; f; } +// */class S_T_IfeFooXIfwBar___[T] extends Mix_IfeFooXIfwBar___ { ; ; f; } +// */class S_T_IfeFooXIfwBar__f[T] extends Mix_IfeFooXIfwBar__f { ; ; f; } +// */class S_T_IfeFooXIfwBar_I_[T] extends Mix_IfeFooXIfwBar_I_ { ; ; f; } +// */class S_T_IfeFooXIfwBar_If[T] extends Mix_IfeFooXIfwBar_If { ; ; f; } +// */class S_T_IfeFooXIfwBarY__[T] extends Mix_IfeFooXIfwBarY__ { ; ; f; } +// */class S_T_IfeFooXIfwBarY_f[T] extends Mix_IfeFooXIfwBarY_f { ; ; f; } +// */class S_T_IfeFooXIfwBarYI_[T] extends Mix_IfeFooXIfwBarYI_ { ; ; f; } +// */class S_T_IfeFooXIfwBarYIf[T] extends Mix_IfeFooXIfwBarYIf { ; ; f; } + +/* */class S_TZ__eFoo___ [T] extends MixZ__eFoo___ [C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo___wBar___[T] extends MixZ__eFoo___wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo___wBar__f[T] extends MixZ__eFoo___wBar__f[C] { class I; ; f; } +/* */class S_TZ__eFoo___wBar_I_[T] extends MixZ__eFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo___wBar_If[T] extends MixZ__eFoo___wBar_If[C] { ; ; f; } +/* */class S_TZ__eFoo___wBarY__[T] extends MixZ__eFoo___wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo___wBarY_f[T] extends MixZ__eFoo___wBarY_f[C] { class I; ; f; } +/* */class S_TZ__eFoo___wBarYI_[T] extends MixZ__eFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo___wBarYIf[T] extends MixZ__eFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZ__eFoo__f [T] extends MixZ__eFoo__f [C] { class I; ; f; } +/* */class S_TZ__eFoo__fwBar___[T] extends MixZ__eFoo__fwBar___[C] { class I; ; f; } +// */class S_TZ__eFoo__fwBar__f[T] extends MixZ__eFoo__fwBar__f[C] { class I; ; f; } +/* */class S_TZ__eFoo__fwBar_I_[T] extends MixZ__eFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZ__eFoo__fwBar_If[T] extends MixZ__eFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZ__eFoo__fwBarY__[T] extends MixZ__eFoo__fwBarY__[C] { class I; ; f; } +// */class S_TZ__eFoo__fwBarY_f[T] extends MixZ__eFoo__fwBarY_f[C] { class I; ; f; } +/* */class S_TZ__eFoo__fwBarYI_[T] extends MixZ__eFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZ__eFoo__fwBarYIf[T] extends MixZ__eFoo__fwBarYIf[C] { ; ; f; } +/* */class S_TZ__eFoo_I_ [T] extends MixZ__eFoo_I_ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo_I_wBar___[T] extends MixZ__eFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo_I_wBar__f[T] extends MixZ__eFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZ__eFoo_I_wBar_I_[T] extends MixZ__eFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__eFoo_I_wBar_If[T] extends MixZ__eFoo_I_wBar_If[C] { ; ; f; } +/* */class S_TZ__eFoo_I_wBarY__[T] extends MixZ__eFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFoo_I_wBarY_f[T] extends MixZ__eFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZ__eFoo_I_wBarYI_[T] extends MixZ__eFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__eFoo_I_wBarYIf[T] extends MixZ__eFoo_I_wBarYIf[C] { ; ; f; } +/* */class S_TZ__eFoo_If [T] extends MixZ__eFoo_If [C] { ; ; f; } +/* */class S_TZ__eFoo_IfwBar___[T] extends MixZ__eFoo_IfwBar___[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBar__f[T] extends MixZ__eFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBar_I_[T] extends MixZ__eFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBar_If[T] extends MixZ__eFoo_IfwBar_If[C] { ; ; f; } +/* */class S_TZ__eFoo_IfwBarY__[T] extends MixZ__eFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBarY_f[T] extends MixZ__eFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBarYI_[T] extends MixZ__eFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZ__eFoo_IfwBarYIf[T] extends MixZ__eFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZ__eFooX__ [T] extends MixZ__eFooX__ [C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooX__wBar___[T] extends MixZ__eFooX__wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooX__wBar__f[T] extends MixZ__eFooX__wBar__f[C] { class I; ; f; } +/* */class S_TZ__eFooX__wBar_I_[T] extends MixZ__eFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooX__wBar_If[T] extends MixZ__eFooX__wBar_If[C] { ; ; f; } +/* */class S_TZ__eFooX__wBarY__[T] extends MixZ__eFooX__wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooX__wBarY_f[T] extends MixZ__eFooX__wBarY_f[C] { class I; ; f; } +/* */class S_TZ__eFooX__wBarYI_[T] extends MixZ__eFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooX__wBarYIf[T] extends MixZ__eFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZ__eFooX_f [T] extends MixZ__eFooX_f [C] { class I; ; f; } +/* */class S_TZ__eFooX_fwBar___[T] extends MixZ__eFooX_fwBar___[C] { class I; ; f; } +// */class S_TZ__eFooX_fwBar__f[T] extends MixZ__eFooX_fwBar__f[C] { class I; ; f; } +/* */class S_TZ__eFooX_fwBar_I_[T] extends MixZ__eFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZ__eFooX_fwBar_If[T] extends MixZ__eFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZ__eFooX_fwBarY__[T] extends MixZ__eFooX_fwBarY__[C] { class I; ; f; } +// */class S_TZ__eFooX_fwBarY_f[T] extends MixZ__eFooX_fwBarY_f[C] { class I; ; f; } +/* */class S_TZ__eFooX_fwBarYI_[T] extends MixZ__eFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZ__eFooX_fwBarYIf[T] extends MixZ__eFooX_fwBarYIf[C] { ; ; f; } +/* */class S_TZ__eFooXI_ [T] extends MixZ__eFooXI_ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooXI_wBar___[T] extends MixZ__eFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooXI_wBar__f[T] extends MixZ__eFooXI_wBar__f[C] { ; ; f; } +// */class S_TZ__eFooXI_wBar_I_[T] extends MixZ__eFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__eFooXI_wBar_If[T] extends MixZ__eFooXI_wBar_If[C] { ; ; f; } +/* */class S_TZ__eFooXI_wBarY__[T] extends MixZ__eFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__eFooXI_wBarY_f[T] extends MixZ__eFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZ__eFooXI_wBarYI_[T] extends MixZ__eFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__eFooXI_wBarYIf[T] extends MixZ__eFooXI_wBarYIf[C] { ; ; f; } +/* */class S_TZ__eFooXIf [T] extends MixZ__eFooXIf [C] { ; ; f; } +/* */class S_TZ__eFooXIfwBar___[T] extends MixZ__eFooXIfwBar___[C] { ; ; f; } +// */class S_TZ__eFooXIfwBar__f[T] extends MixZ__eFooXIfwBar__f[C] { ; ; f; } +// */class S_TZ__eFooXIfwBar_I_[T] extends MixZ__eFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZ__eFooXIfwBar_If[T] extends MixZ__eFooXIfwBar_If[C] { ; ; f; } +/* */class S_TZ__eFooXIfwBarY__[T] extends MixZ__eFooXIfwBarY__[C] { ; ; f; } +// */class S_TZ__eFooXIfwBarY_f[T] extends MixZ__eFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZ__eFooXIfwBarYI_[T] extends MixZ__eFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZ__eFooXIfwBarYIf[T] extends MixZ__eFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZ_feFoo___ [T] extends MixZ_feFoo___ [C] { class I; ; f; } +/* */class S_TZ_feFoo___wBar___[T] extends MixZ_feFoo___wBar___[C] { class I; ; f; } +/* */class S_TZ_feFoo___wBar__f[T] extends MixZ_feFoo___wBar__f[C] { class I; ; f; } +/* */class S_TZ_feFoo___wBar_I_[T] extends MixZ_feFoo___wBar_I_[C] { ; ; f; } +/* */class S_TZ_feFoo___wBar_If[T] extends MixZ_feFoo___wBar_If[C] { ; ; f; } +/* */class S_TZ_feFoo___wBarY__[T] extends MixZ_feFoo___wBarY__[C] { class I; ; f; } +/* */class S_TZ_feFoo___wBarY_f[T] extends MixZ_feFoo___wBarY_f[C] { class I; ; f; } +/* */class S_TZ_feFoo___wBarYI_[T] extends MixZ_feFoo___wBarYI_[C] { ; ; f; } +/* */class S_TZ_feFoo___wBarYIf[T] extends MixZ_feFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZ_feFoo__f [T] extends MixZ_feFoo__f [C] { class I; ; f; } +/* */class S_TZ_feFoo__fwBar___[T] extends MixZ_feFoo__fwBar___[C] { class I; ; f; } +/* */class S_TZ_feFoo__fwBar__f[T] extends MixZ_feFoo__fwBar__f[C] { class I; ; f; } +/* */class S_TZ_feFoo__fwBar_I_[T] extends MixZ_feFoo__fwBar_I_[C] { ; ; f; } +/* */class S_TZ_feFoo__fwBar_If[T] extends MixZ_feFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZ_feFoo__fwBarY__[T] extends MixZ_feFoo__fwBarY__[C] { class I; ; f; } +/* */class S_TZ_feFoo__fwBarY_f[T] extends MixZ_feFoo__fwBarY_f[C] { class I; ; f; } +/* */class S_TZ_feFoo__fwBarYI_[T] extends MixZ_feFoo__fwBarYI_[C] { ; ; f; } +/* */class S_TZ_feFoo__fwBarYIf[T] extends MixZ_feFoo__fwBarYIf[C] { ; ; f; } +/* */class S_TZ_feFoo_I_ [T] extends MixZ_feFoo_I_ [C] { ; ; f; } +/* */class S_TZ_feFoo_I_wBar___[T] extends MixZ_feFoo_I_wBar___[C] { ; ; f; } +/* */class S_TZ_feFoo_I_wBar__f[T] extends MixZ_feFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZ_feFoo_I_wBar_I_[T] extends MixZ_feFoo_I_wBar_I_[C] { ; ; f; } +// */class S_TZ_feFoo_I_wBar_If[T] extends MixZ_feFoo_I_wBar_If[C] { ; ; f; } +/* */class S_TZ_feFoo_I_wBarY__[T] extends MixZ_feFoo_I_wBarY__[C] { ; ; f; } +/* */class S_TZ_feFoo_I_wBarY_f[T] extends MixZ_feFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZ_feFoo_I_wBarYI_[T] extends MixZ_feFoo_I_wBarYI_[C] { ; ; f; } +// */class S_TZ_feFoo_I_wBarYIf[T] extends MixZ_feFoo_I_wBarYIf[C] { ; ; f; } +/* */class S_TZ_feFoo_If [T] extends MixZ_feFoo_If [C] { ; ; f; } +/* */class S_TZ_feFoo_IfwBar___[T] extends MixZ_feFoo_IfwBar___[C] { ; ; f; } +/* */class S_TZ_feFoo_IfwBar__f[T] extends MixZ_feFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZ_feFoo_IfwBar_I_[T] extends MixZ_feFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZ_feFoo_IfwBar_If[T] extends MixZ_feFoo_IfwBar_If[C] { ; ; f; } +/* */class S_TZ_feFoo_IfwBarY__[T] extends MixZ_feFoo_IfwBarY__[C] { ; ; f; } +/* */class S_TZ_feFoo_IfwBarY_f[T] extends MixZ_feFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZ_feFoo_IfwBarYI_[T] extends MixZ_feFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZ_feFoo_IfwBarYIf[T] extends MixZ_feFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZ_feFooX__ [T] extends MixZ_feFooX__ [C] { class I; ; f; } +/* */class S_TZ_feFooX__wBar___[T] extends MixZ_feFooX__wBar___[C] { class I; ; f; } +/* */class S_TZ_feFooX__wBar__f[T] extends MixZ_feFooX__wBar__f[C] { class I; ; f; } +/* */class S_TZ_feFooX__wBar_I_[T] extends MixZ_feFooX__wBar_I_[C] { ; ; f; } +/* */class S_TZ_feFooX__wBar_If[T] extends MixZ_feFooX__wBar_If[C] { ; ; f; } +/* */class S_TZ_feFooX__wBarY__[T] extends MixZ_feFooX__wBarY__[C] { class I; ; f; } +/* */class S_TZ_feFooX__wBarY_f[T] extends MixZ_feFooX__wBarY_f[C] { class I; ; f; } +/* */class S_TZ_feFooX__wBarYI_[T] extends MixZ_feFooX__wBarYI_[C] { ; ; f; } +/* */class S_TZ_feFooX__wBarYIf[T] extends MixZ_feFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZ_feFooX_f [T] extends MixZ_feFooX_f [C] { class I; ; f; } +/* */class S_TZ_feFooX_fwBar___[T] extends MixZ_feFooX_fwBar___[C] { class I; ; f; } +/* */class S_TZ_feFooX_fwBar__f[T] extends MixZ_feFooX_fwBar__f[C] { class I; ; f; } +/* */class S_TZ_feFooX_fwBar_I_[T] extends MixZ_feFooX_fwBar_I_[C] { ; ; f; } +/* */class S_TZ_feFooX_fwBar_If[T] extends MixZ_feFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZ_feFooX_fwBarY__[T] extends MixZ_feFooX_fwBarY__[C] { class I; ; f; } +/* */class S_TZ_feFooX_fwBarY_f[T] extends MixZ_feFooX_fwBarY_f[C] { class I; ; f; } +/* */class S_TZ_feFooX_fwBarYI_[T] extends MixZ_feFooX_fwBarYI_[C] { ; ; f; } +/* */class S_TZ_feFooX_fwBarYIf[T] extends MixZ_feFooX_fwBarYIf[C] { ; ; f; } +/* */class S_TZ_feFooXI_ [T] extends MixZ_feFooXI_ [C] { ; ; f; } +/* */class S_TZ_feFooXI_wBar___[T] extends MixZ_feFooXI_wBar___[C] { ; ; f; } +/* */class S_TZ_feFooXI_wBar__f[T] extends MixZ_feFooXI_wBar__f[C] { ; ; f; } +// */class S_TZ_feFooXI_wBar_I_[T] extends MixZ_feFooXI_wBar_I_[C] { ; ; f; } +// */class S_TZ_feFooXI_wBar_If[T] extends MixZ_feFooXI_wBar_If[C] { ; ; f; } +/* */class S_TZ_feFooXI_wBarY__[T] extends MixZ_feFooXI_wBarY__[C] { ; ; f; } +/* */class S_TZ_feFooXI_wBarY_f[T] extends MixZ_feFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZ_feFooXI_wBarYI_[T] extends MixZ_feFooXI_wBarYI_[C] { ; ; f; } +// */class S_TZ_feFooXI_wBarYIf[T] extends MixZ_feFooXI_wBarYIf[C] { ; ; f; } +/* */class S_TZ_feFooXIf [T] extends MixZ_feFooXIf [C] { ; ; f; } +/* */class S_TZ_feFooXIfwBar___[T] extends MixZ_feFooXIfwBar___[C] { ; ; f; } +/* */class S_TZ_feFooXIfwBar__f[T] extends MixZ_feFooXIfwBar__f[C] { ; ; f; } +// */class S_TZ_feFooXIfwBar_I_[T] extends MixZ_feFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZ_feFooXIfwBar_If[T] extends MixZ_feFooXIfwBar_If[C] { ; ; f; } +/* */class S_TZ_feFooXIfwBarY__[T] extends MixZ_feFooXIfwBarY__[C] { ; ; f; } +/* */class S_TZ_feFooXIfwBarY_f[T] extends MixZ_feFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZ_feFooXIfwBarYI_[T] extends MixZ_feFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZ_feFooXIfwBarYIf[T] extends MixZ_feFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZI_eFoo___ [T] extends MixZI_eFoo___ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFoo___wBar___[T] extends MixZI_eFoo___wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFoo___wBar__f[T] extends MixZI_eFoo___wBar__f[C] { ; ; f; } +// */class S_TZI_eFoo___wBar_I_[T] extends MixZI_eFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo___wBar_If[T] extends MixZI_eFoo___wBar_If[C] { ; ; f; } +/* */class S_TZI_eFoo___wBarY__[T] extends MixZI_eFoo___wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFoo___wBarY_f[T] extends MixZI_eFoo___wBarY_f[C] { ; ; f; } +// */class S_TZI_eFoo___wBarYI_[T] extends MixZI_eFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo___wBarYIf[T] extends MixZI_eFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZI_eFoo__f [T] extends MixZI_eFoo__f [C] { ; ; f; } +/* */class S_TZI_eFoo__fwBar___[T] extends MixZI_eFoo__fwBar___[C] { ; ; f; } +// */class S_TZI_eFoo__fwBar__f[T] extends MixZI_eFoo__fwBar__f[C] { ; ; f; } +// */class S_TZI_eFoo__fwBar_I_[T] extends MixZI_eFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZI_eFoo__fwBar_If[T] extends MixZI_eFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZI_eFoo__fwBarY__[T] extends MixZI_eFoo__fwBarY__[C] { ; ; f; } +// */class S_TZI_eFoo__fwBarY_f[T] extends MixZI_eFoo__fwBarY_f[C] { ; ; f; } +// */class S_TZI_eFoo__fwBarYI_[T] extends MixZI_eFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZI_eFoo__fwBarYIf[T] extends MixZI_eFoo__fwBarYIf[C] { ; ; f; } +// */class S_TZI_eFoo_I_ [T] extends MixZI_eFoo_I_ [C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo_I_wBar___[T] extends MixZI_eFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo_I_wBar__f[T] extends MixZI_eFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZI_eFoo_I_wBar_I_[T] extends MixZI_eFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo_I_wBar_If[T] extends MixZI_eFoo_I_wBar_If[C] { ; ; f; } +// */class S_TZI_eFoo_I_wBarY__[T] extends MixZI_eFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo_I_wBarY_f[T] extends MixZI_eFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZI_eFoo_I_wBarYI_[T] extends MixZI_eFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFoo_I_wBarYIf[T] extends MixZI_eFoo_I_wBarYIf[C] { ; ; f; } +// */class S_TZI_eFoo_If [T] extends MixZI_eFoo_If [C] { ; ; f; } +// */class S_TZI_eFoo_IfwBar___[T] extends MixZI_eFoo_IfwBar___[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBar__f[T] extends MixZI_eFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBar_I_[T] extends MixZI_eFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBar_If[T] extends MixZI_eFoo_IfwBar_If[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBarY__[T] extends MixZI_eFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBarY_f[T] extends MixZI_eFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBarYI_[T] extends MixZI_eFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZI_eFoo_IfwBarYIf[T] extends MixZI_eFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZI_eFooX__ [T] extends MixZI_eFooX__ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFooX__wBar___[T] extends MixZI_eFooX__wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFooX__wBar__f[T] extends MixZI_eFooX__wBar__f[C] { ; ; f; } +// */class S_TZI_eFooX__wBar_I_[T] extends MixZI_eFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooX__wBar_If[T] extends MixZI_eFooX__wBar_If[C] { ; ; f; } +/* */class S_TZI_eFooX__wBarY__[T] extends MixZI_eFooX__wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_eFooX__wBarY_f[T] extends MixZI_eFooX__wBarY_f[C] { ; ; f; } +// */class S_TZI_eFooX__wBarYI_[T] extends MixZI_eFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooX__wBarYIf[T] extends MixZI_eFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZI_eFooX_f [T] extends MixZI_eFooX_f [C] { ; ; f; } +/* */class S_TZI_eFooX_fwBar___[T] extends MixZI_eFooX_fwBar___[C] { ; ; f; } +// */class S_TZI_eFooX_fwBar__f[T] extends MixZI_eFooX_fwBar__f[C] { ; ; f; } +// */class S_TZI_eFooX_fwBar_I_[T] extends MixZI_eFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZI_eFooX_fwBar_If[T] extends MixZI_eFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZI_eFooX_fwBarY__[T] extends MixZI_eFooX_fwBarY__[C] { ; ; f; } +// */class S_TZI_eFooX_fwBarY_f[T] extends MixZI_eFooX_fwBarY_f[C] { ; ; f; } +// */class S_TZI_eFooX_fwBarYI_[T] extends MixZI_eFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZI_eFooX_fwBarYIf[T] extends MixZI_eFooX_fwBarYIf[C] { ; ; f; } +// */class S_TZI_eFooXI_ [T] extends MixZI_eFooXI_ [C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooXI_wBar___[T] extends MixZI_eFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooXI_wBar__f[T] extends MixZI_eFooXI_wBar__f[C] { ; ; f; } +// */class S_TZI_eFooXI_wBar_I_[T] extends MixZI_eFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooXI_wBar_If[T] extends MixZI_eFooXI_wBar_If[C] { ; ; f; } +// */class S_TZI_eFooXI_wBarY__[T] extends MixZI_eFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooXI_wBarY_f[T] extends MixZI_eFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZI_eFooXI_wBarYI_[T] extends MixZI_eFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_eFooXI_wBarYIf[T] extends MixZI_eFooXI_wBarYIf[C] { ; ; f; } +// */class S_TZI_eFooXIf [T] extends MixZI_eFooXIf [C] { ; ; f; } +// */class S_TZI_eFooXIfwBar___[T] extends MixZI_eFooXIfwBar___[C] { ; ; f; } +// */class S_TZI_eFooXIfwBar__f[T] extends MixZI_eFooXIfwBar__f[C] { ; ; f; } +// */class S_TZI_eFooXIfwBar_I_[T] extends MixZI_eFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZI_eFooXIfwBar_If[T] extends MixZI_eFooXIfwBar_If[C] { ; ; f; } +// */class S_TZI_eFooXIfwBarY__[T] extends MixZI_eFooXIfwBarY__[C] { ; ; f; } +// */class S_TZI_eFooXIfwBarY_f[T] extends MixZI_eFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZI_eFooXIfwBarYI_[T] extends MixZI_eFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZI_eFooXIfwBarYIf[T] extends MixZI_eFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZIfeFoo___ [T] extends MixZIfeFoo___ [C] { ; ; f; } +/* */class S_TZIfeFoo___wBar___[T] extends MixZIfeFoo___wBar___[C] { ; ; f; } +/* */class S_TZIfeFoo___wBar__f[T] extends MixZIfeFoo___wBar__f[C] { ; ; f; } +// */class S_TZIfeFoo___wBar_I_[T] extends MixZIfeFoo___wBar_I_[C] { ; ; f; } +// */class S_TZIfeFoo___wBar_If[T] extends MixZIfeFoo___wBar_If[C] { ; ; f; } +/* */class S_TZIfeFoo___wBarY__[T] extends MixZIfeFoo___wBarY__[C] { ; ; f; } +/* */class S_TZIfeFoo___wBarY_f[T] extends MixZIfeFoo___wBarY_f[C] { ; ; f; } +// */class S_TZIfeFoo___wBarYI_[T] extends MixZIfeFoo___wBarYI_[C] { ; ; f; } +// */class S_TZIfeFoo___wBarYIf[T] extends MixZIfeFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZIfeFoo__f [T] extends MixZIfeFoo__f [C] { ; ; f; } +/* */class S_TZIfeFoo__fwBar___[T] extends MixZIfeFoo__fwBar___[C] { ; ; f; } +/* */class S_TZIfeFoo__fwBar__f[T] extends MixZIfeFoo__fwBar__f[C] { ; ; f; } +// */class S_TZIfeFoo__fwBar_I_[T] extends MixZIfeFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZIfeFoo__fwBar_If[T] extends MixZIfeFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZIfeFoo__fwBarY__[T] extends MixZIfeFoo__fwBarY__[C] { ; ; f; } +/* */class S_TZIfeFoo__fwBarY_f[T] extends MixZIfeFoo__fwBarY_f[C] { ; ; f; } +// */class S_TZIfeFoo__fwBarYI_[T] extends MixZIfeFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZIfeFoo__fwBarYIf[T] extends MixZIfeFoo__fwBarYIf[C] { ; ; f; } +// */class S_TZIfeFoo_I_ [T] extends MixZIfeFoo_I_ [C] { ; ; f; } +// */class S_TZIfeFoo_I_wBar___[T] extends MixZIfeFoo_I_wBar___[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBar__f[T] extends MixZIfeFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBar_I_[T] extends MixZIfeFoo_I_wBar_I_[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBar_If[T] extends MixZIfeFoo_I_wBar_If[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBarY__[T] extends MixZIfeFoo_I_wBarY__[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBarY_f[T] extends MixZIfeFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBarYI_[T] extends MixZIfeFoo_I_wBarYI_[C] { ; ; f; } +// */class S_TZIfeFoo_I_wBarYIf[T] extends MixZIfeFoo_I_wBarYIf[C] { ; ; f; } +// */class S_TZIfeFoo_If [T] extends MixZIfeFoo_If [C] { ; ; f; } +// */class S_TZIfeFoo_IfwBar___[T] extends MixZIfeFoo_IfwBar___[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBar__f[T] extends MixZIfeFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBar_I_[T] extends MixZIfeFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBar_If[T] extends MixZIfeFoo_IfwBar_If[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBarY__[T] extends MixZIfeFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBarY_f[T] extends MixZIfeFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBarYI_[T] extends MixZIfeFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZIfeFoo_IfwBarYIf[T] extends MixZIfeFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZIfeFooX__ [T] extends MixZIfeFooX__ [C] { ; ; f; } +/* */class S_TZIfeFooX__wBar___[T] extends MixZIfeFooX__wBar___[C] { ; ; f; } +/* */class S_TZIfeFooX__wBar__f[T] extends MixZIfeFooX__wBar__f[C] { ; ; f; } +// */class S_TZIfeFooX__wBar_I_[T] extends MixZIfeFooX__wBar_I_[C] { ; ; f; } +// */class S_TZIfeFooX__wBar_If[T] extends MixZIfeFooX__wBar_If[C] { ; ; f; } +/* */class S_TZIfeFooX__wBarY__[T] extends MixZIfeFooX__wBarY__[C] { ; ; f; } +/* */class S_TZIfeFooX__wBarY_f[T] extends MixZIfeFooX__wBarY_f[C] { ; ; f; } +// */class S_TZIfeFooX__wBarYI_[T] extends MixZIfeFooX__wBarYI_[C] { ; ; f; } +// */class S_TZIfeFooX__wBarYIf[T] extends MixZIfeFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZIfeFooX_f [T] extends MixZIfeFooX_f [C] { ; ; f; } +/* */class S_TZIfeFooX_fwBar___[T] extends MixZIfeFooX_fwBar___[C] { ; ; f; } +/* */class S_TZIfeFooX_fwBar__f[T] extends MixZIfeFooX_fwBar__f[C] { ; ; f; } +// */class S_TZIfeFooX_fwBar_I_[T] extends MixZIfeFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZIfeFooX_fwBar_If[T] extends MixZIfeFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZIfeFooX_fwBarY__[T] extends MixZIfeFooX_fwBarY__[C] { ; ; f; } +/* */class S_TZIfeFooX_fwBarY_f[T] extends MixZIfeFooX_fwBarY_f[C] { ; ; f; } +// */class S_TZIfeFooX_fwBarYI_[T] extends MixZIfeFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZIfeFooX_fwBarYIf[T] extends MixZIfeFooX_fwBarYIf[C] { ; ; f; } +// */class S_TZIfeFooXI_ [T] extends MixZIfeFooXI_ [C] { ; ; f; } +// */class S_TZIfeFooXI_wBar___[T] extends MixZIfeFooXI_wBar___[C] { ; ; f; } +// */class S_TZIfeFooXI_wBar__f[T] extends MixZIfeFooXI_wBar__f[C] { ; ; f; } +// */class S_TZIfeFooXI_wBar_I_[T] extends MixZIfeFooXI_wBar_I_[C] { ; ; f; } +// */class S_TZIfeFooXI_wBar_If[T] extends MixZIfeFooXI_wBar_If[C] { ; ; f; } +// */class S_TZIfeFooXI_wBarY__[T] extends MixZIfeFooXI_wBarY__[C] { ; ; f; } +// */class S_TZIfeFooXI_wBarY_f[T] extends MixZIfeFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZIfeFooXI_wBarYI_[T] extends MixZIfeFooXI_wBarYI_[C] { ; ; f; } +// */class S_TZIfeFooXI_wBarYIf[T] extends MixZIfeFooXI_wBarYIf[C] { ; ; f; } +// */class S_TZIfeFooXIf [T] extends MixZIfeFooXIf [C] { ; ; f; } +// */class S_TZIfeFooXIfwBar___[T] extends MixZIfeFooXIfwBar___[C] { ; ; f; } +// */class S_TZIfeFooXIfwBar__f[T] extends MixZIfeFooXIfwBar__f[C] { ; ; f; } +// */class S_TZIfeFooXIfwBar_I_[T] extends MixZIfeFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZIfeFooXIfwBar_If[T] extends MixZIfeFooXIfwBar_If[C] { ; ; f; } +// */class S_TZIfeFooXIfwBarY__[T] extends MixZIfeFooXIfwBarY__[C] { ; ; f; } +// */class S_TZIfeFooXIfwBarY_f[T] extends MixZIfeFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZIfeFooXIfwBarYI_[T] extends MixZIfeFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZIfeFooXIfwBarYIf[T] extends MixZIfeFooXIfwBarYIf[C] { ; ; f; } + + + +/* */class S_T___wFoo___ [T] extends Mix___wFoo___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFoo___wBar___[T] extends Mix___wFoo___wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFoo___wBar__f[T] extends Mix___wFoo___wBar__f { class I; ; f; } +/* */class S_T___wFoo___wBar_I_[T] extends Mix___wFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFoo___wBar_If[T] extends Mix___wFoo___wBar_If { ; ; f; } +/* */class S_T___wFoo___wBarY__[T] extends Mix___wFoo___wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFoo___wBarY_f[T] extends Mix___wFoo___wBarY_f { class I; ; f; } +/* */class S_T___wFoo___wBarYI_[T] extends Mix___wFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFoo___wBarYIf[T] extends Mix___wFoo___wBarYIf { ; ; f; } +/* */class S_T___wFoo__f [T] extends Mix___wFoo__f { class I; ; f; } +/* */class S_T___wFoo__fwBar___[T] extends Mix___wFoo__fwBar___ { class I; ; f; } +// */class S_T___wFoo__fwBar__f[T] extends Mix___wFoo__fwBar__f { class I; ; f; } +/* */class S_T___wFoo__fwBar_I_[T] extends Mix___wFoo__fwBar_I_ { ; ; f; } +// */class S_T___wFoo__fwBar_If[T] extends Mix___wFoo__fwBar_If { ; ; f; } +/* */class S_T___wFoo__fwBarY__[T] extends Mix___wFoo__fwBarY__ { class I; ; f; } +// */class S_T___wFoo__fwBarY_f[T] extends Mix___wFoo__fwBarY_f { class I; ; f; } +/* */class S_T___wFoo__fwBarYI_[T] extends Mix___wFoo__fwBarYI_ { ; ; f; } +// */class S_T___wFoo__fwBarYIf[T] extends Mix___wFoo__fwBarYIf { ; ; f; } +/* */class S_T___wFoo_I_ [T] extends Mix___wFoo_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFoo_I_wBar___[T] extends Mix___wFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFoo_I_wBar__f[T] extends Mix___wFoo_I_wBar__f { ; ; f; } +// */class S_T___wFoo_I_wBar_I_[T] extends Mix___wFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T___wFoo_I_wBar_If[T] extends Mix___wFoo_I_wBar_If { ; ; f; } +/* */class S_T___wFoo_I_wBarY__[T] extends Mix___wFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFoo_I_wBarY_f[T] extends Mix___wFoo_I_wBarY_f { ; ; f; } +// */class S_T___wFoo_I_wBarYI_[T] extends Mix___wFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T___wFoo_I_wBarYIf[T] extends Mix___wFoo_I_wBarYIf { ; ; f; } +/* */class S_T___wFoo_If [T] extends Mix___wFoo_If { ; ; f; } +/* */class S_T___wFoo_IfwBar___[T] extends Mix___wFoo_IfwBar___ { ; ; f; } +// */class S_T___wFoo_IfwBar__f[T] extends Mix___wFoo_IfwBar__f { ; ; f; } +// */class S_T___wFoo_IfwBar_I_[T] extends Mix___wFoo_IfwBar_I_ { ; ; f; } +// */class S_T___wFoo_IfwBar_If[T] extends Mix___wFoo_IfwBar_If { ; ; f; } +/* */class S_T___wFoo_IfwBarY__[T] extends Mix___wFoo_IfwBarY__ { ; ; f; } +// */class S_T___wFoo_IfwBarY_f[T] extends Mix___wFoo_IfwBarY_f { ; ; f; } +// */class S_T___wFoo_IfwBarYI_[T] extends Mix___wFoo_IfwBarYI_ { ; ; f; } +// */class S_T___wFoo_IfwBarYIf[T] extends Mix___wFoo_IfwBarYIf { ; ; f; } +/* */class S_T___wFooX__ [T] extends Mix___wFooX__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFooX__wBar___[T] extends Mix___wFooX__wBar___ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFooX__wBar__f[T] extends Mix___wFooX__wBar__f { class I; ; f; } +/* */class S_T___wFooX__wBar_I_[T] extends Mix___wFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFooX__wBar_If[T] extends Mix___wFooX__wBar_If { ; ; f; } +/* */class S_T___wFooX__wBarY__[T] extends Mix___wFooX__wBarY__ { class I; def f: I = {sub; null}; f; } +/* */class S_T___wFooX__wBarY_f[T] extends Mix___wFooX__wBarY_f { class I; ; f; } +/* */class S_T___wFooX__wBarYI_[T] extends Mix___wFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFooX__wBarYIf[T] extends Mix___wFooX__wBarYIf { ; ; f; } +/* */class S_T___wFooX_f [T] extends Mix___wFooX_f { class I; ; f; } +/* */class S_T___wFooX_fwBar___[T] extends Mix___wFooX_fwBar___ { class I; ; f; } +// */class S_T___wFooX_fwBar__f[T] extends Mix___wFooX_fwBar__f { class I; ; f; } +/* */class S_T___wFooX_fwBar_I_[T] extends Mix___wFooX_fwBar_I_ { ; ; f; } +// */class S_T___wFooX_fwBar_If[T] extends Mix___wFooX_fwBar_If { ; ; f; } +/* */class S_T___wFooX_fwBarY__[T] extends Mix___wFooX_fwBarY__ { class I; ; f; } +// */class S_T___wFooX_fwBarY_f[T] extends Mix___wFooX_fwBarY_f { class I; ; f; } +/* */class S_T___wFooX_fwBarYI_[T] extends Mix___wFooX_fwBarYI_ { ; ; f; } +// */class S_T___wFooX_fwBarYIf[T] extends Mix___wFooX_fwBarYIf { ; ; f; } +/* */class S_T___wFooXI_ [T] extends Mix___wFooXI_ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFooXI_wBar___[T] extends Mix___wFooXI_wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFooXI_wBar__f[T] extends Mix___wFooXI_wBar__f { ; ; f; } +// */class S_T___wFooXI_wBar_I_[T] extends Mix___wFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T___wFooXI_wBar_If[T] extends Mix___wFooXI_wBar_If { ; ; f; } +/* */class S_T___wFooXI_wBarY__[T] extends Mix___wFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T___wFooXI_wBarY_f[T] extends Mix___wFooXI_wBarY_f { ; ; f; } +// */class S_T___wFooXI_wBarYI_[T] extends Mix___wFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T___wFooXI_wBarYIf[T] extends Mix___wFooXI_wBarYIf { ; ; f; } +/* */class S_T___wFooXIf [T] extends Mix___wFooXIf { ; ; f; } +/* */class S_T___wFooXIfwBar___[T] extends Mix___wFooXIfwBar___ { ; ; f; } +// */class S_T___wFooXIfwBar__f[T] extends Mix___wFooXIfwBar__f { ; ; f; } +// */class S_T___wFooXIfwBar_I_[T] extends Mix___wFooXIfwBar_I_ { ; ; f; } +// */class S_T___wFooXIfwBar_If[T] extends Mix___wFooXIfwBar_If { ; ; f; } +/* */class S_T___wFooXIfwBarY__[T] extends Mix___wFooXIfwBarY__ { ; ; f; } +// */class S_T___wFooXIfwBarY_f[T] extends Mix___wFooXIfwBarY_f { ; ; f; } +// */class S_T___wFooXIfwBarYI_[T] extends Mix___wFooXIfwBarYI_ { ; ; f; } +// */class S_T___wFooXIfwBarYIf[T] extends Mix___wFooXIfwBarYIf { ; ; f; } + +/* */class S_T__fwFoo___ [T] extends Mix__fwFoo___ { class I; ; f; } +/* */class S_T__fwFoo___wBar___[T] extends Mix__fwFoo___wBar___ { class I; ; f; } +/* */class S_T__fwFoo___wBar__f[T] extends Mix__fwFoo___wBar__f { class I; ; f; } +/* */class S_T__fwFoo___wBar_I_[T] extends Mix__fwFoo___wBar_I_ { ; ; f; } +/* */class S_T__fwFoo___wBar_If[T] extends Mix__fwFoo___wBar_If { ; ; f; } +/* */class S_T__fwFoo___wBarY__[T] extends Mix__fwFoo___wBarY__ { class I; ; f; } +/* */class S_T__fwFoo___wBarY_f[T] extends Mix__fwFoo___wBarY_f { class I; ; f; } +/* */class S_T__fwFoo___wBarYI_[T] extends Mix__fwFoo___wBarYI_ { ; ; f; } +/* */class S_T__fwFoo___wBarYIf[T] extends Mix__fwFoo___wBarYIf { ; ; f; } +/* */class S_T__fwFoo__f [T] extends Mix__fwFoo__f { class I; ; f; } +/* */class S_T__fwFoo__fwBar___[T] extends Mix__fwFoo__fwBar___ { class I; ; f; } +/* */class S_T__fwFoo__fwBar__f[T] extends Mix__fwFoo__fwBar__f { class I; ; f; } +/* */class S_T__fwFoo__fwBar_I_[T] extends Mix__fwFoo__fwBar_I_ { ; ; f; } +/* */class S_T__fwFoo__fwBar_If[T] extends Mix__fwFoo__fwBar_If { ; ; f; } +/* */class S_T__fwFoo__fwBarY__[T] extends Mix__fwFoo__fwBarY__ { class I; ; f; } +/* */class S_T__fwFoo__fwBarY_f[T] extends Mix__fwFoo__fwBarY_f { class I; ; f; } +/* */class S_T__fwFoo__fwBarYI_[T] extends Mix__fwFoo__fwBarYI_ { ; ; f; } +/* */class S_T__fwFoo__fwBarYIf[T] extends Mix__fwFoo__fwBarYIf { ; ; f; } +/* */class S_T__fwFoo_I_ [T] extends Mix__fwFoo_I_ { ; ; f; } +/* */class S_T__fwFoo_I_wBar___[T] extends Mix__fwFoo_I_wBar___ { ; ; f; } +/* */class S_T__fwFoo_I_wBar__f[T] extends Mix__fwFoo_I_wBar__f { ; ; f; } +// */class S_T__fwFoo_I_wBar_I_[T] extends Mix__fwFoo_I_wBar_I_ { ; ; f; } +// */class S_T__fwFoo_I_wBar_If[T] extends Mix__fwFoo_I_wBar_If { ; ; f; } +/* */class S_T__fwFoo_I_wBarY__[T] extends Mix__fwFoo_I_wBarY__ { ; ; f; } +/* */class S_T__fwFoo_I_wBarY_f[T] extends Mix__fwFoo_I_wBarY_f { ; ; f; } +// */class S_T__fwFoo_I_wBarYI_[T] extends Mix__fwFoo_I_wBarYI_ { ; ; f; } +// */class S_T__fwFoo_I_wBarYIf[T] extends Mix__fwFoo_I_wBarYIf { ; ; f; } +/* */class S_T__fwFoo_If [T] extends Mix__fwFoo_If { ; ; f; } +/* */class S_T__fwFoo_IfwBar___[T] extends Mix__fwFoo_IfwBar___ { ; ; f; } +/* */class S_T__fwFoo_IfwBar__f[T] extends Mix__fwFoo_IfwBar__f { ; ; f; } +// */class S_T__fwFoo_IfwBar_I_[T] extends Mix__fwFoo_IfwBar_I_ { ; ; f; } +// */class S_T__fwFoo_IfwBar_If[T] extends Mix__fwFoo_IfwBar_If { ; ; f; } +/* */class S_T__fwFoo_IfwBarY__[T] extends Mix__fwFoo_IfwBarY__ { ; ; f; } +/* */class S_T__fwFoo_IfwBarY_f[T] extends Mix__fwFoo_IfwBarY_f { ; ; f; } +// */class S_T__fwFoo_IfwBarYI_[T] extends Mix__fwFoo_IfwBarYI_ { ; ; f; } +// */class S_T__fwFoo_IfwBarYIf[T] extends Mix__fwFoo_IfwBarYIf { ; ; f; } +/* */class S_T__fwFooX__ [T] extends Mix__fwFooX__ { class I; ; f; } +/* */class S_T__fwFooX__wBar___[T] extends Mix__fwFooX__wBar___ { class I; ; f; } +/* */class S_T__fwFooX__wBar__f[T] extends Mix__fwFooX__wBar__f { class I; ; f; } +/* */class S_T__fwFooX__wBar_I_[T] extends Mix__fwFooX__wBar_I_ { ; ; f; } +/* */class S_T__fwFooX__wBar_If[T] extends Mix__fwFooX__wBar_If { ; ; f; } +/* */class S_T__fwFooX__wBarY__[T] extends Mix__fwFooX__wBarY__ { class I; ; f; } +/* */class S_T__fwFooX__wBarY_f[T] extends Mix__fwFooX__wBarY_f { class I; ; f; } +/* */class S_T__fwFooX__wBarYI_[T] extends Mix__fwFooX__wBarYI_ { ; ; f; } +/* */class S_T__fwFooX__wBarYIf[T] extends Mix__fwFooX__wBarYIf { ; ; f; } +/* */class S_T__fwFooX_f [T] extends Mix__fwFooX_f { class I; ; f; } +/* */class S_T__fwFooX_fwBar___[T] extends Mix__fwFooX_fwBar___ { class I; ; f; } +/* */class S_T__fwFooX_fwBar__f[T] extends Mix__fwFooX_fwBar__f { class I; ; f; } +/* */class S_T__fwFooX_fwBar_I_[T] extends Mix__fwFooX_fwBar_I_ { ; ; f; } +/* */class S_T__fwFooX_fwBar_If[T] extends Mix__fwFooX_fwBar_If { ; ; f; } +/* */class S_T__fwFooX_fwBarY__[T] extends Mix__fwFooX_fwBarY__ { class I; ; f; } +/* */class S_T__fwFooX_fwBarY_f[T] extends Mix__fwFooX_fwBarY_f { class I; ; f; } +/* */class S_T__fwFooX_fwBarYI_[T] extends Mix__fwFooX_fwBarYI_ { ; ; f; } +/* */class S_T__fwFooX_fwBarYIf[T] extends Mix__fwFooX_fwBarYIf { ; ; f; } +/* */class S_T__fwFooXI_ [T] extends Mix__fwFooXI_ { ; ; f; } +/* */class S_T__fwFooXI_wBar___[T] extends Mix__fwFooXI_wBar___ { ; ; f; } +/* */class S_T__fwFooXI_wBar__f[T] extends Mix__fwFooXI_wBar__f { ; ; f; } +// */class S_T__fwFooXI_wBar_I_[T] extends Mix__fwFooXI_wBar_I_ { ; ; f; } +// */class S_T__fwFooXI_wBar_If[T] extends Mix__fwFooXI_wBar_If { ; ; f; } +/* */class S_T__fwFooXI_wBarY__[T] extends Mix__fwFooXI_wBarY__ { ; ; f; } +/* */class S_T__fwFooXI_wBarY_f[T] extends Mix__fwFooXI_wBarY_f { ; ; f; } +// */class S_T__fwFooXI_wBarYI_[T] extends Mix__fwFooXI_wBarYI_ { ; ; f; } +// */class S_T__fwFooXI_wBarYIf[T] extends Mix__fwFooXI_wBarYIf { ; ; f; } +/* */class S_T__fwFooXIf [T] extends Mix__fwFooXIf { ; ; f; } +/* */class S_T__fwFooXIfwBar___[T] extends Mix__fwFooXIfwBar___ { ; ; f; } +/* */class S_T__fwFooXIfwBar__f[T] extends Mix__fwFooXIfwBar__f { ; ; f; } +// */class S_T__fwFooXIfwBar_I_[T] extends Mix__fwFooXIfwBar_I_ { ; ; f; } +// */class S_T__fwFooXIfwBar_If[T] extends Mix__fwFooXIfwBar_If { ; ; f; } +/* */class S_T__fwFooXIfwBarY__[T] extends Mix__fwFooXIfwBarY__ { ; ; f; } +/* */class S_T__fwFooXIfwBarY_f[T] extends Mix__fwFooXIfwBarY_f { ; ; f; } +// */class S_T__fwFooXIfwBarYI_[T] extends Mix__fwFooXIfwBarYI_ { ; ; f; } +// */class S_T__fwFooXIfwBarYIf[T] extends Mix__fwFooXIfwBarYIf { ; ; f; } + +/* */class S_T_I_wFoo___ [T] extends Mix_I_wFoo___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFoo___wBar___[T] extends Mix_I_wFoo___wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFoo___wBar__f[T] extends Mix_I_wFoo___wBar__f { ; ; f; } +// */class S_T_I_wFoo___wBar_I_[T] extends Mix_I_wFoo___wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo___wBar_If[T] extends Mix_I_wFoo___wBar_If { ; ; f; } +/* */class S_T_I_wFoo___wBarY__[T] extends Mix_I_wFoo___wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFoo___wBarY_f[T] extends Mix_I_wFoo___wBarY_f { ; ; f; } +// */class S_T_I_wFoo___wBarYI_[T] extends Mix_I_wFoo___wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo___wBarYIf[T] extends Mix_I_wFoo___wBarYIf { ; ; f; } +/* */class S_T_I_wFoo__f [T] extends Mix_I_wFoo__f { ; ; f; } +/* */class S_T_I_wFoo__fwBar___[T] extends Mix_I_wFoo__fwBar___ { ; ; f; } +// */class S_T_I_wFoo__fwBar__f[T] extends Mix_I_wFoo__fwBar__f { ; ; f; } +// */class S_T_I_wFoo__fwBar_I_[T] extends Mix_I_wFoo__fwBar_I_ { ; ; f; } +// */class S_T_I_wFoo__fwBar_If[T] extends Mix_I_wFoo__fwBar_If { ; ; f; } +/* */class S_T_I_wFoo__fwBarY__[T] extends Mix_I_wFoo__fwBarY__ { ; ; f; } +// */class S_T_I_wFoo__fwBarY_f[T] extends Mix_I_wFoo__fwBarY_f { ; ; f; } +// */class S_T_I_wFoo__fwBarYI_[T] extends Mix_I_wFoo__fwBarYI_ { ; ; f; } +// */class S_T_I_wFoo__fwBarYIf[T] extends Mix_I_wFoo__fwBarYIf { ; ; f; } +// */class S_T_I_wFoo_I_ [T] extends Mix_I_wFoo_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo_I_wBar___[T] extends Mix_I_wFoo_I_wBar___ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo_I_wBar__f[T] extends Mix_I_wFoo_I_wBar__f { ; ; f; } +// */class S_T_I_wFoo_I_wBar_I_[T] extends Mix_I_wFoo_I_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo_I_wBar_If[T] extends Mix_I_wFoo_I_wBar_If { ; ; f; } +// */class S_T_I_wFoo_I_wBarY__[T] extends Mix_I_wFoo_I_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo_I_wBarY_f[T] extends Mix_I_wFoo_I_wBarY_f { ; ; f; } +// */class S_T_I_wFoo_I_wBarYI_[T] extends Mix_I_wFoo_I_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFoo_I_wBarYIf[T] extends Mix_I_wFoo_I_wBarYIf { ; ; f; } +// */class S_T_I_wFoo_If [T] extends Mix_I_wFoo_If { ; ; f; } +// */class S_T_I_wFoo_IfwBar___[T] extends Mix_I_wFoo_IfwBar___ { ; ; f; } +// */class S_T_I_wFoo_IfwBar__f[T] extends Mix_I_wFoo_IfwBar__f { ; ; f; } +// */class S_T_I_wFoo_IfwBar_I_[T] extends Mix_I_wFoo_IfwBar_I_ { ; ; f; } +// */class S_T_I_wFoo_IfwBar_If[T] extends Mix_I_wFoo_IfwBar_If { ; ; f; } +// */class S_T_I_wFoo_IfwBarY__[T] extends Mix_I_wFoo_IfwBarY__ { ; ; f; } +// */class S_T_I_wFoo_IfwBarY_f[T] extends Mix_I_wFoo_IfwBarY_f { ; ; f; } +// */class S_T_I_wFoo_IfwBarYI_[T] extends Mix_I_wFoo_IfwBarYI_ { ; ; f; } +// */class S_T_I_wFoo_IfwBarYIf[T] extends Mix_I_wFoo_IfwBarYIf { ; ; f; } +/* */class S_T_I_wFooX__ [T] extends Mix_I_wFooX__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFooX__wBar___[T] extends Mix_I_wFooX__wBar___ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFooX__wBar__f[T] extends Mix_I_wFooX__wBar__f { ; ; f; } +// */class S_T_I_wFooX__wBar_I_[T] extends Mix_I_wFooX__wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooX__wBar_If[T] extends Mix_I_wFooX__wBar_If { ; ; f; } +/* */class S_T_I_wFooX__wBarY__[T] extends Mix_I_wFooX__wBarY__ { ; def f: I = {sub; null}; f; } +/* */class S_T_I_wFooX__wBarY_f[T] extends Mix_I_wFooX__wBarY_f { ; ; f; } +// */class S_T_I_wFooX__wBarYI_[T] extends Mix_I_wFooX__wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooX__wBarYIf[T] extends Mix_I_wFooX__wBarYIf { ; ; f; } +/* */class S_T_I_wFooX_f [T] extends Mix_I_wFooX_f { ; ; f; } +/* */class S_T_I_wFooX_fwBar___[T] extends Mix_I_wFooX_fwBar___ { ; ; f; } +// */class S_T_I_wFooX_fwBar__f[T] extends Mix_I_wFooX_fwBar__f { ; ; f; } +// */class S_T_I_wFooX_fwBar_I_[T] extends Mix_I_wFooX_fwBar_I_ { ; ; f; } +// */class S_T_I_wFooX_fwBar_If[T] extends Mix_I_wFooX_fwBar_If { ; ; f; } +/* */class S_T_I_wFooX_fwBarY__[T] extends Mix_I_wFooX_fwBarY__ { ; ; f; } +// */class S_T_I_wFooX_fwBarY_f[T] extends Mix_I_wFooX_fwBarY_f { ; ; f; } +// */class S_T_I_wFooX_fwBarYI_[T] extends Mix_I_wFooX_fwBarYI_ { ; ; f; } +// */class S_T_I_wFooX_fwBarYIf[T] extends Mix_I_wFooX_fwBarYIf { ; ; f; } +// */class S_T_I_wFooXI_ [T] extends Mix_I_wFooXI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooXI_wBar___[T] extends Mix_I_wFooXI_wBar___ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooXI_wBar__f[T] extends Mix_I_wFooXI_wBar__f { ; ; f; } +// */class S_T_I_wFooXI_wBar_I_[T] extends Mix_I_wFooXI_wBar_I_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooXI_wBar_If[T] extends Mix_I_wFooXI_wBar_If { ; ; f; } +// */class S_T_I_wFooXI_wBarY__[T] extends Mix_I_wFooXI_wBarY__ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooXI_wBarY_f[T] extends Mix_I_wFooXI_wBarY_f { ; ; f; } +// */class S_T_I_wFooXI_wBarYI_[T] extends Mix_I_wFooXI_wBarYI_ { ; def f: I = {sub; null}; f; } +// */class S_T_I_wFooXI_wBarYIf[T] extends Mix_I_wFooXI_wBarYIf { ; ; f; } +// */class S_T_I_wFooXIf [T] extends Mix_I_wFooXIf { ; ; f; } +// */class S_T_I_wFooXIfwBar___[T] extends Mix_I_wFooXIfwBar___ { ; ; f; } +// */class S_T_I_wFooXIfwBar__f[T] extends Mix_I_wFooXIfwBar__f { ; ; f; } +// */class S_T_I_wFooXIfwBar_I_[T] extends Mix_I_wFooXIfwBar_I_ { ; ; f; } +// */class S_T_I_wFooXIfwBar_If[T] extends Mix_I_wFooXIfwBar_If { ; ; f; } +// */class S_T_I_wFooXIfwBarY__[T] extends Mix_I_wFooXIfwBarY__ { ; ; f; } +// */class S_T_I_wFooXIfwBarY_f[T] extends Mix_I_wFooXIfwBarY_f { ; ; f; } +// */class S_T_I_wFooXIfwBarYI_[T] extends Mix_I_wFooXIfwBarYI_ { ; ; f; } +// */class S_T_I_wFooXIfwBarYIf[T] extends Mix_I_wFooXIfwBarYIf { ; ; f; } + +/* */class S_T_IfwFoo___ [T] extends Mix_IfwFoo___ { ; ; f; } +/* */class S_T_IfwFoo___wBar___[T] extends Mix_IfwFoo___wBar___ { ; ; f; } +/* */class S_T_IfwFoo___wBar__f[T] extends Mix_IfwFoo___wBar__f { ; ; f; } +// */class S_T_IfwFoo___wBar_I_[T] extends Mix_IfwFoo___wBar_I_ { ; ; f; } +// */class S_T_IfwFoo___wBar_If[T] extends Mix_IfwFoo___wBar_If { ; ; f; } +/* */class S_T_IfwFoo___wBarY__[T] extends Mix_IfwFoo___wBarY__ { ; ; f; } +/* */class S_T_IfwFoo___wBarY_f[T] extends Mix_IfwFoo___wBarY_f { ; ; f; } +// */class S_T_IfwFoo___wBarYI_[T] extends Mix_IfwFoo___wBarYI_ { ; ; f; } +// */class S_T_IfwFoo___wBarYIf[T] extends Mix_IfwFoo___wBarYIf { ; ; f; } +/* */class S_T_IfwFoo__f [T] extends Mix_IfwFoo__f { ; ; f; } +/* */class S_T_IfwFoo__fwBar___[T] extends Mix_IfwFoo__fwBar___ { ; ; f; } +/* */class S_T_IfwFoo__fwBar__f[T] extends Mix_IfwFoo__fwBar__f { ; ; f; } +// */class S_T_IfwFoo__fwBar_I_[T] extends Mix_IfwFoo__fwBar_I_ { ; ; f; } +// */class S_T_IfwFoo__fwBar_If[T] extends Mix_IfwFoo__fwBar_If { ; ; f; } +/* */class S_T_IfwFoo__fwBarY__[T] extends Mix_IfwFoo__fwBarY__ { ; ; f; } +/* */class S_T_IfwFoo__fwBarY_f[T] extends Mix_IfwFoo__fwBarY_f { ; ; f; } +// */class S_T_IfwFoo__fwBarYI_[T] extends Mix_IfwFoo__fwBarYI_ { ; ; f; } +// */class S_T_IfwFoo__fwBarYIf[T] extends Mix_IfwFoo__fwBarYIf { ; ; f; } +// */class S_T_IfwFoo_I_ [T] extends Mix_IfwFoo_I_ { ; ; f; } +// */class S_T_IfwFoo_I_wBar___[T] extends Mix_IfwFoo_I_wBar___ { ; ; f; } +// */class S_T_IfwFoo_I_wBar__f[T] extends Mix_IfwFoo_I_wBar__f { ; ; f; } +// */class S_T_IfwFoo_I_wBar_I_[T] extends Mix_IfwFoo_I_wBar_I_ { ; ; f; } +// */class S_T_IfwFoo_I_wBar_If[T] extends Mix_IfwFoo_I_wBar_If { ; ; f; } +// */class S_T_IfwFoo_I_wBarY__[T] extends Mix_IfwFoo_I_wBarY__ { ; ; f; } +// */class S_T_IfwFoo_I_wBarY_f[T] extends Mix_IfwFoo_I_wBarY_f { ; ; f; } +// */class S_T_IfwFoo_I_wBarYI_[T] extends Mix_IfwFoo_I_wBarYI_ { ; ; f; } +// */class S_T_IfwFoo_I_wBarYIf[T] extends Mix_IfwFoo_I_wBarYIf { ; ; f; } +// */class S_T_IfwFoo_If [T] extends Mix_IfwFoo_If { ; ; f; } +// */class S_T_IfwFoo_IfwBar___[T] extends Mix_IfwFoo_IfwBar___ { ; ; f; } +// */class S_T_IfwFoo_IfwBar__f[T] extends Mix_IfwFoo_IfwBar__f { ; ; f; } +// */class S_T_IfwFoo_IfwBar_I_[T] extends Mix_IfwFoo_IfwBar_I_ { ; ; f; } +// */class S_T_IfwFoo_IfwBar_If[T] extends Mix_IfwFoo_IfwBar_If { ; ; f; } +// */class S_T_IfwFoo_IfwBarY__[T] extends Mix_IfwFoo_IfwBarY__ { ; ; f; } +// */class S_T_IfwFoo_IfwBarY_f[T] extends Mix_IfwFoo_IfwBarY_f { ; ; f; } +// */class S_T_IfwFoo_IfwBarYI_[T] extends Mix_IfwFoo_IfwBarYI_ { ; ; f; } +// */class S_T_IfwFoo_IfwBarYIf[T] extends Mix_IfwFoo_IfwBarYIf { ; ; f; } +/* */class S_T_IfwFooX__ [T] extends Mix_IfwFooX__ { ; ; f; } +/* */class S_T_IfwFooX__wBar___[T] extends Mix_IfwFooX__wBar___ { ; ; f; } +/* */class S_T_IfwFooX__wBar__f[T] extends Mix_IfwFooX__wBar__f { ; ; f; } +// */class S_T_IfwFooX__wBar_I_[T] extends Mix_IfwFooX__wBar_I_ { ; ; f; } +// */class S_T_IfwFooX__wBar_If[T] extends Mix_IfwFooX__wBar_If { ; ; f; } +/* */class S_T_IfwFooX__wBarY__[T] extends Mix_IfwFooX__wBarY__ { ; ; f; } +/* */class S_T_IfwFooX__wBarY_f[T] extends Mix_IfwFooX__wBarY_f { ; ; f; } +// */class S_T_IfwFooX__wBarYI_[T] extends Mix_IfwFooX__wBarYI_ { ; ; f; } +// */class S_T_IfwFooX__wBarYIf[T] extends Mix_IfwFooX__wBarYIf { ; ; f; } +/* */class S_T_IfwFooX_f [T] extends Mix_IfwFooX_f { ; ; f; } +/* */class S_T_IfwFooX_fwBar___[T] extends Mix_IfwFooX_fwBar___ { ; ; f; } +/* */class S_T_IfwFooX_fwBar__f[T] extends Mix_IfwFooX_fwBar__f { ; ; f; } +// */class S_T_IfwFooX_fwBar_I_[T] extends Mix_IfwFooX_fwBar_I_ { ; ; f; } +// */class S_T_IfwFooX_fwBar_If[T] extends Mix_IfwFooX_fwBar_If { ; ; f; } +/* */class S_T_IfwFooX_fwBarY__[T] extends Mix_IfwFooX_fwBarY__ { ; ; f; } +/* */class S_T_IfwFooX_fwBarY_f[T] extends Mix_IfwFooX_fwBarY_f { ; ; f; } +// */class S_T_IfwFooX_fwBarYI_[T] extends Mix_IfwFooX_fwBarYI_ { ; ; f; } +// */class S_T_IfwFooX_fwBarYIf[T] extends Mix_IfwFooX_fwBarYIf { ; ; f; } +// */class S_T_IfwFooXI_ [T] extends Mix_IfwFooXI_ { ; ; f; } +// */class S_T_IfwFooXI_wBar___[T] extends Mix_IfwFooXI_wBar___ { ; ; f; } +// */class S_T_IfwFooXI_wBar__f[T] extends Mix_IfwFooXI_wBar__f { ; ; f; } +// */class S_T_IfwFooXI_wBar_I_[T] extends Mix_IfwFooXI_wBar_I_ { ; ; f; } +// */class S_T_IfwFooXI_wBar_If[T] extends Mix_IfwFooXI_wBar_If { ; ; f; } +// */class S_T_IfwFooXI_wBarY__[T] extends Mix_IfwFooXI_wBarY__ { ; ; f; } +// */class S_T_IfwFooXI_wBarY_f[T] extends Mix_IfwFooXI_wBarY_f { ; ; f; } +// */class S_T_IfwFooXI_wBarYI_[T] extends Mix_IfwFooXI_wBarYI_ { ; ; f; } +// */class S_T_IfwFooXI_wBarYIf[T] extends Mix_IfwFooXI_wBarYIf { ; ; f; } +// */class S_T_IfwFooXIf [T] extends Mix_IfwFooXIf { ; ; f; } +// */class S_T_IfwFooXIfwBar___[T] extends Mix_IfwFooXIfwBar___ { ; ; f; } +// */class S_T_IfwFooXIfwBar__f[T] extends Mix_IfwFooXIfwBar__f { ; ; f; } +// */class S_T_IfwFooXIfwBar_I_[T] extends Mix_IfwFooXIfwBar_I_ { ; ; f; } +// */class S_T_IfwFooXIfwBar_If[T] extends Mix_IfwFooXIfwBar_If { ; ; f; } +// */class S_T_IfwFooXIfwBarY__[T] extends Mix_IfwFooXIfwBarY__ { ; ; f; } +// */class S_T_IfwFooXIfwBarY_f[T] extends Mix_IfwFooXIfwBarY_f { ; ; f; } +// */class S_T_IfwFooXIfwBarYI_[T] extends Mix_IfwFooXIfwBarYI_ { ; ; f; } +// */class S_T_IfwFooXIfwBarYIf[T] extends Mix_IfwFooXIfwBarYIf { ; ; f; } + +/* */class S_TZ__wFoo___ [T] extends MixZ__wFoo___ [C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo___wBar___[T] extends MixZ__wFoo___wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo___wBar__f[T] extends MixZ__wFoo___wBar__f[C] { class I; ; f; } +/* */class S_TZ__wFoo___wBar_I_[T] extends MixZ__wFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo___wBar_If[T] extends MixZ__wFoo___wBar_If[C] { ; ; f; } +/* */class S_TZ__wFoo___wBarY__[T] extends MixZ__wFoo___wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo___wBarY_f[T] extends MixZ__wFoo___wBarY_f[C] { class I; ; f; } +/* */class S_TZ__wFoo___wBarYI_[T] extends MixZ__wFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo___wBarYIf[T] extends MixZ__wFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZ__wFoo__f [T] extends MixZ__wFoo__f [C] { class I; ; f; } +/* */class S_TZ__wFoo__fwBar___[T] extends MixZ__wFoo__fwBar___[C] { class I; ; f; } +// */class S_TZ__wFoo__fwBar__f[T] extends MixZ__wFoo__fwBar__f[C] { class I; ; f; } +/* */class S_TZ__wFoo__fwBar_I_[T] extends MixZ__wFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZ__wFoo__fwBar_If[T] extends MixZ__wFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZ__wFoo__fwBarY__[T] extends MixZ__wFoo__fwBarY__[C] { class I; ; f; } +// */class S_TZ__wFoo__fwBarY_f[T] extends MixZ__wFoo__fwBarY_f[C] { class I; ; f; } +/* */class S_TZ__wFoo__fwBarYI_[T] extends MixZ__wFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZ__wFoo__fwBarYIf[T] extends MixZ__wFoo__fwBarYIf[C] { ; ; f; } +/* */class S_TZ__wFoo_I_ [T] extends MixZ__wFoo_I_ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo_I_wBar___[T] extends MixZ__wFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo_I_wBar__f[T] extends MixZ__wFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZ__wFoo_I_wBar_I_[T] extends MixZ__wFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__wFoo_I_wBar_If[T] extends MixZ__wFoo_I_wBar_If[C] { ; ; f; } +/* */class S_TZ__wFoo_I_wBarY__[T] extends MixZ__wFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFoo_I_wBarY_f[T] extends MixZ__wFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZ__wFoo_I_wBarYI_[T] extends MixZ__wFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__wFoo_I_wBarYIf[T] extends MixZ__wFoo_I_wBarYIf[C] { ; ; f; } +/* */class S_TZ__wFoo_If [T] extends MixZ__wFoo_If [C] { ; ; f; } +/* */class S_TZ__wFoo_IfwBar___[T] extends MixZ__wFoo_IfwBar___[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBar__f[T] extends MixZ__wFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBar_I_[T] extends MixZ__wFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBar_If[T] extends MixZ__wFoo_IfwBar_If[C] { ; ; f; } +/* */class S_TZ__wFoo_IfwBarY__[T] extends MixZ__wFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBarY_f[T] extends MixZ__wFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBarYI_[T] extends MixZ__wFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZ__wFoo_IfwBarYIf[T] extends MixZ__wFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZ__wFooX__ [T] extends MixZ__wFooX__ [C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooX__wBar___[T] extends MixZ__wFooX__wBar___[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooX__wBar__f[T] extends MixZ__wFooX__wBar__f[C] { class I; ; f; } +/* */class S_TZ__wFooX__wBar_I_[T] extends MixZ__wFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooX__wBar_If[T] extends MixZ__wFooX__wBar_If[C] { ; ; f; } +/* */class S_TZ__wFooX__wBarY__[T] extends MixZ__wFooX__wBarY__[C] { class I; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooX__wBarY_f[T] extends MixZ__wFooX__wBarY_f[C] { class I; ; f; } +/* */class S_TZ__wFooX__wBarYI_[T] extends MixZ__wFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooX__wBarYIf[T] extends MixZ__wFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZ__wFooX_f [T] extends MixZ__wFooX_f [C] { class I; ; f; } +/* */class S_TZ__wFooX_fwBar___[T] extends MixZ__wFooX_fwBar___[C] { class I; ; f; } +// */class S_TZ__wFooX_fwBar__f[T] extends MixZ__wFooX_fwBar__f[C] { class I; ; f; } +/* */class S_TZ__wFooX_fwBar_I_[T] extends MixZ__wFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZ__wFooX_fwBar_If[T] extends MixZ__wFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZ__wFooX_fwBarY__[T] extends MixZ__wFooX_fwBarY__[C] { class I; ; f; } +// */class S_TZ__wFooX_fwBarY_f[T] extends MixZ__wFooX_fwBarY_f[C] { class I; ; f; } +/* */class S_TZ__wFooX_fwBarYI_[T] extends MixZ__wFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZ__wFooX_fwBarYIf[T] extends MixZ__wFooX_fwBarYIf[C] { ; ; f; } +/* */class S_TZ__wFooXI_ [T] extends MixZ__wFooXI_ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooXI_wBar___[T] extends MixZ__wFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooXI_wBar__f[T] extends MixZ__wFooXI_wBar__f[C] { ; ; f; } +// */class S_TZ__wFooXI_wBar_I_[T] extends MixZ__wFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__wFooXI_wBar_If[T] extends MixZ__wFooXI_wBar_If[C] { ; ; f; } +/* */class S_TZ__wFooXI_wBarY__[T] extends MixZ__wFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZ__wFooXI_wBarY_f[T] extends MixZ__wFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZ__wFooXI_wBarYI_[T] extends MixZ__wFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZ__wFooXI_wBarYIf[T] extends MixZ__wFooXI_wBarYIf[C] { ; ; f; } +/* */class S_TZ__wFooXIf [T] extends MixZ__wFooXIf [C] { ; ; f; } +/* */class S_TZ__wFooXIfwBar___[T] extends MixZ__wFooXIfwBar___[C] { ; ; f; } +// */class S_TZ__wFooXIfwBar__f[T] extends MixZ__wFooXIfwBar__f[C] { ; ; f; } +// */class S_TZ__wFooXIfwBar_I_[T] extends MixZ__wFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZ__wFooXIfwBar_If[T] extends MixZ__wFooXIfwBar_If[C] { ; ; f; } +/* */class S_TZ__wFooXIfwBarY__[T] extends MixZ__wFooXIfwBarY__[C] { ; ; f; } +// */class S_TZ__wFooXIfwBarY_f[T] extends MixZ__wFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZ__wFooXIfwBarYI_[T] extends MixZ__wFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZ__wFooXIfwBarYIf[T] extends MixZ__wFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZ_fwFoo___ [T] extends MixZ_fwFoo___ [C] { class I; ; f; } +/* */class S_TZ_fwFoo___wBar___[T] extends MixZ_fwFoo___wBar___[C] { class I; ; f; } +/* */class S_TZ_fwFoo___wBar__f[T] extends MixZ_fwFoo___wBar__f[C] { class I; ; f; } +/* */class S_TZ_fwFoo___wBar_I_[T] extends MixZ_fwFoo___wBar_I_[C] { ; ; f; } +/* */class S_TZ_fwFoo___wBar_If[T] extends MixZ_fwFoo___wBar_If[C] { ; ; f; } +/* */class S_TZ_fwFoo___wBarY__[T] extends MixZ_fwFoo___wBarY__[C] { class I; ; f; } +/* */class S_TZ_fwFoo___wBarY_f[T] extends MixZ_fwFoo___wBarY_f[C] { class I; ; f; } +/* */class S_TZ_fwFoo___wBarYI_[T] extends MixZ_fwFoo___wBarYI_[C] { ; ; f; } +/* */class S_TZ_fwFoo___wBarYIf[T] extends MixZ_fwFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFoo__f [T] extends MixZ_fwFoo__f [C] { class I; ; f; } +/* */class S_TZ_fwFoo__fwBar___[T] extends MixZ_fwFoo__fwBar___[C] { class I; ; f; } +/* */class S_TZ_fwFoo__fwBar__f[T] extends MixZ_fwFoo__fwBar__f[C] { class I; ; f; } +/* */class S_TZ_fwFoo__fwBar_I_[T] extends MixZ_fwFoo__fwBar_I_[C] { ; ; f; } +/* */class S_TZ_fwFoo__fwBar_If[T] extends MixZ_fwFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZ_fwFoo__fwBarY__[T] extends MixZ_fwFoo__fwBarY__[C] { class I; ; f; } +/* */class S_TZ_fwFoo__fwBarY_f[T] extends MixZ_fwFoo__fwBarY_f[C] { class I; ; f; } +/* */class S_TZ_fwFoo__fwBarYI_[T] extends MixZ_fwFoo__fwBarYI_[C] { ; ; f; } +/* */class S_TZ_fwFoo__fwBarYIf[T] extends MixZ_fwFoo__fwBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFoo_I_ [T] extends MixZ_fwFoo_I_ [C] { ; ; f; } +/* */class S_TZ_fwFoo_I_wBar___[T] extends MixZ_fwFoo_I_wBar___[C] { ; ; f; } +/* */class S_TZ_fwFoo_I_wBar__f[T] extends MixZ_fwFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZ_fwFoo_I_wBar_I_[T] extends MixZ_fwFoo_I_wBar_I_[C] { ; ; f; } +// */class S_TZ_fwFoo_I_wBar_If[T] extends MixZ_fwFoo_I_wBar_If[C] { ; ; f; } +/* */class S_TZ_fwFoo_I_wBarY__[T] extends MixZ_fwFoo_I_wBarY__[C] { ; ; f; } +/* */class S_TZ_fwFoo_I_wBarY_f[T] extends MixZ_fwFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZ_fwFoo_I_wBarYI_[T] extends MixZ_fwFoo_I_wBarYI_[C] { ; ; f; } +// */class S_TZ_fwFoo_I_wBarYIf[T] extends MixZ_fwFoo_I_wBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFoo_If [T] extends MixZ_fwFoo_If [C] { ; ; f; } +/* */class S_TZ_fwFoo_IfwBar___[T] extends MixZ_fwFoo_IfwBar___[C] { ; ; f; } +/* */class S_TZ_fwFoo_IfwBar__f[T] extends MixZ_fwFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZ_fwFoo_IfwBar_I_[T] extends MixZ_fwFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZ_fwFoo_IfwBar_If[T] extends MixZ_fwFoo_IfwBar_If[C] { ; ; f; } +/* */class S_TZ_fwFoo_IfwBarY__[T] extends MixZ_fwFoo_IfwBarY__[C] { ; ; f; } +/* */class S_TZ_fwFoo_IfwBarY_f[T] extends MixZ_fwFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZ_fwFoo_IfwBarYI_[T] extends MixZ_fwFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZ_fwFoo_IfwBarYIf[T] extends MixZ_fwFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFooX__ [T] extends MixZ_fwFooX__ [C] { class I; ; f; } +/* */class S_TZ_fwFooX__wBar___[T] extends MixZ_fwFooX__wBar___[C] { class I; ; f; } +/* */class S_TZ_fwFooX__wBar__f[T] extends MixZ_fwFooX__wBar__f[C] { class I; ; f; } +/* */class S_TZ_fwFooX__wBar_I_[T] extends MixZ_fwFooX__wBar_I_[C] { ; ; f; } +/* */class S_TZ_fwFooX__wBar_If[T] extends MixZ_fwFooX__wBar_If[C] { ; ; f; } +/* */class S_TZ_fwFooX__wBarY__[T] extends MixZ_fwFooX__wBarY__[C] { class I; ; f; } +/* */class S_TZ_fwFooX__wBarY_f[T] extends MixZ_fwFooX__wBarY_f[C] { class I; ; f; } +/* */class S_TZ_fwFooX__wBarYI_[T] extends MixZ_fwFooX__wBarYI_[C] { ; ; f; } +/* */class S_TZ_fwFooX__wBarYIf[T] extends MixZ_fwFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFooX_f [T] extends MixZ_fwFooX_f [C] { class I; ; f; } +/* */class S_TZ_fwFooX_fwBar___[T] extends MixZ_fwFooX_fwBar___[C] { class I; ; f; } +/* */class S_TZ_fwFooX_fwBar__f[T] extends MixZ_fwFooX_fwBar__f[C] { class I; ; f; } +/* */class S_TZ_fwFooX_fwBar_I_[T] extends MixZ_fwFooX_fwBar_I_[C] { ; ; f; } +/* */class S_TZ_fwFooX_fwBar_If[T] extends MixZ_fwFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZ_fwFooX_fwBarY__[T] extends MixZ_fwFooX_fwBarY__[C] { class I; ; f; } +/* */class S_TZ_fwFooX_fwBarY_f[T] extends MixZ_fwFooX_fwBarY_f[C] { class I; ; f; } +/* */class S_TZ_fwFooX_fwBarYI_[T] extends MixZ_fwFooX_fwBarYI_[C] { ; ; f; } +/* */class S_TZ_fwFooX_fwBarYIf[T] extends MixZ_fwFooX_fwBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFooXI_ [T] extends MixZ_fwFooXI_ [C] { ; ; f; } +/* */class S_TZ_fwFooXI_wBar___[T] extends MixZ_fwFooXI_wBar___[C] { ; ; f; } +/* */class S_TZ_fwFooXI_wBar__f[T] extends MixZ_fwFooXI_wBar__f[C] { ; ; f; } +// */class S_TZ_fwFooXI_wBar_I_[T] extends MixZ_fwFooXI_wBar_I_[C] { ; ; f; } +// */class S_TZ_fwFooXI_wBar_If[T] extends MixZ_fwFooXI_wBar_If[C] { ; ; f; } +/* */class S_TZ_fwFooXI_wBarY__[T] extends MixZ_fwFooXI_wBarY__[C] { ; ; f; } +/* */class S_TZ_fwFooXI_wBarY_f[T] extends MixZ_fwFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZ_fwFooXI_wBarYI_[T] extends MixZ_fwFooXI_wBarYI_[C] { ; ; f; } +// */class S_TZ_fwFooXI_wBarYIf[T] extends MixZ_fwFooXI_wBarYIf[C] { ; ; f; } +/* */class S_TZ_fwFooXIf [T] extends MixZ_fwFooXIf [C] { ; ; f; } +/* */class S_TZ_fwFooXIfwBar___[T] extends MixZ_fwFooXIfwBar___[C] { ; ; f; } +/* */class S_TZ_fwFooXIfwBar__f[T] extends MixZ_fwFooXIfwBar__f[C] { ; ; f; } +// */class S_TZ_fwFooXIfwBar_I_[T] extends MixZ_fwFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZ_fwFooXIfwBar_If[T] extends MixZ_fwFooXIfwBar_If[C] { ; ; f; } +/* */class S_TZ_fwFooXIfwBarY__[T] extends MixZ_fwFooXIfwBarY__[C] { ; ; f; } +/* */class S_TZ_fwFooXIfwBarY_f[T] extends MixZ_fwFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZ_fwFooXIfwBarYI_[T] extends MixZ_fwFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZ_fwFooXIfwBarYIf[T] extends MixZ_fwFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZI_wFoo___ [T] extends MixZI_wFoo___ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFoo___wBar___[T] extends MixZI_wFoo___wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFoo___wBar__f[T] extends MixZI_wFoo___wBar__f[C] { ; ; f; } +// */class S_TZI_wFoo___wBar_I_[T] extends MixZI_wFoo___wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo___wBar_If[T] extends MixZI_wFoo___wBar_If[C] { ; ; f; } +/* */class S_TZI_wFoo___wBarY__[T] extends MixZI_wFoo___wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFoo___wBarY_f[T] extends MixZI_wFoo___wBarY_f[C] { ; ; f; } +// */class S_TZI_wFoo___wBarYI_[T] extends MixZI_wFoo___wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo___wBarYIf[T] extends MixZI_wFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZI_wFoo__f [T] extends MixZI_wFoo__f [C] { ; ; f; } +/* */class S_TZI_wFoo__fwBar___[T] extends MixZI_wFoo__fwBar___[C] { ; ; f; } +// */class S_TZI_wFoo__fwBar__f[T] extends MixZI_wFoo__fwBar__f[C] { ; ; f; } +// */class S_TZI_wFoo__fwBar_I_[T] extends MixZI_wFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZI_wFoo__fwBar_If[T] extends MixZI_wFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZI_wFoo__fwBarY__[T] extends MixZI_wFoo__fwBarY__[C] { ; ; f; } +// */class S_TZI_wFoo__fwBarY_f[T] extends MixZI_wFoo__fwBarY_f[C] { ; ; f; } +// */class S_TZI_wFoo__fwBarYI_[T] extends MixZI_wFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZI_wFoo__fwBarYIf[T] extends MixZI_wFoo__fwBarYIf[C] { ; ; f; } +// */class S_TZI_wFoo_I_ [T] extends MixZI_wFoo_I_ [C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo_I_wBar___[T] extends MixZI_wFoo_I_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo_I_wBar__f[T] extends MixZI_wFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZI_wFoo_I_wBar_I_[T] extends MixZI_wFoo_I_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo_I_wBar_If[T] extends MixZI_wFoo_I_wBar_If[C] { ; ; f; } +// */class S_TZI_wFoo_I_wBarY__[T] extends MixZI_wFoo_I_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo_I_wBarY_f[T] extends MixZI_wFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZI_wFoo_I_wBarYI_[T] extends MixZI_wFoo_I_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFoo_I_wBarYIf[T] extends MixZI_wFoo_I_wBarYIf[C] { ; ; f; } +// */class S_TZI_wFoo_If [T] extends MixZI_wFoo_If [C] { ; ; f; } +// */class S_TZI_wFoo_IfwBar___[T] extends MixZI_wFoo_IfwBar___[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBar__f[T] extends MixZI_wFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBar_I_[T] extends MixZI_wFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBar_If[T] extends MixZI_wFoo_IfwBar_If[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBarY__[T] extends MixZI_wFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBarY_f[T] extends MixZI_wFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBarYI_[T] extends MixZI_wFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZI_wFoo_IfwBarYIf[T] extends MixZI_wFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZI_wFooX__ [T] extends MixZI_wFooX__ [C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFooX__wBar___[T] extends MixZI_wFooX__wBar___[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFooX__wBar__f[T] extends MixZI_wFooX__wBar__f[C] { ; ; f; } +// */class S_TZI_wFooX__wBar_I_[T] extends MixZI_wFooX__wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooX__wBar_If[T] extends MixZI_wFooX__wBar_If[C] { ; ; f; } +/* */class S_TZI_wFooX__wBarY__[T] extends MixZI_wFooX__wBarY__[C] { ; def f: I = {sub; null}; f; } +/* */class S_TZI_wFooX__wBarY_f[T] extends MixZI_wFooX__wBarY_f[C] { ; ; f; } +// */class S_TZI_wFooX__wBarYI_[T] extends MixZI_wFooX__wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooX__wBarYIf[T] extends MixZI_wFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZI_wFooX_f [T] extends MixZI_wFooX_f [C] { ; ; f; } +/* */class S_TZI_wFooX_fwBar___[T] extends MixZI_wFooX_fwBar___[C] { ; ; f; } +// */class S_TZI_wFooX_fwBar__f[T] extends MixZI_wFooX_fwBar__f[C] { ; ; f; } +// */class S_TZI_wFooX_fwBar_I_[T] extends MixZI_wFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZI_wFooX_fwBar_If[T] extends MixZI_wFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZI_wFooX_fwBarY__[T] extends MixZI_wFooX_fwBarY__[C] { ; ; f; } +// */class S_TZI_wFooX_fwBarY_f[T] extends MixZI_wFooX_fwBarY_f[C] { ; ; f; } +// */class S_TZI_wFooX_fwBarYI_[T] extends MixZI_wFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZI_wFooX_fwBarYIf[T] extends MixZI_wFooX_fwBarYIf[C] { ; ; f; } +// */class S_TZI_wFooXI_ [T] extends MixZI_wFooXI_ [C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooXI_wBar___[T] extends MixZI_wFooXI_wBar___[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooXI_wBar__f[T] extends MixZI_wFooXI_wBar__f[C] { ; ; f; } +// */class S_TZI_wFooXI_wBar_I_[T] extends MixZI_wFooXI_wBar_I_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooXI_wBar_If[T] extends MixZI_wFooXI_wBar_If[C] { ; ; f; } +// */class S_TZI_wFooXI_wBarY__[T] extends MixZI_wFooXI_wBarY__[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooXI_wBarY_f[T] extends MixZI_wFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZI_wFooXI_wBarYI_[T] extends MixZI_wFooXI_wBarYI_[C] { ; def f: I = {sub; null}; f; } +// */class S_TZI_wFooXI_wBarYIf[T] extends MixZI_wFooXI_wBarYIf[C] { ; ; f; } +// */class S_TZI_wFooXIf [T] extends MixZI_wFooXIf [C] { ; ; f; } +// */class S_TZI_wFooXIfwBar___[T] extends MixZI_wFooXIfwBar___[C] { ; ; f; } +// */class S_TZI_wFooXIfwBar__f[T] extends MixZI_wFooXIfwBar__f[C] { ; ; f; } +// */class S_TZI_wFooXIfwBar_I_[T] extends MixZI_wFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZI_wFooXIfwBar_If[T] extends MixZI_wFooXIfwBar_If[C] { ; ; f; } +// */class S_TZI_wFooXIfwBarY__[T] extends MixZI_wFooXIfwBarY__[C] { ; ; f; } +// */class S_TZI_wFooXIfwBarY_f[T] extends MixZI_wFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZI_wFooXIfwBarYI_[T] extends MixZI_wFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZI_wFooXIfwBarYIf[T] extends MixZI_wFooXIfwBarYIf[C] { ; ; f; } + +/* */class S_TZIfwFoo___ [T] extends MixZIfwFoo___ [C] { ; ; f; } +/* */class S_TZIfwFoo___wBar___[T] extends MixZIfwFoo___wBar___[C] { ; ; f; } +/* */class S_TZIfwFoo___wBar__f[T] extends MixZIfwFoo___wBar__f[C] { ; ; f; } +// */class S_TZIfwFoo___wBar_I_[T] extends MixZIfwFoo___wBar_I_[C] { ; ; f; } +// */class S_TZIfwFoo___wBar_If[T] extends MixZIfwFoo___wBar_If[C] { ; ; f; } +/* */class S_TZIfwFoo___wBarY__[T] extends MixZIfwFoo___wBarY__[C] { ; ; f; } +/* */class S_TZIfwFoo___wBarY_f[T] extends MixZIfwFoo___wBarY_f[C] { ; ; f; } +// */class S_TZIfwFoo___wBarYI_[T] extends MixZIfwFoo___wBarYI_[C] { ; ; f; } +// */class S_TZIfwFoo___wBarYIf[T] extends MixZIfwFoo___wBarYIf[C] { ; ; f; } +/* */class S_TZIfwFoo__f [T] extends MixZIfwFoo__f [C] { ; ; f; } +/* */class S_TZIfwFoo__fwBar___[T] extends MixZIfwFoo__fwBar___[C] { ; ; f; } +/* */class S_TZIfwFoo__fwBar__f[T] extends MixZIfwFoo__fwBar__f[C] { ; ; f; } +// */class S_TZIfwFoo__fwBar_I_[T] extends MixZIfwFoo__fwBar_I_[C] { ; ; f; } +// */class S_TZIfwFoo__fwBar_If[T] extends MixZIfwFoo__fwBar_If[C] { ; ; f; } +/* */class S_TZIfwFoo__fwBarY__[T] extends MixZIfwFoo__fwBarY__[C] { ; ; f; } +/* */class S_TZIfwFoo__fwBarY_f[T] extends MixZIfwFoo__fwBarY_f[C] { ; ; f; } +// */class S_TZIfwFoo__fwBarYI_[T] extends MixZIfwFoo__fwBarYI_[C] { ; ; f; } +// */class S_TZIfwFoo__fwBarYIf[T] extends MixZIfwFoo__fwBarYIf[C] { ; ; f; } +// */class S_TZIfwFoo_I_ [T] extends MixZIfwFoo_I_ [C] { ; ; f; } +// */class S_TZIfwFoo_I_wBar___[T] extends MixZIfwFoo_I_wBar___[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBar__f[T] extends MixZIfwFoo_I_wBar__f[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBar_I_[T] extends MixZIfwFoo_I_wBar_I_[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBar_If[T] extends MixZIfwFoo_I_wBar_If[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBarY__[T] extends MixZIfwFoo_I_wBarY__[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBarY_f[T] extends MixZIfwFoo_I_wBarY_f[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBarYI_[T] extends MixZIfwFoo_I_wBarYI_[C] { ; ; f; } +// */class S_TZIfwFoo_I_wBarYIf[T] extends MixZIfwFoo_I_wBarYIf[C] { ; ; f; } +// */class S_TZIfwFoo_If [T] extends MixZIfwFoo_If [C] { ; ; f; } +// */class S_TZIfwFoo_IfwBar___[T] extends MixZIfwFoo_IfwBar___[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBar__f[T] extends MixZIfwFoo_IfwBar__f[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBar_I_[T] extends MixZIfwFoo_IfwBar_I_[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBar_If[T] extends MixZIfwFoo_IfwBar_If[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBarY__[T] extends MixZIfwFoo_IfwBarY__[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBarY_f[T] extends MixZIfwFoo_IfwBarY_f[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBarYI_[T] extends MixZIfwFoo_IfwBarYI_[C] { ; ; f; } +// */class S_TZIfwFoo_IfwBarYIf[T] extends MixZIfwFoo_IfwBarYIf[C] { ; ; f; } +/* */class S_TZIfwFooX__ [T] extends MixZIfwFooX__ [C] { ; ; f; } +/* */class S_TZIfwFooX__wBar___[T] extends MixZIfwFooX__wBar___[C] { ; ; f; } +/* */class S_TZIfwFooX__wBar__f[T] extends MixZIfwFooX__wBar__f[C] { ; ; f; } +// */class S_TZIfwFooX__wBar_I_[T] extends MixZIfwFooX__wBar_I_[C] { ; ; f; } +// */class S_TZIfwFooX__wBar_If[T] extends MixZIfwFooX__wBar_If[C] { ; ; f; } +/* */class S_TZIfwFooX__wBarY__[T] extends MixZIfwFooX__wBarY__[C] { ; ; f; } +/* */class S_TZIfwFooX__wBarY_f[T] extends MixZIfwFooX__wBarY_f[C] { ; ; f; } +// */class S_TZIfwFooX__wBarYI_[T] extends MixZIfwFooX__wBarYI_[C] { ; ; f; } +// */class S_TZIfwFooX__wBarYIf[T] extends MixZIfwFooX__wBarYIf[C] { ; ; f; } +/* */class S_TZIfwFooX_f [T] extends MixZIfwFooX_f [C] { ; ; f; } +/* */class S_TZIfwFooX_fwBar___[T] extends MixZIfwFooX_fwBar___[C] { ; ; f; } +/* */class S_TZIfwFooX_fwBar__f[T] extends MixZIfwFooX_fwBar__f[C] { ; ; f; } +// */class S_TZIfwFooX_fwBar_I_[T] extends MixZIfwFooX_fwBar_I_[C] { ; ; f; } +// */class S_TZIfwFooX_fwBar_If[T] extends MixZIfwFooX_fwBar_If[C] { ; ; f; } +/* */class S_TZIfwFooX_fwBarY__[T] extends MixZIfwFooX_fwBarY__[C] { ; ; f; } +/* */class S_TZIfwFooX_fwBarY_f[T] extends MixZIfwFooX_fwBarY_f[C] { ; ; f; } +// */class S_TZIfwFooX_fwBarYI_[T] extends MixZIfwFooX_fwBarYI_[C] { ; ; f; } +// */class S_TZIfwFooX_fwBarYIf[T] extends MixZIfwFooX_fwBarYIf[C] { ; ; f; } +// */class S_TZIfwFooXI_ [T] extends MixZIfwFooXI_ [C] { ; ; f; } +// */class S_TZIfwFooXI_wBar___[T] extends MixZIfwFooXI_wBar___[C] { ; ; f; } +// */class S_TZIfwFooXI_wBar__f[T] extends MixZIfwFooXI_wBar__f[C] { ; ; f; } +// */class S_TZIfwFooXI_wBar_I_[T] extends MixZIfwFooXI_wBar_I_[C] { ; ; f; } +// */class S_TZIfwFooXI_wBar_If[T] extends MixZIfwFooXI_wBar_If[C] { ; ; f; } +// */class S_TZIfwFooXI_wBarY__[T] extends MixZIfwFooXI_wBarY__[C] { ; ; f; } +// */class S_TZIfwFooXI_wBarY_f[T] extends MixZIfwFooXI_wBarY_f[C] { ; ; f; } +// */class S_TZIfwFooXI_wBarYI_[T] extends MixZIfwFooXI_wBarYI_[C] { ; ; f; } +// */class S_TZIfwFooXI_wBarYIf[T] extends MixZIfwFooXI_wBarYIf[C] { ; ; f; } +// */class S_TZIfwFooXIf [T] extends MixZIfwFooXIf [C] { ; ; f; } +// */class S_TZIfwFooXIfwBar___[T] extends MixZIfwFooXIfwBar___[C] { ; ; f; } +// */class S_TZIfwFooXIfwBar__f[T] extends MixZIfwFooXIfwBar__f[C] { ; ; f; } +// */class S_TZIfwFooXIfwBar_I_[T] extends MixZIfwFooXIfwBar_I_[C] { ; ; f; } +// */class S_TZIfwFooXIfwBar_If[T] extends MixZIfwFooXIfwBar_If[C] { ; ; f; } +// */class S_TZIfwFooXIfwBarY__[T] extends MixZIfwFooXIfwBarY__[C] { ; ; f; } +// */class S_TZIfwFooXIfwBarY_f[T] extends MixZIfwFooXIfwBarY_f[C] { ; ; f; } +// */class S_TZIfwFooXIfwBarYI_[T] extends MixZIfwFooXIfwBarYI_[C] { ; ; f; } +// */class S_TZIfwFooXIfwBarYIf[T] extends MixZIfwFooXIfwBarYIf[C] { ; ; f; } + + + +object Test { + var errors: Int = 0; + def test(name: String, test: => Any, count: Int, value: String) = { + try { + Help.init; + test; + if (!Help.check(count, value)) { + Console.print(name + " failed: "); + Help.print; + Console.println; + errors = errors + 1; + } + } catch { + case exception: Throwable => { + Console.print(name + " raised exception " + exception); + Console.println; + errors = errors + 1; + } + } + } + + def main(args:Array[String]): Unit = { + + // */abstract test("Mix___eFoo___ ", new Mix___eFoo___ , 2, null ); + // */abstract test("Mix___eFoo___wBar___", new Mix___eFoo___wBar___ , 3, null ); + // */abstract test("Mix___eFoo___wBar__f", new Mix___eFoo___wBar__f , 3, "bar"); + // */abstract test("Mix___eFoo___wBar_I_", new Mix___eFoo___wBar_I_ , 3, null ); + /* *//* */ test("Mix___eFoo___wBar_If", new Mix___eFoo___wBar_If , 3, "bar"); + // */abstract test("Mix___eFoo___wBarY__", new Mix___eFoo___wBarY__ , 3, null ); + // */abstract test("Mix___eFoo___wBarY_f", new Mix___eFoo___wBarY_f , 3, "bar"); + // */abstract test("Mix___eFoo___wBarYI_", new Mix___eFoo___wBarYI_ , 3, null ); + /* *//* */ test("Mix___eFoo___wBarYIf", new Mix___eFoo___wBarYIf , 3, "bar"); + // */abstract test("Mix___eFoo__f ", new Mix___eFoo__f , 2, "foo"); + // */abstract test("Mix___eFoo__fwBar___", new Mix___eFoo__fwBar___ , 3, "foo"); + // */abstract test("Mix___eFoo__fwBar__f", new Mix___eFoo__fwBar__f , 3, "bar"); + /* *//* */ test("Mix___eFoo__fwBar_I_", new Mix___eFoo__fwBar_I_ , 3, "foo"); + // *//* */ test("Mix___eFoo__fwBar_If", new Mix___eFoo__fwBar_If , 3, "bar"); + // */abstract test("Mix___eFoo__fwBarY__", new Mix___eFoo__fwBarY__ , 3, "foo"); + // */abstract test("Mix___eFoo__fwBarY_f", new Mix___eFoo__fwBarY_f , 3, "bar"); + /* *//* */ test("Mix___eFoo__fwBarYI_", new Mix___eFoo__fwBarYI_ , 3, "foo"); + // *//* */ test("Mix___eFoo__fwBarYIf", new Mix___eFoo__fwBarYIf , 3, "bar"); + // */abstract test("Mix___eFoo_I_ ", new Mix___eFoo_I_ , 2, null ); + // */abstract test("Mix___eFoo_I_wBar___", new Mix___eFoo_I_wBar___ , 3, null ); + /* *//* */ test("Mix___eFoo_I_wBar__f", new Mix___eFoo_I_wBar__f , 3, "bar"); + // */abstract test("Mix___eFoo_I_wBar_I_", new Mix___eFoo_I_wBar_I_ , 3, null ); + // *//* */ test("Mix___eFoo_I_wBar_If", new Mix___eFoo_I_wBar_If , 3, "bar"); + // */abstract test("Mix___eFoo_I_wBarY__", new Mix___eFoo_I_wBarY__ , 3, null ); + /* *//* */ test("Mix___eFoo_I_wBarY_f", new Mix___eFoo_I_wBarY_f , 3, "bar"); + // */abstract test("Mix___eFoo_I_wBarYI_", new Mix___eFoo_I_wBarYI_ , 3, null ); + // *//* */ test("Mix___eFoo_I_wBarYIf", new Mix___eFoo_I_wBarYIf , 3, "bar"); + /* *//* */ test("Mix___eFoo_If ", new Mix___eFoo_If , 2, "foo"); + /* *//* */ test("Mix___eFoo_IfwBar___", new Mix___eFoo_IfwBar___ , 3, "foo"); + // *//* */ test("Mix___eFoo_IfwBar__f", new Mix___eFoo_IfwBar__f , 3, "bar"); + // *//* */ test("Mix___eFoo_IfwBar_I_", new Mix___eFoo_IfwBar_I_ , 3, "foo"); + // *//* */ test("Mix___eFoo_IfwBar_If", new Mix___eFoo_IfwBar_If , 3, "bar"); + /* *//* */ test("Mix___eFoo_IfwBarY__", new Mix___eFoo_IfwBarY__ , 3, "foo"); + // *//* */ test("Mix___eFoo_IfwBarY_f", new Mix___eFoo_IfwBarY_f , 3, "bar"); + // *//* */ test("Mix___eFoo_IfwBarYI_", new Mix___eFoo_IfwBarYI_ , 3, "foo"); + // *//* */ test("Mix___eFoo_IfwBarYIf", new Mix___eFoo_IfwBarYIf , 3, "bar"); + // */abstract test("Mix___eFooX__ ", new Mix___eFooX__ , 2, null ); + // */abstract test("Mix___eFooX__wBar___", new Mix___eFooX__wBar___ , 3, null ); + // */abstract test("Mix___eFooX__wBar__f", new Mix___eFooX__wBar__f , 3, "bar"); + // */abstract test("Mix___eFooX__wBar_I_", new Mix___eFooX__wBar_I_ , 3, null ); + /* *//* */ test("Mix___eFooX__wBar_If", new Mix___eFooX__wBar_If , 3, "bar"); + // */abstract test("Mix___eFooX__wBarY__", new Mix___eFooX__wBarY__ , 3, null ); + // */abstract test("Mix___eFooX__wBarY_f", new Mix___eFooX__wBarY_f , 3, "bar"); + // */abstract test("Mix___eFooX__wBarYI_", new Mix___eFooX__wBarYI_ , 3, null ); + /* *//* */ test("Mix___eFooX__wBarYIf", new Mix___eFooX__wBarYIf , 3, "bar"); + // */abstract test("Mix___eFooX_f ", new Mix___eFooX_f , 2, "foo"); + // */abstract test("Mix___eFooX_fwBar___", new Mix___eFooX_fwBar___ , 3, "foo"); + // */abstract test("Mix___eFooX_fwBar__f", new Mix___eFooX_fwBar__f , 3, "bar"); + /* *//* */ test("Mix___eFooX_fwBar_I_", new Mix___eFooX_fwBar_I_ , 3, "foo"); + // *//* */ test("Mix___eFooX_fwBar_If", new Mix___eFooX_fwBar_If , 3, "bar"); + // */abstract test("Mix___eFooX_fwBarY__", new Mix___eFooX_fwBarY__ , 3, "foo"); + // */abstract test("Mix___eFooX_fwBarY_f", new Mix___eFooX_fwBarY_f , 3, "bar"); + /* *//* */ test("Mix___eFooX_fwBarYI_", new Mix___eFooX_fwBarYI_ , 3, "foo"); + // *//* */ test("Mix___eFooX_fwBarYIf", new Mix___eFooX_fwBarYIf , 3, "bar"); + // */abstract test("Mix___eFooXI_ ", new Mix___eFooXI_ , 2, null ); + // */abstract test("Mix___eFooXI_wBar___", new Mix___eFooXI_wBar___ , 3, null ); + /* *//* */ test("Mix___eFooXI_wBar__f", new Mix___eFooXI_wBar__f , 3, "bar"); + // */abstract test("Mix___eFooXI_wBar_I_", new Mix___eFooXI_wBar_I_ , 3, null ); + // *//* */ test("Mix___eFooXI_wBar_If", new Mix___eFooXI_wBar_If , 3, "bar"); + // */abstract test("Mix___eFooXI_wBarY__", new Mix___eFooXI_wBarY__ , 3, null ); + /* *//* */ test("Mix___eFooXI_wBarY_f", new Mix___eFooXI_wBarY_f , 3, "bar"); + // */abstract test("Mix___eFooXI_wBarYI_", new Mix___eFooXI_wBarYI_ , 3, null ); + // *//* */ test("Mix___eFooXI_wBarYIf", new Mix___eFooXI_wBarYIf , 3, "bar"); + /* *//* */ test("Mix___eFooXIf ", new Mix___eFooXIf , 2, "foo"); + /* *//* */ test("Mix___eFooXIfwBar___", new Mix___eFooXIfwBar___ , 3, "foo"); + // *//* */ test("Mix___eFooXIfwBar__f", new Mix___eFooXIfwBar__f , 3, "bar"); + // *//* */ test("Mix___eFooXIfwBar_I_", new Mix___eFooXIfwBar_I_ , 3, "foo"); + // *//* */ test("Mix___eFooXIfwBar_If", new Mix___eFooXIfwBar_If , 3, "bar"); + /* *//* */ test("Mix___eFooXIfwBarY__", new Mix___eFooXIfwBarY__ , 3, "foo"); + // *//* */ test("Mix___eFooXIfwBarY_f", new Mix___eFooXIfwBarY_f , 3, "bar"); + // *//* */ test("Mix___eFooXIfwBarYI_", new Mix___eFooXIfwBarYI_ , 3, "foo"); + // *//* */ test("Mix___eFooXIfwBarYIf", new Mix___eFooXIfwBarYIf , 3, "bar"); + + // */abstract test("Mix__feFoo___ ", new Mix__feFoo___ , 2, "mix"); + // */abstract test("Mix__feFoo___wBar___", new Mix__feFoo___wBar___ , 3, "mix"); + // */abstract test("Mix__feFoo___wBar__f", new Mix__feFoo___wBar__f , 3, "mix"); + /* *//* */ test("Mix__feFoo___wBar_I_", new Mix__feFoo___wBar_I_ , 3, "mix"); + /* *//* */ test("Mix__feFoo___wBar_If", new Mix__feFoo___wBar_If , 3, "mix"); + // */abstract test("Mix__feFoo___wBarY__", new Mix__feFoo___wBarY__ , 3, "mix"); + // */abstract test("Mix__feFoo___wBarY_f", new Mix__feFoo___wBarY_f , 3, "mix"); + /* *//* */ test("Mix__feFoo___wBarYI_", new Mix__feFoo___wBarYI_ , 3, "mix"); + /* *//* */ test("Mix__feFoo___wBarYIf", new Mix__feFoo___wBarYIf , 3, "mix"); + // */abstract test("Mix__feFoo__f ", new Mix__feFoo__f , 2, "mix"); + // */abstract test("Mix__feFoo__fwBar___", new Mix__feFoo__fwBar___ , 3, "mix"); + // */abstract test("Mix__feFoo__fwBar__f", new Mix__feFoo__fwBar__f , 3, "mix"); + /* *//* */ test("Mix__feFoo__fwBar_I_", new Mix__feFoo__fwBar_I_ , 3, "mix"); + /* *//* */ test("Mix__feFoo__fwBar_If", new Mix__feFoo__fwBar_If , 3, "mix"); + // */abstract test("Mix__feFoo__fwBarY__", new Mix__feFoo__fwBarY__ , 3, "mix"); + // */abstract test("Mix__feFoo__fwBarY_f", new Mix__feFoo__fwBarY_f , 3, "mix"); + /* *//* */ test("Mix__feFoo__fwBarYI_", new Mix__feFoo__fwBarYI_ , 3, "mix"); + /* *//* */ test("Mix__feFoo__fwBarYIf", new Mix__feFoo__fwBarYIf , 3, "mix"); + /* *//* */ test("Mix__feFoo_I_ ", new Mix__feFoo_I_ , 2, "mix"); + /* *//* */ test("Mix__feFoo_I_wBar___", new Mix__feFoo_I_wBar___ , 3, "mix"); + /* *//* */ test("Mix__feFoo_I_wBar__f", new Mix__feFoo_I_wBar__f , 3, "mix"); + // *//* */ test("Mix__feFoo_I_wBar_I_", new Mix__feFoo_I_wBar_I_ , 3, "mix"); + // *//* */ test("Mix__feFoo_I_wBar_If", new Mix__feFoo_I_wBar_If , 3, "mix"); + /* *//* */ test("Mix__feFoo_I_wBarY__", new Mix__feFoo_I_wBarY__ , 3, "mix"); + /* *//* */ test("Mix__feFoo_I_wBarY_f", new Mix__feFoo_I_wBarY_f , 3, "mix"); + // *//* */ test("Mix__feFoo_I_wBarYI_", new Mix__feFoo_I_wBarYI_ , 3, "mix"); + // *//* */ test("Mix__feFoo_I_wBarYIf", new Mix__feFoo_I_wBarYIf , 3, "mix"); + /* *//* */ test("Mix__feFoo_If ", new Mix__feFoo_If , 2, "mix"); + /* *//* */ test("Mix__feFoo_IfwBar___", new Mix__feFoo_IfwBar___ , 3, "mix"); + /* *//* */ test("Mix__feFoo_IfwBar__f", new Mix__feFoo_IfwBar__f , 3, "mix"); + // *//* */ test("Mix__feFoo_IfwBar_I_", new Mix__feFoo_IfwBar_I_ , 3, "mix"); + // *//* */ test("Mix__feFoo_IfwBar_If", new Mix__feFoo_IfwBar_If , 3, "mix"); + /* *//* */ test("Mix__feFoo_IfwBarY__", new Mix__feFoo_IfwBarY__ , 3, "mix"); + /* *//* */ test("Mix__feFoo_IfwBarY_f", new Mix__feFoo_IfwBarY_f , 3, "mix"); + // *//* */ test("Mix__feFoo_IfwBarYI_", new Mix__feFoo_IfwBarYI_ , 3, "mix"); + // *//* */ test("Mix__feFoo_IfwBarYIf", new Mix__feFoo_IfwBarYIf , 3, "mix"); + // */abstract test("Mix__feFooX__ ", new Mix__feFooX__ , 2, "mix"); + // */abstract test("Mix__feFooX__wBar___", new Mix__feFooX__wBar___ , 3, "mix"); + // */abstract test("Mix__feFooX__wBar__f", new Mix__feFooX__wBar__f , 3, "mix"); + /* *//* */ test("Mix__feFooX__wBar_I_", new Mix__feFooX__wBar_I_ , 3, "mix"); + /* *//* */ test("Mix__feFooX__wBar_If", new Mix__feFooX__wBar_If , 3, "mix"); + // */abstract test("Mix__feFooX__wBarY__", new Mix__feFooX__wBarY__ , 3, "mix"); + // */abstract test("Mix__feFooX__wBarY_f", new Mix__feFooX__wBarY_f , 3, "mix"); + /* *//* */ test("Mix__feFooX__wBarYI_", new Mix__feFooX__wBarYI_ , 3, "mix"); + /* *//* */ test("Mix__feFooX__wBarYIf", new Mix__feFooX__wBarYIf , 3, "mix"); + // */abstract test("Mix__feFooX_f ", new Mix__feFooX_f , 2, "mix"); + // */abstract test("Mix__feFooX_fwBar___", new Mix__feFooX_fwBar___ , 3, "mix"); + // */abstract test("Mix__feFooX_fwBar__f", new Mix__feFooX_fwBar__f , 3, "mix"); + /* *//* */ test("Mix__feFooX_fwBar_I_", new Mix__feFooX_fwBar_I_ , 3, "mix"); + /* *//* */ test("Mix__feFooX_fwBar_If", new Mix__feFooX_fwBar_If , 3, "mix"); + // */abstract test("Mix__feFooX_fwBarY__", new Mix__feFooX_fwBarY__ , 3, "mix"); + // */abstract test("Mix__feFooX_fwBarY_f", new Mix__feFooX_fwBarY_f , 3, "mix"); + /* *//* */ test("Mix__feFooX_fwBarYI_", new Mix__feFooX_fwBarYI_ , 3, "mix"); + /* *//* */ test("Mix__feFooX_fwBarYIf", new Mix__feFooX_fwBarYIf , 3, "mix"); + /* *//* */ test("Mix__feFooXI_ ", new Mix__feFooXI_ , 2, "mix"); + /* *//* */ test("Mix__feFooXI_wBar___", new Mix__feFooXI_wBar___ , 3, "mix"); + /* *//* */ test("Mix__feFooXI_wBar__f", new Mix__feFooXI_wBar__f , 3, "mix"); + // *//* */ test("Mix__feFooXI_wBar_I_", new Mix__feFooXI_wBar_I_ , 3, "mix"); + // *//* */ test("Mix__feFooXI_wBar_If", new Mix__feFooXI_wBar_If , 3, "mix"); + /* *//* */ test("Mix__feFooXI_wBarY__", new Mix__feFooXI_wBarY__ , 3, "mix"); + /* *//* */ test("Mix__feFooXI_wBarY_f", new Mix__feFooXI_wBarY_f , 3, "mix"); + // *//* */ test("Mix__feFooXI_wBarYI_", new Mix__feFooXI_wBarYI_ , 3, "mix"); + // *//* */ test("Mix__feFooXI_wBarYIf", new Mix__feFooXI_wBarYIf , 3, "mix"); + /* *//* */ test("Mix__feFooXIf ", new Mix__feFooXIf , 2, "mix"); + /* *//* */ test("Mix__feFooXIfwBar___", new Mix__feFooXIfwBar___ , 3, "mix"); + /* *//* */ test("Mix__feFooXIfwBar__f", new Mix__feFooXIfwBar__f , 3, "mix"); + // *//* */ test("Mix__feFooXIfwBar_I_", new Mix__feFooXIfwBar_I_ , 3, "mix"); + // *//* */ test("Mix__feFooXIfwBar_If", new Mix__feFooXIfwBar_If , 3, "mix"); + /* *//* */ test("Mix__feFooXIfwBarY__", new Mix__feFooXIfwBarY__ , 3, "mix"); + /* *//* */ test("Mix__feFooXIfwBarY_f", new Mix__feFooXIfwBarY_f , 3, "mix"); + // *//* */ test("Mix__feFooXIfwBarYI_", new Mix__feFooXIfwBarYI_ , 3, "mix"); + // *//* */ test("Mix__feFooXIfwBarYIf", new Mix__feFooXIfwBarYIf , 3, "mix"); + + // */abstract test("Mix_I_eFoo___ ", new Mix_I_eFoo___ , 2, null ); + // */abstract test("Mix_I_eFoo___wBar___", new Mix_I_eFoo___wBar___ , 3, null ); + /* *//* */ test("Mix_I_eFoo___wBar__f", new Mix_I_eFoo___wBar__f , 3, "bar"); + // */abstract test("Mix_I_eFoo___wBar_I_", new Mix_I_eFoo___wBar_I_ , 3, null ); + // *//* */ test("Mix_I_eFoo___wBar_If", new Mix_I_eFoo___wBar_If , 3, "bar"); + // */abstract test("Mix_I_eFoo___wBarY__", new Mix_I_eFoo___wBarY__ , 3, null ); + /* *//* */ test("Mix_I_eFoo___wBarY_f", new Mix_I_eFoo___wBarY_f , 3, "bar"); + // */abstract test("Mix_I_eFoo___wBarYI_", new Mix_I_eFoo___wBarYI_ , 3, null ); + // *//* */ test("Mix_I_eFoo___wBarYIf", new Mix_I_eFoo___wBarYIf , 3, "bar"); + /* *//* */ test("Mix_I_eFoo__f ", new Mix_I_eFoo__f , 2, "foo"); + /* *//* */ test("Mix_I_eFoo__fwBar___", new Mix_I_eFoo__fwBar___ , 3, "foo"); + // *//* */ test("Mix_I_eFoo__fwBar__f", new Mix_I_eFoo__fwBar__f , 3, "bar"); + // *//* */ test("Mix_I_eFoo__fwBar_I_", new Mix_I_eFoo__fwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_eFoo__fwBar_If", new Mix_I_eFoo__fwBar_If , 3, "bar"); + /* *//* */ test("Mix_I_eFoo__fwBarY__", new Mix_I_eFoo__fwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_eFoo__fwBarY_f", new Mix_I_eFoo__fwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_eFoo__fwBarYI_", new Mix_I_eFoo__fwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_eFoo__fwBarYIf", new Mix_I_eFoo__fwBarYIf , 3, "bar"); + // */abstract test("Mix_I_eFoo_I_ ", new Mix_I_eFoo_I_ , 2, null ); + // */abstract test("Mix_I_eFoo_I_wBar___", new Mix_I_eFoo_I_wBar___ , 3, null ); + // *//* */ test("Mix_I_eFoo_I_wBar__f", new Mix_I_eFoo_I_wBar__f , 3, "bar"); + // */abstract test("Mix_I_eFoo_I_wBar_I_", new Mix_I_eFoo_I_wBar_I_ , 3, null ); + // *//* */ test("Mix_I_eFoo_I_wBar_If", new Mix_I_eFoo_I_wBar_If , 3, "bar"); + // */abstract test("Mix_I_eFoo_I_wBarY__", new Mix_I_eFoo_I_wBarY__ , 3, null ); + // *//* */ test("Mix_I_eFoo_I_wBarY_f", new Mix_I_eFoo_I_wBarY_f , 3, "bar"); + // */abstract test("Mix_I_eFoo_I_wBarYI_", new Mix_I_eFoo_I_wBarYI_ , 3, null ); + // *//* */ test("Mix_I_eFoo_I_wBarYIf", new Mix_I_eFoo_I_wBarYIf , 3, "bar"); + // *//* */ test("Mix_I_eFoo_If ", new Mix_I_eFoo_If , 2, "foo"); + // *//* */ test("Mix_I_eFoo_IfwBar___", new Mix_I_eFoo_IfwBar___ , 3, "foo"); + // *//* */ test("Mix_I_eFoo_IfwBar__f", new Mix_I_eFoo_IfwBar__f , 3, "bar"); + // *//* */ test("Mix_I_eFoo_IfwBar_I_", new Mix_I_eFoo_IfwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_eFoo_IfwBar_If", new Mix_I_eFoo_IfwBar_If , 3, "bar"); + // *//* */ test("Mix_I_eFoo_IfwBarY__", new Mix_I_eFoo_IfwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_eFoo_IfwBarY_f", new Mix_I_eFoo_IfwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_eFoo_IfwBarYI_", new Mix_I_eFoo_IfwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_eFoo_IfwBarYIf", new Mix_I_eFoo_IfwBarYIf , 3, "bar"); + // */abstract test("Mix_I_eFooX__ ", new Mix_I_eFooX__ , 2, null ); + // */abstract test("Mix_I_eFooX__wBar___", new Mix_I_eFooX__wBar___ , 3, null ); + /* *//* */ test("Mix_I_eFooX__wBar__f", new Mix_I_eFooX__wBar__f , 3, "bar"); + // */abstract test("Mix_I_eFooX__wBar_I_", new Mix_I_eFooX__wBar_I_ , 3, null ); + // *//* */ test("Mix_I_eFooX__wBar_If", new Mix_I_eFooX__wBar_If , 3, "bar"); + // */abstract test("Mix_I_eFooX__wBarY__", new Mix_I_eFooX__wBarY__ , 3, null ); + /* *//* */ test("Mix_I_eFooX__wBarY_f", new Mix_I_eFooX__wBarY_f , 3, "bar"); + // */abstract test("Mix_I_eFooX__wBarYI_", new Mix_I_eFooX__wBarYI_ , 3, null ); + // *//* */ test("Mix_I_eFooX__wBarYIf", new Mix_I_eFooX__wBarYIf , 3, "bar"); + /* *//* */ test("Mix_I_eFooX_f ", new Mix_I_eFooX_f , 2, "foo"); + /* *//* */ test("Mix_I_eFooX_fwBar___", new Mix_I_eFooX_fwBar___ , 3, "foo"); + // *//* */ test("Mix_I_eFooX_fwBar__f", new Mix_I_eFooX_fwBar__f , 3, "bar"); + // *//* */ test("Mix_I_eFooX_fwBar_I_", new Mix_I_eFooX_fwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_eFooX_fwBar_If", new Mix_I_eFooX_fwBar_If , 3, "bar"); + /* *//* */ test("Mix_I_eFooX_fwBarY__", new Mix_I_eFooX_fwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_eFooX_fwBarY_f", new Mix_I_eFooX_fwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_eFooX_fwBarYI_", new Mix_I_eFooX_fwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_eFooX_fwBarYIf", new Mix_I_eFooX_fwBarYIf , 3, "bar"); + // */abstract test("Mix_I_eFooXI_ ", new Mix_I_eFooXI_ , 2, null ); + // */abstract test("Mix_I_eFooXI_wBar___", new Mix_I_eFooXI_wBar___ , 3, null ); + // *//* */ test("Mix_I_eFooXI_wBar__f", new Mix_I_eFooXI_wBar__f , 3, "bar"); + // */abstract test("Mix_I_eFooXI_wBar_I_", new Mix_I_eFooXI_wBar_I_ , 3, null ); + // *//* */ test("Mix_I_eFooXI_wBar_If", new Mix_I_eFooXI_wBar_If , 3, "bar"); + // */abstract test("Mix_I_eFooXI_wBarY__", new Mix_I_eFooXI_wBarY__ , 3, null ); + // *//* */ test("Mix_I_eFooXI_wBarY_f", new Mix_I_eFooXI_wBarY_f , 3, "bar"); + // */abstract test("Mix_I_eFooXI_wBarYI_", new Mix_I_eFooXI_wBarYI_ , 3, null ); + // *//* */ test("Mix_I_eFooXI_wBarYIf", new Mix_I_eFooXI_wBarYIf , 3, "bar"); + // *//* */ test("Mix_I_eFooXIf ", new Mix_I_eFooXIf , 2, "foo"); + // *//* */ test("Mix_I_eFooXIfwBar___", new Mix_I_eFooXIfwBar___ , 3, "foo"); + // *//* */ test("Mix_I_eFooXIfwBar__f", new Mix_I_eFooXIfwBar__f , 3, "bar"); + // *//* */ test("Mix_I_eFooXIfwBar_I_", new Mix_I_eFooXIfwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_eFooXIfwBar_If", new Mix_I_eFooXIfwBar_If , 3, "bar"); + // *//* */ test("Mix_I_eFooXIfwBarY__", new Mix_I_eFooXIfwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_eFooXIfwBarY_f", new Mix_I_eFooXIfwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_eFooXIfwBarYI_", new Mix_I_eFooXIfwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_eFooXIfwBarYIf", new Mix_I_eFooXIfwBarYIf , 3, "bar"); + + /* *//* */ test("Mix_IfeFoo___ ", new Mix_IfeFoo___ , 2, "mix"); + /* *//* */ test("Mix_IfeFoo___wBar___", new Mix_IfeFoo___wBar___ , 3, "mix"); + /* *//* */ test("Mix_IfeFoo___wBar__f", new Mix_IfeFoo___wBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFoo___wBar_I_", new Mix_IfeFoo___wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo___wBar_If", new Mix_IfeFoo___wBar_If , 3, "mix"); + /* *//* */ test("Mix_IfeFoo___wBarY__", new Mix_IfeFoo___wBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfeFoo___wBarY_f", new Mix_IfeFoo___wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFoo___wBarYI_", new Mix_IfeFoo___wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo___wBarYIf", new Mix_IfeFoo___wBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfeFoo__f ", new Mix_IfeFoo__f , 2, "mix"); + /* *//* */ test("Mix_IfeFoo__fwBar___", new Mix_IfeFoo__fwBar___ , 3, "mix"); + /* *//* */ test("Mix_IfeFoo__fwBar__f", new Mix_IfeFoo__fwBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFoo__fwBar_I_", new Mix_IfeFoo__fwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo__fwBar_If", new Mix_IfeFoo__fwBar_If , 3, "mix"); + /* *//* */ test("Mix_IfeFoo__fwBarY__", new Mix_IfeFoo__fwBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfeFoo__fwBarY_f", new Mix_IfeFoo__fwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFoo__fwBarYI_", new Mix_IfeFoo__fwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo__fwBarYIf", new Mix_IfeFoo__fwBarYIf , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_ ", new Mix_IfeFoo_I_ , 2, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBar___", new Mix_IfeFoo_I_wBar___ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBar__f", new Mix_IfeFoo_I_wBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBar_I_", new Mix_IfeFoo_I_wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBar_If", new Mix_IfeFoo_I_wBar_If , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBarY__", new Mix_IfeFoo_I_wBarY__ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBarY_f", new Mix_IfeFoo_I_wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBarYI_", new Mix_IfeFoo_I_wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_I_wBarYIf", new Mix_IfeFoo_I_wBarYIf , 3, "mix"); + // *//* */ test("Mix_IfeFoo_If ", new Mix_IfeFoo_If , 2, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBar___", new Mix_IfeFoo_IfwBar___ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBar__f", new Mix_IfeFoo_IfwBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBar_I_", new Mix_IfeFoo_IfwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBar_If", new Mix_IfeFoo_IfwBar_If , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBarY__", new Mix_IfeFoo_IfwBarY__ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBarY_f", new Mix_IfeFoo_IfwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBarYI_", new Mix_IfeFoo_IfwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFoo_IfwBarYIf", new Mix_IfeFoo_IfwBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfeFooX__ ", new Mix_IfeFooX__ , 2, "mix"); + /* *//* */ test("Mix_IfeFooX__wBar___", new Mix_IfeFooX__wBar___ , 3, "mix"); + /* *//* */ test("Mix_IfeFooX__wBar__f", new Mix_IfeFooX__wBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFooX__wBar_I_", new Mix_IfeFooX__wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFooX__wBar_If", new Mix_IfeFooX__wBar_If , 3, "mix"); + /* *//* */ test("Mix_IfeFooX__wBarY__", new Mix_IfeFooX__wBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfeFooX__wBarY_f", new Mix_IfeFooX__wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFooX__wBarYI_", new Mix_IfeFooX__wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFooX__wBarYIf", new Mix_IfeFooX__wBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfeFooX_f ", new Mix_IfeFooX_f , 2, "mix"); + /* *//* */ test("Mix_IfeFooX_fwBar___", new Mix_IfeFooX_fwBar___ , 3, "mix"); + /* *//* */ test("Mix_IfeFooX_fwBar__f", new Mix_IfeFooX_fwBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFooX_fwBar_I_", new Mix_IfeFooX_fwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFooX_fwBar_If", new Mix_IfeFooX_fwBar_If , 3, "mix"); + /* *//* */ test("Mix_IfeFooX_fwBarY__", new Mix_IfeFooX_fwBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfeFooX_fwBarY_f", new Mix_IfeFooX_fwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFooX_fwBarYI_", new Mix_IfeFooX_fwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFooX_fwBarYIf", new Mix_IfeFooX_fwBarYIf , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_ ", new Mix_IfeFooXI_ , 2, "mix"); + // *//* */ test("Mix_IfeFooXI_wBar___", new Mix_IfeFooXI_wBar___ , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBar__f", new Mix_IfeFooXI_wBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBar_I_", new Mix_IfeFooXI_wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBar_If", new Mix_IfeFooXI_wBar_If , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBarY__", new Mix_IfeFooXI_wBarY__ , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBarY_f", new Mix_IfeFooXI_wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBarYI_", new Mix_IfeFooXI_wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFooXI_wBarYIf", new Mix_IfeFooXI_wBarYIf , 3, "mix"); + // *//* */ test("Mix_IfeFooXIf ", new Mix_IfeFooXIf , 2, "mix"); + // *//* */ test("Mix_IfeFooXIfwBar___", new Mix_IfeFooXIfwBar___ , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBar__f", new Mix_IfeFooXIfwBar__f , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBar_I_", new Mix_IfeFooXIfwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBar_If", new Mix_IfeFooXIfwBar_If , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBarY__", new Mix_IfeFooXIfwBarY__ , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBarY_f", new Mix_IfeFooXIfwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBarYI_", new Mix_IfeFooXIfwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfeFooXIfwBarYIf", new Mix_IfeFooXIfwBarYIf , 3, "mix"); + + // */abstract test("MixZ__eFoo___ ", new MixZ__eFoo___ [C], 2, null ); + // */abstract test("MixZ__eFoo___wBar___", new MixZ__eFoo___wBar___[C], 3, null ); + // */abstract test("MixZ__eFoo___wBar__f", new MixZ__eFoo___wBar__f[C], 3, "bar"); + // */abstract test("MixZ__eFoo___wBar_I_", new MixZ__eFoo___wBar_I_[C], 3, null ); + /* *//* */ test("MixZ__eFoo___wBar_If", new MixZ__eFoo___wBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFoo___wBarY__", new MixZ__eFoo___wBarY__[C], 3, null ); + // */abstract test("MixZ__eFoo___wBarY_f", new MixZ__eFoo___wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__eFoo___wBarYI_", new MixZ__eFoo___wBarYI_[C], 3, null ); + /* *//* */ test("MixZ__eFoo___wBarYIf", new MixZ__eFoo___wBarYIf[C], 3, "bar"); + // */abstract test("MixZ__eFoo__f ", new MixZ__eFoo__f [C], 2, "foo"); + // */abstract test("MixZ__eFoo__fwBar___", new MixZ__eFoo__fwBar___[C], 3, "foo"); + // */abstract test("MixZ__eFoo__fwBar__f", new MixZ__eFoo__fwBar__f[C], 3, "bar"); + /* *//* */ test("MixZ__eFoo__fwBar_I_", new MixZ__eFoo__fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__eFoo__fwBar_If", new MixZ__eFoo__fwBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFoo__fwBarY__", new MixZ__eFoo__fwBarY__[C], 3, "foo"); + // */abstract test("MixZ__eFoo__fwBarY_f", new MixZ__eFoo__fwBarY_f[C], 3, "bar"); + /* *//* */ test("MixZ__eFoo__fwBarYI_", new MixZ__eFoo__fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__eFoo__fwBarYIf", new MixZ__eFoo__fwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__eFoo_I_ ", new MixZ__eFoo_I_ [C], 2, null ); + // */abstract test("MixZ__eFoo_I_wBar___", new MixZ__eFoo_I_wBar___[C], 3, null ); + /* *//* */ test("MixZ__eFoo_I_wBar__f", new MixZ__eFoo_I_wBar__f[C], 3, "bar"); + // */abstract test("MixZ__eFoo_I_wBar_I_", new MixZ__eFoo_I_wBar_I_[C], 3, null ); + // *//* */ test("MixZ__eFoo_I_wBar_If", new MixZ__eFoo_I_wBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFoo_I_wBarY__", new MixZ__eFoo_I_wBarY__[C], 3, null ); + /* *//* */ test("MixZ__eFoo_I_wBarY_f", new MixZ__eFoo_I_wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__eFoo_I_wBarYI_", new MixZ__eFoo_I_wBarYI_[C], 3, null ); + // *//* */ test("MixZ__eFoo_I_wBarYIf", new MixZ__eFoo_I_wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZ__eFoo_If ", new MixZ__eFoo_If [C], 2, "foo"); + /* *//* */ test("MixZ__eFoo_IfwBar___", new MixZ__eFoo_IfwBar___[C], 3, "foo"); + // *//* */ test("MixZ__eFoo_IfwBar__f", new MixZ__eFoo_IfwBar__f[C], 3, "bar"); + // *//* */ test("MixZ__eFoo_IfwBar_I_", new MixZ__eFoo_IfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__eFoo_IfwBar_If", new MixZ__eFoo_IfwBar_If[C], 3, "bar"); + /* *//* */ test("MixZ__eFoo_IfwBarY__", new MixZ__eFoo_IfwBarY__[C], 3, "foo"); + // *//* */ test("MixZ__eFoo_IfwBarY_f", new MixZ__eFoo_IfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZ__eFoo_IfwBarYI_", new MixZ__eFoo_IfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__eFoo_IfwBarYIf", new MixZ__eFoo_IfwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__eFooX__ ", new MixZ__eFooX__ [C], 2, null ); + // */abstract test("MixZ__eFooX__wBar___", new MixZ__eFooX__wBar___[C], 3, null ); + // */abstract test("MixZ__eFooX__wBar__f", new MixZ__eFooX__wBar__f[C], 3, "bar"); + // */abstract test("MixZ__eFooX__wBar_I_", new MixZ__eFooX__wBar_I_[C], 3, null ); + /* *//* */ test("MixZ__eFooX__wBar_If", new MixZ__eFooX__wBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFooX__wBarY__", new MixZ__eFooX__wBarY__[C], 3, null ); + // */abstract test("MixZ__eFooX__wBarY_f", new MixZ__eFooX__wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__eFooX__wBarYI_", new MixZ__eFooX__wBarYI_[C], 3, null ); + /* *//* */ test("MixZ__eFooX__wBarYIf", new MixZ__eFooX__wBarYIf[C], 3, "bar"); + // */abstract test("MixZ__eFooX_f ", new MixZ__eFooX_f [C], 2, "foo"); + // */abstract test("MixZ__eFooX_fwBar___", new MixZ__eFooX_fwBar___[C], 3, "foo"); + // */abstract test("MixZ__eFooX_fwBar__f", new MixZ__eFooX_fwBar__f[C], 3, "bar"); + /* *//* */ test("MixZ__eFooX_fwBar_I_", new MixZ__eFooX_fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__eFooX_fwBar_If", new MixZ__eFooX_fwBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFooX_fwBarY__", new MixZ__eFooX_fwBarY__[C], 3, "foo"); + // */abstract test("MixZ__eFooX_fwBarY_f", new MixZ__eFooX_fwBarY_f[C], 3, "bar"); + /* *//* */ test("MixZ__eFooX_fwBarYI_", new MixZ__eFooX_fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__eFooX_fwBarYIf", new MixZ__eFooX_fwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__eFooXI_ ", new MixZ__eFooXI_ [C], 2, null ); + // */abstract test("MixZ__eFooXI_wBar___", new MixZ__eFooXI_wBar___[C], 3, null ); + /* *//* */ test("MixZ__eFooXI_wBar__f", new MixZ__eFooXI_wBar__f[C], 3, "bar"); + // */abstract test("MixZ__eFooXI_wBar_I_", new MixZ__eFooXI_wBar_I_[C], 3, null ); + // *//* */ test("MixZ__eFooXI_wBar_If", new MixZ__eFooXI_wBar_If[C], 3, "bar"); + // */abstract test("MixZ__eFooXI_wBarY__", new MixZ__eFooXI_wBarY__[C], 3, null ); + /* *//* */ test("MixZ__eFooXI_wBarY_f", new MixZ__eFooXI_wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__eFooXI_wBarYI_", new MixZ__eFooXI_wBarYI_[C], 3, null ); + // *//* */ test("MixZ__eFooXI_wBarYIf", new MixZ__eFooXI_wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZ__eFooXIf ", new MixZ__eFooXIf [C], 2, "foo"); + /* *//* */ test("MixZ__eFooXIfwBar___", new MixZ__eFooXIfwBar___[C], 3, "foo"); + // *//* */ test("MixZ__eFooXIfwBar__f", new MixZ__eFooXIfwBar__f[C], 3, "bar"); + // *//* */ test("MixZ__eFooXIfwBar_I_", new MixZ__eFooXIfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__eFooXIfwBar_If", new MixZ__eFooXIfwBar_If[C], 3, "bar"); + /* *//* */ test("MixZ__eFooXIfwBarY__", new MixZ__eFooXIfwBarY__[C], 3, "foo"); + // *//* */ test("MixZ__eFooXIfwBarY_f", new MixZ__eFooXIfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZ__eFooXIfwBarYI_", new MixZ__eFooXIfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__eFooXIfwBarYIf", new MixZ__eFooXIfwBarYIf[C], 3, "bar"); + + // */abstract test("MixZ_feFoo___ ", new MixZ_feFoo___ [C], 2, "mix"); + // */abstract test("MixZ_feFoo___wBar___", new MixZ_feFoo___wBar___[C], 3, "mix"); + // */abstract test("MixZ_feFoo___wBar__f", new MixZ_feFoo___wBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo___wBar_I_", new MixZ_feFoo___wBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo___wBar_If", new MixZ_feFoo___wBar_If[C], 3, "mix"); + // */abstract test("MixZ_feFoo___wBarY__", new MixZ_feFoo___wBarY__[C], 3, "mix"); + // */abstract test("MixZ_feFoo___wBarY_f", new MixZ_feFoo___wBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo___wBarYI_", new MixZ_feFoo___wBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo___wBarYIf", new MixZ_feFoo___wBarYIf[C], 3, "mix"); + // */abstract test("MixZ_feFoo__f ", new MixZ_feFoo__f [C], 2, "mix"); + // */abstract test("MixZ_feFoo__fwBar___", new MixZ_feFoo__fwBar___[C], 3, "mix"); + // */abstract test("MixZ_feFoo__fwBar__f", new MixZ_feFoo__fwBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo__fwBar_I_", new MixZ_feFoo__fwBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo__fwBar_If", new MixZ_feFoo__fwBar_If[C], 3, "mix"); + // */abstract test("MixZ_feFoo__fwBarY__", new MixZ_feFoo__fwBarY__[C], 3, "mix"); + // */abstract test("MixZ_feFoo__fwBarY_f", new MixZ_feFoo__fwBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo__fwBarYI_", new MixZ_feFoo__fwBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo__fwBarYIf", new MixZ_feFoo__fwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_I_ ", new MixZ_feFoo_I_ [C], 2, "mix"); + /* *//* */ test("MixZ_feFoo_I_wBar___", new MixZ_feFoo_I_wBar___[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_I_wBar__f", new MixZ_feFoo_I_wBar__f[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_I_wBar_I_", new MixZ_feFoo_I_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_I_wBar_If", new MixZ_feFoo_I_wBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_I_wBarY__", new MixZ_feFoo_I_wBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_I_wBarY_f", new MixZ_feFoo_I_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_I_wBarYI_", new MixZ_feFoo_I_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_I_wBarYIf", new MixZ_feFoo_I_wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_If ", new MixZ_feFoo_If [C], 2, "mix"); + /* *//* */ test("MixZ_feFoo_IfwBar___", new MixZ_feFoo_IfwBar___[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_IfwBar__f", new MixZ_feFoo_IfwBar__f[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_IfwBar_I_", new MixZ_feFoo_IfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_IfwBar_If", new MixZ_feFoo_IfwBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_IfwBarY__", new MixZ_feFoo_IfwBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_feFoo_IfwBarY_f", new MixZ_feFoo_IfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_IfwBarYI_", new MixZ_feFoo_IfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_feFoo_IfwBarYIf", new MixZ_feFoo_IfwBarYIf[C], 3, "mix"); + // */abstract test("MixZ_feFooX__ ", new MixZ_feFooX__ [C], 2, "mix"); + // */abstract test("MixZ_feFooX__wBar___", new MixZ_feFooX__wBar___[C], 3, "mix"); + // */abstract test("MixZ_feFooX__wBar__f", new MixZ_feFooX__wBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX__wBar_I_", new MixZ_feFooX__wBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX__wBar_If", new MixZ_feFooX__wBar_If[C], 3, "mix"); + // */abstract test("MixZ_feFooX__wBarY__", new MixZ_feFooX__wBarY__[C], 3, "mix"); + // */abstract test("MixZ_feFooX__wBarY_f", new MixZ_feFooX__wBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX__wBarYI_", new MixZ_feFooX__wBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX__wBarYIf", new MixZ_feFooX__wBarYIf[C], 3, "mix"); + // */abstract test("MixZ_feFooX_f ", new MixZ_feFooX_f [C], 2, "mix"); + // */abstract test("MixZ_feFooX_fwBar___", new MixZ_feFooX_fwBar___[C], 3, "mix"); + // */abstract test("MixZ_feFooX_fwBar__f", new MixZ_feFooX_fwBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX_fwBar_I_", new MixZ_feFooX_fwBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX_fwBar_If", new MixZ_feFooX_fwBar_If[C], 3, "mix"); + // */abstract test("MixZ_feFooX_fwBarY__", new MixZ_feFooX_fwBarY__[C], 3, "mix"); + // */abstract test("MixZ_feFooX_fwBarY_f", new MixZ_feFooX_fwBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX_fwBarYI_", new MixZ_feFooX_fwBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_feFooX_fwBarYIf", new MixZ_feFooX_fwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXI_ ", new MixZ_feFooXI_ [C], 2, "mix"); + /* *//* */ test("MixZ_feFooXI_wBar___", new MixZ_feFooXI_wBar___[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXI_wBar__f", new MixZ_feFooXI_wBar__f[C], 3, "mix"); + // *//* */ test("MixZ_feFooXI_wBar_I_", new MixZ_feFooXI_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_feFooXI_wBar_If", new MixZ_feFooXI_wBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXI_wBarY__", new MixZ_feFooXI_wBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXI_wBarY_f", new MixZ_feFooXI_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_feFooXI_wBarYI_", new MixZ_feFooXI_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_feFooXI_wBarYIf", new MixZ_feFooXI_wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXIf ", new MixZ_feFooXIf [C], 2, "mix"); + /* *//* */ test("MixZ_feFooXIfwBar___", new MixZ_feFooXIfwBar___[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXIfwBar__f", new MixZ_feFooXIfwBar__f[C], 3, "mix"); + // *//* */ test("MixZ_feFooXIfwBar_I_", new MixZ_feFooXIfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_feFooXIfwBar_If", new MixZ_feFooXIfwBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXIfwBarY__", new MixZ_feFooXIfwBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_feFooXIfwBarY_f", new MixZ_feFooXIfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_feFooXIfwBarYI_", new MixZ_feFooXIfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_feFooXIfwBarYIf", new MixZ_feFooXIfwBarYIf[C], 3, "mix"); + + // */abstract test("MixZI_eFoo___ ", new MixZI_eFoo___ [C], 2, null ); + // */abstract test("MixZI_eFoo___wBar___", new MixZI_eFoo___wBar___[C], 3, null ); + /* *//* */ test("MixZI_eFoo___wBar__f", new MixZI_eFoo___wBar__f[C], 3, "bar"); + // */abstract test("MixZI_eFoo___wBar_I_", new MixZI_eFoo___wBar_I_[C], 3, null ); + // *//* */ test("MixZI_eFoo___wBar_If", new MixZI_eFoo___wBar_If[C], 3, "bar"); + // */abstract test("MixZI_eFoo___wBarY__", new MixZI_eFoo___wBarY__[C], 3, null ); + /* *//* */ test("MixZI_eFoo___wBarY_f", new MixZI_eFoo___wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_eFoo___wBarYI_", new MixZI_eFoo___wBarYI_[C], 3, null ); + // *//* */ test("MixZI_eFoo___wBarYIf", new MixZI_eFoo___wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZI_eFoo__f ", new MixZI_eFoo__f [C], 2, "foo"); + /* *//* */ test("MixZI_eFoo__fwBar___", new MixZI_eFoo__fwBar___[C], 3, "foo"); + // *//* */ test("MixZI_eFoo__fwBar__f", new MixZI_eFoo__fwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_eFoo__fwBar_I_", new MixZI_eFoo__fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_eFoo__fwBar_If", new MixZI_eFoo__fwBar_If[C], 3, "bar"); + /* *//* */ test("MixZI_eFoo__fwBarY__", new MixZI_eFoo__fwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_eFoo__fwBarY_f", new MixZI_eFoo__fwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_eFoo__fwBarYI_", new MixZI_eFoo__fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_eFoo__fwBarYIf", new MixZI_eFoo__fwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_eFoo_I_ ", new MixZI_eFoo_I_ [C], 2, null ); + // */abstract test("MixZI_eFoo_I_wBar___", new MixZI_eFoo_I_wBar___[C], 3, null ); + // *//* */ test("MixZI_eFoo_I_wBar__f", new MixZI_eFoo_I_wBar__f[C], 3, "bar"); + // */abstract test("MixZI_eFoo_I_wBar_I_", new MixZI_eFoo_I_wBar_I_[C], 3, null ); + // *//* */ test("MixZI_eFoo_I_wBar_If", new MixZI_eFoo_I_wBar_If[C], 3, "bar"); + // */abstract test("MixZI_eFoo_I_wBarY__", new MixZI_eFoo_I_wBarY__[C], 3, null ); + // *//* */ test("MixZI_eFoo_I_wBarY_f", new MixZI_eFoo_I_wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_eFoo_I_wBarYI_", new MixZI_eFoo_I_wBarYI_[C], 3, null ); + // *//* */ test("MixZI_eFoo_I_wBarYIf", new MixZI_eFoo_I_wBarYIf[C], 3, "bar"); + // *//* */ test("MixZI_eFoo_If ", new MixZI_eFoo_If [C], 2, "foo"); + // *//* */ test("MixZI_eFoo_IfwBar___", new MixZI_eFoo_IfwBar___[C], 3, "foo"); + // *//* */ test("MixZI_eFoo_IfwBar__f", new MixZI_eFoo_IfwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_eFoo_IfwBar_I_", new MixZI_eFoo_IfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_eFoo_IfwBar_If", new MixZI_eFoo_IfwBar_If[C], 3, "bar"); + // *//* */ test("MixZI_eFoo_IfwBarY__", new MixZI_eFoo_IfwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_eFoo_IfwBarY_f", new MixZI_eFoo_IfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_eFoo_IfwBarYI_", new MixZI_eFoo_IfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_eFoo_IfwBarYIf", new MixZI_eFoo_IfwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_eFooX__ ", new MixZI_eFooX__ [C], 2, null ); + // */abstract test("MixZI_eFooX__wBar___", new MixZI_eFooX__wBar___[C], 3, null ); + /* *//* */ test("MixZI_eFooX__wBar__f", new MixZI_eFooX__wBar__f[C], 3, "bar"); + // */abstract test("MixZI_eFooX__wBar_I_", new MixZI_eFooX__wBar_I_[C], 3, null ); + // *//* */ test("MixZI_eFooX__wBar_If", new MixZI_eFooX__wBar_If[C], 3, "bar"); + // */abstract test("MixZI_eFooX__wBarY__", new MixZI_eFooX__wBarY__[C], 3, null ); + /* *//* */ test("MixZI_eFooX__wBarY_f", new MixZI_eFooX__wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_eFooX__wBarYI_", new MixZI_eFooX__wBarYI_[C], 3, null ); + // *//* */ test("MixZI_eFooX__wBarYIf", new MixZI_eFooX__wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZI_eFooX_f ", new MixZI_eFooX_f [C], 2, "foo"); + /* *//* */ test("MixZI_eFooX_fwBar___", new MixZI_eFooX_fwBar___[C], 3, "foo"); + // *//* */ test("MixZI_eFooX_fwBar__f", new MixZI_eFooX_fwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_eFooX_fwBar_I_", new MixZI_eFooX_fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_eFooX_fwBar_If", new MixZI_eFooX_fwBar_If[C], 3, "bar"); + /* *//* */ test("MixZI_eFooX_fwBarY__", new MixZI_eFooX_fwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_eFooX_fwBarY_f", new MixZI_eFooX_fwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_eFooX_fwBarYI_", new MixZI_eFooX_fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_eFooX_fwBarYIf", new MixZI_eFooX_fwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_eFooXI_ ", new MixZI_eFooXI_ [C], 2, null ); + // */abstract test("MixZI_eFooXI_wBar___", new MixZI_eFooXI_wBar___[C], 3, null ); + // *//* */ test("MixZI_eFooXI_wBar__f", new MixZI_eFooXI_wBar__f[C], 3, "bar"); + // */abstract test("MixZI_eFooXI_wBar_I_", new MixZI_eFooXI_wBar_I_[C], 3, null ); + // *//* */ test("MixZI_eFooXI_wBar_If", new MixZI_eFooXI_wBar_If[C], 3, "bar"); + // */abstract test("MixZI_eFooXI_wBarY__", new MixZI_eFooXI_wBarY__[C], 3, null ); + // *//* */ test("MixZI_eFooXI_wBarY_f", new MixZI_eFooXI_wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_eFooXI_wBarYI_", new MixZI_eFooXI_wBarYI_[C], 3, null ); + // *//* */ test("MixZI_eFooXI_wBarYIf", new MixZI_eFooXI_wBarYIf[C], 3, "bar"); + // *//* */ test("MixZI_eFooXIf ", new MixZI_eFooXIf [C], 2, "foo"); + // *//* */ test("MixZI_eFooXIfwBar___", new MixZI_eFooXIfwBar___[C], 3, "foo"); + // *//* */ test("MixZI_eFooXIfwBar__f", new MixZI_eFooXIfwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_eFooXIfwBar_I_", new MixZI_eFooXIfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_eFooXIfwBar_If", new MixZI_eFooXIfwBar_If[C], 3, "bar"); + // *//* */ test("MixZI_eFooXIfwBarY__", new MixZI_eFooXIfwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_eFooXIfwBarY_f", new MixZI_eFooXIfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_eFooXIfwBarYI_", new MixZI_eFooXIfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_eFooXIfwBarYIf", new MixZI_eFooXIfwBarYIf[C], 3, "bar"); + + /* *//* */ test("MixZIfeFoo___ ", new MixZIfeFoo___ [C], 2, "mix"); + /* *//* */ test("MixZIfeFoo___wBar___", new MixZIfeFoo___wBar___[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo___wBar__f", new MixZIfeFoo___wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo___wBar_I_", new MixZIfeFoo___wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo___wBar_If", new MixZIfeFoo___wBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo___wBarY__", new MixZIfeFoo___wBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo___wBarY_f", new MixZIfeFoo___wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo___wBarYI_", new MixZIfeFoo___wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo___wBarYIf", new MixZIfeFoo___wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo__f ", new MixZIfeFoo__f [C], 2, "mix"); + /* *//* */ test("MixZIfeFoo__fwBar___", new MixZIfeFoo__fwBar___[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo__fwBar__f", new MixZIfeFoo__fwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo__fwBar_I_", new MixZIfeFoo__fwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo__fwBar_If", new MixZIfeFoo__fwBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo__fwBarY__", new MixZIfeFoo__fwBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfeFoo__fwBarY_f", new MixZIfeFoo__fwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo__fwBarYI_", new MixZIfeFoo__fwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo__fwBarYIf", new MixZIfeFoo__fwBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_ ", new MixZIfeFoo_I_ [C], 2, "mix"); + // *//* */ test("MixZIfeFoo_I_wBar___", new MixZIfeFoo_I_wBar___[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBar__f", new MixZIfeFoo_I_wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBar_I_", new MixZIfeFoo_I_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBar_If", new MixZIfeFoo_I_wBar_If[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBarY__", new MixZIfeFoo_I_wBarY__[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBarY_f", new MixZIfeFoo_I_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBarYI_", new MixZIfeFoo_I_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_I_wBarYIf", new MixZIfeFoo_I_wBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_If ", new MixZIfeFoo_If [C], 2, "mix"); + // *//* */ test("MixZIfeFoo_IfwBar___", new MixZIfeFoo_IfwBar___[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBar__f", new MixZIfeFoo_IfwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBar_I_", new MixZIfeFoo_IfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBar_If", new MixZIfeFoo_IfwBar_If[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBarY__", new MixZIfeFoo_IfwBarY__[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBarY_f", new MixZIfeFoo_IfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBarYI_", new MixZIfeFoo_IfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFoo_IfwBarYIf", new MixZIfeFoo_IfwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX__ ", new MixZIfeFooX__ [C], 2, "mix"); + /* *//* */ test("MixZIfeFooX__wBar___", new MixZIfeFooX__wBar___[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX__wBar__f", new MixZIfeFooX__wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFooX__wBar_I_", new MixZIfeFooX__wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFooX__wBar_If", new MixZIfeFooX__wBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX__wBarY__", new MixZIfeFooX__wBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX__wBarY_f", new MixZIfeFooX__wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFooX__wBarYI_", new MixZIfeFooX__wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFooX__wBarYIf", new MixZIfeFooX__wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX_f ", new MixZIfeFooX_f [C], 2, "mix"); + /* *//* */ test("MixZIfeFooX_fwBar___", new MixZIfeFooX_fwBar___[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX_fwBar__f", new MixZIfeFooX_fwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFooX_fwBar_I_", new MixZIfeFooX_fwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFooX_fwBar_If", new MixZIfeFooX_fwBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX_fwBarY__", new MixZIfeFooX_fwBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfeFooX_fwBarY_f", new MixZIfeFooX_fwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFooX_fwBarYI_", new MixZIfeFooX_fwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFooX_fwBarYIf", new MixZIfeFooX_fwBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_ ", new MixZIfeFooXI_ [C], 2, "mix"); + // *//* */ test("MixZIfeFooXI_wBar___", new MixZIfeFooXI_wBar___[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBar__f", new MixZIfeFooXI_wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBar_I_", new MixZIfeFooXI_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBar_If", new MixZIfeFooXI_wBar_If[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBarY__", new MixZIfeFooXI_wBarY__[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBarY_f", new MixZIfeFooXI_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBarYI_", new MixZIfeFooXI_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFooXI_wBarYIf", new MixZIfeFooXI_wBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIf ", new MixZIfeFooXIf [C], 2, "mix"); + // *//* */ test("MixZIfeFooXIfwBar___", new MixZIfeFooXIfwBar___[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBar__f", new MixZIfeFooXIfwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBar_I_", new MixZIfeFooXIfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBar_If", new MixZIfeFooXIfwBar_If[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBarY__", new MixZIfeFooXIfwBarY__[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBarY_f", new MixZIfeFooXIfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBarYI_", new MixZIfeFooXIfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfeFooXIfwBarYIf", new MixZIfeFooXIfwBarYIf[C], 3, "mix"); + + + + // */abstract test("Mix___wFoo___ ", new Mix___wFoo___ , 2, null ); + // */abstract test("Mix___wFoo___wBar___", new Mix___wFoo___wBar___ , 3, null ); + // */abstract test("Mix___wFoo___wBar__f", new Mix___wFoo___wBar__f , 3, "bar"); + // */abstract test("Mix___wFoo___wBar_I_", new Mix___wFoo___wBar_I_ , 3, null ); + /* *//* */ test("Mix___wFoo___wBar_If", new Mix___wFoo___wBar_If , 3, "bar"); + // */abstract test("Mix___wFoo___wBarY__", new Mix___wFoo___wBarY__ , 3, null ); + // */abstract test("Mix___wFoo___wBarY_f", new Mix___wFoo___wBarY_f , 3, "bar"); + // */abstract test("Mix___wFoo___wBarYI_", new Mix___wFoo___wBarYI_ , 3, null ); + /* *//* */ test("Mix___wFoo___wBarYIf", new Mix___wFoo___wBarYIf , 3, "bar"); + // */abstract test("Mix___wFoo__f ", new Mix___wFoo__f , 2, "foo"); + // */abstract test("Mix___wFoo__fwBar___", new Mix___wFoo__fwBar___ , 3, "foo"); + // */abstract test("Mix___wFoo__fwBar__f", new Mix___wFoo__fwBar__f , 3, "bar"); + /* *//* */ test("Mix___wFoo__fwBar_I_", new Mix___wFoo__fwBar_I_ , 3, "foo"); + // *//* */ test("Mix___wFoo__fwBar_If", new Mix___wFoo__fwBar_If , 3, "bar"); + // */abstract test("Mix___wFoo__fwBarY__", new Mix___wFoo__fwBarY__ , 3, "foo"); + // */abstract test("Mix___wFoo__fwBarY_f", new Mix___wFoo__fwBarY_f , 3, "bar"); + /* *//* */ test("Mix___wFoo__fwBarYI_", new Mix___wFoo__fwBarYI_ , 3, "foo"); + // *//* */ test("Mix___wFoo__fwBarYIf", new Mix___wFoo__fwBarYIf , 3, "bar"); + // */abstract test("Mix___wFoo_I_ ", new Mix___wFoo_I_ , 2, null ); + // */abstract test("Mix___wFoo_I_wBar___", new Mix___wFoo_I_wBar___ , 3, null ); + /* *//* */ test("Mix___wFoo_I_wBar__f", new Mix___wFoo_I_wBar__f , 3, "bar"); + // */abstract test("Mix___wFoo_I_wBar_I_", new Mix___wFoo_I_wBar_I_ , 3, null ); + // *//* */ test("Mix___wFoo_I_wBar_If", new Mix___wFoo_I_wBar_If , 3, "bar"); + // */abstract test("Mix___wFoo_I_wBarY__", new Mix___wFoo_I_wBarY__ , 3, null ); + /* *//* */ test("Mix___wFoo_I_wBarY_f", new Mix___wFoo_I_wBarY_f , 3, "bar"); + // */abstract test("Mix___wFoo_I_wBarYI_", new Mix___wFoo_I_wBarYI_ , 3, null ); + // *//* */ test("Mix___wFoo_I_wBarYIf", new Mix___wFoo_I_wBarYIf , 3, "bar"); + /* *//* */ test("Mix___wFoo_If ", new Mix___wFoo_If , 2, "foo"); + /* *//* */ test("Mix___wFoo_IfwBar___", new Mix___wFoo_IfwBar___ , 3, "foo"); + // *//* */ test("Mix___wFoo_IfwBar__f", new Mix___wFoo_IfwBar__f , 3, "bar"); + // *//* */ test("Mix___wFoo_IfwBar_I_", new Mix___wFoo_IfwBar_I_ , 3, "foo"); + // *//* */ test("Mix___wFoo_IfwBar_If", new Mix___wFoo_IfwBar_If , 3, "bar"); + /* *//* */ test("Mix___wFoo_IfwBarY__", new Mix___wFoo_IfwBarY__ , 3, "foo"); + // *//* */ test("Mix___wFoo_IfwBarY_f", new Mix___wFoo_IfwBarY_f , 3, "bar"); + // *//* */ test("Mix___wFoo_IfwBarYI_", new Mix___wFoo_IfwBarYI_ , 3, "foo"); + // *//* */ test("Mix___wFoo_IfwBarYIf", new Mix___wFoo_IfwBarYIf , 3, "bar"); + // */abstract test("Mix___wFooX__ ", new Mix___wFooX__ , 2, null ); + // */abstract test("Mix___wFooX__wBar___", new Mix___wFooX__wBar___ , 3, null ); + // */abstract test("Mix___wFooX__wBar__f", new Mix___wFooX__wBar__f , 3, "bar"); + // */abstract test("Mix___wFooX__wBar_I_", new Mix___wFooX__wBar_I_ , 3, null ); + /* *//* */ test("Mix___wFooX__wBar_If", new Mix___wFooX__wBar_If , 3, "bar"); + // */abstract test("Mix___wFooX__wBarY__", new Mix___wFooX__wBarY__ , 3, null ); + // */abstract test("Mix___wFooX__wBarY_f", new Mix___wFooX__wBarY_f , 3, "bar"); + // */abstract test("Mix___wFooX__wBarYI_", new Mix___wFooX__wBarYI_ , 3, null ); + /* *//* */ test("Mix___wFooX__wBarYIf", new Mix___wFooX__wBarYIf , 3, "bar"); + // */abstract test("Mix___wFooX_f ", new Mix___wFooX_f , 2, "foo"); + // */abstract test("Mix___wFooX_fwBar___", new Mix___wFooX_fwBar___ , 3, "foo"); + // */abstract test("Mix___wFooX_fwBar__f", new Mix___wFooX_fwBar__f , 3, "bar"); + /* *//* */ test("Mix___wFooX_fwBar_I_", new Mix___wFooX_fwBar_I_ , 3, "foo"); + // *//* */ test("Mix___wFooX_fwBar_If", new Mix___wFooX_fwBar_If , 3, "bar"); + // */abstract test("Mix___wFooX_fwBarY__", new Mix___wFooX_fwBarY__ , 3, "foo"); + // */abstract test("Mix___wFooX_fwBarY_f", new Mix___wFooX_fwBarY_f , 3, "bar"); + /* *//* */ test("Mix___wFooX_fwBarYI_", new Mix___wFooX_fwBarYI_ , 3, "foo"); + // *//* */ test("Mix___wFooX_fwBarYIf", new Mix___wFooX_fwBarYIf , 3, "bar"); + // */abstract test("Mix___wFooXI_ ", new Mix___wFooXI_ , 2, null ); + // */abstract test("Mix___wFooXI_wBar___", new Mix___wFooXI_wBar___ , 3, null ); + /* *//* */ test("Mix___wFooXI_wBar__f", new Mix___wFooXI_wBar__f , 3, "bar"); + // */abstract test("Mix___wFooXI_wBar_I_", new Mix___wFooXI_wBar_I_ , 3, null ); + // *//* */ test("Mix___wFooXI_wBar_If", new Mix___wFooXI_wBar_If , 3, "bar"); + // */abstract test("Mix___wFooXI_wBarY__", new Mix___wFooXI_wBarY__ , 3, null ); + /* *//* */ test("Mix___wFooXI_wBarY_f", new Mix___wFooXI_wBarY_f , 3, "bar"); + // */abstract test("Mix___wFooXI_wBarYI_", new Mix___wFooXI_wBarYI_ , 3, null ); + // *//* */ test("Mix___wFooXI_wBarYIf", new Mix___wFooXI_wBarYIf , 3, "bar"); + /* *//* */ test("Mix___wFooXIf ", new Mix___wFooXIf , 2, "foo"); + /* *//* */ test("Mix___wFooXIfwBar___", new Mix___wFooXIfwBar___ , 3, "foo"); + // *//* */ test("Mix___wFooXIfwBar__f", new Mix___wFooXIfwBar__f , 3, "bar"); + // *//* */ test("Mix___wFooXIfwBar_I_", new Mix___wFooXIfwBar_I_ , 3, "foo"); + // *//* */ test("Mix___wFooXIfwBar_If", new Mix___wFooXIfwBar_If , 3, "bar"); + /* *//* */ test("Mix___wFooXIfwBarY__", new Mix___wFooXIfwBarY__ , 3, "foo"); + // *//* */ test("Mix___wFooXIfwBarY_f", new Mix___wFooXIfwBarY_f , 3, "bar"); + // *//* */ test("Mix___wFooXIfwBarYI_", new Mix___wFooXIfwBarYI_ , 3, "foo"); + // *//* */ test("Mix___wFooXIfwBarYIf", new Mix___wFooXIfwBarYIf , 3, "bar"); + + // */abstract test("Mix__fwFoo___ ", new Mix__fwFoo___ , 2, "mix"); + // */abstract test("Mix__fwFoo___wBar___", new Mix__fwFoo___wBar___ , 3, "mix"); + // */abstract test("Mix__fwFoo___wBar__f", new Mix__fwFoo___wBar__f , 3, "mix"); + /* *//* */ test("Mix__fwFoo___wBar_I_", new Mix__fwFoo___wBar_I_ , 3, "mix"); + /* *//* */ test("Mix__fwFoo___wBar_If", new Mix__fwFoo___wBar_If , 3, "mix"); + // */abstract test("Mix__fwFoo___wBarY__", new Mix__fwFoo___wBarY__ , 3, "mix"); + // */abstract test("Mix__fwFoo___wBarY_f", new Mix__fwFoo___wBarY_f , 3, "mix"); + /* *//* */ test("Mix__fwFoo___wBarYI_", new Mix__fwFoo___wBarYI_ , 3, "mix"); + /* *//* */ test("Mix__fwFoo___wBarYIf", new Mix__fwFoo___wBarYIf , 3, "mix"); + // */abstract test("Mix__fwFoo__f ", new Mix__fwFoo__f , 2, "mix"); + // */abstract test("Mix__fwFoo__fwBar___", new Mix__fwFoo__fwBar___ , 3, "mix"); + // */abstract test("Mix__fwFoo__fwBar__f", new Mix__fwFoo__fwBar__f , 3, "mix"); + /* *//* */ test("Mix__fwFoo__fwBar_I_", new Mix__fwFoo__fwBar_I_ , 3, "mix"); + /* *//* */ test("Mix__fwFoo__fwBar_If", new Mix__fwFoo__fwBar_If , 3, "mix"); + // */abstract test("Mix__fwFoo__fwBarY__", new Mix__fwFoo__fwBarY__ , 3, "mix"); + // */abstract test("Mix__fwFoo__fwBarY_f", new Mix__fwFoo__fwBarY_f , 3, "mix"); + /* *//* */ test("Mix__fwFoo__fwBarYI_", new Mix__fwFoo__fwBarYI_ , 3, "mix"); + /* *//* */ test("Mix__fwFoo__fwBarYIf", new Mix__fwFoo__fwBarYIf , 3, "mix"); + /* *//* */ test("Mix__fwFoo_I_ ", new Mix__fwFoo_I_ , 2, "mix"); + /* *//* */ test("Mix__fwFoo_I_wBar___", new Mix__fwFoo_I_wBar___ , 3, "mix"); + /* *//* */ test("Mix__fwFoo_I_wBar__f", new Mix__fwFoo_I_wBar__f , 3, "mix"); + // *//* */ test("Mix__fwFoo_I_wBar_I_", new Mix__fwFoo_I_wBar_I_ , 3, "mix"); + // *//* */ test("Mix__fwFoo_I_wBar_If", new Mix__fwFoo_I_wBar_If , 3, "mix"); + /* *//* */ test("Mix__fwFoo_I_wBarY__", new Mix__fwFoo_I_wBarY__ , 3, "mix"); + /* *//* */ test("Mix__fwFoo_I_wBarY_f", new Mix__fwFoo_I_wBarY_f , 3, "mix"); + // *//* */ test("Mix__fwFoo_I_wBarYI_", new Mix__fwFoo_I_wBarYI_ , 3, "mix"); + // *//* */ test("Mix__fwFoo_I_wBarYIf", new Mix__fwFoo_I_wBarYIf , 3, "mix"); + /* *//* */ test("Mix__fwFoo_If ", new Mix__fwFoo_If , 2, "mix"); + /* *//* */ test("Mix__fwFoo_IfwBar___", new Mix__fwFoo_IfwBar___ , 3, "mix"); + /* *//* */ test("Mix__fwFoo_IfwBar__f", new Mix__fwFoo_IfwBar__f , 3, "mix"); + // *//* */ test("Mix__fwFoo_IfwBar_I_", new Mix__fwFoo_IfwBar_I_ , 3, "mix"); + // *//* */ test("Mix__fwFoo_IfwBar_If", new Mix__fwFoo_IfwBar_If , 3, "mix"); + /* *//* */ test("Mix__fwFoo_IfwBarY__", new Mix__fwFoo_IfwBarY__ , 3, "mix"); + /* *//* */ test("Mix__fwFoo_IfwBarY_f", new Mix__fwFoo_IfwBarY_f , 3, "mix"); + // *//* */ test("Mix__fwFoo_IfwBarYI_", new Mix__fwFoo_IfwBarYI_ , 3, "mix"); + // *//* */ test("Mix__fwFoo_IfwBarYIf", new Mix__fwFoo_IfwBarYIf , 3, "mix"); + // */abstract test("Mix__fwFooX__ ", new Mix__fwFooX__ , 2, "mix"); + // */abstract test("Mix__fwFooX__wBar___", new Mix__fwFooX__wBar___ , 3, "mix"); + // */abstract test("Mix__fwFooX__wBar__f", new Mix__fwFooX__wBar__f , 3, "mix"); + /* *//* */ test("Mix__fwFooX__wBar_I_", new Mix__fwFooX__wBar_I_ , 3, "mix"); + /* *//* */ test("Mix__fwFooX__wBar_If", new Mix__fwFooX__wBar_If , 3, "mix"); + // */abstract test("Mix__fwFooX__wBarY__", new Mix__fwFooX__wBarY__ , 3, "mix"); + // */abstract test("Mix__fwFooX__wBarY_f", new Mix__fwFooX__wBarY_f , 3, "mix"); + /* *//* */ test("Mix__fwFooX__wBarYI_", new Mix__fwFooX__wBarYI_ , 3, "mix"); + /* *//* */ test("Mix__fwFooX__wBarYIf", new Mix__fwFooX__wBarYIf , 3, "mix"); + // */abstract test("Mix__fwFooX_f ", new Mix__fwFooX_f , 2, "mix"); + // */abstract test("Mix__fwFooX_fwBar___", new Mix__fwFooX_fwBar___ , 3, "mix"); + // */abstract test("Mix__fwFooX_fwBar__f", new Mix__fwFooX_fwBar__f , 3, "mix"); + /* *//* */ test("Mix__fwFooX_fwBar_I_", new Mix__fwFooX_fwBar_I_ , 3, "mix"); + /* *//* */ test("Mix__fwFooX_fwBar_If", new Mix__fwFooX_fwBar_If , 3, "mix"); + // */abstract test("Mix__fwFooX_fwBarY__", new Mix__fwFooX_fwBarY__ , 3, "mix"); + // */abstract test("Mix__fwFooX_fwBarY_f", new Mix__fwFooX_fwBarY_f , 3, "mix"); + /* *//* */ test("Mix__fwFooX_fwBarYI_", new Mix__fwFooX_fwBarYI_ , 3, "mix"); + /* *//* */ test("Mix__fwFooX_fwBarYIf", new Mix__fwFooX_fwBarYIf , 3, "mix"); + /* *//* */ test("Mix__fwFooXI_ ", new Mix__fwFooXI_ , 2, "mix"); + /* *//* */ test("Mix__fwFooXI_wBar___", new Mix__fwFooXI_wBar___ , 3, "mix"); + /* *//* */ test("Mix__fwFooXI_wBar__f", new Mix__fwFooXI_wBar__f , 3, "mix"); + // *//* */ test("Mix__fwFooXI_wBar_I_", new Mix__fwFooXI_wBar_I_ , 3, "mix"); + // *//* */ test("Mix__fwFooXI_wBar_If", new Mix__fwFooXI_wBar_If , 3, "mix"); + /* *//* */ test("Mix__fwFooXI_wBarY__", new Mix__fwFooXI_wBarY__ , 3, "mix"); + /* *//* */ test("Mix__fwFooXI_wBarY_f", new Mix__fwFooXI_wBarY_f , 3, "mix"); + // *//* */ test("Mix__fwFooXI_wBarYI_", new Mix__fwFooXI_wBarYI_ , 3, "mix"); + // *//* */ test("Mix__fwFooXI_wBarYIf", new Mix__fwFooXI_wBarYIf , 3, "mix"); + /* *//* */ test("Mix__fwFooXIf ", new Mix__fwFooXIf , 2, "mix"); + /* *//* */ test("Mix__fwFooXIfwBar___", new Mix__fwFooXIfwBar___ , 3, "mix"); + /* *//* */ test("Mix__fwFooXIfwBar__f", new Mix__fwFooXIfwBar__f , 3, "mix"); + // *//* */ test("Mix__fwFooXIfwBar_I_", new Mix__fwFooXIfwBar_I_ , 3, "mix"); + // *//* */ test("Mix__fwFooXIfwBar_If", new Mix__fwFooXIfwBar_If , 3, "mix"); + /* *//* */ test("Mix__fwFooXIfwBarY__", new Mix__fwFooXIfwBarY__ , 3, "mix"); + /* *//* */ test("Mix__fwFooXIfwBarY_f", new Mix__fwFooXIfwBarY_f , 3, "mix"); + // *//* */ test("Mix__fwFooXIfwBarYI_", new Mix__fwFooXIfwBarYI_ , 3, "mix"); + // *//* */ test("Mix__fwFooXIfwBarYIf", new Mix__fwFooXIfwBarYIf , 3, "mix"); + + // */abstract test("Mix_I_wFoo___ ", new Mix_I_wFoo___ , 2, null ); + // */abstract test("Mix_I_wFoo___wBar___", new Mix_I_wFoo___wBar___ , 3, null ); + /* *//* */ test("Mix_I_wFoo___wBar__f", new Mix_I_wFoo___wBar__f , 3, "bar"); + // */abstract test("Mix_I_wFoo___wBar_I_", new Mix_I_wFoo___wBar_I_ , 3, null ); + // *//* */ test("Mix_I_wFoo___wBar_If", new Mix_I_wFoo___wBar_If , 3, "bar"); + // */abstract test("Mix_I_wFoo___wBarY__", new Mix_I_wFoo___wBarY__ , 3, null ); + /* *//* */ test("Mix_I_wFoo___wBarY_f", new Mix_I_wFoo___wBarY_f , 3, "bar"); + // */abstract test("Mix_I_wFoo___wBarYI_", new Mix_I_wFoo___wBarYI_ , 3, null ); + // *//* */ test("Mix_I_wFoo___wBarYIf", new Mix_I_wFoo___wBarYIf , 3, "bar"); + /* *//* */ test("Mix_I_wFoo__f ", new Mix_I_wFoo__f , 2, "foo"); + /* *//* */ test("Mix_I_wFoo__fwBar___", new Mix_I_wFoo__fwBar___ , 3, "foo"); + // *//* */ test("Mix_I_wFoo__fwBar__f", new Mix_I_wFoo__fwBar__f , 3, "bar"); + // *//* */ test("Mix_I_wFoo__fwBar_I_", new Mix_I_wFoo__fwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_wFoo__fwBar_If", new Mix_I_wFoo__fwBar_If , 3, "bar"); + /* *//* */ test("Mix_I_wFoo__fwBarY__", new Mix_I_wFoo__fwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_wFoo__fwBarY_f", new Mix_I_wFoo__fwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_wFoo__fwBarYI_", new Mix_I_wFoo__fwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_wFoo__fwBarYIf", new Mix_I_wFoo__fwBarYIf , 3, "bar"); + // */abstract test("Mix_I_wFoo_I_ ", new Mix_I_wFoo_I_ , 2, null ); + // */abstract test("Mix_I_wFoo_I_wBar___", new Mix_I_wFoo_I_wBar___ , 3, null ); + // *//* */ test("Mix_I_wFoo_I_wBar__f", new Mix_I_wFoo_I_wBar__f , 3, "bar"); + // */abstract test("Mix_I_wFoo_I_wBar_I_", new Mix_I_wFoo_I_wBar_I_ , 3, null ); + // *//* */ test("Mix_I_wFoo_I_wBar_If", new Mix_I_wFoo_I_wBar_If , 3, "bar"); + // */abstract test("Mix_I_wFoo_I_wBarY__", new Mix_I_wFoo_I_wBarY__ , 3, null ); + // *//* */ test("Mix_I_wFoo_I_wBarY_f", new Mix_I_wFoo_I_wBarY_f , 3, "bar"); + // */abstract test("Mix_I_wFoo_I_wBarYI_", new Mix_I_wFoo_I_wBarYI_ , 3, null ); + // *//* */ test("Mix_I_wFoo_I_wBarYIf", new Mix_I_wFoo_I_wBarYIf , 3, "bar"); + // *//* */ test("Mix_I_wFoo_If ", new Mix_I_wFoo_If , 2, "foo"); + // *//* */ test("Mix_I_wFoo_IfwBar___", new Mix_I_wFoo_IfwBar___ , 3, "foo"); + // *//* */ test("Mix_I_wFoo_IfwBar__f", new Mix_I_wFoo_IfwBar__f , 3, "bar"); + // *//* */ test("Mix_I_wFoo_IfwBar_I_", new Mix_I_wFoo_IfwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_wFoo_IfwBar_If", new Mix_I_wFoo_IfwBar_If , 3, "bar"); + // *//* */ test("Mix_I_wFoo_IfwBarY__", new Mix_I_wFoo_IfwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_wFoo_IfwBarY_f", new Mix_I_wFoo_IfwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_wFoo_IfwBarYI_", new Mix_I_wFoo_IfwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_wFoo_IfwBarYIf", new Mix_I_wFoo_IfwBarYIf , 3, "bar"); + // */abstract test("Mix_I_wFooX__ ", new Mix_I_wFooX__ , 2, null ); + // */abstract test("Mix_I_wFooX__wBar___", new Mix_I_wFooX__wBar___ , 3, null ); + /* *//* */ test("Mix_I_wFooX__wBar__f", new Mix_I_wFooX__wBar__f , 3, "bar"); + // */abstract test("Mix_I_wFooX__wBar_I_", new Mix_I_wFooX__wBar_I_ , 3, null ); + // *//* */ test("Mix_I_wFooX__wBar_If", new Mix_I_wFooX__wBar_If , 3, "bar"); + // */abstract test("Mix_I_wFooX__wBarY__", new Mix_I_wFooX__wBarY__ , 3, null ); + /* *//* */ test("Mix_I_wFooX__wBarY_f", new Mix_I_wFooX__wBarY_f , 3, "bar"); + // */abstract test("Mix_I_wFooX__wBarYI_", new Mix_I_wFooX__wBarYI_ , 3, null ); + // *//* */ test("Mix_I_wFooX__wBarYIf", new Mix_I_wFooX__wBarYIf , 3, "bar"); + /* *//* */ test("Mix_I_wFooX_f ", new Mix_I_wFooX_f , 2, "foo"); + /* *//* */ test("Mix_I_wFooX_fwBar___", new Mix_I_wFooX_fwBar___ , 3, "foo"); + // *//* */ test("Mix_I_wFooX_fwBar__f", new Mix_I_wFooX_fwBar__f , 3, "bar"); + // *//* */ test("Mix_I_wFooX_fwBar_I_", new Mix_I_wFooX_fwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_wFooX_fwBar_If", new Mix_I_wFooX_fwBar_If , 3, "bar"); + /* *//* */ test("Mix_I_wFooX_fwBarY__", new Mix_I_wFooX_fwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_wFooX_fwBarY_f", new Mix_I_wFooX_fwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_wFooX_fwBarYI_", new Mix_I_wFooX_fwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_wFooX_fwBarYIf", new Mix_I_wFooX_fwBarYIf , 3, "bar"); + // */abstract test("Mix_I_wFooXI_ ", new Mix_I_wFooXI_ , 2, null ); + // */abstract test("Mix_I_wFooXI_wBar___", new Mix_I_wFooXI_wBar___ , 3, null ); + // *//* */ test("Mix_I_wFooXI_wBar__f", new Mix_I_wFooXI_wBar__f , 3, "bar"); + // */abstract test("Mix_I_wFooXI_wBar_I_", new Mix_I_wFooXI_wBar_I_ , 3, null ); + // *//* */ test("Mix_I_wFooXI_wBar_If", new Mix_I_wFooXI_wBar_If , 3, "bar"); + // */abstract test("Mix_I_wFooXI_wBarY__", new Mix_I_wFooXI_wBarY__ , 3, null ); + // *//* */ test("Mix_I_wFooXI_wBarY_f", new Mix_I_wFooXI_wBarY_f , 3, "bar"); + // */abstract test("Mix_I_wFooXI_wBarYI_", new Mix_I_wFooXI_wBarYI_ , 3, null ); + // *//* */ test("Mix_I_wFooXI_wBarYIf", new Mix_I_wFooXI_wBarYIf , 3, "bar"); + // *//* */ test("Mix_I_wFooXIf ", new Mix_I_wFooXIf , 2, "foo"); + // *//* */ test("Mix_I_wFooXIfwBar___", new Mix_I_wFooXIfwBar___ , 3, "foo"); + // *//* */ test("Mix_I_wFooXIfwBar__f", new Mix_I_wFooXIfwBar__f , 3, "bar"); + // *//* */ test("Mix_I_wFooXIfwBar_I_", new Mix_I_wFooXIfwBar_I_ , 3, "foo"); + // *//* */ test("Mix_I_wFooXIfwBar_If", new Mix_I_wFooXIfwBar_If , 3, "bar"); + // *//* */ test("Mix_I_wFooXIfwBarY__", new Mix_I_wFooXIfwBarY__ , 3, "foo"); + // *//* */ test("Mix_I_wFooXIfwBarY_f", new Mix_I_wFooXIfwBarY_f , 3, "bar"); + // *//* */ test("Mix_I_wFooXIfwBarYI_", new Mix_I_wFooXIfwBarYI_ , 3, "foo"); + // *//* */ test("Mix_I_wFooXIfwBarYIf", new Mix_I_wFooXIfwBarYIf , 3, "bar"); + + /* *//* */ test("Mix_IfwFoo___ ", new Mix_IfwFoo___ , 2, "mix"); + /* *//* */ test("Mix_IfwFoo___wBar___", new Mix_IfwFoo___wBar___ , 3, "mix"); + /* *//* */ test("Mix_IfwFoo___wBar__f", new Mix_IfwFoo___wBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFoo___wBar_I_", new Mix_IfwFoo___wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo___wBar_If", new Mix_IfwFoo___wBar_If , 3, "mix"); + /* *//* */ test("Mix_IfwFoo___wBarY__", new Mix_IfwFoo___wBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfwFoo___wBarY_f", new Mix_IfwFoo___wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFoo___wBarYI_", new Mix_IfwFoo___wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo___wBarYIf", new Mix_IfwFoo___wBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfwFoo__f ", new Mix_IfwFoo__f , 2, "mix"); + /* *//* */ test("Mix_IfwFoo__fwBar___", new Mix_IfwFoo__fwBar___ , 3, "mix"); + /* *//* */ test("Mix_IfwFoo__fwBar__f", new Mix_IfwFoo__fwBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFoo__fwBar_I_", new Mix_IfwFoo__fwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo__fwBar_If", new Mix_IfwFoo__fwBar_If , 3, "mix"); + /* *//* */ test("Mix_IfwFoo__fwBarY__", new Mix_IfwFoo__fwBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfwFoo__fwBarY_f", new Mix_IfwFoo__fwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFoo__fwBarYI_", new Mix_IfwFoo__fwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo__fwBarYIf", new Mix_IfwFoo__fwBarYIf , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_ ", new Mix_IfwFoo_I_ , 2, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBar___", new Mix_IfwFoo_I_wBar___ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBar__f", new Mix_IfwFoo_I_wBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBar_I_", new Mix_IfwFoo_I_wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBar_If", new Mix_IfwFoo_I_wBar_If , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBarY__", new Mix_IfwFoo_I_wBarY__ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBarY_f", new Mix_IfwFoo_I_wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBarYI_", new Mix_IfwFoo_I_wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_I_wBarYIf", new Mix_IfwFoo_I_wBarYIf , 3, "mix"); + // *//* */ test("Mix_IfwFoo_If ", new Mix_IfwFoo_If , 2, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBar___", new Mix_IfwFoo_IfwBar___ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBar__f", new Mix_IfwFoo_IfwBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBar_I_", new Mix_IfwFoo_IfwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBar_If", new Mix_IfwFoo_IfwBar_If , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBarY__", new Mix_IfwFoo_IfwBarY__ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBarY_f", new Mix_IfwFoo_IfwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBarYI_", new Mix_IfwFoo_IfwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFoo_IfwBarYIf", new Mix_IfwFoo_IfwBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfwFooX__ ", new Mix_IfwFooX__ , 2, "mix"); + /* *//* */ test("Mix_IfwFooX__wBar___", new Mix_IfwFooX__wBar___ , 3, "mix"); + /* *//* */ test("Mix_IfwFooX__wBar__f", new Mix_IfwFooX__wBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFooX__wBar_I_", new Mix_IfwFooX__wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFooX__wBar_If", new Mix_IfwFooX__wBar_If , 3, "mix"); + /* *//* */ test("Mix_IfwFooX__wBarY__", new Mix_IfwFooX__wBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfwFooX__wBarY_f", new Mix_IfwFooX__wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFooX__wBarYI_", new Mix_IfwFooX__wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFooX__wBarYIf", new Mix_IfwFooX__wBarYIf , 3, "mix"); + /* *//* */ test("Mix_IfwFooX_f ", new Mix_IfwFooX_f , 2, "mix"); + /* *//* */ test("Mix_IfwFooX_fwBar___", new Mix_IfwFooX_fwBar___ , 3, "mix"); + /* *//* */ test("Mix_IfwFooX_fwBar__f", new Mix_IfwFooX_fwBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFooX_fwBar_I_", new Mix_IfwFooX_fwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFooX_fwBar_If", new Mix_IfwFooX_fwBar_If , 3, "mix"); + /* *//* */ test("Mix_IfwFooX_fwBarY__", new Mix_IfwFooX_fwBarY__ , 3, "mix"); + /* *//* */ test("Mix_IfwFooX_fwBarY_f", new Mix_IfwFooX_fwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFooX_fwBarYI_", new Mix_IfwFooX_fwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFooX_fwBarYIf", new Mix_IfwFooX_fwBarYIf , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_ ", new Mix_IfwFooXI_ , 2, "mix"); + // *//* */ test("Mix_IfwFooXI_wBar___", new Mix_IfwFooXI_wBar___ , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBar__f", new Mix_IfwFooXI_wBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBar_I_", new Mix_IfwFooXI_wBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBar_If", new Mix_IfwFooXI_wBar_If , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBarY__", new Mix_IfwFooXI_wBarY__ , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBarY_f", new Mix_IfwFooXI_wBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBarYI_", new Mix_IfwFooXI_wBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFooXI_wBarYIf", new Mix_IfwFooXI_wBarYIf , 3, "mix"); + // *//* */ test("Mix_IfwFooXIf ", new Mix_IfwFooXIf , 2, "mix"); + // *//* */ test("Mix_IfwFooXIfwBar___", new Mix_IfwFooXIfwBar___ , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBar__f", new Mix_IfwFooXIfwBar__f , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBar_I_", new Mix_IfwFooXIfwBar_I_ , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBar_If", new Mix_IfwFooXIfwBar_If , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBarY__", new Mix_IfwFooXIfwBarY__ , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBarY_f", new Mix_IfwFooXIfwBarY_f , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBarYI_", new Mix_IfwFooXIfwBarYI_ , 3, "mix"); + // *//* */ test("Mix_IfwFooXIfwBarYIf", new Mix_IfwFooXIfwBarYIf , 3, "mix"); + + // */abstract test("MixZ__wFoo___ ", new MixZ__wFoo___ [C], 2, null ); + // */abstract test("MixZ__wFoo___wBar___", new MixZ__wFoo___wBar___[C], 3, null ); + // */abstract test("MixZ__wFoo___wBar__f", new MixZ__wFoo___wBar__f[C], 3, "bar"); + // */abstract test("MixZ__wFoo___wBar_I_", new MixZ__wFoo___wBar_I_[C], 3, null ); + /* *//* */ test("MixZ__wFoo___wBar_If", new MixZ__wFoo___wBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFoo___wBarY__", new MixZ__wFoo___wBarY__[C], 3, null ); + // */abstract test("MixZ__wFoo___wBarY_f", new MixZ__wFoo___wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__wFoo___wBarYI_", new MixZ__wFoo___wBarYI_[C], 3, null ); + /* *//* */ test("MixZ__wFoo___wBarYIf", new MixZ__wFoo___wBarYIf[C], 3, "bar"); + // */abstract test("MixZ__wFoo__f ", new MixZ__wFoo__f [C], 2, "foo"); + // */abstract test("MixZ__wFoo__fwBar___", new MixZ__wFoo__fwBar___[C], 3, "foo"); + // */abstract test("MixZ__wFoo__fwBar__f", new MixZ__wFoo__fwBar__f[C], 3, "bar"); + /* *//* */ test("MixZ__wFoo__fwBar_I_", new MixZ__wFoo__fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__wFoo__fwBar_If", new MixZ__wFoo__fwBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFoo__fwBarY__", new MixZ__wFoo__fwBarY__[C], 3, "foo"); + // */abstract test("MixZ__wFoo__fwBarY_f", new MixZ__wFoo__fwBarY_f[C], 3, "bar"); + /* *//* */ test("MixZ__wFoo__fwBarYI_", new MixZ__wFoo__fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__wFoo__fwBarYIf", new MixZ__wFoo__fwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__wFoo_I_ ", new MixZ__wFoo_I_ [C], 2, null ); + // */abstract test("MixZ__wFoo_I_wBar___", new MixZ__wFoo_I_wBar___[C], 3, null ); + /* *//* */ test("MixZ__wFoo_I_wBar__f", new MixZ__wFoo_I_wBar__f[C], 3, "bar"); + // */abstract test("MixZ__wFoo_I_wBar_I_", new MixZ__wFoo_I_wBar_I_[C], 3, null ); + // *//* */ test("MixZ__wFoo_I_wBar_If", new MixZ__wFoo_I_wBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFoo_I_wBarY__", new MixZ__wFoo_I_wBarY__[C], 3, null ); + /* *//* */ test("MixZ__wFoo_I_wBarY_f", new MixZ__wFoo_I_wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__wFoo_I_wBarYI_", new MixZ__wFoo_I_wBarYI_[C], 3, null ); + // *//* */ test("MixZ__wFoo_I_wBarYIf", new MixZ__wFoo_I_wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZ__wFoo_If ", new MixZ__wFoo_If [C], 2, "foo"); + /* *//* */ test("MixZ__wFoo_IfwBar___", new MixZ__wFoo_IfwBar___[C], 3, "foo"); + // *//* */ test("MixZ__wFoo_IfwBar__f", new MixZ__wFoo_IfwBar__f[C], 3, "bar"); + // *//* */ test("MixZ__wFoo_IfwBar_I_", new MixZ__wFoo_IfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__wFoo_IfwBar_If", new MixZ__wFoo_IfwBar_If[C], 3, "bar"); + /* *//* */ test("MixZ__wFoo_IfwBarY__", new MixZ__wFoo_IfwBarY__[C], 3, "foo"); + // *//* */ test("MixZ__wFoo_IfwBarY_f", new MixZ__wFoo_IfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZ__wFoo_IfwBarYI_", new MixZ__wFoo_IfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__wFoo_IfwBarYIf", new MixZ__wFoo_IfwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__wFooX__ ", new MixZ__wFooX__ [C], 2, null ); + // */abstract test("MixZ__wFooX__wBar___", new MixZ__wFooX__wBar___[C], 3, null ); + // */abstract test("MixZ__wFooX__wBar__f", new MixZ__wFooX__wBar__f[C], 3, "bar"); + // */abstract test("MixZ__wFooX__wBar_I_", new MixZ__wFooX__wBar_I_[C], 3, null ); + /* *//* */ test("MixZ__wFooX__wBar_If", new MixZ__wFooX__wBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFooX__wBarY__", new MixZ__wFooX__wBarY__[C], 3, null ); + // */abstract test("MixZ__wFooX__wBarY_f", new MixZ__wFooX__wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__wFooX__wBarYI_", new MixZ__wFooX__wBarYI_[C], 3, null ); + /* *//* */ test("MixZ__wFooX__wBarYIf", new MixZ__wFooX__wBarYIf[C], 3, "bar"); + // */abstract test("MixZ__wFooX_f ", new MixZ__wFooX_f [C], 2, "foo"); + // */abstract test("MixZ__wFooX_fwBar___", new MixZ__wFooX_fwBar___[C], 3, "foo"); + // */abstract test("MixZ__wFooX_fwBar__f", new MixZ__wFooX_fwBar__f[C], 3, "bar"); + /* *//* */ test("MixZ__wFooX_fwBar_I_", new MixZ__wFooX_fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__wFooX_fwBar_If", new MixZ__wFooX_fwBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFooX_fwBarY__", new MixZ__wFooX_fwBarY__[C], 3, "foo"); + // */abstract test("MixZ__wFooX_fwBarY_f", new MixZ__wFooX_fwBarY_f[C], 3, "bar"); + /* *//* */ test("MixZ__wFooX_fwBarYI_", new MixZ__wFooX_fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__wFooX_fwBarYIf", new MixZ__wFooX_fwBarYIf[C], 3, "bar"); + // */abstract test("MixZ__wFooXI_ ", new MixZ__wFooXI_ [C], 2, null ); + // */abstract test("MixZ__wFooXI_wBar___", new MixZ__wFooXI_wBar___[C], 3, null ); + /* *//* */ test("MixZ__wFooXI_wBar__f", new MixZ__wFooXI_wBar__f[C], 3, "bar"); + // */abstract test("MixZ__wFooXI_wBar_I_", new MixZ__wFooXI_wBar_I_[C], 3, null ); + // *//* */ test("MixZ__wFooXI_wBar_If", new MixZ__wFooXI_wBar_If[C], 3, "bar"); + // */abstract test("MixZ__wFooXI_wBarY__", new MixZ__wFooXI_wBarY__[C], 3, null ); + /* *//* */ test("MixZ__wFooXI_wBarY_f", new MixZ__wFooXI_wBarY_f[C], 3, "bar"); + // */abstract test("MixZ__wFooXI_wBarYI_", new MixZ__wFooXI_wBarYI_[C], 3, null ); + // *//* */ test("MixZ__wFooXI_wBarYIf", new MixZ__wFooXI_wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZ__wFooXIf ", new MixZ__wFooXIf [C], 2, "foo"); + /* *//* */ test("MixZ__wFooXIfwBar___", new MixZ__wFooXIfwBar___[C], 3, "foo"); + // *//* */ test("MixZ__wFooXIfwBar__f", new MixZ__wFooXIfwBar__f[C], 3, "bar"); + // *//* */ test("MixZ__wFooXIfwBar_I_", new MixZ__wFooXIfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZ__wFooXIfwBar_If", new MixZ__wFooXIfwBar_If[C], 3, "bar"); + /* *//* */ test("MixZ__wFooXIfwBarY__", new MixZ__wFooXIfwBarY__[C], 3, "foo"); + // *//* */ test("MixZ__wFooXIfwBarY_f", new MixZ__wFooXIfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZ__wFooXIfwBarYI_", new MixZ__wFooXIfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZ__wFooXIfwBarYIf", new MixZ__wFooXIfwBarYIf[C], 3, "bar"); + + // */abstract test("MixZ_fwFoo___ ", new MixZ_fwFoo___ [C], 2, "mix"); + // */abstract test("MixZ_fwFoo___wBar___", new MixZ_fwFoo___wBar___[C], 3, "mix"); + // */abstract test("MixZ_fwFoo___wBar__f", new MixZ_fwFoo___wBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo___wBar_I_", new MixZ_fwFoo___wBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo___wBar_If", new MixZ_fwFoo___wBar_If[C], 3, "mix"); + // */abstract test("MixZ_fwFoo___wBarY__", new MixZ_fwFoo___wBarY__[C], 3, "mix"); + // */abstract test("MixZ_fwFoo___wBarY_f", new MixZ_fwFoo___wBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo___wBarYI_", new MixZ_fwFoo___wBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo___wBarYIf", new MixZ_fwFoo___wBarYIf[C], 3, "mix"); + // */abstract test("MixZ_fwFoo__f ", new MixZ_fwFoo__f [C], 2, "mix"); + // */abstract test("MixZ_fwFoo__fwBar___", new MixZ_fwFoo__fwBar___[C], 3, "mix"); + // */abstract test("MixZ_fwFoo__fwBar__f", new MixZ_fwFoo__fwBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo__fwBar_I_", new MixZ_fwFoo__fwBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo__fwBar_If", new MixZ_fwFoo__fwBar_If[C], 3, "mix"); + // */abstract test("MixZ_fwFoo__fwBarY__", new MixZ_fwFoo__fwBarY__[C], 3, "mix"); + // */abstract test("MixZ_fwFoo__fwBarY_f", new MixZ_fwFoo__fwBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo__fwBarYI_", new MixZ_fwFoo__fwBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo__fwBarYIf", new MixZ_fwFoo__fwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_I_ ", new MixZ_fwFoo_I_ [C], 2, "mix"); + /* *//* */ test("MixZ_fwFoo_I_wBar___", new MixZ_fwFoo_I_wBar___[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_I_wBar__f", new MixZ_fwFoo_I_wBar__f[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_I_wBar_I_", new MixZ_fwFoo_I_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_I_wBar_If", new MixZ_fwFoo_I_wBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_I_wBarY__", new MixZ_fwFoo_I_wBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_I_wBarY_f", new MixZ_fwFoo_I_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_I_wBarYI_", new MixZ_fwFoo_I_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_I_wBarYIf", new MixZ_fwFoo_I_wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_If ", new MixZ_fwFoo_If [C], 2, "mix"); + /* *//* */ test("MixZ_fwFoo_IfwBar___", new MixZ_fwFoo_IfwBar___[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_IfwBar__f", new MixZ_fwFoo_IfwBar__f[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_IfwBar_I_", new MixZ_fwFoo_IfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_IfwBar_If", new MixZ_fwFoo_IfwBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_IfwBarY__", new MixZ_fwFoo_IfwBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_fwFoo_IfwBarY_f", new MixZ_fwFoo_IfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_IfwBarYI_", new MixZ_fwFoo_IfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_fwFoo_IfwBarYIf", new MixZ_fwFoo_IfwBarYIf[C], 3, "mix"); + // */abstract test("MixZ_fwFooX__ ", new MixZ_fwFooX__ [C], 2, "mix"); + // */abstract test("MixZ_fwFooX__wBar___", new MixZ_fwFooX__wBar___[C], 3, "mix"); + // */abstract test("MixZ_fwFooX__wBar__f", new MixZ_fwFooX__wBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX__wBar_I_", new MixZ_fwFooX__wBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX__wBar_If", new MixZ_fwFooX__wBar_If[C], 3, "mix"); + // */abstract test("MixZ_fwFooX__wBarY__", new MixZ_fwFooX__wBarY__[C], 3, "mix"); + // */abstract test("MixZ_fwFooX__wBarY_f", new MixZ_fwFooX__wBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX__wBarYI_", new MixZ_fwFooX__wBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX__wBarYIf", new MixZ_fwFooX__wBarYIf[C], 3, "mix"); + // */abstract test("MixZ_fwFooX_f ", new MixZ_fwFooX_f [C], 2, "mix"); + // */abstract test("MixZ_fwFooX_fwBar___", new MixZ_fwFooX_fwBar___[C], 3, "mix"); + // */abstract test("MixZ_fwFooX_fwBar__f", new MixZ_fwFooX_fwBar__f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX_fwBar_I_", new MixZ_fwFooX_fwBar_I_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX_fwBar_If", new MixZ_fwFooX_fwBar_If[C], 3, "mix"); + // */abstract test("MixZ_fwFooX_fwBarY__", new MixZ_fwFooX_fwBarY__[C], 3, "mix"); + // */abstract test("MixZ_fwFooX_fwBarY_f", new MixZ_fwFooX_fwBarY_f[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX_fwBarYI_", new MixZ_fwFooX_fwBarYI_[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooX_fwBarYIf", new MixZ_fwFooX_fwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXI_ ", new MixZ_fwFooXI_ [C], 2, "mix"); + /* *//* */ test("MixZ_fwFooXI_wBar___", new MixZ_fwFooXI_wBar___[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXI_wBar__f", new MixZ_fwFooXI_wBar__f[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXI_wBar_I_", new MixZ_fwFooXI_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXI_wBar_If", new MixZ_fwFooXI_wBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXI_wBarY__", new MixZ_fwFooXI_wBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXI_wBarY_f", new MixZ_fwFooXI_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXI_wBarYI_", new MixZ_fwFooXI_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXI_wBarYIf", new MixZ_fwFooXI_wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXIf ", new MixZ_fwFooXIf [C], 2, "mix"); + /* *//* */ test("MixZ_fwFooXIfwBar___", new MixZ_fwFooXIfwBar___[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXIfwBar__f", new MixZ_fwFooXIfwBar__f[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXIfwBar_I_", new MixZ_fwFooXIfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXIfwBar_If", new MixZ_fwFooXIfwBar_If[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXIfwBarY__", new MixZ_fwFooXIfwBarY__[C], 3, "mix"); + /* *//* */ test("MixZ_fwFooXIfwBarY_f", new MixZ_fwFooXIfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXIfwBarYI_", new MixZ_fwFooXIfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZ_fwFooXIfwBarYIf", new MixZ_fwFooXIfwBarYIf[C], 3, "mix"); + + // */abstract test("MixZI_wFoo___ ", new MixZI_wFoo___ [C], 2, null ); + // */abstract test("MixZI_wFoo___wBar___", new MixZI_wFoo___wBar___[C], 3, null ); + /* *//* */ test("MixZI_wFoo___wBar__f", new MixZI_wFoo___wBar__f[C], 3, "bar"); + // */abstract test("MixZI_wFoo___wBar_I_", new MixZI_wFoo___wBar_I_[C], 3, null ); + // *//* */ test("MixZI_wFoo___wBar_If", new MixZI_wFoo___wBar_If[C], 3, "bar"); + // */abstract test("MixZI_wFoo___wBarY__", new MixZI_wFoo___wBarY__[C], 3, null ); + /* *//* */ test("MixZI_wFoo___wBarY_f", new MixZI_wFoo___wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_wFoo___wBarYI_", new MixZI_wFoo___wBarYI_[C], 3, null ); + // *//* */ test("MixZI_wFoo___wBarYIf", new MixZI_wFoo___wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZI_wFoo__f ", new MixZI_wFoo__f [C], 2, "foo"); + /* *//* */ test("MixZI_wFoo__fwBar___", new MixZI_wFoo__fwBar___[C], 3, "foo"); + // *//* */ test("MixZI_wFoo__fwBar__f", new MixZI_wFoo__fwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_wFoo__fwBar_I_", new MixZI_wFoo__fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_wFoo__fwBar_If", new MixZI_wFoo__fwBar_If[C], 3, "bar"); + /* *//* */ test("MixZI_wFoo__fwBarY__", new MixZI_wFoo__fwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_wFoo__fwBarY_f", new MixZI_wFoo__fwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_wFoo__fwBarYI_", new MixZI_wFoo__fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_wFoo__fwBarYIf", new MixZI_wFoo__fwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_wFoo_I_ ", new MixZI_wFoo_I_ [C], 2, null ); + // */abstract test("MixZI_wFoo_I_wBar___", new MixZI_wFoo_I_wBar___[C], 3, null ); + // *//* */ test("MixZI_wFoo_I_wBar__f", new MixZI_wFoo_I_wBar__f[C], 3, "bar"); + // */abstract test("MixZI_wFoo_I_wBar_I_", new MixZI_wFoo_I_wBar_I_[C], 3, null ); + // *//* */ test("MixZI_wFoo_I_wBar_If", new MixZI_wFoo_I_wBar_If[C], 3, "bar"); + // */abstract test("MixZI_wFoo_I_wBarY__", new MixZI_wFoo_I_wBarY__[C], 3, null ); + // *//* */ test("MixZI_wFoo_I_wBarY_f", new MixZI_wFoo_I_wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_wFoo_I_wBarYI_", new MixZI_wFoo_I_wBarYI_[C], 3, null ); + // *//* */ test("MixZI_wFoo_I_wBarYIf", new MixZI_wFoo_I_wBarYIf[C], 3, "bar"); + // *//* */ test("MixZI_wFoo_If ", new MixZI_wFoo_If [C], 2, "foo"); + // *//* */ test("MixZI_wFoo_IfwBar___", new MixZI_wFoo_IfwBar___[C], 3, "foo"); + // *//* */ test("MixZI_wFoo_IfwBar__f", new MixZI_wFoo_IfwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_wFoo_IfwBar_I_", new MixZI_wFoo_IfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_wFoo_IfwBar_If", new MixZI_wFoo_IfwBar_If[C], 3, "bar"); + // *//* */ test("MixZI_wFoo_IfwBarY__", new MixZI_wFoo_IfwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_wFoo_IfwBarY_f", new MixZI_wFoo_IfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_wFoo_IfwBarYI_", new MixZI_wFoo_IfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_wFoo_IfwBarYIf", new MixZI_wFoo_IfwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_wFooX__ ", new MixZI_wFooX__ [C], 2, null ); + // */abstract test("MixZI_wFooX__wBar___", new MixZI_wFooX__wBar___[C], 3, null ); + /* *//* */ test("MixZI_wFooX__wBar__f", new MixZI_wFooX__wBar__f[C], 3, "bar"); + // */abstract test("MixZI_wFooX__wBar_I_", new MixZI_wFooX__wBar_I_[C], 3, null ); + // *//* */ test("MixZI_wFooX__wBar_If", new MixZI_wFooX__wBar_If[C], 3, "bar"); + // */abstract test("MixZI_wFooX__wBarY__", new MixZI_wFooX__wBarY__[C], 3, null ); + /* *//* */ test("MixZI_wFooX__wBarY_f", new MixZI_wFooX__wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_wFooX__wBarYI_", new MixZI_wFooX__wBarYI_[C], 3, null ); + // *//* */ test("MixZI_wFooX__wBarYIf", new MixZI_wFooX__wBarYIf[C], 3, "bar"); + /* *//* */ test("MixZI_wFooX_f ", new MixZI_wFooX_f [C], 2, "foo"); + /* *//* */ test("MixZI_wFooX_fwBar___", new MixZI_wFooX_fwBar___[C], 3, "foo"); + // *//* */ test("MixZI_wFooX_fwBar__f", new MixZI_wFooX_fwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_wFooX_fwBar_I_", new MixZI_wFooX_fwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_wFooX_fwBar_If", new MixZI_wFooX_fwBar_If[C], 3, "bar"); + /* *//* */ test("MixZI_wFooX_fwBarY__", new MixZI_wFooX_fwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_wFooX_fwBarY_f", new MixZI_wFooX_fwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_wFooX_fwBarYI_", new MixZI_wFooX_fwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_wFooX_fwBarYIf", new MixZI_wFooX_fwBarYIf[C], 3, "bar"); + // */abstract test("MixZI_wFooXI_ ", new MixZI_wFooXI_ [C], 2, null ); + // */abstract test("MixZI_wFooXI_wBar___", new MixZI_wFooXI_wBar___[C], 3, null ); + // *//* */ test("MixZI_wFooXI_wBar__f", new MixZI_wFooXI_wBar__f[C], 3, "bar"); + // */abstract test("MixZI_wFooXI_wBar_I_", new MixZI_wFooXI_wBar_I_[C], 3, null ); + // *//* */ test("MixZI_wFooXI_wBar_If", new MixZI_wFooXI_wBar_If[C], 3, "bar"); + // */abstract test("MixZI_wFooXI_wBarY__", new MixZI_wFooXI_wBarY__[C], 3, null ); + // *//* */ test("MixZI_wFooXI_wBarY_f", new MixZI_wFooXI_wBarY_f[C], 3, "bar"); + // */abstract test("MixZI_wFooXI_wBarYI_", new MixZI_wFooXI_wBarYI_[C], 3, null ); + // *//* */ test("MixZI_wFooXI_wBarYIf", new MixZI_wFooXI_wBarYIf[C], 3, "bar"); + // *//* */ test("MixZI_wFooXIf ", new MixZI_wFooXIf [C], 2, "foo"); + // *//* */ test("MixZI_wFooXIfwBar___", new MixZI_wFooXIfwBar___[C], 3, "foo"); + // *//* */ test("MixZI_wFooXIfwBar__f", new MixZI_wFooXIfwBar__f[C], 3, "bar"); + // *//* */ test("MixZI_wFooXIfwBar_I_", new MixZI_wFooXIfwBar_I_[C], 3, "foo"); + // *//* */ test("MixZI_wFooXIfwBar_If", new MixZI_wFooXIfwBar_If[C], 3, "bar"); + // *//* */ test("MixZI_wFooXIfwBarY__", new MixZI_wFooXIfwBarY__[C], 3, "foo"); + // *//* */ test("MixZI_wFooXIfwBarY_f", new MixZI_wFooXIfwBarY_f[C], 3, "bar"); + // *//* */ test("MixZI_wFooXIfwBarYI_", new MixZI_wFooXIfwBarYI_[C], 3, "foo"); + // *//* */ test("MixZI_wFooXIfwBarYIf", new MixZI_wFooXIfwBarYIf[C], 3, "bar"); + + /* *//* */ test("MixZIfwFoo___ ", new MixZIfwFoo___ [C], 2, "mix"); + /* *//* */ test("MixZIfwFoo___wBar___", new MixZIfwFoo___wBar___[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo___wBar__f", new MixZIfwFoo___wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo___wBar_I_", new MixZIfwFoo___wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo___wBar_If", new MixZIfwFoo___wBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo___wBarY__", new MixZIfwFoo___wBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo___wBarY_f", new MixZIfwFoo___wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo___wBarYI_", new MixZIfwFoo___wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo___wBarYIf", new MixZIfwFoo___wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo__f ", new MixZIfwFoo__f [C], 2, "mix"); + /* *//* */ test("MixZIfwFoo__fwBar___", new MixZIfwFoo__fwBar___[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo__fwBar__f", new MixZIfwFoo__fwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo__fwBar_I_", new MixZIfwFoo__fwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo__fwBar_If", new MixZIfwFoo__fwBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo__fwBarY__", new MixZIfwFoo__fwBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfwFoo__fwBarY_f", new MixZIfwFoo__fwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo__fwBarYI_", new MixZIfwFoo__fwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo__fwBarYIf", new MixZIfwFoo__fwBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_ ", new MixZIfwFoo_I_ [C], 2, "mix"); + // *//* */ test("MixZIfwFoo_I_wBar___", new MixZIfwFoo_I_wBar___[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBar__f", new MixZIfwFoo_I_wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBar_I_", new MixZIfwFoo_I_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBar_If", new MixZIfwFoo_I_wBar_If[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBarY__", new MixZIfwFoo_I_wBarY__[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBarY_f", new MixZIfwFoo_I_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBarYI_", new MixZIfwFoo_I_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_I_wBarYIf", new MixZIfwFoo_I_wBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_If ", new MixZIfwFoo_If [C], 2, "mix"); + // *//* */ test("MixZIfwFoo_IfwBar___", new MixZIfwFoo_IfwBar___[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBar__f", new MixZIfwFoo_IfwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBar_I_", new MixZIfwFoo_IfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBar_If", new MixZIfwFoo_IfwBar_If[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBarY__", new MixZIfwFoo_IfwBarY__[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBarY_f", new MixZIfwFoo_IfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBarYI_", new MixZIfwFoo_IfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFoo_IfwBarYIf", new MixZIfwFoo_IfwBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX__ ", new MixZIfwFooX__ [C], 2, "mix"); + /* *//* */ test("MixZIfwFooX__wBar___", new MixZIfwFooX__wBar___[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX__wBar__f", new MixZIfwFooX__wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFooX__wBar_I_", new MixZIfwFooX__wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFooX__wBar_If", new MixZIfwFooX__wBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX__wBarY__", new MixZIfwFooX__wBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX__wBarY_f", new MixZIfwFooX__wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFooX__wBarYI_", new MixZIfwFooX__wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFooX__wBarYIf", new MixZIfwFooX__wBarYIf[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX_f ", new MixZIfwFooX_f [C], 2, "mix"); + /* *//* */ test("MixZIfwFooX_fwBar___", new MixZIfwFooX_fwBar___[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX_fwBar__f", new MixZIfwFooX_fwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFooX_fwBar_I_", new MixZIfwFooX_fwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFooX_fwBar_If", new MixZIfwFooX_fwBar_If[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX_fwBarY__", new MixZIfwFooX_fwBarY__[C], 3, "mix"); + /* *//* */ test("MixZIfwFooX_fwBarY_f", new MixZIfwFooX_fwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFooX_fwBarYI_", new MixZIfwFooX_fwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFooX_fwBarYIf", new MixZIfwFooX_fwBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_ ", new MixZIfwFooXI_ [C], 2, "mix"); + // *//* */ test("MixZIfwFooXI_wBar___", new MixZIfwFooXI_wBar___[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBar__f", new MixZIfwFooXI_wBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBar_I_", new MixZIfwFooXI_wBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBar_If", new MixZIfwFooXI_wBar_If[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBarY__", new MixZIfwFooXI_wBarY__[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBarY_f", new MixZIfwFooXI_wBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBarYI_", new MixZIfwFooXI_wBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFooXI_wBarYIf", new MixZIfwFooXI_wBarYIf[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIf ", new MixZIfwFooXIf [C], 2, "mix"); + // *//* */ test("MixZIfwFooXIfwBar___", new MixZIfwFooXIfwBar___[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBar__f", new MixZIfwFooXIfwBar__f[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBar_I_", new MixZIfwFooXIfwBar_I_[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBar_If", new MixZIfwFooXIfwBar_If[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBarY__", new MixZIfwFooXIfwBarY__[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBarY_f", new MixZIfwFooXIfwBarY_f[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBarYI_", new MixZIfwFooXIfwBarYI_[C], 3, "mix"); + // *//* */ test("MixZIfwFooXIfwBarYIf", new MixZIfwFooXIfwBarYIf[C], 3, "mix"); + + + + + + /* */test("S_____eFoo___ ", new S_____eFoo___ , 3, "sub"); + /* */test("S_____eFoo___wBar___", new S_____eFoo___wBar___ , 4, "sub"); + /* */test("S_____eFoo___wBar__f", new S_____eFoo___wBar__f , 4, "bar"); + /* */test("S_____eFoo___wBar_I_", new S_____eFoo___wBar_I_ , 4, "sub"); + /* */test("S_____eFoo___wBar_If", new S_____eFoo___wBar_If , 4, "bar"); + /* */test("S_____eFoo___wBarY__", new S_____eFoo___wBarY__ , 4, "sub"); + /* */test("S_____eFoo___wBarY_f", new S_____eFoo___wBarY_f , 4, "bar"); + /* */test("S_____eFoo___wBarYI_", new S_____eFoo___wBarYI_ , 4, "sub"); + /* */test("S_____eFoo___wBarYIf", new S_____eFoo___wBarYIf , 4, "bar"); + /* */test("S_____eFoo__f ", new S_____eFoo__f , 3, "foo"); + /* */test("S_____eFoo__fwBar___", new S_____eFoo__fwBar___ , 4, "foo"); + // */test("S_____eFoo__fwBar__f", new S_____eFoo__fwBar__f , 4, "bar"); + /* */test("S_____eFoo__fwBar_I_", new S_____eFoo__fwBar_I_ , 4, "foo"); + // */test("S_____eFoo__fwBar_If", new S_____eFoo__fwBar_If , 4, "bar"); + /* */test("S_____eFoo__fwBarY__", new S_____eFoo__fwBarY__ , 4, "foo"); + // */test("S_____eFoo__fwBarY_f", new S_____eFoo__fwBarY_f , 4, "bar"); + /* */test("S_____eFoo__fwBarYI_", new S_____eFoo__fwBarYI_ , 4, "foo"); + // */test("S_____eFoo__fwBarYIf", new S_____eFoo__fwBarYIf , 4, "bar"); + /* */test("S_____eFoo_I_ ", new S_____eFoo_I_ , 3, "sub"); + /* */test("S_____eFoo_I_wBar___", new S_____eFoo_I_wBar___ , 4, "sub"); + /* */test("S_____eFoo_I_wBar__f", new S_____eFoo_I_wBar__f , 4, "bar"); + // */test("S_____eFoo_I_wBar_I_", new S_____eFoo_I_wBar_I_ , 4, "sub"); + // */test("S_____eFoo_I_wBar_If", new S_____eFoo_I_wBar_If , 4, "bar"); + /* */test("S_____eFoo_I_wBarY__", new S_____eFoo_I_wBarY__ , 4, "sub"); + /* */test("S_____eFoo_I_wBarY_f", new S_____eFoo_I_wBarY_f , 4, "bar"); + // */test("S_____eFoo_I_wBarYI_", new S_____eFoo_I_wBarYI_ , 4, "sub"); + // */test("S_____eFoo_I_wBarYIf", new S_____eFoo_I_wBarYIf , 4, "bar"); + /* */test("S_____eFoo_If ", new S_____eFoo_If , 3, "foo"); + /* */test("S_____eFoo_IfwBar___", new S_____eFoo_IfwBar___ , 4, "foo"); + // */test("S_____eFoo_IfwBar__f", new S_____eFoo_IfwBar__f , 4, "bar"); + // */test("S_____eFoo_IfwBar_I_", new S_____eFoo_IfwBar_I_ , 4, "foo"); + // */test("S_____eFoo_IfwBar_If", new S_____eFoo_IfwBar_If , 4, "bar"); + /* */test("S_____eFoo_IfwBarY__", new S_____eFoo_IfwBarY__ , 4, "foo"); + // */test("S_____eFoo_IfwBarY_f", new S_____eFoo_IfwBarY_f , 4, "bar"); + // */test("S_____eFoo_IfwBarYI_", new S_____eFoo_IfwBarYI_ , 4, "foo"); + // */test("S_____eFoo_IfwBarYIf", new S_____eFoo_IfwBarYIf , 4, "bar"); + /* */test("S_____eFooX__ ", new S_____eFooX__ , 3, "sub"); + /* */test("S_____eFooX__wBar___", new S_____eFooX__wBar___ , 4, "sub"); + /* */test("S_____eFooX__wBar__f", new S_____eFooX__wBar__f , 4, "bar"); + /* */test("S_____eFooX__wBar_I_", new S_____eFooX__wBar_I_ , 4, "sub"); + /* */test("S_____eFooX__wBar_If", new S_____eFooX__wBar_If , 4, "bar"); + /* */test("S_____eFooX__wBarY__", new S_____eFooX__wBarY__ , 4, "sub"); + /* */test("S_____eFooX__wBarY_f", new S_____eFooX__wBarY_f , 4, "bar"); + /* */test("S_____eFooX__wBarYI_", new S_____eFooX__wBarYI_ , 4, "sub"); + /* */test("S_____eFooX__wBarYIf", new S_____eFooX__wBarYIf , 4, "bar"); + /* */test("S_____eFooX_f ", new S_____eFooX_f , 3, "foo"); + /* */test("S_____eFooX_fwBar___", new S_____eFooX_fwBar___ , 4, "foo"); + // */test("S_____eFooX_fwBar__f", new S_____eFooX_fwBar__f , 4, "bar"); + /* */test("S_____eFooX_fwBar_I_", new S_____eFooX_fwBar_I_ , 4, "foo"); + // */test("S_____eFooX_fwBar_If", new S_____eFooX_fwBar_If , 4, "bar"); + /* */test("S_____eFooX_fwBarY__", new S_____eFooX_fwBarY__ , 4, "foo"); + // */test("S_____eFooX_fwBarY_f", new S_____eFooX_fwBarY_f , 4, "bar"); + /* */test("S_____eFooX_fwBarYI_", new S_____eFooX_fwBarYI_ , 4, "foo"); + // */test("S_____eFooX_fwBarYIf", new S_____eFooX_fwBarYIf , 4, "bar"); + /* */test("S_____eFooXI_ ", new S_____eFooXI_ , 3, "sub"); + /* */test("S_____eFooXI_wBar___", new S_____eFooXI_wBar___ , 4, "sub"); + /* */test("S_____eFooXI_wBar__f", new S_____eFooXI_wBar__f , 4, "bar"); + // */test("S_____eFooXI_wBar_I_", new S_____eFooXI_wBar_I_ , 4, "sub"); + // */test("S_____eFooXI_wBar_If", new S_____eFooXI_wBar_If , 4, "bar"); + /* */test("S_____eFooXI_wBarY__", new S_____eFooXI_wBarY__ , 4, "sub"); + /* */test("S_____eFooXI_wBarY_f", new S_____eFooXI_wBarY_f , 4, "bar"); + // */test("S_____eFooXI_wBarYI_", new S_____eFooXI_wBarYI_ , 4, "sub"); + // */test("S_____eFooXI_wBarYIf", new S_____eFooXI_wBarYIf , 4, "bar"); + /* */test("S_____eFooXIf ", new S_____eFooXIf , 3, "foo"); + /* */test("S_____eFooXIfwBar___", new S_____eFooXIfwBar___ , 4, "foo"); + // */test("S_____eFooXIfwBar__f", new S_____eFooXIfwBar__f , 4, "bar"); + // */test("S_____eFooXIfwBar_I_", new S_____eFooXIfwBar_I_ , 4, "foo"); + // */test("S_____eFooXIfwBar_If", new S_____eFooXIfwBar_If , 4, "bar"); + /* */test("S_____eFooXIfwBarY__", new S_____eFooXIfwBarY__ , 4, "foo"); + // */test("S_____eFooXIfwBarY_f", new S_____eFooXIfwBarY_f , 4, "bar"); + // */test("S_____eFooXIfwBarYI_", new S_____eFooXIfwBarYI_ , 4, "foo"); + // */test("S_____eFooXIfwBarYIf", new S_____eFooXIfwBarYIf , 4, "bar"); + + /* */test("S____feFoo___ ", new S____feFoo___ , 3, "mix"); + /* */test("S____feFoo___wBar___", new S____feFoo___wBar___ , 4, "mix"); + /* */test("S____feFoo___wBar__f", new S____feFoo___wBar__f , 4, "mix"); + /* */test("S____feFoo___wBar_I_", new S____feFoo___wBar_I_ , 4, "mix"); + /* */test("S____feFoo___wBar_If", new S____feFoo___wBar_If , 4, "mix"); + /* */test("S____feFoo___wBarY__", new S____feFoo___wBarY__ , 4, "mix"); + /* */test("S____feFoo___wBarY_f", new S____feFoo___wBarY_f , 4, "mix"); + /* */test("S____feFoo___wBarYI_", new S____feFoo___wBarYI_ , 4, "mix"); + /* */test("S____feFoo___wBarYIf", new S____feFoo___wBarYIf , 4, "mix"); + /* */test("S____feFoo__f ", new S____feFoo__f , 3, "mix"); + /* */test("S____feFoo__fwBar___", new S____feFoo__fwBar___ , 4, "mix"); + /* */test("S____feFoo__fwBar__f", new S____feFoo__fwBar__f , 4, "mix"); + /* */test("S____feFoo__fwBar_I_", new S____feFoo__fwBar_I_ , 4, "mix"); + /* */test("S____feFoo__fwBar_If", new S____feFoo__fwBar_If , 4, "mix"); + /* */test("S____feFoo__fwBarY__", new S____feFoo__fwBarY__ , 4, "mix"); + /* */test("S____feFoo__fwBarY_f", new S____feFoo__fwBarY_f , 4, "mix"); + /* */test("S____feFoo__fwBarYI_", new S____feFoo__fwBarYI_ , 4, "mix"); + /* */test("S____feFoo__fwBarYIf", new S____feFoo__fwBarYIf , 4, "mix"); + /* */test("S____feFoo_I_ ", new S____feFoo_I_ , 3, "mix"); + /* */test("S____feFoo_I_wBar___", new S____feFoo_I_wBar___ , 4, "mix"); + /* */test("S____feFoo_I_wBar__f", new S____feFoo_I_wBar__f , 4, "mix"); + // */test("S____feFoo_I_wBar_I_", new S____feFoo_I_wBar_I_ , 4, "mix"); + // */test("S____feFoo_I_wBar_If", new S____feFoo_I_wBar_If , 4, "mix"); + /* */test("S____feFoo_I_wBarY__", new S____feFoo_I_wBarY__ , 4, "mix"); + /* */test("S____feFoo_I_wBarY_f", new S____feFoo_I_wBarY_f , 4, "mix"); + // */test("S____feFoo_I_wBarYI_", new S____feFoo_I_wBarYI_ , 4, "mix"); + // */test("S____feFoo_I_wBarYIf", new S____feFoo_I_wBarYIf , 4, "mix"); + /* */test("S____feFoo_If ", new S____feFoo_If , 3, "mix"); + /* */test("S____feFoo_IfwBar___", new S____feFoo_IfwBar___ , 4, "mix"); + /* */test("S____feFoo_IfwBar__f", new S____feFoo_IfwBar__f , 4, "mix"); + // */test("S____feFoo_IfwBar_I_", new S____feFoo_IfwBar_I_ , 4, "mix"); + // */test("S____feFoo_IfwBar_If", new S____feFoo_IfwBar_If , 4, "mix"); + /* */test("S____feFoo_IfwBarY__", new S____feFoo_IfwBarY__ , 4, "mix"); + /* */test("S____feFoo_IfwBarY_f", new S____feFoo_IfwBarY_f , 4, "mix"); + // */test("S____feFoo_IfwBarYI_", new S____feFoo_IfwBarYI_ , 4, "mix"); + // */test("S____feFoo_IfwBarYIf", new S____feFoo_IfwBarYIf , 4, "mix"); + /* */test("S____feFooX__ ", new S____feFooX__ , 3, "mix"); + /* */test("S____feFooX__wBar___", new S____feFooX__wBar___ , 4, "mix"); + /* */test("S____feFooX__wBar__f", new S____feFooX__wBar__f , 4, "mix"); + /* */test("S____feFooX__wBar_I_", new S____feFooX__wBar_I_ , 4, "mix"); + /* */test("S____feFooX__wBar_If", new S____feFooX__wBar_If , 4, "mix"); + /* */test("S____feFooX__wBarY__", new S____feFooX__wBarY__ , 4, "mix"); + /* */test("S____feFooX__wBarY_f", new S____feFooX__wBarY_f , 4, "mix"); + /* */test("S____feFooX__wBarYI_", new S____feFooX__wBarYI_ , 4, "mix"); + /* */test("S____feFooX__wBarYIf", new S____feFooX__wBarYIf , 4, "mix"); + /* */test("S____feFooX_f ", new S____feFooX_f , 3, "mix"); + /* */test("S____feFooX_fwBar___", new S____feFooX_fwBar___ , 4, "mix"); + /* */test("S____feFooX_fwBar__f", new S____feFooX_fwBar__f , 4, "mix"); + /* */test("S____feFooX_fwBar_I_", new S____feFooX_fwBar_I_ , 4, "mix"); + /* */test("S____feFooX_fwBar_If", new S____feFooX_fwBar_If , 4, "mix"); + /* */test("S____feFooX_fwBarY__", new S____feFooX_fwBarY__ , 4, "mix"); + /* */test("S____feFooX_fwBarY_f", new S____feFooX_fwBarY_f , 4, "mix"); + /* */test("S____feFooX_fwBarYI_", new S____feFooX_fwBarYI_ , 4, "mix"); + /* */test("S____feFooX_fwBarYIf", new S____feFooX_fwBarYIf , 4, "mix"); + /* */test("S____feFooXI_ ", new S____feFooXI_ , 3, "mix"); + /* */test("S____feFooXI_wBar___", new S____feFooXI_wBar___ , 4, "mix"); + /* */test("S____feFooXI_wBar__f", new S____feFooXI_wBar__f , 4, "mix"); + // */test("S____feFooXI_wBar_I_", new S____feFooXI_wBar_I_ , 4, "mix"); + // */test("S____feFooXI_wBar_If", new S____feFooXI_wBar_If , 4, "mix"); + /* */test("S____feFooXI_wBarY__", new S____feFooXI_wBarY__ , 4, "mix"); + /* */test("S____feFooXI_wBarY_f", new S____feFooXI_wBarY_f , 4, "mix"); + // */test("S____feFooXI_wBarYI_", new S____feFooXI_wBarYI_ , 4, "mix"); + // */test("S____feFooXI_wBarYIf", new S____feFooXI_wBarYIf , 4, "mix"); + /* */test("S____feFooXIf ", new S____feFooXIf , 3, "mix"); + /* */test("S____feFooXIfwBar___", new S____feFooXIfwBar___ , 4, "mix"); + /* */test("S____feFooXIfwBar__f", new S____feFooXIfwBar__f , 4, "mix"); + // */test("S____feFooXIfwBar_I_", new S____feFooXIfwBar_I_ , 4, "mix"); + // */test("S____feFooXIfwBar_If", new S____feFooXIfwBar_If , 4, "mix"); + /* */test("S____feFooXIfwBarY__", new S____feFooXIfwBarY__ , 4, "mix"); + /* */test("S____feFooXIfwBarY_f", new S____feFooXIfwBarY_f , 4, "mix"); + // */test("S____feFooXIfwBarYI_", new S____feFooXIfwBarYI_ , 4, "mix"); + // */test("S____feFooXIfwBarYIf", new S____feFooXIfwBarYIf , 4, "mix"); + + /* */test("S___I_eFoo___ ", new S___I_eFoo___ , 3, "sub"); + /* */test("S___I_eFoo___wBar___", new S___I_eFoo___wBar___ , 4, "sub"); + /* */test("S___I_eFoo___wBar__f", new S___I_eFoo___wBar__f , 4, "bar"); + // */test("S___I_eFoo___wBar_I_", new S___I_eFoo___wBar_I_ , 4, "sub"); + // */test("S___I_eFoo___wBar_If", new S___I_eFoo___wBar_If , 4, "bar"); + /* */test("S___I_eFoo___wBarY__", new S___I_eFoo___wBarY__ , 4, "sub"); + /* */test("S___I_eFoo___wBarY_f", new S___I_eFoo___wBarY_f , 4, "bar"); + // */test("S___I_eFoo___wBarYI_", new S___I_eFoo___wBarYI_ , 4, "sub"); + // */test("S___I_eFoo___wBarYIf", new S___I_eFoo___wBarYIf , 4, "bar"); + /* */test("S___I_eFoo__f ", new S___I_eFoo__f , 3, "foo"); + /* */test("S___I_eFoo__fwBar___", new S___I_eFoo__fwBar___ , 4, "foo"); + // */test("S___I_eFoo__fwBar__f", new S___I_eFoo__fwBar__f , 4, "bar"); + // */test("S___I_eFoo__fwBar_I_", new S___I_eFoo__fwBar_I_ , 4, "foo"); + // */test("S___I_eFoo__fwBar_If", new S___I_eFoo__fwBar_If , 4, "bar"); + /* */test("S___I_eFoo__fwBarY__", new S___I_eFoo__fwBarY__ , 4, "foo"); + // */test("S___I_eFoo__fwBarY_f", new S___I_eFoo__fwBarY_f , 4, "bar"); + // */test("S___I_eFoo__fwBarYI_", new S___I_eFoo__fwBarYI_ , 4, "foo"); + // */test("S___I_eFoo__fwBarYIf", new S___I_eFoo__fwBarYIf , 4, "bar"); + // */test("S___I_eFoo_I_ ", new S___I_eFoo_I_ , 3, "sub"); + // */test("S___I_eFoo_I_wBar___", new S___I_eFoo_I_wBar___ , 4, "sub"); + // */test("S___I_eFoo_I_wBar__f", new S___I_eFoo_I_wBar__f , 4, "bar"); + // */test("S___I_eFoo_I_wBar_I_", new S___I_eFoo_I_wBar_I_ , 4, "sub"); + // */test("S___I_eFoo_I_wBar_If", new S___I_eFoo_I_wBar_If , 4, "bar"); + // */test("S___I_eFoo_I_wBarY__", new S___I_eFoo_I_wBarY__ , 4, "sub"); + // */test("S___I_eFoo_I_wBarY_f", new S___I_eFoo_I_wBarY_f , 4, "bar"); + // */test("S___I_eFoo_I_wBarYI_", new S___I_eFoo_I_wBarYI_ , 4, "sub"); + // */test("S___I_eFoo_I_wBarYIf", new S___I_eFoo_I_wBarYIf , 4, "bar"); + // */test("S___I_eFoo_If ", new S___I_eFoo_If , 3, "foo"); + // */test("S___I_eFoo_IfwBar___", new S___I_eFoo_IfwBar___ , 4, "foo"); + // */test("S___I_eFoo_IfwBar__f", new S___I_eFoo_IfwBar__f , 4, "bar"); + // */test("S___I_eFoo_IfwBar_I_", new S___I_eFoo_IfwBar_I_ , 4, "foo"); + // */test("S___I_eFoo_IfwBar_If", new S___I_eFoo_IfwBar_If , 4, "bar"); + // */test("S___I_eFoo_IfwBarY__", new S___I_eFoo_IfwBarY__ , 4, "foo"); + // */test("S___I_eFoo_IfwBarY_f", new S___I_eFoo_IfwBarY_f , 4, "bar"); + // */test("S___I_eFoo_IfwBarYI_", new S___I_eFoo_IfwBarYI_ , 4, "foo"); + // */test("S___I_eFoo_IfwBarYIf", new S___I_eFoo_IfwBarYIf , 4, "bar"); + /* */test("S___I_eFooX__ ", new S___I_eFooX__ , 3, "sub"); + /* */test("S___I_eFooX__wBar___", new S___I_eFooX__wBar___ , 4, "sub"); + /* */test("S___I_eFooX__wBar__f", new S___I_eFooX__wBar__f , 4, "bar"); + // */test("S___I_eFooX__wBar_I_", new S___I_eFooX__wBar_I_ , 4, "sub"); + // */test("S___I_eFooX__wBar_If", new S___I_eFooX__wBar_If , 4, "bar"); + /* */test("S___I_eFooX__wBarY__", new S___I_eFooX__wBarY__ , 4, "sub"); + /* */test("S___I_eFooX__wBarY_f", new S___I_eFooX__wBarY_f , 4, "bar"); + // */test("S___I_eFooX__wBarYI_", new S___I_eFooX__wBarYI_ , 4, "sub"); + // */test("S___I_eFooX__wBarYIf", new S___I_eFooX__wBarYIf , 4, "bar"); + /* */test("S___I_eFooX_f ", new S___I_eFooX_f , 3, "foo"); + /* */test("S___I_eFooX_fwBar___", new S___I_eFooX_fwBar___ , 4, "foo"); + // */test("S___I_eFooX_fwBar__f", new S___I_eFooX_fwBar__f , 4, "bar"); + // */test("S___I_eFooX_fwBar_I_", new S___I_eFooX_fwBar_I_ , 4, "foo"); + // */test("S___I_eFooX_fwBar_If", new S___I_eFooX_fwBar_If , 4, "bar"); + /* */test("S___I_eFooX_fwBarY__", new S___I_eFooX_fwBarY__ , 4, "foo"); + // */test("S___I_eFooX_fwBarY_f", new S___I_eFooX_fwBarY_f , 4, "bar"); + // */test("S___I_eFooX_fwBarYI_", new S___I_eFooX_fwBarYI_ , 4, "foo"); + // */test("S___I_eFooX_fwBarYIf", new S___I_eFooX_fwBarYIf , 4, "bar"); + // */test("S___I_eFooXI_ ", new S___I_eFooXI_ , 3, "sub"); + // */test("S___I_eFooXI_wBar___", new S___I_eFooXI_wBar___ , 4, "sub"); + // */test("S___I_eFooXI_wBar__f", new S___I_eFooXI_wBar__f , 4, "bar"); + // */test("S___I_eFooXI_wBar_I_", new S___I_eFooXI_wBar_I_ , 4, "sub"); + // */test("S___I_eFooXI_wBar_If", new S___I_eFooXI_wBar_If , 4, "bar"); + // */test("S___I_eFooXI_wBarY__", new S___I_eFooXI_wBarY__ , 4, "sub"); + // */test("S___I_eFooXI_wBarY_f", new S___I_eFooXI_wBarY_f , 4, "bar"); + // */test("S___I_eFooXI_wBarYI_", new S___I_eFooXI_wBarYI_ , 4, "sub"); + // */test("S___I_eFooXI_wBarYIf", new S___I_eFooXI_wBarYIf , 4, "bar"); + // */test("S___I_eFooXIf ", new S___I_eFooXIf , 3, "foo"); + // */test("S___I_eFooXIfwBar___", new S___I_eFooXIfwBar___ , 4, "foo"); + // */test("S___I_eFooXIfwBar__f", new S___I_eFooXIfwBar__f , 4, "bar"); + // */test("S___I_eFooXIfwBar_I_", new S___I_eFooXIfwBar_I_ , 4, "foo"); + // */test("S___I_eFooXIfwBar_If", new S___I_eFooXIfwBar_If , 4, "bar"); + // */test("S___I_eFooXIfwBarY__", new S___I_eFooXIfwBarY__ , 4, "foo"); + // */test("S___I_eFooXIfwBarY_f", new S___I_eFooXIfwBarY_f , 4, "bar"); + // */test("S___I_eFooXIfwBarYI_", new S___I_eFooXIfwBarYI_ , 4, "foo"); + // */test("S___I_eFooXIfwBarYIf", new S___I_eFooXIfwBarYIf , 4, "bar"); + + /* */test("S___IfeFoo___ ", new S___IfeFoo___ , 3, "mix"); + /* */test("S___IfeFoo___wBar___", new S___IfeFoo___wBar___ , 4, "mix"); + /* */test("S___IfeFoo___wBar__f", new S___IfeFoo___wBar__f , 4, "mix"); + // */test("S___IfeFoo___wBar_I_", new S___IfeFoo___wBar_I_ , 4, "mix"); + // */test("S___IfeFoo___wBar_If", new S___IfeFoo___wBar_If , 4, "mix"); + /* */test("S___IfeFoo___wBarY__", new S___IfeFoo___wBarY__ , 4, "mix"); + /* */test("S___IfeFoo___wBarY_f", new S___IfeFoo___wBarY_f , 4, "mix"); + // */test("S___IfeFoo___wBarYI_", new S___IfeFoo___wBarYI_ , 4, "mix"); + // */test("S___IfeFoo___wBarYIf", new S___IfeFoo___wBarYIf , 4, "mix"); + /* */test("S___IfeFoo__f ", new S___IfeFoo__f , 3, "mix"); + /* */test("S___IfeFoo__fwBar___", new S___IfeFoo__fwBar___ , 4, "mix"); + /* */test("S___IfeFoo__fwBar__f", new S___IfeFoo__fwBar__f , 4, "mix"); + // */test("S___IfeFoo__fwBar_I_", new S___IfeFoo__fwBar_I_ , 4, "mix"); + // */test("S___IfeFoo__fwBar_If", new S___IfeFoo__fwBar_If , 4, "mix"); + /* */test("S___IfeFoo__fwBarY__", new S___IfeFoo__fwBarY__ , 4, "mix"); + /* */test("S___IfeFoo__fwBarY_f", new S___IfeFoo__fwBarY_f , 4, "mix"); + // */test("S___IfeFoo__fwBarYI_", new S___IfeFoo__fwBarYI_ , 4, "mix"); + // */test("S___IfeFoo__fwBarYIf", new S___IfeFoo__fwBarYIf , 4, "mix"); + // */test("S___IfeFoo_I_ ", new S___IfeFoo_I_ , 3, "mix"); + // */test("S___IfeFoo_I_wBar___", new S___IfeFoo_I_wBar___ , 4, "mix"); + // */test("S___IfeFoo_I_wBar__f", new S___IfeFoo_I_wBar__f , 4, "mix"); + // */test("S___IfeFoo_I_wBar_I_", new S___IfeFoo_I_wBar_I_ , 4, "mix"); + // */test("S___IfeFoo_I_wBar_If", new S___IfeFoo_I_wBar_If , 4, "mix"); + // */test("S___IfeFoo_I_wBarY__", new S___IfeFoo_I_wBarY__ , 4, "mix"); + // */test("S___IfeFoo_I_wBarY_f", new S___IfeFoo_I_wBarY_f , 4, "mix"); + // */test("S___IfeFoo_I_wBarYI_", new S___IfeFoo_I_wBarYI_ , 4, "mix"); + // */test("S___IfeFoo_I_wBarYIf", new S___IfeFoo_I_wBarYIf , 4, "mix"); + // */test("S___IfeFoo_If ", new S___IfeFoo_If , 3, "mix"); + // */test("S___IfeFoo_IfwBar___", new S___IfeFoo_IfwBar___ , 4, "mix"); + // */test("S___IfeFoo_IfwBar__f", new S___IfeFoo_IfwBar__f , 4, "mix"); + // */test("S___IfeFoo_IfwBar_I_", new S___IfeFoo_IfwBar_I_ , 4, "mix"); + // */test("S___IfeFoo_IfwBar_If", new S___IfeFoo_IfwBar_If , 4, "mix"); + // */test("S___IfeFoo_IfwBarY__", new S___IfeFoo_IfwBarY__ , 4, "mix"); + // */test("S___IfeFoo_IfwBarY_f", new S___IfeFoo_IfwBarY_f , 4, "mix"); + // */test("S___IfeFoo_IfwBarYI_", new S___IfeFoo_IfwBarYI_ , 4, "mix"); + // */test("S___IfeFoo_IfwBarYIf", new S___IfeFoo_IfwBarYIf , 4, "mix"); + /* */test("S___IfeFooX__ ", new S___IfeFooX__ , 3, "mix"); + /* */test("S___IfeFooX__wBar___", new S___IfeFooX__wBar___ , 4, "mix"); + /* */test("S___IfeFooX__wBar__f", new S___IfeFooX__wBar__f , 4, "mix"); + // */test("S___IfeFooX__wBar_I_", new S___IfeFooX__wBar_I_ , 4, "mix"); + // */test("S___IfeFooX__wBar_If", new S___IfeFooX__wBar_If , 4, "mix"); + /* */test("S___IfeFooX__wBarY__", new S___IfeFooX__wBarY__ , 4, "mix"); + /* */test("S___IfeFooX__wBarY_f", new S___IfeFooX__wBarY_f , 4, "mix"); + // */test("S___IfeFooX__wBarYI_", new S___IfeFooX__wBarYI_ , 4, "mix"); + // */test("S___IfeFooX__wBarYIf", new S___IfeFooX__wBarYIf , 4, "mix"); + /* */test("S___IfeFooX_f ", new S___IfeFooX_f , 3, "mix"); + /* */test("S___IfeFooX_fwBar___", new S___IfeFooX_fwBar___ , 4, "mix"); + /* */test("S___IfeFooX_fwBar__f", new S___IfeFooX_fwBar__f , 4, "mix"); + // */test("S___IfeFooX_fwBar_I_", new S___IfeFooX_fwBar_I_ , 4, "mix"); + // */test("S___IfeFooX_fwBar_If", new S___IfeFooX_fwBar_If , 4, "mix"); + /* */test("S___IfeFooX_fwBarY__", new S___IfeFooX_fwBarY__ , 4, "mix"); + /* */test("S___IfeFooX_fwBarY_f", new S___IfeFooX_fwBarY_f , 4, "mix"); + // */test("S___IfeFooX_fwBarYI_", new S___IfeFooX_fwBarYI_ , 4, "mix"); + // */test("S___IfeFooX_fwBarYIf", new S___IfeFooX_fwBarYIf , 4, "mix"); + // */test("S___IfeFooXI_ ", new S___IfeFooXI_ , 3, "mix"); + // */test("S___IfeFooXI_wBar___", new S___IfeFooXI_wBar___ , 4, "mix"); + // */test("S___IfeFooXI_wBar__f", new S___IfeFooXI_wBar__f , 4, "mix"); + // */test("S___IfeFooXI_wBar_I_", new S___IfeFooXI_wBar_I_ , 4, "mix"); + // */test("S___IfeFooXI_wBar_If", new S___IfeFooXI_wBar_If , 4, "mix"); + // */test("S___IfeFooXI_wBarY__", new S___IfeFooXI_wBarY__ , 4, "mix"); + // */test("S___IfeFooXI_wBarY_f", new S___IfeFooXI_wBarY_f , 4, "mix"); + // */test("S___IfeFooXI_wBarYI_", new S___IfeFooXI_wBarYI_ , 4, "mix"); + // */test("S___IfeFooXI_wBarYIf", new S___IfeFooXI_wBarYIf , 4, "mix"); + // */test("S___IfeFooXIf ", new S___IfeFooXIf , 3, "mix"); + // */test("S___IfeFooXIfwBar___", new S___IfeFooXIfwBar___ , 4, "mix"); + // */test("S___IfeFooXIfwBar__f", new S___IfeFooXIfwBar__f , 4, "mix"); + // */test("S___IfeFooXIfwBar_I_", new S___IfeFooXIfwBar_I_ , 4, "mix"); + // */test("S___IfeFooXIfwBar_If", new S___IfeFooXIfwBar_If , 4, "mix"); + // */test("S___IfeFooXIfwBarY__", new S___IfeFooXIfwBarY__ , 4, "mix"); + // */test("S___IfeFooXIfwBarY_f", new S___IfeFooXIfwBarY_f , 4, "mix"); + // */test("S___IfeFooXIfwBarYI_", new S___IfeFooXIfwBarYI_ , 4, "mix"); + // */test("S___IfeFooXIfwBarYIf", new S___IfeFooXIfwBarYIf , 4, "mix"); + + /* */test("S__Z__eFoo___ ", new S__Z__eFoo___ , 3, "sub"); + /* */test("S__Z__eFoo___wBar___", new S__Z__eFoo___wBar___ , 4, "sub"); + /* */test("S__Z__eFoo___wBar__f", new S__Z__eFoo___wBar__f , 4, "bar"); + /* */test("S__Z__eFoo___wBar_I_", new S__Z__eFoo___wBar_I_ , 4, "sub"); + /* */test("S__Z__eFoo___wBar_If", new S__Z__eFoo___wBar_If , 4, "bar"); + /* */test("S__Z__eFoo___wBarY__", new S__Z__eFoo___wBarY__ , 4, "sub"); + /* */test("S__Z__eFoo___wBarY_f", new S__Z__eFoo___wBarY_f , 4, "bar"); + /* */test("S__Z__eFoo___wBarYI_", new S__Z__eFoo___wBarYI_ , 4, "sub"); + /* */test("S__Z__eFoo___wBarYIf", new S__Z__eFoo___wBarYIf , 4, "bar"); + /* */test("S__Z__eFoo__f ", new S__Z__eFoo__f , 3, "foo"); + /* */test("S__Z__eFoo__fwBar___", new S__Z__eFoo__fwBar___ , 4, "foo"); + // */test("S__Z__eFoo__fwBar__f", new S__Z__eFoo__fwBar__f , 4, "bar"); + /* */test("S__Z__eFoo__fwBar_I_", new S__Z__eFoo__fwBar_I_ , 4, "foo"); + // */test("S__Z__eFoo__fwBar_If", new S__Z__eFoo__fwBar_If , 4, "bar"); + /* */test("S__Z__eFoo__fwBarY__", new S__Z__eFoo__fwBarY__ , 4, "foo"); + // */test("S__Z__eFoo__fwBarY_f", new S__Z__eFoo__fwBarY_f , 4, "bar"); + /* */test("S__Z__eFoo__fwBarYI_", new S__Z__eFoo__fwBarYI_ , 4, "foo"); + // */test("S__Z__eFoo__fwBarYIf", new S__Z__eFoo__fwBarYIf , 4, "bar"); + /* */test("S__Z__eFoo_I_ ", new S__Z__eFoo_I_ , 3, "sub"); + /* */test("S__Z__eFoo_I_wBar___", new S__Z__eFoo_I_wBar___ , 4, "sub"); + /* */test("S__Z__eFoo_I_wBar__f", new S__Z__eFoo_I_wBar__f , 4, "bar"); + // */test("S__Z__eFoo_I_wBar_I_", new S__Z__eFoo_I_wBar_I_ , 4, "sub"); + // */test("S__Z__eFoo_I_wBar_If", new S__Z__eFoo_I_wBar_If , 4, "bar"); + /* */test("S__Z__eFoo_I_wBarY__", new S__Z__eFoo_I_wBarY__ , 4, "sub"); + /* */test("S__Z__eFoo_I_wBarY_f", new S__Z__eFoo_I_wBarY_f , 4, "bar"); + // */test("S__Z__eFoo_I_wBarYI_", new S__Z__eFoo_I_wBarYI_ , 4, "sub"); + // */test("S__Z__eFoo_I_wBarYIf", new S__Z__eFoo_I_wBarYIf , 4, "bar"); + /* */test("S__Z__eFoo_If ", new S__Z__eFoo_If , 3, "foo"); + /* */test("S__Z__eFoo_IfwBar___", new S__Z__eFoo_IfwBar___ , 4, "foo"); + // */test("S__Z__eFoo_IfwBar__f", new S__Z__eFoo_IfwBar__f , 4, "bar"); + // */test("S__Z__eFoo_IfwBar_I_", new S__Z__eFoo_IfwBar_I_ , 4, "foo"); + // */test("S__Z__eFoo_IfwBar_If", new S__Z__eFoo_IfwBar_If , 4, "bar"); + /* */test("S__Z__eFoo_IfwBarY__", new S__Z__eFoo_IfwBarY__ , 4, "foo"); + // */test("S__Z__eFoo_IfwBarY_f", new S__Z__eFoo_IfwBarY_f , 4, "bar"); + // */test("S__Z__eFoo_IfwBarYI_", new S__Z__eFoo_IfwBarYI_ , 4, "foo"); + // */test("S__Z__eFoo_IfwBarYIf", new S__Z__eFoo_IfwBarYIf , 4, "bar"); + /* */test("S__Z__eFooX__ ", new S__Z__eFooX__ , 3, "sub"); + /* */test("S__Z__eFooX__wBar___", new S__Z__eFooX__wBar___ , 4, "sub"); + /* */test("S__Z__eFooX__wBar__f", new S__Z__eFooX__wBar__f , 4, "bar"); + /* */test("S__Z__eFooX__wBar_I_", new S__Z__eFooX__wBar_I_ , 4, "sub"); + /* */test("S__Z__eFooX__wBar_If", new S__Z__eFooX__wBar_If , 4, "bar"); + /* */test("S__Z__eFooX__wBarY__", new S__Z__eFooX__wBarY__ , 4, "sub"); + /* */test("S__Z__eFooX__wBarY_f", new S__Z__eFooX__wBarY_f , 4, "bar"); + /* */test("S__Z__eFooX__wBarYI_", new S__Z__eFooX__wBarYI_ , 4, "sub"); + /* */test("S__Z__eFooX__wBarYIf", new S__Z__eFooX__wBarYIf , 4, "bar"); + /* */test("S__Z__eFooX_f ", new S__Z__eFooX_f , 3, "foo"); + /* */test("S__Z__eFooX_fwBar___", new S__Z__eFooX_fwBar___ , 4, "foo"); + // */test("S__Z__eFooX_fwBar__f", new S__Z__eFooX_fwBar__f , 4, "bar"); + /* */test("S__Z__eFooX_fwBar_I_", new S__Z__eFooX_fwBar_I_ , 4, "foo"); + // */test("S__Z__eFooX_fwBar_If", new S__Z__eFooX_fwBar_If , 4, "bar"); + /* */test("S__Z__eFooX_fwBarY__", new S__Z__eFooX_fwBarY__ , 4, "foo"); + // */test("S__Z__eFooX_fwBarY_f", new S__Z__eFooX_fwBarY_f , 4, "bar"); + /* */test("S__Z__eFooX_fwBarYI_", new S__Z__eFooX_fwBarYI_ , 4, "foo"); + // */test("S__Z__eFooX_fwBarYIf", new S__Z__eFooX_fwBarYIf , 4, "bar"); + /* */test("S__Z__eFooXI_ ", new S__Z__eFooXI_ , 3, "sub"); + /* */test("S__Z__eFooXI_wBar___", new S__Z__eFooXI_wBar___ , 4, "sub"); + /* */test("S__Z__eFooXI_wBar__f", new S__Z__eFooXI_wBar__f , 4, "bar"); + // */test("S__Z__eFooXI_wBar_I_", new S__Z__eFooXI_wBar_I_ , 4, "sub"); + // */test("S__Z__eFooXI_wBar_If", new S__Z__eFooXI_wBar_If , 4, "bar"); + /* */test("S__Z__eFooXI_wBarY__", new S__Z__eFooXI_wBarY__ , 4, "sub"); + /* */test("S__Z__eFooXI_wBarY_f", new S__Z__eFooXI_wBarY_f , 4, "bar"); + // */test("S__Z__eFooXI_wBarYI_", new S__Z__eFooXI_wBarYI_ , 4, "sub"); + // */test("S__Z__eFooXI_wBarYIf", new S__Z__eFooXI_wBarYIf , 4, "bar"); + /* */test("S__Z__eFooXIf ", new S__Z__eFooXIf , 3, "foo"); + /* */test("S__Z__eFooXIfwBar___", new S__Z__eFooXIfwBar___ , 4, "foo"); + // */test("S__Z__eFooXIfwBar__f", new S__Z__eFooXIfwBar__f , 4, "bar"); + // */test("S__Z__eFooXIfwBar_I_", new S__Z__eFooXIfwBar_I_ , 4, "foo"); + // */test("S__Z__eFooXIfwBar_If", new S__Z__eFooXIfwBar_If , 4, "bar"); + /* */test("S__Z__eFooXIfwBarY__", new S__Z__eFooXIfwBarY__ , 4, "foo"); + // */test("S__Z__eFooXIfwBarY_f", new S__Z__eFooXIfwBarY_f , 4, "bar"); + // */test("S__Z__eFooXIfwBarYI_", new S__Z__eFooXIfwBarYI_ , 4, "foo"); + // */test("S__Z__eFooXIfwBarYIf", new S__Z__eFooXIfwBarYIf , 4, "bar"); + + /* */test("S__Z_feFoo___ ", new S__Z_feFoo___ , 3, "mix"); + /* */test("S__Z_feFoo___wBar___", new S__Z_feFoo___wBar___ , 4, "mix"); + /* */test("S__Z_feFoo___wBar__f", new S__Z_feFoo___wBar__f , 4, "mix"); + /* */test("S__Z_feFoo___wBar_I_", new S__Z_feFoo___wBar_I_ , 4, "mix"); + /* */test("S__Z_feFoo___wBar_If", new S__Z_feFoo___wBar_If , 4, "mix"); + /* */test("S__Z_feFoo___wBarY__", new S__Z_feFoo___wBarY__ , 4, "mix"); + /* */test("S__Z_feFoo___wBarY_f", new S__Z_feFoo___wBarY_f , 4, "mix"); + /* */test("S__Z_feFoo___wBarYI_", new S__Z_feFoo___wBarYI_ , 4, "mix"); + /* */test("S__Z_feFoo___wBarYIf", new S__Z_feFoo___wBarYIf , 4, "mix"); + /* */test("S__Z_feFoo__f ", new S__Z_feFoo__f , 3, "mix"); + /* */test("S__Z_feFoo__fwBar___", new S__Z_feFoo__fwBar___ , 4, "mix"); + /* */test("S__Z_feFoo__fwBar__f", new S__Z_feFoo__fwBar__f , 4, "mix"); + /* */test("S__Z_feFoo__fwBar_I_", new S__Z_feFoo__fwBar_I_ , 4, "mix"); + /* */test("S__Z_feFoo__fwBar_If", new S__Z_feFoo__fwBar_If , 4, "mix"); + /* */test("S__Z_feFoo__fwBarY__", new S__Z_feFoo__fwBarY__ , 4, "mix"); + /* */test("S__Z_feFoo__fwBarY_f", new S__Z_feFoo__fwBarY_f , 4, "mix"); + /* */test("S__Z_feFoo__fwBarYI_", new S__Z_feFoo__fwBarYI_ , 4, "mix"); + /* */test("S__Z_feFoo__fwBarYIf", new S__Z_feFoo__fwBarYIf , 4, "mix"); + /* */test("S__Z_feFoo_I_ ", new S__Z_feFoo_I_ , 3, "mix"); + /* */test("S__Z_feFoo_I_wBar___", new S__Z_feFoo_I_wBar___ , 4, "mix"); + /* */test("S__Z_feFoo_I_wBar__f", new S__Z_feFoo_I_wBar__f , 4, "mix"); + // */test("S__Z_feFoo_I_wBar_I_", new S__Z_feFoo_I_wBar_I_ , 4, "mix"); + // */test("S__Z_feFoo_I_wBar_If", new S__Z_feFoo_I_wBar_If , 4, "mix"); + /* */test("S__Z_feFoo_I_wBarY__", new S__Z_feFoo_I_wBarY__ , 4, "mix"); + /* */test("S__Z_feFoo_I_wBarY_f", new S__Z_feFoo_I_wBarY_f , 4, "mix"); + // */test("S__Z_feFoo_I_wBarYI_", new S__Z_feFoo_I_wBarYI_ , 4, "mix"); + // */test("S__Z_feFoo_I_wBarYIf", new S__Z_feFoo_I_wBarYIf , 4, "mix"); + /* */test("S__Z_feFoo_If ", new S__Z_feFoo_If , 3, "mix"); + /* */test("S__Z_feFoo_IfwBar___", new S__Z_feFoo_IfwBar___ , 4, "mix"); + /* */test("S__Z_feFoo_IfwBar__f", new S__Z_feFoo_IfwBar__f , 4, "mix"); + // */test("S__Z_feFoo_IfwBar_I_", new S__Z_feFoo_IfwBar_I_ , 4, "mix"); + // */test("S__Z_feFoo_IfwBar_If", new S__Z_feFoo_IfwBar_If , 4, "mix"); + /* */test("S__Z_feFoo_IfwBarY__", new S__Z_feFoo_IfwBarY__ , 4, "mix"); + /* */test("S__Z_feFoo_IfwBarY_f", new S__Z_feFoo_IfwBarY_f , 4, "mix"); + // */test("S__Z_feFoo_IfwBarYI_", new S__Z_feFoo_IfwBarYI_ , 4, "mix"); + // */test("S__Z_feFoo_IfwBarYIf", new S__Z_feFoo_IfwBarYIf , 4, "mix"); + /* */test("S__Z_feFooX__ ", new S__Z_feFooX__ , 3, "mix"); + /* */test("S__Z_feFooX__wBar___", new S__Z_feFooX__wBar___ , 4, "mix"); + /* */test("S__Z_feFooX__wBar__f", new S__Z_feFooX__wBar__f , 4, "mix"); + /* */test("S__Z_feFooX__wBar_I_", new S__Z_feFooX__wBar_I_ , 4, "mix"); + /* */test("S__Z_feFooX__wBar_If", new S__Z_feFooX__wBar_If , 4, "mix"); + /* */test("S__Z_feFooX__wBarY__", new S__Z_feFooX__wBarY__ , 4, "mix"); + /* */test("S__Z_feFooX__wBarY_f", new S__Z_feFooX__wBarY_f , 4, "mix"); + /* */test("S__Z_feFooX__wBarYI_", new S__Z_feFooX__wBarYI_ , 4, "mix"); + /* */test("S__Z_feFooX__wBarYIf", new S__Z_feFooX__wBarYIf , 4, "mix"); + /* */test("S__Z_feFooX_f ", new S__Z_feFooX_f , 3, "mix"); + /* */test("S__Z_feFooX_fwBar___", new S__Z_feFooX_fwBar___ , 4, "mix"); + /* */test("S__Z_feFooX_fwBar__f", new S__Z_feFooX_fwBar__f , 4, "mix"); + /* */test("S__Z_feFooX_fwBar_I_", new S__Z_feFooX_fwBar_I_ , 4, "mix"); + /* */test("S__Z_feFooX_fwBar_If", new S__Z_feFooX_fwBar_If , 4, "mix"); + /* */test("S__Z_feFooX_fwBarY__", new S__Z_feFooX_fwBarY__ , 4, "mix"); + /* */test("S__Z_feFooX_fwBarY_f", new S__Z_feFooX_fwBarY_f , 4, "mix"); + /* */test("S__Z_feFooX_fwBarYI_", new S__Z_feFooX_fwBarYI_ , 4, "mix"); + /* */test("S__Z_feFooX_fwBarYIf", new S__Z_feFooX_fwBarYIf , 4, "mix"); + /* */test("S__Z_feFooXI_ ", new S__Z_feFooXI_ , 3, "mix"); + /* */test("S__Z_feFooXI_wBar___", new S__Z_feFooXI_wBar___ , 4, "mix"); + /* */test("S__Z_feFooXI_wBar__f", new S__Z_feFooXI_wBar__f , 4, "mix"); + // */test("S__Z_feFooXI_wBar_I_", new S__Z_feFooXI_wBar_I_ , 4, "mix"); + // */test("S__Z_feFooXI_wBar_If", new S__Z_feFooXI_wBar_If , 4, "mix"); + /* */test("S__Z_feFooXI_wBarY__", new S__Z_feFooXI_wBarY__ , 4, "mix"); + /* */test("S__Z_feFooXI_wBarY_f", new S__Z_feFooXI_wBarY_f , 4, "mix"); + // */test("S__Z_feFooXI_wBarYI_", new S__Z_feFooXI_wBarYI_ , 4, "mix"); + // */test("S__Z_feFooXI_wBarYIf", new S__Z_feFooXI_wBarYIf , 4, "mix"); + /* */test("S__Z_feFooXIf ", new S__Z_feFooXIf , 3, "mix"); + /* */test("S__Z_feFooXIfwBar___", new S__Z_feFooXIfwBar___ , 4, "mix"); + /* */test("S__Z_feFooXIfwBar__f", new S__Z_feFooXIfwBar__f , 4, "mix"); + // */test("S__Z_feFooXIfwBar_I_", new S__Z_feFooXIfwBar_I_ , 4, "mix"); + // */test("S__Z_feFooXIfwBar_If", new S__Z_feFooXIfwBar_If , 4, "mix"); + /* */test("S__Z_feFooXIfwBarY__", new S__Z_feFooXIfwBarY__ , 4, "mix"); + /* */test("S__Z_feFooXIfwBarY_f", new S__Z_feFooXIfwBarY_f , 4, "mix"); + // */test("S__Z_feFooXIfwBarYI_", new S__Z_feFooXIfwBarYI_ , 4, "mix"); + // */test("S__Z_feFooXIfwBarYIf", new S__Z_feFooXIfwBarYIf , 4, "mix"); + + /* */test("S__ZI_eFoo___ ", new S__ZI_eFoo___ , 3, "sub"); + /* */test("S__ZI_eFoo___wBar___", new S__ZI_eFoo___wBar___ , 4, "sub"); + /* */test("S__ZI_eFoo___wBar__f", new S__ZI_eFoo___wBar__f , 4, "bar"); + // */test("S__ZI_eFoo___wBar_I_", new S__ZI_eFoo___wBar_I_ , 4, "sub"); + // */test("S__ZI_eFoo___wBar_If", new S__ZI_eFoo___wBar_If , 4, "bar"); + /* */test("S__ZI_eFoo___wBarY__", new S__ZI_eFoo___wBarY__ , 4, "sub"); + /* */test("S__ZI_eFoo___wBarY_f", new S__ZI_eFoo___wBarY_f , 4, "bar"); + // */test("S__ZI_eFoo___wBarYI_", new S__ZI_eFoo___wBarYI_ , 4, "sub"); + // */test("S__ZI_eFoo___wBarYIf", new S__ZI_eFoo___wBarYIf , 4, "bar"); + /* */test("S__ZI_eFoo__f ", new S__ZI_eFoo__f , 3, "foo"); + /* */test("S__ZI_eFoo__fwBar___", new S__ZI_eFoo__fwBar___ , 4, "foo"); + // */test("S__ZI_eFoo__fwBar__f", new S__ZI_eFoo__fwBar__f , 4, "bar"); + // */test("S__ZI_eFoo__fwBar_I_", new S__ZI_eFoo__fwBar_I_ , 4, "foo"); + // */test("S__ZI_eFoo__fwBar_If", new S__ZI_eFoo__fwBar_If , 4, "bar"); + /* */test("S__ZI_eFoo__fwBarY__", new S__ZI_eFoo__fwBarY__ , 4, "foo"); + // */test("S__ZI_eFoo__fwBarY_f", new S__ZI_eFoo__fwBarY_f , 4, "bar"); + // */test("S__ZI_eFoo__fwBarYI_", new S__ZI_eFoo__fwBarYI_ , 4, "foo"); + // */test("S__ZI_eFoo__fwBarYIf", new S__ZI_eFoo__fwBarYIf , 4, "bar"); + // */test("S__ZI_eFoo_I_ ", new S__ZI_eFoo_I_ , 3, "sub"); + // */test("S__ZI_eFoo_I_wBar___", new S__ZI_eFoo_I_wBar___ , 4, "sub"); + // */test("S__ZI_eFoo_I_wBar__f", new S__ZI_eFoo_I_wBar__f , 4, "bar"); + // */test("S__ZI_eFoo_I_wBar_I_", new S__ZI_eFoo_I_wBar_I_ , 4, "sub"); + // */test("S__ZI_eFoo_I_wBar_If", new S__ZI_eFoo_I_wBar_If , 4, "bar"); + // */test("S__ZI_eFoo_I_wBarY__", new S__ZI_eFoo_I_wBarY__ , 4, "sub"); + // */test("S__ZI_eFoo_I_wBarY_f", new S__ZI_eFoo_I_wBarY_f , 4, "bar"); + // */test("S__ZI_eFoo_I_wBarYI_", new S__ZI_eFoo_I_wBarYI_ , 4, "sub"); + // */test("S__ZI_eFoo_I_wBarYIf", new S__ZI_eFoo_I_wBarYIf , 4, "bar"); + // */test("S__ZI_eFoo_If ", new S__ZI_eFoo_If , 3, "foo"); + // */test("S__ZI_eFoo_IfwBar___", new S__ZI_eFoo_IfwBar___ , 4, "foo"); + // */test("S__ZI_eFoo_IfwBar__f", new S__ZI_eFoo_IfwBar__f , 4, "bar"); + // */test("S__ZI_eFoo_IfwBar_I_", new S__ZI_eFoo_IfwBar_I_ , 4, "foo"); + // */test("S__ZI_eFoo_IfwBar_If", new S__ZI_eFoo_IfwBar_If , 4, "bar"); + // */test("S__ZI_eFoo_IfwBarY__", new S__ZI_eFoo_IfwBarY__ , 4, "foo"); + // */test("S__ZI_eFoo_IfwBarY_f", new S__ZI_eFoo_IfwBarY_f , 4, "bar"); + // */test("S__ZI_eFoo_IfwBarYI_", new S__ZI_eFoo_IfwBarYI_ , 4, "foo"); + // */test("S__ZI_eFoo_IfwBarYIf", new S__ZI_eFoo_IfwBarYIf , 4, "bar"); + /* */test("S__ZI_eFooX__ ", new S__ZI_eFooX__ , 3, "sub"); + /* */test("S__ZI_eFooX__wBar___", new S__ZI_eFooX__wBar___ , 4, "sub"); + /* */test("S__ZI_eFooX__wBar__f", new S__ZI_eFooX__wBar__f , 4, "bar"); + // */test("S__ZI_eFooX__wBar_I_", new S__ZI_eFooX__wBar_I_ , 4, "sub"); + // */test("S__ZI_eFooX__wBar_If", new S__ZI_eFooX__wBar_If , 4, "bar"); + /* */test("S__ZI_eFooX__wBarY__", new S__ZI_eFooX__wBarY__ , 4, "sub"); + /* */test("S__ZI_eFooX__wBarY_f", new S__ZI_eFooX__wBarY_f , 4, "bar"); + // */test("S__ZI_eFooX__wBarYI_", new S__ZI_eFooX__wBarYI_ , 4, "sub"); + // */test("S__ZI_eFooX__wBarYIf", new S__ZI_eFooX__wBarYIf , 4, "bar"); + /* */test("S__ZI_eFooX_f ", new S__ZI_eFooX_f , 3, "foo"); + /* */test("S__ZI_eFooX_fwBar___", new S__ZI_eFooX_fwBar___ , 4, "foo"); + // */test("S__ZI_eFooX_fwBar__f", new S__ZI_eFooX_fwBar__f , 4, "bar"); + // */test("S__ZI_eFooX_fwBar_I_", new S__ZI_eFooX_fwBar_I_ , 4, "foo"); + // */test("S__ZI_eFooX_fwBar_If", new S__ZI_eFooX_fwBar_If , 4, "bar"); + /* */test("S__ZI_eFooX_fwBarY__", new S__ZI_eFooX_fwBarY__ , 4, "foo"); + // */test("S__ZI_eFooX_fwBarY_f", new S__ZI_eFooX_fwBarY_f , 4, "bar"); + // */test("S__ZI_eFooX_fwBarYI_", new S__ZI_eFooX_fwBarYI_ , 4, "foo"); + // */test("S__ZI_eFooX_fwBarYIf", new S__ZI_eFooX_fwBarYIf , 4, "bar"); + // */test("S__ZI_eFooXI_ ", new S__ZI_eFooXI_ , 3, "sub"); + // */test("S__ZI_eFooXI_wBar___", new S__ZI_eFooXI_wBar___ , 4, "sub"); + // */test("S__ZI_eFooXI_wBar__f", new S__ZI_eFooXI_wBar__f , 4, "bar"); + // */test("S__ZI_eFooXI_wBar_I_", new S__ZI_eFooXI_wBar_I_ , 4, "sub"); + // */test("S__ZI_eFooXI_wBar_If", new S__ZI_eFooXI_wBar_If , 4, "bar"); + // */test("S__ZI_eFooXI_wBarY__", new S__ZI_eFooXI_wBarY__ , 4, "sub"); + // */test("S__ZI_eFooXI_wBarY_f", new S__ZI_eFooXI_wBarY_f , 4, "bar"); + // */test("S__ZI_eFooXI_wBarYI_", new S__ZI_eFooXI_wBarYI_ , 4, "sub"); + // */test("S__ZI_eFooXI_wBarYIf", new S__ZI_eFooXI_wBarYIf , 4, "bar"); + // */test("S__ZI_eFooXIf ", new S__ZI_eFooXIf , 3, "foo"); + // */test("S__ZI_eFooXIfwBar___", new S__ZI_eFooXIfwBar___ , 4, "foo"); + // */test("S__ZI_eFooXIfwBar__f", new S__ZI_eFooXIfwBar__f , 4, "bar"); + // */test("S__ZI_eFooXIfwBar_I_", new S__ZI_eFooXIfwBar_I_ , 4, "foo"); + // */test("S__ZI_eFooXIfwBar_If", new S__ZI_eFooXIfwBar_If , 4, "bar"); + // */test("S__ZI_eFooXIfwBarY__", new S__ZI_eFooXIfwBarY__ , 4, "foo"); + // */test("S__ZI_eFooXIfwBarY_f", new S__ZI_eFooXIfwBarY_f , 4, "bar"); + // */test("S__ZI_eFooXIfwBarYI_", new S__ZI_eFooXIfwBarYI_ , 4, "foo"); + // */test("S__ZI_eFooXIfwBarYIf", new S__ZI_eFooXIfwBarYIf , 4, "bar"); + + /* */test("S__ZIfeFoo___ ", new S__ZIfeFoo___ , 3, "mix"); + /* */test("S__ZIfeFoo___wBar___", new S__ZIfeFoo___wBar___ , 4, "mix"); + /* */test("S__ZIfeFoo___wBar__f", new S__ZIfeFoo___wBar__f , 4, "mix"); + // */test("S__ZIfeFoo___wBar_I_", new S__ZIfeFoo___wBar_I_ , 4, "mix"); + // */test("S__ZIfeFoo___wBar_If", new S__ZIfeFoo___wBar_If , 4, "mix"); + /* */test("S__ZIfeFoo___wBarY__", new S__ZIfeFoo___wBarY__ , 4, "mix"); + /* */test("S__ZIfeFoo___wBarY_f", new S__ZIfeFoo___wBarY_f , 4, "mix"); + // */test("S__ZIfeFoo___wBarYI_", new S__ZIfeFoo___wBarYI_ , 4, "mix"); + // */test("S__ZIfeFoo___wBarYIf", new S__ZIfeFoo___wBarYIf , 4, "mix"); + /* */test("S__ZIfeFoo__f ", new S__ZIfeFoo__f , 3, "mix"); + /* */test("S__ZIfeFoo__fwBar___", new S__ZIfeFoo__fwBar___ , 4, "mix"); + /* */test("S__ZIfeFoo__fwBar__f", new S__ZIfeFoo__fwBar__f , 4, "mix"); + // */test("S__ZIfeFoo__fwBar_I_", new S__ZIfeFoo__fwBar_I_ , 4, "mix"); + // */test("S__ZIfeFoo__fwBar_If", new S__ZIfeFoo__fwBar_If , 4, "mix"); + /* */test("S__ZIfeFoo__fwBarY__", new S__ZIfeFoo__fwBarY__ , 4, "mix"); + /* */test("S__ZIfeFoo__fwBarY_f", new S__ZIfeFoo__fwBarY_f , 4, "mix"); + // */test("S__ZIfeFoo__fwBarYI_", new S__ZIfeFoo__fwBarYI_ , 4, "mix"); + // */test("S__ZIfeFoo__fwBarYIf", new S__ZIfeFoo__fwBarYIf , 4, "mix"); + // */test("S__ZIfeFoo_I_ ", new S__ZIfeFoo_I_ , 3, "mix"); + // */test("S__ZIfeFoo_I_wBar___", new S__ZIfeFoo_I_wBar___ , 4, "mix"); + // */test("S__ZIfeFoo_I_wBar__f", new S__ZIfeFoo_I_wBar__f , 4, "mix"); + // */test("S__ZIfeFoo_I_wBar_I_", new S__ZIfeFoo_I_wBar_I_ , 4, "mix"); + // */test("S__ZIfeFoo_I_wBar_If", new S__ZIfeFoo_I_wBar_If , 4, "mix"); + // */test("S__ZIfeFoo_I_wBarY__", new S__ZIfeFoo_I_wBarY__ , 4, "mix"); + // */test("S__ZIfeFoo_I_wBarY_f", new S__ZIfeFoo_I_wBarY_f , 4, "mix"); + // */test("S__ZIfeFoo_I_wBarYI_", new S__ZIfeFoo_I_wBarYI_ , 4, "mix"); + // */test("S__ZIfeFoo_I_wBarYIf", new S__ZIfeFoo_I_wBarYIf , 4, "mix"); + // */test("S__ZIfeFoo_If ", new S__ZIfeFoo_If , 3, "mix"); + // */test("S__ZIfeFoo_IfwBar___", new S__ZIfeFoo_IfwBar___ , 4, "mix"); + // */test("S__ZIfeFoo_IfwBar__f", new S__ZIfeFoo_IfwBar__f , 4, "mix"); + // */test("S__ZIfeFoo_IfwBar_I_", new S__ZIfeFoo_IfwBar_I_ , 4, "mix"); + // */test("S__ZIfeFoo_IfwBar_If", new S__ZIfeFoo_IfwBar_If , 4, "mix"); + // */test("S__ZIfeFoo_IfwBarY__", new S__ZIfeFoo_IfwBarY__ , 4, "mix"); + // */test("S__ZIfeFoo_IfwBarY_f", new S__ZIfeFoo_IfwBarY_f , 4, "mix"); + // */test("S__ZIfeFoo_IfwBarYI_", new S__ZIfeFoo_IfwBarYI_ , 4, "mix"); + // */test("S__ZIfeFoo_IfwBarYIf", new S__ZIfeFoo_IfwBarYIf , 4, "mix"); + /* */test("S__ZIfeFooX__ ", new S__ZIfeFooX__ , 3, "mix"); + /* */test("S__ZIfeFooX__wBar___", new S__ZIfeFooX__wBar___ , 4, "mix"); + /* */test("S__ZIfeFooX__wBar__f", new S__ZIfeFooX__wBar__f , 4, "mix"); + // */test("S__ZIfeFooX__wBar_I_", new S__ZIfeFooX__wBar_I_ , 4, "mix"); + // */test("S__ZIfeFooX__wBar_If", new S__ZIfeFooX__wBar_If , 4, "mix"); + /* */test("S__ZIfeFooX__wBarY__", new S__ZIfeFooX__wBarY__ , 4, "mix"); + /* */test("S__ZIfeFooX__wBarY_f", new S__ZIfeFooX__wBarY_f , 4, "mix"); + // */test("S__ZIfeFooX__wBarYI_", new S__ZIfeFooX__wBarYI_ , 4, "mix"); + // */test("S__ZIfeFooX__wBarYIf", new S__ZIfeFooX__wBarYIf , 4, "mix"); + /* */test("S__ZIfeFooX_f ", new S__ZIfeFooX_f , 3, "mix"); + /* */test("S__ZIfeFooX_fwBar___", new S__ZIfeFooX_fwBar___ , 4, "mix"); + /* */test("S__ZIfeFooX_fwBar__f", new S__ZIfeFooX_fwBar__f , 4, "mix"); + // */test("S__ZIfeFooX_fwBar_I_", new S__ZIfeFooX_fwBar_I_ , 4, "mix"); + // */test("S__ZIfeFooX_fwBar_If", new S__ZIfeFooX_fwBar_If , 4, "mix"); + /* */test("S__ZIfeFooX_fwBarY__", new S__ZIfeFooX_fwBarY__ , 4, "mix"); + /* */test("S__ZIfeFooX_fwBarY_f", new S__ZIfeFooX_fwBarY_f , 4, "mix"); + // */test("S__ZIfeFooX_fwBarYI_", new S__ZIfeFooX_fwBarYI_ , 4, "mix"); + // */test("S__ZIfeFooX_fwBarYIf", new S__ZIfeFooX_fwBarYIf , 4, "mix"); + // */test("S__ZIfeFooXI_ ", new S__ZIfeFooXI_ , 3, "mix"); + // */test("S__ZIfeFooXI_wBar___", new S__ZIfeFooXI_wBar___ , 4, "mix"); + // */test("S__ZIfeFooXI_wBar__f", new S__ZIfeFooXI_wBar__f , 4, "mix"); + // */test("S__ZIfeFooXI_wBar_I_", new S__ZIfeFooXI_wBar_I_ , 4, "mix"); + // */test("S__ZIfeFooXI_wBar_If", new S__ZIfeFooXI_wBar_If , 4, "mix"); + // */test("S__ZIfeFooXI_wBarY__", new S__ZIfeFooXI_wBarY__ , 4, "mix"); + // */test("S__ZIfeFooXI_wBarY_f", new S__ZIfeFooXI_wBarY_f , 4, "mix"); + // */test("S__ZIfeFooXI_wBarYI_", new S__ZIfeFooXI_wBarYI_ , 4, "mix"); + // */test("S__ZIfeFooXI_wBarYIf", new S__ZIfeFooXI_wBarYIf , 4, "mix"); + // */test("S__ZIfeFooXIf ", new S__ZIfeFooXIf , 3, "mix"); + // */test("S__ZIfeFooXIfwBar___", new S__ZIfeFooXIfwBar___ , 4, "mix"); + // */test("S__ZIfeFooXIfwBar__f", new S__ZIfeFooXIfwBar__f , 4, "mix"); + // */test("S__ZIfeFooXIfwBar_I_", new S__ZIfeFooXIfwBar_I_ , 4, "mix"); + // */test("S__ZIfeFooXIfwBar_If", new S__ZIfeFooXIfwBar_If , 4, "mix"); + // */test("S__ZIfeFooXIfwBarY__", new S__ZIfeFooXIfwBarY__ , 4, "mix"); + // */test("S__ZIfeFooXIfwBarY_f", new S__ZIfeFooXIfwBarY_f , 4, "mix"); + // */test("S__ZIfeFooXIfwBarYI_", new S__ZIfeFooXIfwBarYI_ , 4, "mix"); + // */test("S__ZIfeFooXIfwBarYIf", new S__ZIfeFooXIfwBarYIf , 4, "mix"); + + + + /* */test("S_____wFoo___ ", new S_____wFoo___ , 3, "sub"); + /* */test("S_____wFoo___wBar___", new S_____wFoo___wBar___ , 4, "sub"); + /* */test("S_____wFoo___wBar__f", new S_____wFoo___wBar__f , 4, "bar"); + /* */test("S_____wFoo___wBar_I_", new S_____wFoo___wBar_I_ , 4, "sub"); + /* */test("S_____wFoo___wBar_If", new S_____wFoo___wBar_If , 4, "bar"); + /* */test("S_____wFoo___wBarY__", new S_____wFoo___wBarY__ , 4, "sub"); + /* */test("S_____wFoo___wBarY_f", new S_____wFoo___wBarY_f , 4, "bar"); + /* */test("S_____wFoo___wBarYI_", new S_____wFoo___wBarYI_ , 4, "sub"); + /* */test("S_____wFoo___wBarYIf", new S_____wFoo___wBarYIf , 4, "bar"); + /* */test("S_____wFoo__f ", new S_____wFoo__f , 3, "foo"); + /* */test("S_____wFoo__fwBar___", new S_____wFoo__fwBar___ , 4, "foo"); + // */test("S_____wFoo__fwBar__f", new S_____wFoo__fwBar__f , 4, "bar"); + /* */test("S_____wFoo__fwBar_I_", new S_____wFoo__fwBar_I_ , 4, "foo"); + // */test("S_____wFoo__fwBar_If", new S_____wFoo__fwBar_If , 4, "bar"); + /* */test("S_____wFoo__fwBarY__", new S_____wFoo__fwBarY__ , 4, "foo"); + // */test("S_____wFoo__fwBarY_f", new S_____wFoo__fwBarY_f , 4, "bar"); + /* */test("S_____wFoo__fwBarYI_", new S_____wFoo__fwBarYI_ , 4, "foo"); + // */test("S_____wFoo__fwBarYIf", new S_____wFoo__fwBarYIf , 4, "bar"); + /* */test("S_____wFoo_I_ ", new S_____wFoo_I_ , 3, "sub"); + /* */test("S_____wFoo_I_wBar___", new S_____wFoo_I_wBar___ , 4, "sub"); + /* */test("S_____wFoo_I_wBar__f", new S_____wFoo_I_wBar__f , 4, "bar"); + // */test("S_____wFoo_I_wBar_I_", new S_____wFoo_I_wBar_I_ , 4, "sub"); + // */test("S_____wFoo_I_wBar_If", new S_____wFoo_I_wBar_If , 4, "bar"); + /* */test("S_____wFoo_I_wBarY__", new S_____wFoo_I_wBarY__ , 4, "sub"); + /* */test("S_____wFoo_I_wBarY_f", new S_____wFoo_I_wBarY_f , 4, "bar"); + // */test("S_____wFoo_I_wBarYI_", new S_____wFoo_I_wBarYI_ , 4, "sub"); + // */test("S_____wFoo_I_wBarYIf", new S_____wFoo_I_wBarYIf , 4, "bar"); + /* */test("S_____wFoo_If ", new S_____wFoo_If , 3, "foo"); + /* */test("S_____wFoo_IfwBar___", new S_____wFoo_IfwBar___ , 4, "foo"); + // */test("S_____wFoo_IfwBar__f", new S_____wFoo_IfwBar__f , 4, "bar"); + // */test("S_____wFoo_IfwBar_I_", new S_____wFoo_IfwBar_I_ , 4, "foo"); + // */test("S_____wFoo_IfwBar_If", new S_____wFoo_IfwBar_If , 4, "bar"); + /* */test("S_____wFoo_IfwBarY__", new S_____wFoo_IfwBarY__ , 4, "foo"); + // */test("S_____wFoo_IfwBarY_f", new S_____wFoo_IfwBarY_f , 4, "bar"); + // */test("S_____wFoo_IfwBarYI_", new S_____wFoo_IfwBarYI_ , 4, "foo"); + // */test("S_____wFoo_IfwBarYIf", new S_____wFoo_IfwBarYIf , 4, "bar"); + /* */test("S_____wFooX__ ", new S_____wFooX__ , 3, "sub"); + /* */test("S_____wFooX__wBar___", new S_____wFooX__wBar___ , 4, "sub"); + /* */test("S_____wFooX__wBar__f", new S_____wFooX__wBar__f , 4, "bar"); + /* */test("S_____wFooX__wBar_I_", new S_____wFooX__wBar_I_ , 4, "sub"); + /* */test("S_____wFooX__wBar_If", new S_____wFooX__wBar_If , 4, "bar"); + /* */test("S_____wFooX__wBarY__", new S_____wFooX__wBarY__ , 4, "sub"); + /* */test("S_____wFooX__wBarY_f", new S_____wFooX__wBarY_f , 4, "bar"); + /* */test("S_____wFooX__wBarYI_", new S_____wFooX__wBarYI_ , 4, "sub"); + /* */test("S_____wFooX__wBarYIf", new S_____wFooX__wBarYIf , 4, "bar"); + /* */test("S_____wFooX_f ", new S_____wFooX_f , 3, "foo"); + /* */test("S_____wFooX_fwBar___", new S_____wFooX_fwBar___ , 4, "foo"); + // */test("S_____wFooX_fwBar__f", new S_____wFooX_fwBar__f , 4, "bar"); + /* */test("S_____wFooX_fwBar_I_", new S_____wFooX_fwBar_I_ , 4, "foo"); + // */test("S_____wFooX_fwBar_If", new S_____wFooX_fwBar_If , 4, "bar"); + /* */test("S_____wFooX_fwBarY__", new S_____wFooX_fwBarY__ , 4, "foo"); + // */test("S_____wFooX_fwBarY_f", new S_____wFooX_fwBarY_f , 4, "bar"); + /* */test("S_____wFooX_fwBarYI_", new S_____wFooX_fwBarYI_ , 4, "foo"); + // */test("S_____wFooX_fwBarYIf", new S_____wFooX_fwBarYIf , 4, "bar"); + /* */test("S_____wFooXI_ ", new S_____wFooXI_ , 3, "sub"); + /* */test("S_____wFooXI_wBar___", new S_____wFooXI_wBar___ , 4, "sub"); + /* */test("S_____wFooXI_wBar__f", new S_____wFooXI_wBar__f , 4, "bar"); + // */test("S_____wFooXI_wBar_I_", new S_____wFooXI_wBar_I_ , 4, "sub"); + // */test("S_____wFooXI_wBar_If", new S_____wFooXI_wBar_If , 4, "bar"); + /* */test("S_____wFooXI_wBarY__", new S_____wFooXI_wBarY__ , 4, "sub"); + /* */test("S_____wFooXI_wBarY_f", new S_____wFooXI_wBarY_f , 4, "bar"); + // */test("S_____wFooXI_wBarYI_", new S_____wFooXI_wBarYI_ , 4, "sub"); + // */test("S_____wFooXI_wBarYIf", new S_____wFooXI_wBarYIf , 4, "bar"); + /* */test("S_____wFooXIf ", new S_____wFooXIf , 3, "foo"); + /* */test("S_____wFooXIfwBar___", new S_____wFooXIfwBar___ , 4, "foo"); + // */test("S_____wFooXIfwBar__f", new S_____wFooXIfwBar__f , 4, "bar"); + // */test("S_____wFooXIfwBar_I_", new S_____wFooXIfwBar_I_ , 4, "foo"); + // */test("S_____wFooXIfwBar_If", new S_____wFooXIfwBar_If , 4, "bar"); + /* */test("S_____wFooXIfwBarY__", new S_____wFooXIfwBarY__ , 4, "foo"); + // */test("S_____wFooXIfwBarY_f", new S_____wFooXIfwBarY_f , 4, "bar"); + // */test("S_____wFooXIfwBarYI_", new S_____wFooXIfwBarYI_ , 4, "foo"); + // */test("S_____wFooXIfwBarYIf", new S_____wFooXIfwBarYIf , 4, "bar"); + + /* */test("S____fwFoo___ ", new S____fwFoo___ , 3, "mix"); + /* */test("S____fwFoo___wBar___", new S____fwFoo___wBar___ , 4, "mix"); + /* */test("S____fwFoo___wBar__f", new S____fwFoo___wBar__f , 4, "mix"); + /* */test("S____fwFoo___wBar_I_", new S____fwFoo___wBar_I_ , 4, "mix"); + /* */test("S____fwFoo___wBar_If", new S____fwFoo___wBar_If , 4, "mix"); + /* */test("S____fwFoo___wBarY__", new S____fwFoo___wBarY__ , 4, "mix"); + /* */test("S____fwFoo___wBarY_f", new S____fwFoo___wBarY_f , 4, "mix"); + /* */test("S____fwFoo___wBarYI_", new S____fwFoo___wBarYI_ , 4, "mix"); + /* */test("S____fwFoo___wBarYIf", new S____fwFoo___wBarYIf , 4, "mix"); + /* */test("S____fwFoo__f ", new S____fwFoo__f , 3, "mix"); + /* */test("S____fwFoo__fwBar___", new S____fwFoo__fwBar___ , 4, "mix"); + /* */test("S____fwFoo__fwBar__f", new S____fwFoo__fwBar__f , 4, "mix"); + /* */test("S____fwFoo__fwBar_I_", new S____fwFoo__fwBar_I_ , 4, "mix"); + /* */test("S____fwFoo__fwBar_If", new S____fwFoo__fwBar_If , 4, "mix"); + /* */test("S____fwFoo__fwBarY__", new S____fwFoo__fwBarY__ , 4, "mix"); + /* */test("S____fwFoo__fwBarY_f", new S____fwFoo__fwBarY_f , 4, "mix"); + /* */test("S____fwFoo__fwBarYI_", new S____fwFoo__fwBarYI_ , 4, "mix"); + /* */test("S____fwFoo__fwBarYIf", new S____fwFoo__fwBarYIf , 4, "mix"); + /* */test("S____fwFoo_I_ ", new S____fwFoo_I_ , 3, "mix"); + /* */test("S____fwFoo_I_wBar___", new S____fwFoo_I_wBar___ , 4, "mix"); + /* */test("S____fwFoo_I_wBar__f", new S____fwFoo_I_wBar__f , 4, "mix"); + // */test("S____fwFoo_I_wBar_I_", new S____fwFoo_I_wBar_I_ , 4, "mix"); + // */test("S____fwFoo_I_wBar_If", new S____fwFoo_I_wBar_If , 4, "mix"); + /* */test("S____fwFoo_I_wBarY__", new S____fwFoo_I_wBarY__ , 4, "mix"); + /* */test("S____fwFoo_I_wBarY_f", new S____fwFoo_I_wBarY_f , 4, "mix"); + // */test("S____fwFoo_I_wBarYI_", new S____fwFoo_I_wBarYI_ , 4, "mix"); + // */test("S____fwFoo_I_wBarYIf", new S____fwFoo_I_wBarYIf , 4, "mix"); + /* */test("S____fwFoo_If ", new S____fwFoo_If , 3, "mix"); + /* */test("S____fwFoo_IfwBar___", new S____fwFoo_IfwBar___ , 4, "mix"); + /* */test("S____fwFoo_IfwBar__f", new S____fwFoo_IfwBar__f , 4, "mix"); + // */test("S____fwFoo_IfwBar_I_", new S____fwFoo_IfwBar_I_ , 4, "mix"); + // */test("S____fwFoo_IfwBar_If", new S____fwFoo_IfwBar_If , 4, "mix"); + /* */test("S____fwFoo_IfwBarY__", new S____fwFoo_IfwBarY__ , 4, "mix"); + /* */test("S____fwFoo_IfwBarY_f", new S____fwFoo_IfwBarY_f , 4, "mix"); + // */test("S____fwFoo_IfwBarYI_", new S____fwFoo_IfwBarYI_ , 4, "mix"); + // */test("S____fwFoo_IfwBarYIf", new S____fwFoo_IfwBarYIf , 4, "mix"); + /* */test("S____fwFooX__ ", new S____fwFooX__ , 3, "mix"); + /* */test("S____fwFooX__wBar___", new S____fwFooX__wBar___ , 4, "mix"); + /* */test("S____fwFooX__wBar__f", new S____fwFooX__wBar__f , 4, "mix"); + /* */test("S____fwFooX__wBar_I_", new S____fwFooX__wBar_I_ , 4, "mix"); + /* */test("S____fwFooX__wBar_If", new S____fwFooX__wBar_If , 4, "mix"); + /* */test("S____fwFooX__wBarY__", new S____fwFooX__wBarY__ , 4, "mix"); + /* */test("S____fwFooX__wBarY_f", new S____fwFooX__wBarY_f , 4, "mix"); + /* */test("S____fwFooX__wBarYI_", new S____fwFooX__wBarYI_ , 4, "mix"); + /* */test("S____fwFooX__wBarYIf", new S____fwFooX__wBarYIf , 4, "mix"); + /* */test("S____fwFooX_f ", new S____fwFooX_f , 3, "mix"); + /* */test("S____fwFooX_fwBar___", new S____fwFooX_fwBar___ , 4, "mix"); + /* */test("S____fwFooX_fwBar__f", new S____fwFooX_fwBar__f , 4, "mix"); + /* */test("S____fwFooX_fwBar_I_", new S____fwFooX_fwBar_I_ , 4, "mix"); + /* */test("S____fwFooX_fwBar_If", new S____fwFooX_fwBar_If , 4, "mix"); + /* */test("S____fwFooX_fwBarY__", new S____fwFooX_fwBarY__ , 4, "mix"); + /* */test("S____fwFooX_fwBarY_f", new S____fwFooX_fwBarY_f , 4, "mix"); + /* */test("S____fwFooX_fwBarYI_", new S____fwFooX_fwBarYI_ , 4, "mix"); + /* */test("S____fwFooX_fwBarYIf", new S____fwFooX_fwBarYIf , 4, "mix"); + /* */test("S____fwFooXI_ ", new S____fwFooXI_ , 3, "mix"); + /* */test("S____fwFooXI_wBar___", new S____fwFooXI_wBar___ , 4, "mix"); + /* */test("S____fwFooXI_wBar__f", new S____fwFooXI_wBar__f , 4, "mix"); + // */test("S____fwFooXI_wBar_I_", new S____fwFooXI_wBar_I_ , 4, "mix"); + // */test("S____fwFooXI_wBar_If", new S____fwFooXI_wBar_If , 4, "mix"); + /* */test("S____fwFooXI_wBarY__", new S____fwFooXI_wBarY__ , 4, "mix"); + /* */test("S____fwFooXI_wBarY_f", new S____fwFooXI_wBarY_f , 4, "mix"); + // */test("S____fwFooXI_wBarYI_", new S____fwFooXI_wBarYI_ , 4, "mix"); + // */test("S____fwFooXI_wBarYIf", new S____fwFooXI_wBarYIf , 4, "mix"); + /* */test("S____fwFooXIf ", new S____fwFooXIf , 3, "mix"); + /* */test("S____fwFooXIfwBar___", new S____fwFooXIfwBar___ , 4, "mix"); + /* */test("S____fwFooXIfwBar__f", new S____fwFooXIfwBar__f , 4, "mix"); + // */test("S____fwFooXIfwBar_I_", new S____fwFooXIfwBar_I_ , 4, "mix"); + // */test("S____fwFooXIfwBar_If", new S____fwFooXIfwBar_If , 4, "mix"); + /* */test("S____fwFooXIfwBarY__", new S____fwFooXIfwBarY__ , 4, "mix"); + /* */test("S____fwFooXIfwBarY_f", new S____fwFooXIfwBarY_f , 4, "mix"); + // */test("S____fwFooXIfwBarYI_", new S____fwFooXIfwBarYI_ , 4, "mix"); + // */test("S____fwFooXIfwBarYIf", new S____fwFooXIfwBarYIf , 4, "mix"); + + /* */test("S___I_wFoo___ ", new S___I_wFoo___ , 3, "sub"); + /* */test("S___I_wFoo___wBar___", new S___I_wFoo___wBar___ , 4, "sub"); + /* */test("S___I_wFoo___wBar__f", new S___I_wFoo___wBar__f , 4, "bar"); + // */test("S___I_wFoo___wBar_I_", new S___I_wFoo___wBar_I_ , 4, "sub"); + // */test("S___I_wFoo___wBar_If", new S___I_wFoo___wBar_If , 4, "bar"); + /* */test("S___I_wFoo___wBarY__", new S___I_wFoo___wBarY__ , 4, "sub"); + /* */test("S___I_wFoo___wBarY_f", new S___I_wFoo___wBarY_f , 4, "bar"); + // */test("S___I_wFoo___wBarYI_", new S___I_wFoo___wBarYI_ , 4, "sub"); + // */test("S___I_wFoo___wBarYIf", new S___I_wFoo___wBarYIf , 4, "bar"); + /* */test("S___I_wFoo__f ", new S___I_wFoo__f , 3, "foo"); + /* */test("S___I_wFoo__fwBar___", new S___I_wFoo__fwBar___ , 4, "foo"); + // */test("S___I_wFoo__fwBar__f", new S___I_wFoo__fwBar__f , 4, "bar"); + // */test("S___I_wFoo__fwBar_I_", new S___I_wFoo__fwBar_I_ , 4, "foo"); + // */test("S___I_wFoo__fwBar_If", new S___I_wFoo__fwBar_If , 4, "bar"); + /* */test("S___I_wFoo__fwBarY__", new S___I_wFoo__fwBarY__ , 4, "foo"); + // */test("S___I_wFoo__fwBarY_f", new S___I_wFoo__fwBarY_f , 4, "bar"); + // */test("S___I_wFoo__fwBarYI_", new S___I_wFoo__fwBarYI_ , 4, "foo"); + // */test("S___I_wFoo__fwBarYIf", new S___I_wFoo__fwBarYIf , 4, "bar"); + // */test("S___I_wFoo_I_ ", new S___I_wFoo_I_ , 3, "sub"); + // */test("S___I_wFoo_I_wBar___", new S___I_wFoo_I_wBar___ , 4, "sub"); + // */test("S___I_wFoo_I_wBar__f", new S___I_wFoo_I_wBar__f , 4, "bar"); + // */test("S___I_wFoo_I_wBar_I_", new S___I_wFoo_I_wBar_I_ , 4, "sub"); + // */test("S___I_wFoo_I_wBar_If", new S___I_wFoo_I_wBar_If , 4, "bar"); + // */test("S___I_wFoo_I_wBarY__", new S___I_wFoo_I_wBarY__ , 4, "sub"); + // */test("S___I_wFoo_I_wBarY_f", new S___I_wFoo_I_wBarY_f , 4, "bar"); + // */test("S___I_wFoo_I_wBarYI_", new S___I_wFoo_I_wBarYI_ , 4, "sub"); + // */test("S___I_wFoo_I_wBarYIf", new S___I_wFoo_I_wBarYIf , 4, "bar"); + // */test("S___I_wFoo_If ", new S___I_wFoo_If , 3, "foo"); + // */test("S___I_wFoo_IfwBar___", new S___I_wFoo_IfwBar___ , 4, "foo"); + // */test("S___I_wFoo_IfwBar__f", new S___I_wFoo_IfwBar__f , 4, "bar"); + // */test("S___I_wFoo_IfwBar_I_", new S___I_wFoo_IfwBar_I_ , 4, "foo"); + // */test("S___I_wFoo_IfwBar_If", new S___I_wFoo_IfwBar_If , 4, "bar"); + // */test("S___I_wFoo_IfwBarY__", new S___I_wFoo_IfwBarY__ , 4, "foo"); + // */test("S___I_wFoo_IfwBarY_f", new S___I_wFoo_IfwBarY_f , 4, "bar"); + // */test("S___I_wFoo_IfwBarYI_", new S___I_wFoo_IfwBarYI_ , 4, "foo"); + // */test("S___I_wFoo_IfwBarYIf", new S___I_wFoo_IfwBarYIf , 4, "bar"); + /* */test("S___I_wFooX__ ", new S___I_wFooX__ , 3, "sub"); + /* */test("S___I_wFooX__wBar___", new S___I_wFooX__wBar___ , 4, "sub"); + /* */test("S___I_wFooX__wBar__f", new S___I_wFooX__wBar__f , 4, "bar"); + // */test("S___I_wFooX__wBar_I_", new S___I_wFooX__wBar_I_ , 4, "sub"); + // */test("S___I_wFooX__wBar_If", new S___I_wFooX__wBar_If , 4, "bar"); + /* */test("S___I_wFooX__wBarY__", new S___I_wFooX__wBarY__ , 4, "sub"); + /* */test("S___I_wFooX__wBarY_f", new S___I_wFooX__wBarY_f , 4, "bar"); + // */test("S___I_wFooX__wBarYI_", new S___I_wFooX__wBarYI_ , 4, "sub"); + // */test("S___I_wFooX__wBarYIf", new S___I_wFooX__wBarYIf , 4, "bar"); + /* */test("S___I_wFooX_f ", new S___I_wFooX_f , 3, "foo"); + /* */test("S___I_wFooX_fwBar___", new S___I_wFooX_fwBar___ , 4, "foo"); + // */test("S___I_wFooX_fwBar__f", new S___I_wFooX_fwBar__f , 4, "bar"); + // */test("S___I_wFooX_fwBar_I_", new S___I_wFooX_fwBar_I_ , 4, "foo"); + // */test("S___I_wFooX_fwBar_If", new S___I_wFooX_fwBar_If , 4, "bar"); + /* */test("S___I_wFooX_fwBarY__", new S___I_wFooX_fwBarY__ , 4, "foo"); + // */test("S___I_wFooX_fwBarY_f", new S___I_wFooX_fwBarY_f , 4, "bar"); + // */test("S___I_wFooX_fwBarYI_", new S___I_wFooX_fwBarYI_ , 4, "foo"); + // */test("S___I_wFooX_fwBarYIf", new S___I_wFooX_fwBarYIf , 4, "bar"); + // */test("S___I_wFooXI_ ", new S___I_wFooXI_ , 3, "sub"); + // */test("S___I_wFooXI_wBar___", new S___I_wFooXI_wBar___ , 4, "sub"); + // */test("S___I_wFooXI_wBar__f", new S___I_wFooXI_wBar__f , 4, "bar"); + // */test("S___I_wFooXI_wBar_I_", new S___I_wFooXI_wBar_I_ , 4, "sub"); + // */test("S___I_wFooXI_wBar_If", new S___I_wFooXI_wBar_If , 4, "bar"); + // */test("S___I_wFooXI_wBarY__", new S___I_wFooXI_wBarY__ , 4, "sub"); + // */test("S___I_wFooXI_wBarY_f", new S___I_wFooXI_wBarY_f , 4, "bar"); + // */test("S___I_wFooXI_wBarYI_", new S___I_wFooXI_wBarYI_ , 4, "sub"); + // */test("S___I_wFooXI_wBarYIf", new S___I_wFooXI_wBarYIf , 4, "bar"); + // */test("S___I_wFooXIf ", new S___I_wFooXIf , 3, "foo"); + // */test("S___I_wFooXIfwBar___", new S___I_wFooXIfwBar___ , 4, "foo"); + // */test("S___I_wFooXIfwBar__f", new S___I_wFooXIfwBar__f , 4, "bar"); + // */test("S___I_wFooXIfwBar_I_", new S___I_wFooXIfwBar_I_ , 4, "foo"); + // */test("S___I_wFooXIfwBar_If", new S___I_wFooXIfwBar_If , 4, "bar"); + // */test("S___I_wFooXIfwBarY__", new S___I_wFooXIfwBarY__ , 4, "foo"); + // */test("S___I_wFooXIfwBarY_f", new S___I_wFooXIfwBarY_f , 4, "bar"); + // */test("S___I_wFooXIfwBarYI_", new S___I_wFooXIfwBarYI_ , 4, "foo"); + // */test("S___I_wFooXIfwBarYIf", new S___I_wFooXIfwBarYIf , 4, "bar"); + + /* */test("S___IfwFoo___ ", new S___IfwFoo___ , 3, "mix"); + /* */test("S___IfwFoo___wBar___", new S___IfwFoo___wBar___ , 4, "mix"); + /* */test("S___IfwFoo___wBar__f", new S___IfwFoo___wBar__f , 4, "mix"); + // */test("S___IfwFoo___wBar_I_", new S___IfwFoo___wBar_I_ , 4, "mix"); + // */test("S___IfwFoo___wBar_If", new S___IfwFoo___wBar_If , 4, "mix"); + /* */test("S___IfwFoo___wBarY__", new S___IfwFoo___wBarY__ , 4, "mix"); + /* */test("S___IfwFoo___wBarY_f", new S___IfwFoo___wBarY_f , 4, "mix"); + // */test("S___IfwFoo___wBarYI_", new S___IfwFoo___wBarYI_ , 4, "mix"); + // */test("S___IfwFoo___wBarYIf", new S___IfwFoo___wBarYIf , 4, "mix"); + /* */test("S___IfwFoo__f ", new S___IfwFoo__f , 3, "mix"); + /* */test("S___IfwFoo__fwBar___", new S___IfwFoo__fwBar___ , 4, "mix"); + /* */test("S___IfwFoo__fwBar__f", new S___IfwFoo__fwBar__f , 4, "mix"); + // */test("S___IfwFoo__fwBar_I_", new S___IfwFoo__fwBar_I_ , 4, "mix"); + // */test("S___IfwFoo__fwBar_If", new S___IfwFoo__fwBar_If , 4, "mix"); + /* */test("S___IfwFoo__fwBarY__", new S___IfwFoo__fwBarY__ , 4, "mix"); + /* */test("S___IfwFoo__fwBarY_f", new S___IfwFoo__fwBarY_f , 4, "mix"); + // */test("S___IfwFoo__fwBarYI_", new S___IfwFoo__fwBarYI_ , 4, "mix"); + // */test("S___IfwFoo__fwBarYIf", new S___IfwFoo__fwBarYIf , 4, "mix"); + // */test("S___IfwFoo_I_ ", new S___IfwFoo_I_ , 3, "mix"); + // */test("S___IfwFoo_I_wBar___", new S___IfwFoo_I_wBar___ , 4, "mix"); + // */test("S___IfwFoo_I_wBar__f", new S___IfwFoo_I_wBar__f , 4, "mix"); + // */test("S___IfwFoo_I_wBar_I_", new S___IfwFoo_I_wBar_I_ , 4, "mix"); + // */test("S___IfwFoo_I_wBar_If", new S___IfwFoo_I_wBar_If , 4, "mix"); + // */test("S___IfwFoo_I_wBarY__", new S___IfwFoo_I_wBarY__ , 4, "mix"); + // */test("S___IfwFoo_I_wBarY_f", new S___IfwFoo_I_wBarY_f , 4, "mix"); + // */test("S___IfwFoo_I_wBarYI_", new S___IfwFoo_I_wBarYI_ , 4, "mix"); + // */test("S___IfwFoo_I_wBarYIf", new S___IfwFoo_I_wBarYIf , 4, "mix"); + // */test("S___IfwFoo_If ", new S___IfwFoo_If , 3, "mix"); + // */test("S___IfwFoo_IfwBar___", new S___IfwFoo_IfwBar___ , 4, "mix"); + // */test("S___IfwFoo_IfwBar__f", new S___IfwFoo_IfwBar__f , 4, "mix"); + // */test("S___IfwFoo_IfwBar_I_", new S___IfwFoo_IfwBar_I_ , 4, "mix"); + // */test("S___IfwFoo_IfwBar_If", new S___IfwFoo_IfwBar_If , 4, "mix"); + // */test("S___IfwFoo_IfwBarY__", new S___IfwFoo_IfwBarY__ , 4, "mix"); + // */test("S___IfwFoo_IfwBarY_f", new S___IfwFoo_IfwBarY_f , 4, "mix"); + // */test("S___IfwFoo_IfwBarYI_", new S___IfwFoo_IfwBarYI_ , 4, "mix"); + // */test("S___IfwFoo_IfwBarYIf", new S___IfwFoo_IfwBarYIf , 4, "mix"); + /* */test("S___IfwFooX__ ", new S___IfwFooX__ , 3, "mix"); + /* */test("S___IfwFooX__wBar___", new S___IfwFooX__wBar___ , 4, "mix"); + /* */test("S___IfwFooX__wBar__f", new S___IfwFooX__wBar__f , 4, "mix"); + // */test("S___IfwFooX__wBar_I_", new S___IfwFooX__wBar_I_ , 4, "mix"); + // */test("S___IfwFooX__wBar_If", new S___IfwFooX__wBar_If , 4, "mix"); + /* */test("S___IfwFooX__wBarY__", new S___IfwFooX__wBarY__ , 4, "mix"); + /* */test("S___IfwFooX__wBarY_f", new S___IfwFooX__wBarY_f , 4, "mix"); + // */test("S___IfwFooX__wBarYI_", new S___IfwFooX__wBarYI_ , 4, "mix"); + // */test("S___IfwFooX__wBarYIf", new S___IfwFooX__wBarYIf , 4, "mix"); + /* */test("S___IfwFooX_f ", new S___IfwFooX_f , 3, "mix"); + /* */test("S___IfwFooX_fwBar___", new S___IfwFooX_fwBar___ , 4, "mix"); + /* */test("S___IfwFooX_fwBar__f", new S___IfwFooX_fwBar__f , 4, "mix"); + // */test("S___IfwFooX_fwBar_I_", new S___IfwFooX_fwBar_I_ , 4, "mix"); + // */test("S___IfwFooX_fwBar_If", new S___IfwFooX_fwBar_If , 4, "mix"); + /* */test("S___IfwFooX_fwBarY__", new S___IfwFooX_fwBarY__ , 4, "mix"); + /* */test("S___IfwFooX_fwBarY_f", new S___IfwFooX_fwBarY_f , 4, "mix"); + // */test("S___IfwFooX_fwBarYI_", new S___IfwFooX_fwBarYI_ , 4, "mix"); + // */test("S___IfwFooX_fwBarYIf", new S___IfwFooX_fwBarYIf , 4, "mix"); + // */test("S___IfwFooXI_ ", new S___IfwFooXI_ , 3, "mix"); + // */test("S___IfwFooXI_wBar___", new S___IfwFooXI_wBar___ , 4, "mix"); + // */test("S___IfwFooXI_wBar__f", new S___IfwFooXI_wBar__f , 4, "mix"); + // */test("S___IfwFooXI_wBar_I_", new S___IfwFooXI_wBar_I_ , 4, "mix"); + // */test("S___IfwFooXI_wBar_If", new S___IfwFooXI_wBar_If , 4, "mix"); + // */test("S___IfwFooXI_wBarY__", new S___IfwFooXI_wBarY__ , 4, "mix"); + // */test("S___IfwFooXI_wBarY_f", new S___IfwFooXI_wBarY_f , 4, "mix"); + // */test("S___IfwFooXI_wBarYI_", new S___IfwFooXI_wBarYI_ , 4, "mix"); + // */test("S___IfwFooXI_wBarYIf", new S___IfwFooXI_wBarYIf , 4, "mix"); + // */test("S___IfwFooXIf ", new S___IfwFooXIf , 3, "mix"); + // */test("S___IfwFooXIfwBar___", new S___IfwFooXIfwBar___ , 4, "mix"); + // */test("S___IfwFooXIfwBar__f", new S___IfwFooXIfwBar__f , 4, "mix"); + // */test("S___IfwFooXIfwBar_I_", new S___IfwFooXIfwBar_I_ , 4, "mix"); + // */test("S___IfwFooXIfwBar_If", new S___IfwFooXIfwBar_If , 4, "mix"); + // */test("S___IfwFooXIfwBarY__", new S___IfwFooXIfwBarY__ , 4, "mix"); + // */test("S___IfwFooXIfwBarY_f", new S___IfwFooXIfwBarY_f , 4, "mix"); + // */test("S___IfwFooXIfwBarYI_", new S___IfwFooXIfwBarYI_ , 4, "mix"); + // */test("S___IfwFooXIfwBarYIf", new S___IfwFooXIfwBarYIf , 4, "mix"); + + /* */test("S__Z__wFoo___ ", new S__Z__wFoo___ , 3, "sub"); + /* */test("S__Z__wFoo___wBar___", new S__Z__wFoo___wBar___ , 4, "sub"); + /* */test("S__Z__wFoo___wBar__f", new S__Z__wFoo___wBar__f , 4, "bar"); + /* */test("S__Z__wFoo___wBar_I_", new S__Z__wFoo___wBar_I_ , 4, "sub"); + /* */test("S__Z__wFoo___wBar_If", new S__Z__wFoo___wBar_If , 4, "bar"); + /* */test("S__Z__wFoo___wBarY__", new S__Z__wFoo___wBarY__ , 4, "sub"); + /* */test("S__Z__wFoo___wBarY_f", new S__Z__wFoo___wBarY_f , 4, "bar"); + /* */test("S__Z__wFoo___wBarYI_", new S__Z__wFoo___wBarYI_ , 4, "sub"); + /* */test("S__Z__wFoo___wBarYIf", new S__Z__wFoo___wBarYIf , 4, "bar"); + /* */test("S__Z__wFoo__f ", new S__Z__wFoo__f , 3, "foo"); + /* */test("S__Z__wFoo__fwBar___", new S__Z__wFoo__fwBar___ , 4, "foo"); + // */test("S__Z__wFoo__fwBar__f", new S__Z__wFoo__fwBar__f , 4, "bar"); + /* */test("S__Z__wFoo__fwBar_I_", new S__Z__wFoo__fwBar_I_ , 4, "foo"); + // */test("S__Z__wFoo__fwBar_If", new S__Z__wFoo__fwBar_If , 4, "bar"); + /* */test("S__Z__wFoo__fwBarY__", new S__Z__wFoo__fwBarY__ , 4, "foo"); + // */test("S__Z__wFoo__fwBarY_f", new S__Z__wFoo__fwBarY_f , 4, "bar"); + /* */test("S__Z__wFoo__fwBarYI_", new S__Z__wFoo__fwBarYI_ , 4, "foo"); + // */test("S__Z__wFoo__fwBarYIf", new S__Z__wFoo__fwBarYIf , 4, "bar"); + /* */test("S__Z__wFoo_I_ ", new S__Z__wFoo_I_ , 3, "sub"); + /* */test("S__Z__wFoo_I_wBar___", new S__Z__wFoo_I_wBar___ , 4, "sub"); + /* */test("S__Z__wFoo_I_wBar__f", new S__Z__wFoo_I_wBar__f , 4, "bar"); + // */test("S__Z__wFoo_I_wBar_I_", new S__Z__wFoo_I_wBar_I_ , 4, "sub"); + // */test("S__Z__wFoo_I_wBar_If", new S__Z__wFoo_I_wBar_If , 4, "bar"); + /* */test("S__Z__wFoo_I_wBarY__", new S__Z__wFoo_I_wBarY__ , 4, "sub"); + /* */test("S__Z__wFoo_I_wBarY_f", new S__Z__wFoo_I_wBarY_f , 4, "bar"); + // */test("S__Z__wFoo_I_wBarYI_", new S__Z__wFoo_I_wBarYI_ , 4, "sub"); + // */test("S__Z__wFoo_I_wBarYIf", new S__Z__wFoo_I_wBarYIf , 4, "bar"); + /* */test("S__Z__wFoo_If ", new S__Z__wFoo_If , 3, "foo"); + /* */test("S__Z__wFoo_IfwBar___", new S__Z__wFoo_IfwBar___ , 4, "foo"); + // */test("S__Z__wFoo_IfwBar__f", new S__Z__wFoo_IfwBar__f , 4, "bar"); + // */test("S__Z__wFoo_IfwBar_I_", new S__Z__wFoo_IfwBar_I_ , 4, "foo"); + // */test("S__Z__wFoo_IfwBar_If", new S__Z__wFoo_IfwBar_If , 4, "bar"); + /* */test("S__Z__wFoo_IfwBarY__", new S__Z__wFoo_IfwBarY__ , 4, "foo"); + // */test("S__Z__wFoo_IfwBarY_f", new S__Z__wFoo_IfwBarY_f , 4, "bar"); + // */test("S__Z__wFoo_IfwBarYI_", new S__Z__wFoo_IfwBarYI_ , 4, "foo"); + // */test("S__Z__wFoo_IfwBarYIf", new S__Z__wFoo_IfwBarYIf , 4, "bar"); + /* */test("S__Z__wFooX__ ", new S__Z__wFooX__ , 3, "sub"); + /* */test("S__Z__wFooX__wBar___", new S__Z__wFooX__wBar___ , 4, "sub"); + /* */test("S__Z__wFooX__wBar__f", new S__Z__wFooX__wBar__f , 4, "bar"); + /* */test("S__Z__wFooX__wBar_I_", new S__Z__wFooX__wBar_I_ , 4, "sub"); + /* */test("S__Z__wFooX__wBar_If", new S__Z__wFooX__wBar_If , 4, "bar"); + /* */test("S__Z__wFooX__wBarY__", new S__Z__wFooX__wBarY__ , 4, "sub"); + /* */test("S__Z__wFooX__wBarY_f", new S__Z__wFooX__wBarY_f , 4, "bar"); + /* */test("S__Z__wFooX__wBarYI_", new S__Z__wFooX__wBarYI_ , 4, "sub"); + /* */test("S__Z__wFooX__wBarYIf", new S__Z__wFooX__wBarYIf , 4, "bar"); + /* */test("S__Z__wFooX_f ", new S__Z__wFooX_f , 3, "foo"); + /* */test("S__Z__wFooX_fwBar___", new S__Z__wFooX_fwBar___ , 4, "foo"); + // */test("S__Z__wFooX_fwBar__f", new S__Z__wFooX_fwBar__f , 4, "bar"); + /* */test("S__Z__wFooX_fwBar_I_", new S__Z__wFooX_fwBar_I_ , 4, "foo"); + // */test("S__Z__wFooX_fwBar_If", new S__Z__wFooX_fwBar_If , 4, "bar"); + /* */test("S__Z__wFooX_fwBarY__", new S__Z__wFooX_fwBarY__ , 4, "foo"); + // */test("S__Z__wFooX_fwBarY_f", new S__Z__wFooX_fwBarY_f , 4, "bar"); + /* */test("S__Z__wFooX_fwBarYI_", new S__Z__wFooX_fwBarYI_ , 4, "foo"); + // */test("S__Z__wFooX_fwBarYIf", new S__Z__wFooX_fwBarYIf , 4, "bar"); + /* */test("S__Z__wFooXI_ ", new S__Z__wFooXI_ , 3, "sub"); + /* */test("S__Z__wFooXI_wBar___", new S__Z__wFooXI_wBar___ , 4, "sub"); + /* */test("S__Z__wFooXI_wBar__f", new S__Z__wFooXI_wBar__f , 4, "bar"); + // */test("S__Z__wFooXI_wBar_I_", new S__Z__wFooXI_wBar_I_ , 4, "sub"); + // */test("S__Z__wFooXI_wBar_If", new S__Z__wFooXI_wBar_If , 4, "bar"); + /* */test("S__Z__wFooXI_wBarY__", new S__Z__wFooXI_wBarY__ , 4, "sub"); + /* */test("S__Z__wFooXI_wBarY_f", new S__Z__wFooXI_wBarY_f , 4, "bar"); + // */test("S__Z__wFooXI_wBarYI_", new S__Z__wFooXI_wBarYI_ , 4, "sub"); + // */test("S__Z__wFooXI_wBarYIf", new S__Z__wFooXI_wBarYIf , 4, "bar"); + /* */test("S__Z__wFooXIf ", new S__Z__wFooXIf , 3, "foo"); + /* */test("S__Z__wFooXIfwBar___", new S__Z__wFooXIfwBar___ , 4, "foo"); + // */test("S__Z__wFooXIfwBar__f", new S__Z__wFooXIfwBar__f , 4, "bar"); + // */test("S__Z__wFooXIfwBar_I_", new S__Z__wFooXIfwBar_I_ , 4, "foo"); + // */test("S__Z__wFooXIfwBar_If", new S__Z__wFooXIfwBar_If , 4, "bar"); + /* */test("S__Z__wFooXIfwBarY__", new S__Z__wFooXIfwBarY__ , 4, "foo"); + // */test("S__Z__wFooXIfwBarY_f", new S__Z__wFooXIfwBarY_f , 4, "bar"); + // */test("S__Z__wFooXIfwBarYI_", new S__Z__wFooXIfwBarYI_ , 4, "foo"); + // */test("S__Z__wFooXIfwBarYIf", new S__Z__wFooXIfwBarYIf , 4, "bar"); + + /* */test("S__Z_fwFoo___ ", new S__Z_fwFoo___ , 3, "mix"); + /* */test("S__Z_fwFoo___wBar___", new S__Z_fwFoo___wBar___ , 4, "mix"); + /* */test("S__Z_fwFoo___wBar__f", new S__Z_fwFoo___wBar__f , 4, "mix"); + /* */test("S__Z_fwFoo___wBar_I_", new S__Z_fwFoo___wBar_I_ , 4, "mix"); + /* */test("S__Z_fwFoo___wBar_If", new S__Z_fwFoo___wBar_If , 4, "mix"); + /* */test("S__Z_fwFoo___wBarY__", new S__Z_fwFoo___wBarY__ , 4, "mix"); + /* */test("S__Z_fwFoo___wBarY_f", new S__Z_fwFoo___wBarY_f , 4, "mix"); + /* */test("S__Z_fwFoo___wBarYI_", new S__Z_fwFoo___wBarYI_ , 4, "mix"); + /* */test("S__Z_fwFoo___wBarYIf", new S__Z_fwFoo___wBarYIf , 4, "mix"); + /* */test("S__Z_fwFoo__f ", new S__Z_fwFoo__f , 3, "mix"); + /* */test("S__Z_fwFoo__fwBar___", new S__Z_fwFoo__fwBar___ , 4, "mix"); + /* */test("S__Z_fwFoo__fwBar__f", new S__Z_fwFoo__fwBar__f , 4, "mix"); + /* */test("S__Z_fwFoo__fwBar_I_", new S__Z_fwFoo__fwBar_I_ , 4, "mix"); + /* */test("S__Z_fwFoo__fwBar_If", new S__Z_fwFoo__fwBar_If , 4, "mix"); + /* */test("S__Z_fwFoo__fwBarY__", new S__Z_fwFoo__fwBarY__ , 4, "mix"); + /* */test("S__Z_fwFoo__fwBarY_f", new S__Z_fwFoo__fwBarY_f , 4, "mix"); + /* */test("S__Z_fwFoo__fwBarYI_", new S__Z_fwFoo__fwBarYI_ , 4, "mix"); + /* */test("S__Z_fwFoo__fwBarYIf", new S__Z_fwFoo__fwBarYIf , 4, "mix"); + /* */test("S__Z_fwFoo_I_ ", new S__Z_fwFoo_I_ , 3, "mix"); + /* */test("S__Z_fwFoo_I_wBar___", new S__Z_fwFoo_I_wBar___ , 4, "mix"); + /* */test("S__Z_fwFoo_I_wBar__f", new S__Z_fwFoo_I_wBar__f , 4, "mix"); + // */test("S__Z_fwFoo_I_wBar_I_", new S__Z_fwFoo_I_wBar_I_ , 4, "mix"); + // */test("S__Z_fwFoo_I_wBar_If", new S__Z_fwFoo_I_wBar_If , 4, "mix"); + /* */test("S__Z_fwFoo_I_wBarY__", new S__Z_fwFoo_I_wBarY__ , 4, "mix"); + /* */test("S__Z_fwFoo_I_wBarY_f", new S__Z_fwFoo_I_wBarY_f , 4, "mix"); + // */test("S__Z_fwFoo_I_wBarYI_", new S__Z_fwFoo_I_wBarYI_ , 4, "mix"); + // */test("S__Z_fwFoo_I_wBarYIf", new S__Z_fwFoo_I_wBarYIf , 4, "mix"); + /* */test("S__Z_fwFoo_If ", new S__Z_fwFoo_If , 3, "mix"); + /* */test("S__Z_fwFoo_IfwBar___", new S__Z_fwFoo_IfwBar___ , 4, "mix"); + /* */test("S__Z_fwFoo_IfwBar__f", new S__Z_fwFoo_IfwBar__f , 4, "mix"); + // */test("S__Z_fwFoo_IfwBar_I_", new S__Z_fwFoo_IfwBar_I_ , 4, "mix"); + // */test("S__Z_fwFoo_IfwBar_If", new S__Z_fwFoo_IfwBar_If , 4, "mix"); + /* */test("S__Z_fwFoo_IfwBarY__", new S__Z_fwFoo_IfwBarY__ , 4, "mix"); + /* */test("S__Z_fwFoo_IfwBarY_f", new S__Z_fwFoo_IfwBarY_f , 4, "mix"); + // */test("S__Z_fwFoo_IfwBarYI_", new S__Z_fwFoo_IfwBarYI_ , 4, "mix"); + // */test("S__Z_fwFoo_IfwBarYIf", new S__Z_fwFoo_IfwBarYIf , 4, "mix"); + /* */test("S__Z_fwFooX__ ", new S__Z_fwFooX__ , 3, "mix"); + /* */test("S__Z_fwFooX__wBar___", new S__Z_fwFooX__wBar___ , 4, "mix"); + /* */test("S__Z_fwFooX__wBar__f", new S__Z_fwFooX__wBar__f , 4, "mix"); + /* */test("S__Z_fwFooX__wBar_I_", new S__Z_fwFooX__wBar_I_ , 4, "mix"); + /* */test("S__Z_fwFooX__wBar_If", new S__Z_fwFooX__wBar_If , 4, "mix"); + /* */test("S__Z_fwFooX__wBarY__", new S__Z_fwFooX__wBarY__ , 4, "mix"); + /* */test("S__Z_fwFooX__wBarY_f", new S__Z_fwFooX__wBarY_f , 4, "mix"); + /* */test("S__Z_fwFooX__wBarYI_", new S__Z_fwFooX__wBarYI_ , 4, "mix"); + /* */test("S__Z_fwFooX__wBarYIf", new S__Z_fwFooX__wBarYIf , 4, "mix"); + /* */test("S__Z_fwFooX_f ", new S__Z_fwFooX_f , 3, "mix"); + /* */test("S__Z_fwFooX_fwBar___", new S__Z_fwFooX_fwBar___ , 4, "mix"); + /* */test("S__Z_fwFooX_fwBar__f", new S__Z_fwFooX_fwBar__f , 4, "mix"); + /* */test("S__Z_fwFooX_fwBar_I_", new S__Z_fwFooX_fwBar_I_ , 4, "mix"); + /* */test("S__Z_fwFooX_fwBar_If", new S__Z_fwFooX_fwBar_If , 4, "mix"); + /* */test("S__Z_fwFooX_fwBarY__", new S__Z_fwFooX_fwBarY__ , 4, "mix"); + /* */test("S__Z_fwFooX_fwBarY_f", new S__Z_fwFooX_fwBarY_f , 4, "mix"); + /* */test("S__Z_fwFooX_fwBarYI_", new S__Z_fwFooX_fwBarYI_ , 4, "mix"); + /* */test("S__Z_fwFooX_fwBarYIf", new S__Z_fwFooX_fwBarYIf , 4, "mix"); + /* */test("S__Z_fwFooXI_ ", new S__Z_fwFooXI_ , 3, "mix"); + /* */test("S__Z_fwFooXI_wBar___", new S__Z_fwFooXI_wBar___ , 4, "mix"); + /* */test("S__Z_fwFooXI_wBar__f", new S__Z_fwFooXI_wBar__f , 4, "mix"); + // */test("S__Z_fwFooXI_wBar_I_", new S__Z_fwFooXI_wBar_I_ , 4, "mix"); + // */test("S__Z_fwFooXI_wBar_If", new S__Z_fwFooXI_wBar_If , 4, "mix"); + /* */test("S__Z_fwFooXI_wBarY__", new S__Z_fwFooXI_wBarY__ , 4, "mix"); + /* */test("S__Z_fwFooXI_wBarY_f", new S__Z_fwFooXI_wBarY_f , 4, "mix"); + // */test("S__Z_fwFooXI_wBarYI_", new S__Z_fwFooXI_wBarYI_ , 4, "mix"); + // */test("S__Z_fwFooXI_wBarYIf", new S__Z_fwFooXI_wBarYIf , 4, "mix"); + /* */test("S__Z_fwFooXIf ", new S__Z_fwFooXIf , 3, "mix"); + /* */test("S__Z_fwFooXIfwBar___", new S__Z_fwFooXIfwBar___ , 4, "mix"); + /* */test("S__Z_fwFooXIfwBar__f", new S__Z_fwFooXIfwBar__f , 4, "mix"); + // */test("S__Z_fwFooXIfwBar_I_", new S__Z_fwFooXIfwBar_I_ , 4, "mix"); + // */test("S__Z_fwFooXIfwBar_If", new S__Z_fwFooXIfwBar_If , 4, "mix"); + /* */test("S__Z_fwFooXIfwBarY__", new S__Z_fwFooXIfwBarY__ , 4, "mix"); + /* */test("S__Z_fwFooXIfwBarY_f", new S__Z_fwFooXIfwBarY_f , 4, "mix"); + // */test("S__Z_fwFooXIfwBarYI_", new S__Z_fwFooXIfwBarYI_ , 4, "mix"); + // */test("S__Z_fwFooXIfwBarYIf", new S__Z_fwFooXIfwBarYIf , 4, "mix"); + + /* */test("S__ZI_wFoo___ ", new S__ZI_wFoo___ , 3, "sub"); + /* */test("S__ZI_wFoo___wBar___", new S__ZI_wFoo___wBar___ , 4, "sub"); + /* */test("S__ZI_wFoo___wBar__f", new S__ZI_wFoo___wBar__f , 4, "bar"); + // */test("S__ZI_wFoo___wBar_I_", new S__ZI_wFoo___wBar_I_ , 4, "sub"); + // */test("S__ZI_wFoo___wBar_If", new S__ZI_wFoo___wBar_If , 4, "bar"); + /* */test("S__ZI_wFoo___wBarY__", new S__ZI_wFoo___wBarY__ , 4, "sub"); + /* */test("S__ZI_wFoo___wBarY_f", new S__ZI_wFoo___wBarY_f , 4, "bar"); + // */test("S__ZI_wFoo___wBarYI_", new S__ZI_wFoo___wBarYI_ , 4, "sub"); + // */test("S__ZI_wFoo___wBarYIf", new S__ZI_wFoo___wBarYIf , 4, "bar"); + /* */test("S__ZI_wFoo__f ", new S__ZI_wFoo__f , 3, "foo"); + /* */test("S__ZI_wFoo__fwBar___", new S__ZI_wFoo__fwBar___ , 4, "foo"); + // */test("S__ZI_wFoo__fwBar__f", new S__ZI_wFoo__fwBar__f , 4, "bar"); + // */test("S__ZI_wFoo__fwBar_I_", new S__ZI_wFoo__fwBar_I_ , 4, "foo"); + // */test("S__ZI_wFoo__fwBar_If", new S__ZI_wFoo__fwBar_If , 4, "bar"); + /* */test("S__ZI_wFoo__fwBarY__", new S__ZI_wFoo__fwBarY__ , 4, "foo"); + // */test("S__ZI_wFoo__fwBarY_f", new S__ZI_wFoo__fwBarY_f , 4, "bar"); + // */test("S__ZI_wFoo__fwBarYI_", new S__ZI_wFoo__fwBarYI_ , 4, "foo"); + // */test("S__ZI_wFoo__fwBarYIf", new S__ZI_wFoo__fwBarYIf , 4, "bar"); + // */test("S__ZI_wFoo_I_ ", new S__ZI_wFoo_I_ , 3, "sub"); + // */test("S__ZI_wFoo_I_wBar___", new S__ZI_wFoo_I_wBar___ , 4, "sub"); + // */test("S__ZI_wFoo_I_wBar__f", new S__ZI_wFoo_I_wBar__f , 4, "bar"); + // */test("S__ZI_wFoo_I_wBar_I_", new S__ZI_wFoo_I_wBar_I_ , 4, "sub"); + // */test("S__ZI_wFoo_I_wBar_If", new S__ZI_wFoo_I_wBar_If , 4, "bar"); + // */test("S__ZI_wFoo_I_wBarY__", new S__ZI_wFoo_I_wBarY__ , 4, "sub"); + // */test("S__ZI_wFoo_I_wBarY_f", new S__ZI_wFoo_I_wBarY_f , 4, "bar"); + // */test("S__ZI_wFoo_I_wBarYI_", new S__ZI_wFoo_I_wBarYI_ , 4, "sub"); + // */test("S__ZI_wFoo_I_wBarYIf", new S__ZI_wFoo_I_wBarYIf , 4, "bar"); + // */test("S__ZI_wFoo_If ", new S__ZI_wFoo_If , 3, "foo"); + // */test("S__ZI_wFoo_IfwBar___", new S__ZI_wFoo_IfwBar___ , 4, "foo"); + // */test("S__ZI_wFoo_IfwBar__f", new S__ZI_wFoo_IfwBar__f , 4, "bar"); + // */test("S__ZI_wFoo_IfwBar_I_", new S__ZI_wFoo_IfwBar_I_ , 4, "foo"); + // */test("S__ZI_wFoo_IfwBar_If", new S__ZI_wFoo_IfwBar_If , 4, "bar"); + // */test("S__ZI_wFoo_IfwBarY__", new S__ZI_wFoo_IfwBarY__ , 4, "foo"); + // */test("S__ZI_wFoo_IfwBarY_f", new S__ZI_wFoo_IfwBarY_f , 4, "bar"); + // */test("S__ZI_wFoo_IfwBarYI_", new S__ZI_wFoo_IfwBarYI_ , 4, "foo"); + // */test("S__ZI_wFoo_IfwBarYIf", new S__ZI_wFoo_IfwBarYIf , 4, "bar"); + /* */test("S__ZI_wFooX__ ", new S__ZI_wFooX__ , 3, "sub"); + /* */test("S__ZI_wFooX__wBar___", new S__ZI_wFooX__wBar___ , 4, "sub"); + /* */test("S__ZI_wFooX__wBar__f", new S__ZI_wFooX__wBar__f , 4, "bar"); + // */test("S__ZI_wFooX__wBar_I_", new S__ZI_wFooX__wBar_I_ , 4, "sub"); + // */test("S__ZI_wFooX__wBar_If", new S__ZI_wFooX__wBar_If , 4, "bar"); + /* */test("S__ZI_wFooX__wBarY__", new S__ZI_wFooX__wBarY__ , 4, "sub"); + /* */test("S__ZI_wFooX__wBarY_f", new S__ZI_wFooX__wBarY_f , 4, "bar"); + // */test("S__ZI_wFooX__wBarYI_", new S__ZI_wFooX__wBarYI_ , 4, "sub"); + // */test("S__ZI_wFooX__wBarYIf", new S__ZI_wFooX__wBarYIf , 4, "bar"); + /* */test("S__ZI_wFooX_f ", new S__ZI_wFooX_f , 3, "foo"); + /* */test("S__ZI_wFooX_fwBar___", new S__ZI_wFooX_fwBar___ , 4, "foo"); + // */test("S__ZI_wFooX_fwBar__f", new S__ZI_wFooX_fwBar__f , 4, "bar"); + // */test("S__ZI_wFooX_fwBar_I_", new S__ZI_wFooX_fwBar_I_ , 4, "foo"); + // */test("S__ZI_wFooX_fwBar_If", new S__ZI_wFooX_fwBar_If , 4, "bar"); + /* */test("S__ZI_wFooX_fwBarY__", new S__ZI_wFooX_fwBarY__ , 4, "foo"); + // */test("S__ZI_wFooX_fwBarY_f", new S__ZI_wFooX_fwBarY_f , 4, "bar"); + // */test("S__ZI_wFooX_fwBarYI_", new S__ZI_wFooX_fwBarYI_ , 4, "foo"); + // */test("S__ZI_wFooX_fwBarYIf", new S__ZI_wFooX_fwBarYIf , 4, "bar"); + // */test("S__ZI_wFooXI_ ", new S__ZI_wFooXI_ , 3, "sub"); + // */test("S__ZI_wFooXI_wBar___", new S__ZI_wFooXI_wBar___ , 4, "sub"); + // */test("S__ZI_wFooXI_wBar__f", new S__ZI_wFooXI_wBar__f , 4, "bar"); + // */test("S__ZI_wFooXI_wBar_I_", new S__ZI_wFooXI_wBar_I_ , 4, "sub"); + // */test("S__ZI_wFooXI_wBar_If", new S__ZI_wFooXI_wBar_If , 4, "bar"); + // */test("S__ZI_wFooXI_wBarY__", new S__ZI_wFooXI_wBarY__ , 4, "sub"); + // */test("S__ZI_wFooXI_wBarY_f", new S__ZI_wFooXI_wBarY_f , 4, "bar"); + // */test("S__ZI_wFooXI_wBarYI_", new S__ZI_wFooXI_wBarYI_ , 4, "sub"); + // */test("S__ZI_wFooXI_wBarYIf", new S__ZI_wFooXI_wBarYIf , 4, "bar"); + // */test("S__ZI_wFooXIf ", new S__ZI_wFooXIf , 3, "foo"); + // */test("S__ZI_wFooXIfwBar___", new S__ZI_wFooXIfwBar___ , 4, "foo"); + // */test("S__ZI_wFooXIfwBar__f", new S__ZI_wFooXIfwBar__f , 4, "bar"); + // */test("S__ZI_wFooXIfwBar_I_", new S__ZI_wFooXIfwBar_I_ , 4, "foo"); + // */test("S__ZI_wFooXIfwBar_If", new S__ZI_wFooXIfwBar_If , 4, "bar"); + // */test("S__ZI_wFooXIfwBarY__", new S__ZI_wFooXIfwBarY__ , 4, "foo"); + // */test("S__ZI_wFooXIfwBarY_f", new S__ZI_wFooXIfwBarY_f , 4, "bar"); + // */test("S__ZI_wFooXIfwBarYI_", new S__ZI_wFooXIfwBarYI_ , 4, "foo"); + // */test("S__ZI_wFooXIfwBarYIf", new S__ZI_wFooXIfwBarYIf , 4, "bar"); + + /* */test("S__ZIfwFoo___ ", new S__ZIfwFoo___ , 3, "mix"); + /* */test("S__ZIfwFoo___wBar___", new S__ZIfwFoo___wBar___ , 4, "mix"); + /* */test("S__ZIfwFoo___wBar__f", new S__ZIfwFoo___wBar__f , 4, "mix"); + // */test("S__ZIfwFoo___wBar_I_", new S__ZIfwFoo___wBar_I_ , 4, "mix"); + // */test("S__ZIfwFoo___wBar_If", new S__ZIfwFoo___wBar_If , 4, "mix"); + /* */test("S__ZIfwFoo___wBarY__", new S__ZIfwFoo___wBarY__ , 4, "mix"); + /* */test("S__ZIfwFoo___wBarY_f", new S__ZIfwFoo___wBarY_f , 4, "mix"); + // */test("S__ZIfwFoo___wBarYI_", new S__ZIfwFoo___wBarYI_ , 4, "mix"); + // */test("S__ZIfwFoo___wBarYIf", new S__ZIfwFoo___wBarYIf , 4, "mix"); + /* */test("S__ZIfwFoo__f ", new S__ZIfwFoo__f , 3, "mix"); + /* */test("S__ZIfwFoo__fwBar___", new S__ZIfwFoo__fwBar___ , 4, "mix"); + /* */test("S__ZIfwFoo__fwBar__f", new S__ZIfwFoo__fwBar__f , 4, "mix"); + // */test("S__ZIfwFoo__fwBar_I_", new S__ZIfwFoo__fwBar_I_ , 4, "mix"); + // */test("S__ZIfwFoo__fwBar_If", new S__ZIfwFoo__fwBar_If , 4, "mix"); + /* */test("S__ZIfwFoo__fwBarY__", new S__ZIfwFoo__fwBarY__ , 4, "mix"); + /* */test("S__ZIfwFoo__fwBarY_f", new S__ZIfwFoo__fwBarY_f , 4, "mix"); + // */test("S__ZIfwFoo__fwBarYI_", new S__ZIfwFoo__fwBarYI_ , 4, "mix"); + // */test("S__ZIfwFoo__fwBarYIf", new S__ZIfwFoo__fwBarYIf , 4, "mix"); + // */test("S__ZIfwFoo_I_ ", new S__ZIfwFoo_I_ , 3, "mix"); + // */test("S__ZIfwFoo_I_wBar___", new S__ZIfwFoo_I_wBar___ , 4, "mix"); + // */test("S__ZIfwFoo_I_wBar__f", new S__ZIfwFoo_I_wBar__f , 4, "mix"); + // */test("S__ZIfwFoo_I_wBar_I_", new S__ZIfwFoo_I_wBar_I_ , 4, "mix"); + // */test("S__ZIfwFoo_I_wBar_If", new S__ZIfwFoo_I_wBar_If , 4, "mix"); + // */test("S__ZIfwFoo_I_wBarY__", new S__ZIfwFoo_I_wBarY__ , 4, "mix"); + // */test("S__ZIfwFoo_I_wBarY_f", new S__ZIfwFoo_I_wBarY_f , 4, "mix"); + // */test("S__ZIfwFoo_I_wBarYI_", new S__ZIfwFoo_I_wBarYI_ , 4, "mix"); + // */test("S__ZIfwFoo_I_wBarYIf", new S__ZIfwFoo_I_wBarYIf , 4, "mix"); + // */test("S__ZIfwFoo_If ", new S__ZIfwFoo_If , 3, "mix"); + // */test("S__ZIfwFoo_IfwBar___", new S__ZIfwFoo_IfwBar___ , 4, "mix"); + // */test("S__ZIfwFoo_IfwBar__f", new S__ZIfwFoo_IfwBar__f , 4, "mix"); + // */test("S__ZIfwFoo_IfwBar_I_", new S__ZIfwFoo_IfwBar_I_ , 4, "mix"); + // */test("S__ZIfwFoo_IfwBar_If", new S__ZIfwFoo_IfwBar_If , 4, "mix"); + // */test("S__ZIfwFoo_IfwBarY__", new S__ZIfwFoo_IfwBarY__ , 4, "mix"); + // */test("S__ZIfwFoo_IfwBarY_f", new S__ZIfwFoo_IfwBarY_f , 4, "mix"); + // */test("S__ZIfwFoo_IfwBarYI_", new S__ZIfwFoo_IfwBarYI_ , 4, "mix"); + // */test("S__ZIfwFoo_IfwBarYIf", new S__ZIfwFoo_IfwBarYIf , 4, "mix"); + /* */test("S__ZIfwFooX__ ", new S__ZIfwFooX__ , 3, "mix"); + /* */test("S__ZIfwFooX__wBar___", new S__ZIfwFooX__wBar___ , 4, "mix"); + /* */test("S__ZIfwFooX__wBar__f", new S__ZIfwFooX__wBar__f , 4, "mix"); + // */test("S__ZIfwFooX__wBar_I_", new S__ZIfwFooX__wBar_I_ , 4, "mix"); + // */test("S__ZIfwFooX__wBar_If", new S__ZIfwFooX__wBar_If , 4, "mix"); + /* */test("S__ZIfwFooX__wBarY__", new S__ZIfwFooX__wBarY__ , 4, "mix"); + /* */test("S__ZIfwFooX__wBarY_f", new S__ZIfwFooX__wBarY_f , 4, "mix"); + // */test("S__ZIfwFooX__wBarYI_", new S__ZIfwFooX__wBarYI_ , 4, "mix"); + // */test("S__ZIfwFooX__wBarYIf", new S__ZIfwFooX__wBarYIf , 4, "mix"); + /* */test("S__ZIfwFooX_f ", new S__ZIfwFooX_f , 3, "mix"); + /* */test("S__ZIfwFooX_fwBar___", new S__ZIfwFooX_fwBar___ , 4, "mix"); + /* */test("S__ZIfwFooX_fwBar__f", new S__ZIfwFooX_fwBar__f , 4, "mix"); + // */test("S__ZIfwFooX_fwBar_I_", new S__ZIfwFooX_fwBar_I_ , 4, "mix"); + // */test("S__ZIfwFooX_fwBar_If", new S__ZIfwFooX_fwBar_If , 4, "mix"); + /* */test("S__ZIfwFooX_fwBarY__", new S__ZIfwFooX_fwBarY__ , 4, "mix"); + /* */test("S__ZIfwFooX_fwBarY_f", new S__ZIfwFooX_fwBarY_f , 4, "mix"); + // */test("S__ZIfwFooX_fwBarYI_", new S__ZIfwFooX_fwBarYI_ , 4, "mix"); + // */test("S__ZIfwFooX_fwBarYIf", new S__ZIfwFooX_fwBarYIf , 4, "mix"); + // */test("S__ZIfwFooXI_ ", new S__ZIfwFooXI_ , 3, "mix"); + // */test("S__ZIfwFooXI_wBar___", new S__ZIfwFooXI_wBar___ , 4, "mix"); + // */test("S__ZIfwFooXI_wBar__f", new S__ZIfwFooXI_wBar__f , 4, "mix"); + // */test("S__ZIfwFooXI_wBar_I_", new S__ZIfwFooXI_wBar_I_ , 4, "mix"); + // */test("S__ZIfwFooXI_wBar_If", new S__ZIfwFooXI_wBar_If , 4, "mix"); + // */test("S__ZIfwFooXI_wBarY__", new S__ZIfwFooXI_wBarY__ , 4, "mix"); + // */test("S__ZIfwFooXI_wBarY_f", new S__ZIfwFooXI_wBarY_f , 4, "mix"); + // */test("S__ZIfwFooXI_wBarYI_", new S__ZIfwFooXI_wBarYI_ , 4, "mix"); + // */test("S__ZIfwFooXI_wBarYIf", new S__ZIfwFooXI_wBarYIf , 4, "mix"); + // */test("S__ZIfwFooXIf ", new S__ZIfwFooXIf , 3, "mix"); + // */test("S__ZIfwFooXIfwBar___", new S__ZIfwFooXIfwBar___ , 4, "mix"); + // */test("S__ZIfwFooXIfwBar__f", new S__ZIfwFooXIfwBar__f , 4, "mix"); + // */test("S__ZIfwFooXIfwBar_I_", new S__ZIfwFooXIfwBar_I_ , 4, "mix"); + // */test("S__ZIfwFooXIfwBar_If", new S__ZIfwFooXIfwBar_If , 4, "mix"); + // */test("S__ZIfwFooXIfwBarY__", new S__ZIfwFooXIfwBarY__ , 4, "mix"); + // */test("S__ZIfwFooXIfwBarY_f", new S__ZIfwFooXIfwBarY_f , 4, "mix"); + // */test("S__ZIfwFooXIfwBarYI_", new S__ZIfwFooXIfwBarYI_ , 4, "mix"); + // */test("S__ZIfwFooXIfwBarYIf", new S__ZIfwFooXIfwBarYIf , 4, "mix"); + + + + /* */test("S_T___eFoo___ ", new S_T___eFoo___ [D], 3, "sub"); + /* */test("S_T___eFoo___wBar___", new S_T___eFoo___wBar___[D], 4, "sub"); + /* */test("S_T___eFoo___wBar__f", new S_T___eFoo___wBar__f[D], 4, "bar"); + /* */test("S_T___eFoo___wBar_I_", new S_T___eFoo___wBar_I_[D], 4, "sub"); + /* */test("S_T___eFoo___wBar_If", new S_T___eFoo___wBar_If[D], 4, "bar"); + /* */test("S_T___eFoo___wBarY__", new S_T___eFoo___wBarY__[D], 4, "sub"); + /* */test("S_T___eFoo___wBarY_f", new S_T___eFoo___wBarY_f[D], 4, "bar"); + /* */test("S_T___eFoo___wBarYI_", new S_T___eFoo___wBarYI_[D], 4, "sub"); + /* */test("S_T___eFoo___wBarYIf", new S_T___eFoo___wBarYIf[D], 4, "bar"); + /* */test("S_T___eFoo__f ", new S_T___eFoo__f [D], 3, "foo"); + /* */test("S_T___eFoo__fwBar___", new S_T___eFoo__fwBar___[D], 4, "foo"); + // */test("S_T___eFoo__fwBar__f", new S_T___eFoo__fwBar__f[D], 4, "bar"); + /* */test("S_T___eFoo__fwBar_I_", new S_T___eFoo__fwBar_I_[D], 4, "foo"); + // */test("S_T___eFoo__fwBar_If", new S_T___eFoo__fwBar_If[D], 4, "bar"); + /* */test("S_T___eFoo__fwBarY__", new S_T___eFoo__fwBarY__[D], 4, "foo"); + // */test("S_T___eFoo__fwBarY_f", new S_T___eFoo__fwBarY_f[D], 4, "bar"); + /* */test("S_T___eFoo__fwBarYI_", new S_T___eFoo__fwBarYI_[D], 4, "foo"); + // */test("S_T___eFoo__fwBarYIf", new S_T___eFoo__fwBarYIf[D], 4, "bar"); + /* */test("S_T___eFoo_I_ ", new S_T___eFoo_I_ [D], 3, "sub"); + /* */test("S_T___eFoo_I_wBar___", new S_T___eFoo_I_wBar___[D], 4, "sub"); + /* */test("S_T___eFoo_I_wBar__f", new S_T___eFoo_I_wBar__f[D], 4, "bar"); + // */test("S_T___eFoo_I_wBar_I_", new S_T___eFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_T___eFoo_I_wBar_If", new S_T___eFoo_I_wBar_If[D], 4, "bar"); + /* */test("S_T___eFoo_I_wBarY__", new S_T___eFoo_I_wBarY__[D], 4, "sub"); + /* */test("S_T___eFoo_I_wBarY_f", new S_T___eFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_T___eFoo_I_wBarYI_", new S_T___eFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_T___eFoo_I_wBarYIf", new S_T___eFoo_I_wBarYIf[D], 4, "bar"); + /* */test("S_T___eFoo_If ", new S_T___eFoo_If [D], 3, "foo"); + /* */test("S_T___eFoo_IfwBar___", new S_T___eFoo_IfwBar___[D], 4, "foo"); + // */test("S_T___eFoo_IfwBar__f", new S_T___eFoo_IfwBar__f[D], 4, "bar"); + // */test("S_T___eFoo_IfwBar_I_", new S_T___eFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_T___eFoo_IfwBar_If", new S_T___eFoo_IfwBar_If[D], 4, "bar"); + /* */test("S_T___eFoo_IfwBarY__", new S_T___eFoo_IfwBarY__[D], 4, "foo"); + // */test("S_T___eFoo_IfwBarY_f", new S_T___eFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_T___eFoo_IfwBarYI_", new S_T___eFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_T___eFoo_IfwBarYIf", new S_T___eFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_T___eFooX__ ", new S_T___eFooX__ [D], 3, "sub"); + /* */test("S_T___eFooX__wBar___", new S_T___eFooX__wBar___[D], 4, "sub"); + /* */test("S_T___eFooX__wBar__f", new S_T___eFooX__wBar__f[D], 4, "bar"); + /* */test("S_T___eFooX__wBar_I_", new S_T___eFooX__wBar_I_[D], 4, "sub"); + /* */test("S_T___eFooX__wBar_If", new S_T___eFooX__wBar_If[D], 4, "bar"); + /* */test("S_T___eFooX__wBarY__", new S_T___eFooX__wBarY__[D], 4, "sub"); + /* */test("S_T___eFooX__wBarY_f", new S_T___eFooX__wBarY_f[D], 4, "bar"); + /* */test("S_T___eFooX__wBarYI_", new S_T___eFooX__wBarYI_[D], 4, "sub"); + /* */test("S_T___eFooX__wBarYIf", new S_T___eFooX__wBarYIf[D], 4, "bar"); + /* */test("S_T___eFooX_f ", new S_T___eFooX_f [D], 3, "foo"); + /* */test("S_T___eFooX_fwBar___", new S_T___eFooX_fwBar___[D], 4, "foo"); + // */test("S_T___eFooX_fwBar__f", new S_T___eFooX_fwBar__f[D], 4, "bar"); + /* */test("S_T___eFooX_fwBar_I_", new S_T___eFooX_fwBar_I_[D], 4, "foo"); + // */test("S_T___eFooX_fwBar_If", new S_T___eFooX_fwBar_If[D], 4, "bar"); + /* */test("S_T___eFooX_fwBarY__", new S_T___eFooX_fwBarY__[D], 4, "foo"); + // */test("S_T___eFooX_fwBarY_f", new S_T___eFooX_fwBarY_f[D], 4, "bar"); + /* */test("S_T___eFooX_fwBarYI_", new S_T___eFooX_fwBarYI_[D], 4, "foo"); + // */test("S_T___eFooX_fwBarYIf", new S_T___eFooX_fwBarYIf[D], 4, "bar"); + /* */test("S_T___eFooXI_ ", new S_T___eFooXI_ [D], 3, "sub"); + /* */test("S_T___eFooXI_wBar___", new S_T___eFooXI_wBar___[D], 4, "sub"); + /* */test("S_T___eFooXI_wBar__f", new S_T___eFooXI_wBar__f[D], 4, "bar"); + // */test("S_T___eFooXI_wBar_I_", new S_T___eFooXI_wBar_I_[D], 4, "sub"); + // */test("S_T___eFooXI_wBar_If", new S_T___eFooXI_wBar_If[D], 4, "bar"); + /* */test("S_T___eFooXI_wBarY__", new S_T___eFooXI_wBarY__[D], 4, "sub"); + /* */test("S_T___eFooXI_wBarY_f", new S_T___eFooXI_wBarY_f[D], 4, "bar"); + // */test("S_T___eFooXI_wBarYI_", new S_T___eFooXI_wBarYI_[D], 4, "sub"); + // */test("S_T___eFooXI_wBarYIf", new S_T___eFooXI_wBarYIf[D], 4, "bar"); + /* */test("S_T___eFooXIf ", new S_T___eFooXIf [D], 3, "foo"); + /* */test("S_T___eFooXIfwBar___", new S_T___eFooXIfwBar___[D], 4, "foo"); + // */test("S_T___eFooXIfwBar__f", new S_T___eFooXIfwBar__f[D], 4, "bar"); + // */test("S_T___eFooXIfwBar_I_", new S_T___eFooXIfwBar_I_[D], 4, "foo"); + // */test("S_T___eFooXIfwBar_If", new S_T___eFooXIfwBar_If[D], 4, "bar"); + /* */test("S_T___eFooXIfwBarY__", new S_T___eFooXIfwBarY__[D], 4, "foo"); + // */test("S_T___eFooXIfwBarY_f", new S_T___eFooXIfwBarY_f[D], 4, "bar"); + // */test("S_T___eFooXIfwBarYI_", new S_T___eFooXIfwBarYI_[D], 4, "foo"); + // */test("S_T___eFooXIfwBarYIf", new S_T___eFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_T__feFoo___ ", new S_T__feFoo___ [D], 3, "mix"); + /* */test("S_T__feFoo___wBar___", new S_T__feFoo___wBar___[D], 4, "mix"); + /* */test("S_T__feFoo___wBar__f", new S_T__feFoo___wBar__f[D], 4, "mix"); + /* */test("S_T__feFoo___wBar_I_", new S_T__feFoo___wBar_I_[D], 4, "mix"); + /* */test("S_T__feFoo___wBar_If", new S_T__feFoo___wBar_If[D], 4, "mix"); + /* */test("S_T__feFoo___wBarY__", new S_T__feFoo___wBarY__[D], 4, "mix"); + /* */test("S_T__feFoo___wBarY_f", new S_T__feFoo___wBarY_f[D], 4, "mix"); + /* */test("S_T__feFoo___wBarYI_", new S_T__feFoo___wBarYI_[D], 4, "mix"); + /* */test("S_T__feFoo___wBarYIf", new S_T__feFoo___wBarYIf[D], 4, "mix"); + /* */test("S_T__feFoo__f ", new S_T__feFoo__f [D], 3, "mix"); + /* */test("S_T__feFoo__fwBar___", new S_T__feFoo__fwBar___[D], 4, "mix"); + /* */test("S_T__feFoo__fwBar__f", new S_T__feFoo__fwBar__f[D], 4, "mix"); + /* */test("S_T__feFoo__fwBar_I_", new S_T__feFoo__fwBar_I_[D], 4, "mix"); + /* */test("S_T__feFoo__fwBar_If", new S_T__feFoo__fwBar_If[D], 4, "mix"); + /* */test("S_T__feFoo__fwBarY__", new S_T__feFoo__fwBarY__[D], 4, "mix"); + /* */test("S_T__feFoo__fwBarY_f", new S_T__feFoo__fwBarY_f[D], 4, "mix"); + /* */test("S_T__feFoo__fwBarYI_", new S_T__feFoo__fwBarYI_[D], 4, "mix"); + /* */test("S_T__feFoo__fwBarYIf", new S_T__feFoo__fwBarYIf[D], 4, "mix"); + /* */test("S_T__feFoo_I_ ", new S_T__feFoo_I_ [D], 3, "mix"); + /* */test("S_T__feFoo_I_wBar___", new S_T__feFoo_I_wBar___[D], 4, "mix"); + /* */test("S_T__feFoo_I_wBar__f", new S_T__feFoo_I_wBar__f[D], 4, "mix"); + // */test("S_T__feFoo_I_wBar_I_", new S_T__feFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_T__feFoo_I_wBar_If", new S_T__feFoo_I_wBar_If[D], 4, "mix"); + /* */test("S_T__feFoo_I_wBarY__", new S_T__feFoo_I_wBarY__[D], 4, "mix"); + /* */test("S_T__feFoo_I_wBarY_f", new S_T__feFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_T__feFoo_I_wBarYI_", new S_T__feFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_T__feFoo_I_wBarYIf", new S_T__feFoo_I_wBarYIf[D], 4, "mix"); + /* */test("S_T__feFoo_If ", new S_T__feFoo_If [D], 3, "mix"); + /* */test("S_T__feFoo_IfwBar___", new S_T__feFoo_IfwBar___[D], 4, "mix"); + /* */test("S_T__feFoo_IfwBar__f", new S_T__feFoo_IfwBar__f[D], 4, "mix"); + // */test("S_T__feFoo_IfwBar_I_", new S_T__feFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_T__feFoo_IfwBar_If", new S_T__feFoo_IfwBar_If[D], 4, "mix"); + /* */test("S_T__feFoo_IfwBarY__", new S_T__feFoo_IfwBarY__[D], 4, "mix"); + /* */test("S_T__feFoo_IfwBarY_f", new S_T__feFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_T__feFoo_IfwBarYI_", new S_T__feFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_T__feFoo_IfwBarYIf", new S_T__feFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_T__feFooX__ ", new S_T__feFooX__ [D], 3, "mix"); + /* */test("S_T__feFooX__wBar___", new S_T__feFooX__wBar___[D], 4, "mix"); + /* */test("S_T__feFooX__wBar__f", new S_T__feFooX__wBar__f[D], 4, "mix"); + /* */test("S_T__feFooX__wBar_I_", new S_T__feFooX__wBar_I_[D], 4, "mix"); + /* */test("S_T__feFooX__wBar_If", new S_T__feFooX__wBar_If[D], 4, "mix"); + /* */test("S_T__feFooX__wBarY__", new S_T__feFooX__wBarY__[D], 4, "mix"); + /* */test("S_T__feFooX__wBarY_f", new S_T__feFooX__wBarY_f[D], 4, "mix"); + /* */test("S_T__feFooX__wBarYI_", new S_T__feFooX__wBarYI_[D], 4, "mix"); + /* */test("S_T__feFooX__wBarYIf", new S_T__feFooX__wBarYIf[D], 4, "mix"); + /* */test("S_T__feFooX_f ", new S_T__feFooX_f [D], 3, "mix"); + /* */test("S_T__feFooX_fwBar___", new S_T__feFooX_fwBar___[D], 4, "mix"); + /* */test("S_T__feFooX_fwBar__f", new S_T__feFooX_fwBar__f[D], 4, "mix"); + /* */test("S_T__feFooX_fwBar_I_", new S_T__feFooX_fwBar_I_[D], 4, "mix"); + /* */test("S_T__feFooX_fwBar_If", new S_T__feFooX_fwBar_If[D], 4, "mix"); + /* */test("S_T__feFooX_fwBarY__", new S_T__feFooX_fwBarY__[D], 4, "mix"); + /* */test("S_T__feFooX_fwBarY_f", new S_T__feFooX_fwBarY_f[D], 4, "mix"); + /* */test("S_T__feFooX_fwBarYI_", new S_T__feFooX_fwBarYI_[D], 4, "mix"); + /* */test("S_T__feFooX_fwBarYIf", new S_T__feFooX_fwBarYIf[D], 4, "mix"); + /* */test("S_T__feFooXI_ ", new S_T__feFooXI_ [D], 3, "mix"); + /* */test("S_T__feFooXI_wBar___", new S_T__feFooXI_wBar___[D], 4, "mix"); + /* */test("S_T__feFooXI_wBar__f", new S_T__feFooXI_wBar__f[D], 4, "mix"); + // */test("S_T__feFooXI_wBar_I_", new S_T__feFooXI_wBar_I_[D], 4, "mix"); + // */test("S_T__feFooXI_wBar_If", new S_T__feFooXI_wBar_If[D], 4, "mix"); + /* */test("S_T__feFooXI_wBarY__", new S_T__feFooXI_wBarY__[D], 4, "mix"); + /* */test("S_T__feFooXI_wBarY_f", new S_T__feFooXI_wBarY_f[D], 4, "mix"); + // */test("S_T__feFooXI_wBarYI_", new S_T__feFooXI_wBarYI_[D], 4, "mix"); + // */test("S_T__feFooXI_wBarYIf", new S_T__feFooXI_wBarYIf[D], 4, "mix"); + /* */test("S_T__feFooXIf ", new S_T__feFooXIf [D], 3, "mix"); + /* */test("S_T__feFooXIfwBar___", new S_T__feFooXIfwBar___[D], 4, "mix"); + /* */test("S_T__feFooXIfwBar__f", new S_T__feFooXIfwBar__f[D], 4, "mix"); + // */test("S_T__feFooXIfwBar_I_", new S_T__feFooXIfwBar_I_[D], 4, "mix"); + // */test("S_T__feFooXIfwBar_If", new S_T__feFooXIfwBar_If[D], 4, "mix"); + /* */test("S_T__feFooXIfwBarY__", new S_T__feFooXIfwBarY__[D], 4, "mix"); + /* */test("S_T__feFooXIfwBarY_f", new S_T__feFooXIfwBarY_f[D], 4, "mix"); + // */test("S_T__feFooXIfwBarYI_", new S_T__feFooXIfwBarYI_[D], 4, "mix"); + // */test("S_T__feFooXIfwBarYIf", new S_T__feFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_T_I_eFoo___ ", new S_T_I_eFoo___ [D], 3, "sub"); + /* */test("S_T_I_eFoo___wBar___", new S_T_I_eFoo___wBar___[D], 4, "sub"); + /* */test("S_T_I_eFoo___wBar__f", new S_T_I_eFoo___wBar__f[D], 4, "bar"); + // */test("S_T_I_eFoo___wBar_I_", new S_T_I_eFoo___wBar_I_[D], 4, "sub"); + // */test("S_T_I_eFoo___wBar_If", new S_T_I_eFoo___wBar_If[D], 4, "bar"); + /* */test("S_T_I_eFoo___wBarY__", new S_T_I_eFoo___wBarY__[D], 4, "sub"); + /* */test("S_T_I_eFoo___wBarY_f", new S_T_I_eFoo___wBarY_f[D], 4, "bar"); + // */test("S_T_I_eFoo___wBarYI_", new S_T_I_eFoo___wBarYI_[D], 4, "sub"); + // */test("S_T_I_eFoo___wBarYIf", new S_T_I_eFoo___wBarYIf[D], 4, "bar"); + /* */test("S_T_I_eFoo__f ", new S_T_I_eFoo__f [D], 3, "foo"); + /* */test("S_T_I_eFoo__fwBar___", new S_T_I_eFoo__fwBar___[D], 4, "foo"); + // */test("S_T_I_eFoo__fwBar__f", new S_T_I_eFoo__fwBar__f[D], 4, "bar"); + // */test("S_T_I_eFoo__fwBar_I_", new S_T_I_eFoo__fwBar_I_[D], 4, "foo"); + // */test("S_T_I_eFoo__fwBar_If", new S_T_I_eFoo__fwBar_If[D], 4, "bar"); + /* */test("S_T_I_eFoo__fwBarY__", new S_T_I_eFoo__fwBarY__[D], 4, "foo"); + // */test("S_T_I_eFoo__fwBarY_f", new S_T_I_eFoo__fwBarY_f[D], 4, "bar"); + // */test("S_T_I_eFoo__fwBarYI_", new S_T_I_eFoo__fwBarYI_[D], 4, "foo"); + // */test("S_T_I_eFoo__fwBarYIf", new S_T_I_eFoo__fwBarYIf[D], 4, "bar"); + // */test("S_T_I_eFoo_I_ ", new S_T_I_eFoo_I_ [D], 3, "sub"); + // */test("S_T_I_eFoo_I_wBar___", new S_T_I_eFoo_I_wBar___[D], 4, "sub"); + // */test("S_T_I_eFoo_I_wBar__f", new S_T_I_eFoo_I_wBar__f[D], 4, "bar"); + // */test("S_T_I_eFoo_I_wBar_I_", new S_T_I_eFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_T_I_eFoo_I_wBar_If", new S_T_I_eFoo_I_wBar_If[D], 4, "bar"); + // */test("S_T_I_eFoo_I_wBarY__", new S_T_I_eFoo_I_wBarY__[D], 4, "sub"); + // */test("S_T_I_eFoo_I_wBarY_f", new S_T_I_eFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_T_I_eFoo_I_wBarYI_", new S_T_I_eFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_T_I_eFoo_I_wBarYIf", new S_T_I_eFoo_I_wBarYIf[D], 4, "bar"); + // */test("S_T_I_eFoo_If ", new S_T_I_eFoo_If [D], 3, "foo"); + // */test("S_T_I_eFoo_IfwBar___", new S_T_I_eFoo_IfwBar___[D], 4, "foo"); + // */test("S_T_I_eFoo_IfwBar__f", new S_T_I_eFoo_IfwBar__f[D], 4, "bar"); + // */test("S_T_I_eFoo_IfwBar_I_", new S_T_I_eFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_T_I_eFoo_IfwBar_If", new S_T_I_eFoo_IfwBar_If[D], 4, "bar"); + // */test("S_T_I_eFoo_IfwBarY__", new S_T_I_eFoo_IfwBarY__[D], 4, "foo"); + // */test("S_T_I_eFoo_IfwBarY_f", new S_T_I_eFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_T_I_eFoo_IfwBarYI_", new S_T_I_eFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_T_I_eFoo_IfwBarYIf", new S_T_I_eFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_T_I_eFooX__ ", new S_T_I_eFooX__ [D], 3, "sub"); + /* */test("S_T_I_eFooX__wBar___", new S_T_I_eFooX__wBar___[D], 4, "sub"); + /* */test("S_T_I_eFooX__wBar__f", new S_T_I_eFooX__wBar__f[D], 4, "bar"); + // */test("S_T_I_eFooX__wBar_I_", new S_T_I_eFooX__wBar_I_[D], 4, "sub"); + // */test("S_T_I_eFooX__wBar_If", new S_T_I_eFooX__wBar_If[D], 4, "bar"); + /* */test("S_T_I_eFooX__wBarY__", new S_T_I_eFooX__wBarY__[D], 4, "sub"); + /* */test("S_T_I_eFooX__wBarY_f", new S_T_I_eFooX__wBarY_f[D], 4, "bar"); + // */test("S_T_I_eFooX__wBarYI_", new S_T_I_eFooX__wBarYI_[D], 4, "sub"); + // */test("S_T_I_eFooX__wBarYIf", new S_T_I_eFooX__wBarYIf[D], 4, "bar"); + /* */test("S_T_I_eFooX_f ", new S_T_I_eFooX_f [D], 3, "foo"); + /* */test("S_T_I_eFooX_fwBar___", new S_T_I_eFooX_fwBar___[D], 4, "foo"); + // */test("S_T_I_eFooX_fwBar__f", new S_T_I_eFooX_fwBar__f[D], 4, "bar"); + // */test("S_T_I_eFooX_fwBar_I_", new S_T_I_eFooX_fwBar_I_[D], 4, "foo"); + // */test("S_T_I_eFooX_fwBar_If", new S_T_I_eFooX_fwBar_If[D], 4, "bar"); + /* */test("S_T_I_eFooX_fwBarY__", new S_T_I_eFooX_fwBarY__[D], 4, "foo"); + // */test("S_T_I_eFooX_fwBarY_f", new S_T_I_eFooX_fwBarY_f[D], 4, "bar"); + // */test("S_T_I_eFooX_fwBarYI_", new S_T_I_eFooX_fwBarYI_[D], 4, "foo"); + // */test("S_T_I_eFooX_fwBarYIf", new S_T_I_eFooX_fwBarYIf[D], 4, "bar"); + // */test("S_T_I_eFooXI_ ", new S_T_I_eFooXI_ [D], 3, "sub"); + // */test("S_T_I_eFooXI_wBar___", new S_T_I_eFooXI_wBar___[D], 4, "sub"); + // */test("S_T_I_eFooXI_wBar__f", new S_T_I_eFooXI_wBar__f[D], 4, "bar"); + // */test("S_T_I_eFooXI_wBar_I_", new S_T_I_eFooXI_wBar_I_[D], 4, "sub"); + // */test("S_T_I_eFooXI_wBar_If", new S_T_I_eFooXI_wBar_If[D], 4, "bar"); + // */test("S_T_I_eFooXI_wBarY__", new S_T_I_eFooXI_wBarY__[D], 4, "sub"); + // */test("S_T_I_eFooXI_wBarY_f", new S_T_I_eFooXI_wBarY_f[D], 4, "bar"); + // */test("S_T_I_eFooXI_wBarYI_", new S_T_I_eFooXI_wBarYI_[D], 4, "sub"); + // */test("S_T_I_eFooXI_wBarYIf", new S_T_I_eFooXI_wBarYIf[D], 4, "bar"); + // */test("S_T_I_eFooXIf ", new S_T_I_eFooXIf [D], 3, "foo"); + // */test("S_T_I_eFooXIfwBar___", new S_T_I_eFooXIfwBar___[D], 4, "foo"); + // */test("S_T_I_eFooXIfwBar__f", new S_T_I_eFooXIfwBar__f[D], 4, "bar"); + // */test("S_T_I_eFooXIfwBar_I_", new S_T_I_eFooXIfwBar_I_[D], 4, "foo"); + // */test("S_T_I_eFooXIfwBar_If", new S_T_I_eFooXIfwBar_If[D], 4, "bar"); + // */test("S_T_I_eFooXIfwBarY__", new S_T_I_eFooXIfwBarY__[D], 4, "foo"); + // */test("S_T_I_eFooXIfwBarY_f", new S_T_I_eFooXIfwBarY_f[D], 4, "bar"); + // */test("S_T_I_eFooXIfwBarYI_", new S_T_I_eFooXIfwBarYI_[D], 4, "foo"); + // */test("S_T_I_eFooXIfwBarYIf", new S_T_I_eFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_T_IfeFoo___ ", new S_T_IfeFoo___ [D], 3, "mix"); + /* */test("S_T_IfeFoo___wBar___", new S_T_IfeFoo___wBar___[D], 4, "mix"); + /* */test("S_T_IfeFoo___wBar__f", new S_T_IfeFoo___wBar__f[D], 4, "mix"); + // */test("S_T_IfeFoo___wBar_I_", new S_T_IfeFoo___wBar_I_[D], 4, "mix"); + // */test("S_T_IfeFoo___wBar_If", new S_T_IfeFoo___wBar_If[D], 4, "mix"); + /* */test("S_T_IfeFoo___wBarY__", new S_T_IfeFoo___wBarY__[D], 4, "mix"); + /* */test("S_T_IfeFoo___wBarY_f", new S_T_IfeFoo___wBarY_f[D], 4, "mix"); + // */test("S_T_IfeFoo___wBarYI_", new S_T_IfeFoo___wBarYI_[D], 4, "mix"); + // */test("S_T_IfeFoo___wBarYIf", new S_T_IfeFoo___wBarYIf[D], 4, "mix"); + /* */test("S_T_IfeFoo__f ", new S_T_IfeFoo__f [D], 3, "mix"); + /* */test("S_T_IfeFoo__fwBar___", new S_T_IfeFoo__fwBar___[D], 4, "mix"); + /* */test("S_T_IfeFoo__fwBar__f", new S_T_IfeFoo__fwBar__f[D], 4, "mix"); + // */test("S_T_IfeFoo__fwBar_I_", new S_T_IfeFoo__fwBar_I_[D], 4, "mix"); + // */test("S_T_IfeFoo__fwBar_If", new S_T_IfeFoo__fwBar_If[D], 4, "mix"); + /* */test("S_T_IfeFoo__fwBarY__", new S_T_IfeFoo__fwBarY__[D], 4, "mix"); + /* */test("S_T_IfeFoo__fwBarY_f", new S_T_IfeFoo__fwBarY_f[D], 4, "mix"); + // */test("S_T_IfeFoo__fwBarYI_", new S_T_IfeFoo__fwBarYI_[D], 4, "mix"); + // */test("S_T_IfeFoo__fwBarYIf", new S_T_IfeFoo__fwBarYIf[D], 4, "mix"); + // */test("S_T_IfeFoo_I_ ", new S_T_IfeFoo_I_ [D], 3, "mix"); + // */test("S_T_IfeFoo_I_wBar___", new S_T_IfeFoo_I_wBar___[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBar__f", new S_T_IfeFoo_I_wBar__f[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBar_I_", new S_T_IfeFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBar_If", new S_T_IfeFoo_I_wBar_If[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBarY__", new S_T_IfeFoo_I_wBarY__[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBarY_f", new S_T_IfeFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBarYI_", new S_T_IfeFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_T_IfeFoo_I_wBarYIf", new S_T_IfeFoo_I_wBarYIf[D], 4, "mix"); + // */test("S_T_IfeFoo_If ", new S_T_IfeFoo_If [D], 3, "mix"); + // */test("S_T_IfeFoo_IfwBar___", new S_T_IfeFoo_IfwBar___[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBar__f", new S_T_IfeFoo_IfwBar__f[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBar_I_", new S_T_IfeFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBar_If", new S_T_IfeFoo_IfwBar_If[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBarY__", new S_T_IfeFoo_IfwBarY__[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBarY_f", new S_T_IfeFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBarYI_", new S_T_IfeFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_T_IfeFoo_IfwBarYIf", new S_T_IfeFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_T_IfeFooX__ ", new S_T_IfeFooX__ [D], 3, "mix"); + /* */test("S_T_IfeFooX__wBar___", new S_T_IfeFooX__wBar___[D], 4, "mix"); + /* */test("S_T_IfeFooX__wBar__f", new S_T_IfeFooX__wBar__f[D], 4, "mix"); + // */test("S_T_IfeFooX__wBar_I_", new S_T_IfeFooX__wBar_I_[D], 4, "mix"); + // */test("S_T_IfeFooX__wBar_If", new S_T_IfeFooX__wBar_If[D], 4, "mix"); + /* */test("S_T_IfeFooX__wBarY__", new S_T_IfeFooX__wBarY__[D], 4, "mix"); + /* */test("S_T_IfeFooX__wBarY_f", new S_T_IfeFooX__wBarY_f[D], 4, "mix"); + // */test("S_T_IfeFooX__wBarYI_", new S_T_IfeFooX__wBarYI_[D], 4, "mix"); + // */test("S_T_IfeFooX__wBarYIf", new S_T_IfeFooX__wBarYIf[D], 4, "mix"); + /* */test("S_T_IfeFooX_f ", new S_T_IfeFooX_f [D], 3, "mix"); + /* */test("S_T_IfeFooX_fwBar___", new S_T_IfeFooX_fwBar___[D], 4, "mix"); + /* */test("S_T_IfeFooX_fwBar__f", new S_T_IfeFooX_fwBar__f[D], 4, "mix"); + // */test("S_T_IfeFooX_fwBar_I_", new S_T_IfeFooX_fwBar_I_[D], 4, "mix"); + // */test("S_T_IfeFooX_fwBar_If", new S_T_IfeFooX_fwBar_If[D], 4, "mix"); + /* */test("S_T_IfeFooX_fwBarY__", new S_T_IfeFooX_fwBarY__[D], 4, "mix"); + /* */test("S_T_IfeFooX_fwBarY_f", new S_T_IfeFooX_fwBarY_f[D], 4, "mix"); + // */test("S_T_IfeFooX_fwBarYI_", new S_T_IfeFooX_fwBarYI_[D], 4, "mix"); + // */test("S_T_IfeFooX_fwBarYIf", new S_T_IfeFooX_fwBarYIf[D], 4, "mix"); + // */test("S_T_IfeFooXI_ ", new S_T_IfeFooXI_ [D], 3, "mix"); + // */test("S_T_IfeFooXI_wBar___", new S_T_IfeFooXI_wBar___[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBar__f", new S_T_IfeFooXI_wBar__f[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBar_I_", new S_T_IfeFooXI_wBar_I_[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBar_If", new S_T_IfeFooXI_wBar_If[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBarY__", new S_T_IfeFooXI_wBarY__[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBarY_f", new S_T_IfeFooXI_wBarY_f[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBarYI_", new S_T_IfeFooXI_wBarYI_[D], 4, "mix"); + // */test("S_T_IfeFooXI_wBarYIf", new S_T_IfeFooXI_wBarYIf[D], 4, "mix"); + // */test("S_T_IfeFooXIf ", new S_T_IfeFooXIf [D], 3, "mix"); + // */test("S_T_IfeFooXIfwBar___", new S_T_IfeFooXIfwBar___[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBar__f", new S_T_IfeFooXIfwBar__f[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBar_I_", new S_T_IfeFooXIfwBar_I_[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBar_If", new S_T_IfeFooXIfwBar_If[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBarY__", new S_T_IfeFooXIfwBarY__[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBarY_f", new S_T_IfeFooXIfwBarY_f[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBarYI_", new S_T_IfeFooXIfwBarYI_[D], 4, "mix"); + // */test("S_T_IfeFooXIfwBarYIf", new S_T_IfeFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_TZ__eFoo___ ", new S_TZ__eFoo___ [D], 3, "sub"); + /* */test("S_TZ__eFoo___wBar___", new S_TZ__eFoo___wBar___[D], 4, "sub"); + /* */test("S_TZ__eFoo___wBar__f", new S_TZ__eFoo___wBar__f[D], 4, "bar"); + /* */test("S_TZ__eFoo___wBar_I_", new S_TZ__eFoo___wBar_I_[D], 4, "sub"); + /* */test("S_TZ__eFoo___wBar_If", new S_TZ__eFoo___wBar_If[D], 4, "bar"); + /* */test("S_TZ__eFoo___wBarY__", new S_TZ__eFoo___wBarY__[D], 4, "sub"); + /* */test("S_TZ__eFoo___wBarY_f", new S_TZ__eFoo___wBarY_f[D], 4, "bar"); + /* */test("S_TZ__eFoo___wBarYI_", new S_TZ__eFoo___wBarYI_[D], 4, "sub"); + /* */test("S_TZ__eFoo___wBarYIf", new S_TZ__eFoo___wBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFoo__f ", new S_TZ__eFoo__f [D], 3, "foo"); + /* */test("S_TZ__eFoo__fwBar___", new S_TZ__eFoo__fwBar___[D], 4, "foo"); + // */test("S_TZ__eFoo__fwBar__f", new S_TZ__eFoo__fwBar__f[D], 4, "bar"); + /* */test("S_TZ__eFoo__fwBar_I_", new S_TZ__eFoo__fwBar_I_[D], 4, "foo"); + // */test("S_TZ__eFoo__fwBar_If", new S_TZ__eFoo__fwBar_If[D], 4, "bar"); + /* */test("S_TZ__eFoo__fwBarY__", new S_TZ__eFoo__fwBarY__[D], 4, "foo"); + // */test("S_TZ__eFoo__fwBarY_f", new S_TZ__eFoo__fwBarY_f[D], 4, "bar"); + /* */test("S_TZ__eFoo__fwBarYI_", new S_TZ__eFoo__fwBarYI_[D], 4, "foo"); + // */test("S_TZ__eFoo__fwBarYIf", new S_TZ__eFoo__fwBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFoo_I_ ", new S_TZ__eFoo_I_ [D], 3, "sub"); + /* */test("S_TZ__eFoo_I_wBar___", new S_TZ__eFoo_I_wBar___[D], 4, "sub"); + /* */test("S_TZ__eFoo_I_wBar__f", new S_TZ__eFoo_I_wBar__f[D], 4, "bar"); + // */test("S_TZ__eFoo_I_wBar_I_", new S_TZ__eFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_TZ__eFoo_I_wBar_If", new S_TZ__eFoo_I_wBar_If[D], 4, "bar"); + /* */test("S_TZ__eFoo_I_wBarY__", new S_TZ__eFoo_I_wBarY__[D], 4, "sub"); + /* */test("S_TZ__eFoo_I_wBarY_f", new S_TZ__eFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_TZ__eFoo_I_wBarYI_", new S_TZ__eFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_TZ__eFoo_I_wBarYIf", new S_TZ__eFoo_I_wBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFoo_If ", new S_TZ__eFoo_If [D], 3, "foo"); + /* */test("S_TZ__eFoo_IfwBar___", new S_TZ__eFoo_IfwBar___[D], 4, "foo"); + // */test("S_TZ__eFoo_IfwBar__f", new S_TZ__eFoo_IfwBar__f[D], 4, "bar"); + // */test("S_TZ__eFoo_IfwBar_I_", new S_TZ__eFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_TZ__eFoo_IfwBar_If", new S_TZ__eFoo_IfwBar_If[D], 4, "bar"); + /* */test("S_TZ__eFoo_IfwBarY__", new S_TZ__eFoo_IfwBarY__[D], 4, "foo"); + // */test("S_TZ__eFoo_IfwBarY_f", new S_TZ__eFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_TZ__eFoo_IfwBarYI_", new S_TZ__eFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_TZ__eFoo_IfwBarYIf", new S_TZ__eFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFooX__ ", new S_TZ__eFooX__ [D], 3, "sub"); + /* */test("S_TZ__eFooX__wBar___", new S_TZ__eFooX__wBar___[D], 4, "sub"); + /* */test("S_TZ__eFooX__wBar__f", new S_TZ__eFooX__wBar__f[D], 4, "bar"); + /* */test("S_TZ__eFooX__wBar_I_", new S_TZ__eFooX__wBar_I_[D], 4, "sub"); + /* */test("S_TZ__eFooX__wBar_If", new S_TZ__eFooX__wBar_If[D], 4, "bar"); + /* */test("S_TZ__eFooX__wBarY__", new S_TZ__eFooX__wBarY__[D], 4, "sub"); + /* */test("S_TZ__eFooX__wBarY_f", new S_TZ__eFooX__wBarY_f[D], 4, "bar"); + /* */test("S_TZ__eFooX__wBarYI_", new S_TZ__eFooX__wBarYI_[D], 4, "sub"); + /* */test("S_TZ__eFooX__wBarYIf", new S_TZ__eFooX__wBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFooX_f ", new S_TZ__eFooX_f [D], 3, "foo"); + /* */test("S_TZ__eFooX_fwBar___", new S_TZ__eFooX_fwBar___[D], 4, "foo"); + // */test("S_TZ__eFooX_fwBar__f", new S_TZ__eFooX_fwBar__f[D], 4, "bar"); + /* */test("S_TZ__eFooX_fwBar_I_", new S_TZ__eFooX_fwBar_I_[D], 4, "foo"); + // */test("S_TZ__eFooX_fwBar_If", new S_TZ__eFooX_fwBar_If[D], 4, "bar"); + /* */test("S_TZ__eFooX_fwBarY__", new S_TZ__eFooX_fwBarY__[D], 4, "foo"); + // */test("S_TZ__eFooX_fwBarY_f", new S_TZ__eFooX_fwBarY_f[D], 4, "bar"); + /* */test("S_TZ__eFooX_fwBarYI_", new S_TZ__eFooX_fwBarYI_[D], 4, "foo"); + // */test("S_TZ__eFooX_fwBarYIf", new S_TZ__eFooX_fwBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFooXI_ ", new S_TZ__eFooXI_ [D], 3, "sub"); + /* */test("S_TZ__eFooXI_wBar___", new S_TZ__eFooXI_wBar___[D], 4, "sub"); + /* */test("S_TZ__eFooXI_wBar__f", new S_TZ__eFooXI_wBar__f[D], 4, "bar"); + // */test("S_TZ__eFooXI_wBar_I_", new S_TZ__eFooXI_wBar_I_[D], 4, "sub"); + // */test("S_TZ__eFooXI_wBar_If", new S_TZ__eFooXI_wBar_If[D], 4, "bar"); + /* */test("S_TZ__eFooXI_wBarY__", new S_TZ__eFooXI_wBarY__[D], 4, "sub"); + /* */test("S_TZ__eFooXI_wBarY_f", new S_TZ__eFooXI_wBarY_f[D], 4, "bar"); + // */test("S_TZ__eFooXI_wBarYI_", new S_TZ__eFooXI_wBarYI_[D], 4, "sub"); + // */test("S_TZ__eFooXI_wBarYIf", new S_TZ__eFooXI_wBarYIf[D], 4, "bar"); + /* */test("S_TZ__eFooXIf ", new S_TZ__eFooXIf [D], 3, "foo"); + /* */test("S_TZ__eFooXIfwBar___", new S_TZ__eFooXIfwBar___[D], 4, "foo"); + // */test("S_TZ__eFooXIfwBar__f", new S_TZ__eFooXIfwBar__f[D], 4, "bar"); + // */test("S_TZ__eFooXIfwBar_I_", new S_TZ__eFooXIfwBar_I_[D], 4, "foo"); + // */test("S_TZ__eFooXIfwBar_If", new S_TZ__eFooXIfwBar_If[D], 4, "bar"); + /* */test("S_TZ__eFooXIfwBarY__", new S_TZ__eFooXIfwBarY__[D], 4, "foo"); + // */test("S_TZ__eFooXIfwBarY_f", new S_TZ__eFooXIfwBarY_f[D], 4, "bar"); + // */test("S_TZ__eFooXIfwBarYI_", new S_TZ__eFooXIfwBarYI_[D], 4, "foo"); + // */test("S_TZ__eFooXIfwBarYIf", new S_TZ__eFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_TZ_feFoo___ ", new S_TZ_feFoo___ [D], 3, "mix"); + /* */test("S_TZ_feFoo___wBar___", new S_TZ_feFoo___wBar___[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBar__f", new S_TZ_feFoo___wBar__f[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBar_I_", new S_TZ_feFoo___wBar_I_[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBar_If", new S_TZ_feFoo___wBar_If[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBarY__", new S_TZ_feFoo___wBarY__[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBarY_f", new S_TZ_feFoo___wBarY_f[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBarYI_", new S_TZ_feFoo___wBarYI_[D], 4, "mix"); + /* */test("S_TZ_feFoo___wBarYIf", new S_TZ_feFoo___wBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFoo__f ", new S_TZ_feFoo__f [D], 3, "mix"); + /* */test("S_TZ_feFoo__fwBar___", new S_TZ_feFoo__fwBar___[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBar__f", new S_TZ_feFoo__fwBar__f[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBar_I_", new S_TZ_feFoo__fwBar_I_[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBar_If", new S_TZ_feFoo__fwBar_If[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBarY__", new S_TZ_feFoo__fwBarY__[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBarY_f", new S_TZ_feFoo__fwBarY_f[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBarYI_", new S_TZ_feFoo__fwBarYI_[D], 4, "mix"); + /* */test("S_TZ_feFoo__fwBarYIf", new S_TZ_feFoo__fwBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFoo_I_ ", new S_TZ_feFoo_I_ [D], 3, "mix"); + /* */test("S_TZ_feFoo_I_wBar___", new S_TZ_feFoo_I_wBar___[D], 4, "mix"); + /* */test("S_TZ_feFoo_I_wBar__f", new S_TZ_feFoo_I_wBar__f[D], 4, "mix"); + // */test("S_TZ_feFoo_I_wBar_I_", new S_TZ_feFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_TZ_feFoo_I_wBar_If", new S_TZ_feFoo_I_wBar_If[D], 4, "mix"); + /* */test("S_TZ_feFoo_I_wBarY__", new S_TZ_feFoo_I_wBarY__[D], 4, "mix"); + /* */test("S_TZ_feFoo_I_wBarY_f", new S_TZ_feFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_TZ_feFoo_I_wBarYI_", new S_TZ_feFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_TZ_feFoo_I_wBarYIf", new S_TZ_feFoo_I_wBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFoo_If ", new S_TZ_feFoo_If [D], 3, "mix"); + /* */test("S_TZ_feFoo_IfwBar___", new S_TZ_feFoo_IfwBar___[D], 4, "mix"); + /* */test("S_TZ_feFoo_IfwBar__f", new S_TZ_feFoo_IfwBar__f[D], 4, "mix"); + // */test("S_TZ_feFoo_IfwBar_I_", new S_TZ_feFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_TZ_feFoo_IfwBar_If", new S_TZ_feFoo_IfwBar_If[D], 4, "mix"); + /* */test("S_TZ_feFoo_IfwBarY__", new S_TZ_feFoo_IfwBarY__[D], 4, "mix"); + /* */test("S_TZ_feFoo_IfwBarY_f", new S_TZ_feFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_TZ_feFoo_IfwBarYI_", new S_TZ_feFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_TZ_feFoo_IfwBarYIf", new S_TZ_feFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFooX__ ", new S_TZ_feFooX__ [D], 3, "mix"); + /* */test("S_TZ_feFooX__wBar___", new S_TZ_feFooX__wBar___[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBar__f", new S_TZ_feFooX__wBar__f[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBar_I_", new S_TZ_feFooX__wBar_I_[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBar_If", new S_TZ_feFooX__wBar_If[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBarY__", new S_TZ_feFooX__wBarY__[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBarY_f", new S_TZ_feFooX__wBarY_f[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBarYI_", new S_TZ_feFooX__wBarYI_[D], 4, "mix"); + /* */test("S_TZ_feFooX__wBarYIf", new S_TZ_feFooX__wBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFooX_f ", new S_TZ_feFooX_f [D], 3, "mix"); + /* */test("S_TZ_feFooX_fwBar___", new S_TZ_feFooX_fwBar___[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBar__f", new S_TZ_feFooX_fwBar__f[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBar_I_", new S_TZ_feFooX_fwBar_I_[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBar_If", new S_TZ_feFooX_fwBar_If[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBarY__", new S_TZ_feFooX_fwBarY__[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBarY_f", new S_TZ_feFooX_fwBarY_f[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBarYI_", new S_TZ_feFooX_fwBarYI_[D], 4, "mix"); + /* */test("S_TZ_feFooX_fwBarYIf", new S_TZ_feFooX_fwBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFooXI_ ", new S_TZ_feFooXI_ [D], 3, "mix"); + /* */test("S_TZ_feFooXI_wBar___", new S_TZ_feFooXI_wBar___[D], 4, "mix"); + /* */test("S_TZ_feFooXI_wBar__f", new S_TZ_feFooXI_wBar__f[D], 4, "mix"); + // */test("S_TZ_feFooXI_wBar_I_", new S_TZ_feFooXI_wBar_I_[D], 4, "mix"); + // */test("S_TZ_feFooXI_wBar_If", new S_TZ_feFooXI_wBar_If[D], 4, "mix"); + /* */test("S_TZ_feFooXI_wBarY__", new S_TZ_feFooXI_wBarY__[D], 4, "mix"); + /* */test("S_TZ_feFooXI_wBarY_f", new S_TZ_feFooXI_wBarY_f[D], 4, "mix"); + // */test("S_TZ_feFooXI_wBarYI_", new S_TZ_feFooXI_wBarYI_[D], 4, "mix"); + // */test("S_TZ_feFooXI_wBarYIf", new S_TZ_feFooXI_wBarYIf[D], 4, "mix"); + /* */test("S_TZ_feFooXIf ", new S_TZ_feFooXIf [D], 3, "mix"); + /* */test("S_TZ_feFooXIfwBar___", new S_TZ_feFooXIfwBar___[D], 4, "mix"); + /* */test("S_TZ_feFooXIfwBar__f", new S_TZ_feFooXIfwBar__f[D], 4, "mix"); + // */test("S_TZ_feFooXIfwBar_I_", new S_TZ_feFooXIfwBar_I_[D], 4, "mix"); + // */test("S_TZ_feFooXIfwBar_If", new S_TZ_feFooXIfwBar_If[D], 4, "mix"); + /* */test("S_TZ_feFooXIfwBarY__", new S_TZ_feFooXIfwBarY__[D], 4, "mix"); + /* */test("S_TZ_feFooXIfwBarY_f", new S_TZ_feFooXIfwBarY_f[D], 4, "mix"); + // */test("S_TZ_feFooXIfwBarYI_", new S_TZ_feFooXIfwBarYI_[D], 4, "mix"); + // */test("S_TZ_feFooXIfwBarYIf", new S_TZ_feFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_TZI_eFoo___ ", new S_TZI_eFoo___ [D], 3, "sub"); + /* */test("S_TZI_eFoo___wBar___", new S_TZI_eFoo___wBar___[D], 4, "sub"); + /* */test("S_TZI_eFoo___wBar__f", new S_TZI_eFoo___wBar__f[D], 4, "bar"); + // */test("S_TZI_eFoo___wBar_I_", new S_TZI_eFoo___wBar_I_[D], 4, "sub"); + // */test("S_TZI_eFoo___wBar_If", new S_TZI_eFoo___wBar_If[D], 4, "bar"); + /* */test("S_TZI_eFoo___wBarY__", new S_TZI_eFoo___wBarY__[D], 4, "sub"); + /* */test("S_TZI_eFoo___wBarY_f", new S_TZI_eFoo___wBarY_f[D], 4, "bar"); + // */test("S_TZI_eFoo___wBarYI_", new S_TZI_eFoo___wBarYI_[D], 4, "sub"); + // */test("S_TZI_eFoo___wBarYIf", new S_TZI_eFoo___wBarYIf[D], 4, "bar"); + /* */test("S_TZI_eFoo__f ", new S_TZI_eFoo__f [D], 3, "foo"); + /* */test("S_TZI_eFoo__fwBar___", new S_TZI_eFoo__fwBar___[D], 4, "foo"); + // */test("S_TZI_eFoo__fwBar__f", new S_TZI_eFoo__fwBar__f[D], 4, "bar"); + // */test("S_TZI_eFoo__fwBar_I_", new S_TZI_eFoo__fwBar_I_[D], 4, "foo"); + // */test("S_TZI_eFoo__fwBar_If", new S_TZI_eFoo__fwBar_If[D], 4, "bar"); + /* */test("S_TZI_eFoo__fwBarY__", new S_TZI_eFoo__fwBarY__[D], 4, "foo"); + // */test("S_TZI_eFoo__fwBarY_f", new S_TZI_eFoo__fwBarY_f[D], 4, "bar"); + // */test("S_TZI_eFoo__fwBarYI_", new S_TZI_eFoo__fwBarYI_[D], 4, "foo"); + // */test("S_TZI_eFoo__fwBarYIf", new S_TZI_eFoo__fwBarYIf[D], 4, "bar"); + // */test("S_TZI_eFoo_I_ ", new S_TZI_eFoo_I_ [D], 3, "sub"); + // */test("S_TZI_eFoo_I_wBar___", new S_TZI_eFoo_I_wBar___[D], 4, "sub"); + // */test("S_TZI_eFoo_I_wBar__f", new S_TZI_eFoo_I_wBar__f[D], 4, "bar"); + // */test("S_TZI_eFoo_I_wBar_I_", new S_TZI_eFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_TZI_eFoo_I_wBar_If", new S_TZI_eFoo_I_wBar_If[D], 4, "bar"); + // */test("S_TZI_eFoo_I_wBarY__", new S_TZI_eFoo_I_wBarY__[D], 4, "sub"); + // */test("S_TZI_eFoo_I_wBarY_f", new S_TZI_eFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_TZI_eFoo_I_wBarYI_", new S_TZI_eFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_TZI_eFoo_I_wBarYIf", new S_TZI_eFoo_I_wBarYIf[D], 4, "bar"); + // */test("S_TZI_eFoo_If ", new S_TZI_eFoo_If [D], 3, "foo"); + // */test("S_TZI_eFoo_IfwBar___", new S_TZI_eFoo_IfwBar___[D], 4, "foo"); + // */test("S_TZI_eFoo_IfwBar__f", new S_TZI_eFoo_IfwBar__f[D], 4, "bar"); + // */test("S_TZI_eFoo_IfwBar_I_", new S_TZI_eFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_TZI_eFoo_IfwBar_If", new S_TZI_eFoo_IfwBar_If[D], 4, "bar"); + // */test("S_TZI_eFoo_IfwBarY__", new S_TZI_eFoo_IfwBarY__[D], 4, "foo"); + // */test("S_TZI_eFoo_IfwBarY_f", new S_TZI_eFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_TZI_eFoo_IfwBarYI_", new S_TZI_eFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_TZI_eFoo_IfwBarYIf", new S_TZI_eFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_TZI_eFooX__ ", new S_TZI_eFooX__ [D], 3, "sub"); + /* */test("S_TZI_eFooX__wBar___", new S_TZI_eFooX__wBar___[D], 4, "sub"); + /* */test("S_TZI_eFooX__wBar__f", new S_TZI_eFooX__wBar__f[D], 4, "bar"); + // */test("S_TZI_eFooX__wBar_I_", new S_TZI_eFooX__wBar_I_[D], 4, "sub"); + // */test("S_TZI_eFooX__wBar_If", new S_TZI_eFooX__wBar_If[D], 4, "bar"); + /* */test("S_TZI_eFooX__wBarY__", new S_TZI_eFooX__wBarY__[D], 4, "sub"); + /* */test("S_TZI_eFooX__wBarY_f", new S_TZI_eFooX__wBarY_f[D], 4, "bar"); + // */test("S_TZI_eFooX__wBarYI_", new S_TZI_eFooX__wBarYI_[D], 4, "sub"); + // */test("S_TZI_eFooX__wBarYIf", new S_TZI_eFooX__wBarYIf[D], 4, "bar"); + /* */test("S_TZI_eFooX_f ", new S_TZI_eFooX_f [D], 3, "foo"); + /* */test("S_TZI_eFooX_fwBar___", new S_TZI_eFooX_fwBar___[D], 4, "foo"); + // */test("S_TZI_eFooX_fwBar__f", new S_TZI_eFooX_fwBar__f[D], 4, "bar"); + // */test("S_TZI_eFooX_fwBar_I_", new S_TZI_eFooX_fwBar_I_[D], 4, "foo"); + // */test("S_TZI_eFooX_fwBar_If", new S_TZI_eFooX_fwBar_If[D], 4, "bar"); + /* */test("S_TZI_eFooX_fwBarY__", new S_TZI_eFooX_fwBarY__[D], 4, "foo"); + // */test("S_TZI_eFooX_fwBarY_f", new S_TZI_eFooX_fwBarY_f[D], 4, "bar"); + // */test("S_TZI_eFooX_fwBarYI_", new S_TZI_eFooX_fwBarYI_[D], 4, "foo"); + // */test("S_TZI_eFooX_fwBarYIf", new S_TZI_eFooX_fwBarYIf[D], 4, "bar"); + // */test("S_TZI_eFooXI_ ", new S_TZI_eFooXI_ [D], 3, "sub"); + // */test("S_TZI_eFooXI_wBar___", new S_TZI_eFooXI_wBar___[D], 4, "sub"); + // */test("S_TZI_eFooXI_wBar__f", new S_TZI_eFooXI_wBar__f[D], 4, "bar"); + // */test("S_TZI_eFooXI_wBar_I_", new S_TZI_eFooXI_wBar_I_[D], 4, "sub"); + // */test("S_TZI_eFooXI_wBar_If", new S_TZI_eFooXI_wBar_If[D], 4, "bar"); + // */test("S_TZI_eFooXI_wBarY__", new S_TZI_eFooXI_wBarY__[D], 4, "sub"); + // */test("S_TZI_eFooXI_wBarY_f", new S_TZI_eFooXI_wBarY_f[D], 4, "bar"); + // */test("S_TZI_eFooXI_wBarYI_", new S_TZI_eFooXI_wBarYI_[D], 4, "sub"); + // */test("S_TZI_eFooXI_wBarYIf", new S_TZI_eFooXI_wBarYIf[D], 4, "bar"); + // */test("S_TZI_eFooXIf ", new S_TZI_eFooXIf [D], 3, "foo"); + // */test("S_TZI_eFooXIfwBar___", new S_TZI_eFooXIfwBar___[D], 4, "foo"); + // */test("S_TZI_eFooXIfwBar__f", new S_TZI_eFooXIfwBar__f[D], 4, "bar"); + // */test("S_TZI_eFooXIfwBar_I_", new S_TZI_eFooXIfwBar_I_[D], 4, "foo"); + // */test("S_TZI_eFooXIfwBar_If", new S_TZI_eFooXIfwBar_If[D], 4, "bar"); + // */test("S_TZI_eFooXIfwBarY__", new S_TZI_eFooXIfwBarY__[D], 4, "foo"); + // */test("S_TZI_eFooXIfwBarY_f", new S_TZI_eFooXIfwBarY_f[D], 4, "bar"); + // */test("S_TZI_eFooXIfwBarYI_", new S_TZI_eFooXIfwBarYI_[D], 4, "foo"); + // */test("S_TZI_eFooXIfwBarYIf", new S_TZI_eFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_TZIfeFoo___ ", new S_TZIfeFoo___ [D], 3, "mix"); + /* */test("S_TZIfeFoo___wBar___", new S_TZIfeFoo___wBar___[D], 4, "mix"); + /* */test("S_TZIfeFoo___wBar__f", new S_TZIfeFoo___wBar__f[D], 4, "mix"); + // */test("S_TZIfeFoo___wBar_I_", new S_TZIfeFoo___wBar_I_[D], 4, "mix"); + // */test("S_TZIfeFoo___wBar_If", new S_TZIfeFoo___wBar_If[D], 4, "mix"); + /* */test("S_TZIfeFoo___wBarY__", new S_TZIfeFoo___wBarY__[D], 4, "mix"); + /* */test("S_TZIfeFoo___wBarY_f", new S_TZIfeFoo___wBarY_f[D], 4, "mix"); + // */test("S_TZIfeFoo___wBarYI_", new S_TZIfeFoo___wBarYI_[D], 4, "mix"); + // */test("S_TZIfeFoo___wBarYIf", new S_TZIfeFoo___wBarYIf[D], 4, "mix"); + /* */test("S_TZIfeFoo__f ", new S_TZIfeFoo__f [D], 3, "mix"); + /* */test("S_TZIfeFoo__fwBar___", new S_TZIfeFoo__fwBar___[D], 4, "mix"); + /* */test("S_TZIfeFoo__fwBar__f", new S_TZIfeFoo__fwBar__f[D], 4, "mix"); + // */test("S_TZIfeFoo__fwBar_I_", new S_TZIfeFoo__fwBar_I_[D], 4, "mix"); + // */test("S_TZIfeFoo__fwBar_If", new S_TZIfeFoo__fwBar_If[D], 4, "mix"); + /* */test("S_TZIfeFoo__fwBarY__", new S_TZIfeFoo__fwBarY__[D], 4, "mix"); + /* */test("S_TZIfeFoo__fwBarY_f", new S_TZIfeFoo__fwBarY_f[D], 4, "mix"); + // */test("S_TZIfeFoo__fwBarYI_", new S_TZIfeFoo__fwBarYI_[D], 4, "mix"); + // */test("S_TZIfeFoo__fwBarYIf", new S_TZIfeFoo__fwBarYIf[D], 4, "mix"); + // */test("S_TZIfeFoo_I_ ", new S_TZIfeFoo_I_ [D], 3, "mix"); + // */test("S_TZIfeFoo_I_wBar___", new S_TZIfeFoo_I_wBar___[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBar__f", new S_TZIfeFoo_I_wBar__f[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBar_I_", new S_TZIfeFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBar_If", new S_TZIfeFoo_I_wBar_If[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBarY__", new S_TZIfeFoo_I_wBarY__[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBarY_f", new S_TZIfeFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBarYI_", new S_TZIfeFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_TZIfeFoo_I_wBarYIf", new S_TZIfeFoo_I_wBarYIf[D], 4, "mix"); + // */test("S_TZIfeFoo_If ", new S_TZIfeFoo_If [D], 3, "mix"); + // */test("S_TZIfeFoo_IfwBar___", new S_TZIfeFoo_IfwBar___[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBar__f", new S_TZIfeFoo_IfwBar__f[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBar_I_", new S_TZIfeFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBar_If", new S_TZIfeFoo_IfwBar_If[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBarY__", new S_TZIfeFoo_IfwBarY__[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBarY_f", new S_TZIfeFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBarYI_", new S_TZIfeFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_TZIfeFoo_IfwBarYIf", new S_TZIfeFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_TZIfeFooX__ ", new S_TZIfeFooX__ [D], 3, "mix"); + /* */test("S_TZIfeFooX__wBar___", new S_TZIfeFooX__wBar___[D], 4, "mix"); + /* */test("S_TZIfeFooX__wBar__f", new S_TZIfeFooX__wBar__f[D], 4, "mix"); + // */test("S_TZIfeFooX__wBar_I_", new S_TZIfeFooX__wBar_I_[D], 4, "mix"); + // */test("S_TZIfeFooX__wBar_If", new S_TZIfeFooX__wBar_If[D], 4, "mix"); + /* */test("S_TZIfeFooX__wBarY__", new S_TZIfeFooX__wBarY__[D], 4, "mix"); + /* */test("S_TZIfeFooX__wBarY_f", new S_TZIfeFooX__wBarY_f[D], 4, "mix"); + // */test("S_TZIfeFooX__wBarYI_", new S_TZIfeFooX__wBarYI_[D], 4, "mix"); + // */test("S_TZIfeFooX__wBarYIf", new S_TZIfeFooX__wBarYIf[D], 4, "mix"); + /* */test("S_TZIfeFooX_f ", new S_TZIfeFooX_f [D], 3, "mix"); + /* */test("S_TZIfeFooX_fwBar___", new S_TZIfeFooX_fwBar___[D], 4, "mix"); + /* */test("S_TZIfeFooX_fwBar__f", new S_TZIfeFooX_fwBar__f[D], 4, "mix"); + // */test("S_TZIfeFooX_fwBar_I_", new S_TZIfeFooX_fwBar_I_[D], 4, "mix"); + // */test("S_TZIfeFooX_fwBar_If", new S_TZIfeFooX_fwBar_If[D], 4, "mix"); + /* */test("S_TZIfeFooX_fwBarY__", new S_TZIfeFooX_fwBarY__[D], 4, "mix"); + /* */test("S_TZIfeFooX_fwBarY_f", new S_TZIfeFooX_fwBarY_f[D], 4, "mix"); + // */test("S_TZIfeFooX_fwBarYI_", new S_TZIfeFooX_fwBarYI_[D], 4, "mix"); + // */test("S_TZIfeFooX_fwBarYIf", new S_TZIfeFooX_fwBarYIf[D], 4, "mix"); + // */test("S_TZIfeFooXI_ ", new S_TZIfeFooXI_ [D], 3, "mix"); + // */test("S_TZIfeFooXI_wBar___", new S_TZIfeFooXI_wBar___[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBar__f", new S_TZIfeFooXI_wBar__f[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBar_I_", new S_TZIfeFooXI_wBar_I_[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBar_If", new S_TZIfeFooXI_wBar_If[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBarY__", new S_TZIfeFooXI_wBarY__[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBarY_f", new S_TZIfeFooXI_wBarY_f[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBarYI_", new S_TZIfeFooXI_wBarYI_[D], 4, "mix"); + // */test("S_TZIfeFooXI_wBarYIf", new S_TZIfeFooXI_wBarYIf[D], 4, "mix"); + // */test("S_TZIfeFooXIf ", new S_TZIfeFooXIf [D], 3, "mix"); + // */test("S_TZIfeFooXIfwBar___", new S_TZIfeFooXIfwBar___[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBar__f", new S_TZIfeFooXIfwBar__f[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBar_I_", new S_TZIfeFooXIfwBar_I_[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBar_If", new S_TZIfeFooXIfwBar_If[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBarY__", new S_TZIfeFooXIfwBarY__[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBarY_f", new S_TZIfeFooXIfwBarY_f[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBarYI_", new S_TZIfeFooXIfwBarYI_[D], 4, "mix"); + // */test("S_TZIfeFooXIfwBarYIf", new S_TZIfeFooXIfwBarYIf[D], 4, "mix"); + + + + /* */test("S_T___wFoo___ ", new S_T___wFoo___ [D], 3, "sub"); + /* */test("S_T___wFoo___wBar___", new S_T___wFoo___wBar___[D], 4, "sub"); + /* */test("S_T___wFoo___wBar__f", new S_T___wFoo___wBar__f[D], 4, "bar"); + /* */test("S_T___wFoo___wBar_I_", new S_T___wFoo___wBar_I_[D], 4, "sub"); + /* */test("S_T___wFoo___wBar_If", new S_T___wFoo___wBar_If[D], 4, "bar"); + /* */test("S_T___wFoo___wBarY__", new S_T___wFoo___wBarY__[D], 4, "sub"); + /* */test("S_T___wFoo___wBarY_f", new S_T___wFoo___wBarY_f[D], 4, "bar"); + /* */test("S_T___wFoo___wBarYI_", new S_T___wFoo___wBarYI_[D], 4, "sub"); + /* */test("S_T___wFoo___wBarYIf", new S_T___wFoo___wBarYIf[D], 4, "bar"); + /* */test("S_T___wFoo__f ", new S_T___wFoo__f [D], 3, "foo"); + /* */test("S_T___wFoo__fwBar___", new S_T___wFoo__fwBar___[D], 4, "foo"); + // */test("S_T___wFoo__fwBar__f", new S_T___wFoo__fwBar__f[D], 4, "bar"); + /* */test("S_T___wFoo__fwBar_I_", new S_T___wFoo__fwBar_I_[D], 4, "foo"); + // */test("S_T___wFoo__fwBar_If", new S_T___wFoo__fwBar_If[D], 4, "bar"); + /* */test("S_T___wFoo__fwBarY__", new S_T___wFoo__fwBarY__[D], 4, "foo"); + // */test("S_T___wFoo__fwBarY_f", new S_T___wFoo__fwBarY_f[D], 4, "bar"); + /* */test("S_T___wFoo__fwBarYI_", new S_T___wFoo__fwBarYI_[D], 4, "foo"); + // */test("S_T___wFoo__fwBarYIf", new S_T___wFoo__fwBarYIf[D], 4, "bar"); + /* */test("S_T___wFoo_I_ ", new S_T___wFoo_I_ [D], 3, "sub"); + /* */test("S_T___wFoo_I_wBar___", new S_T___wFoo_I_wBar___[D], 4, "sub"); + /* */test("S_T___wFoo_I_wBar__f", new S_T___wFoo_I_wBar__f[D], 4, "bar"); + // */test("S_T___wFoo_I_wBar_I_", new S_T___wFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_T___wFoo_I_wBar_If", new S_T___wFoo_I_wBar_If[D], 4, "bar"); + /* */test("S_T___wFoo_I_wBarY__", new S_T___wFoo_I_wBarY__[D], 4, "sub"); + /* */test("S_T___wFoo_I_wBarY_f", new S_T___wFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_T___wFoo_I_wBarYI_", new S_T___wFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_T___wFoo_I_wBarYIf", new S_T___wFoo_I_wBarYIf[D], 4, "bar"); + /* */test("S_T___wFoo_If ", new S_T___wFoo_If [D], 3, "foo"); + /* */test("S_T___wFoo_IfwBar___", new S_T___wFoo_IfwBar___[D], 4, "foo"); + // */test("S_T___wFoo_IfwBar__f", new S_T___wFoo_IfwBar__f[D], 4, "bar"); + // */test("S_T___wFoo_IfwBar_I_", new S_T___wFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_T___wFoo_IfwBar_If", new S_T___wFoo_IfwBar_If[D], 4, "bar"); + /* */test("S_T___wFoo_IfwBarY__", new S_T___wFoo_IfwBarY__[D], 4, "foo"); + // */test("S_T___wFoo_IfwBarY_f", new S_T___wFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_T___wFoo_IfwBarYI_", new S_T___wFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_T___wFoo_IfwBarYIf", new S_T___wFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_T___wFooX__ ", new S_T___wFooX__ [D], 3, "sub"); + /* */test("S_T___wFooX__wBar___", new S_T___wFooX__wBar___[D], 4, "sub"); + /* */test("S_T___wFooX__wBar__f", new S_T___wFooX__wBar__f[D], 4, "bar"); + /* */test("S_T___wFooX__wBar_I_", new S_T___wFooX__wBar_I_[D], 4, "sub"); + /* */test("S_T___wFooX__wBar_If", new S_T___wFooX__wBar_If[D], 4, "bar"); + /* */test("S_T___wFooX__wBarY__", new S_T___wFooX__wBarY__[D], 4, "sub"); + /* */test("S_T___wFooX__wBarY_f", new S_T___wFooX__wBarY_f[D], 4, "bar"); + /* */test("S_T___wFooX__wBarYI_", new S_T___wFooX__wBarYI_[D], 4, "sub"); + /* */test("S_T___wFooX__wBarYIf", new S_T___wFooX__wBarYIf[D], 4, "bar"); + /* */test("S_T___wFooX_f ", new S_T___wFooX_f [D], 3, "foo"); + /* */test("S_T___wFooX_fwBar___", new S_T___wFooX_fwBar___[D], 4, "foo"); + // */test("S_T___wFooX_fwBar__f", new S_T___wFooX_fwBar__f[D], 4, "bar"); + /* */test("S_T___wFooX_fwBar_I_", new S_T___wFooX_fwBar_I_[D], 4, "foo"); + // */test("S_T___wFooX_fwBar_If", new S_T___wFooX_fwBar_If[D], 4, "bar"); + /* */test("S_T___wFooX_fwBarY__", new S_T___wFooX_fwBarY__[D], 4, "foo"); + // */test("S_T___wFooX_fwBarY_f", new S_T___wFooX_fwBarY_f[D], 4, "bar"); + /* */test("S_T___wFooX_fwBarYI_", new S_T___wFooX_fwBarYI_[D], 4, "foo"); + // */test("S_T___wFooX_fwBarYIf", new S_T___wFooX_fwBarYIf[D], 4, "bar"); + /* */test("S_T___wFooXI_ ", new S_T___wFooXI_ [D], 3, "sub"); + /* */test("S_T___wFooXI_wBar___", new S_T___wFooXI_wBar___[D], 4, "sub"); + /* */test("S_T___wFooXI_wBar__f", new S_T___wFooXI_wBar__f[D], 4, "bar"); + // */test("S_T___wFooXI_wBar_I_", new S_T___wFooXI_wBar_I_[D], 4, "sub"); + // */test("S_T___wFooXI_wBar_If", new S_T___wFooXI_wBar_If[D], 4, "bar"); + /* */test("S_T___wFooXI_wBarY__", new S_T___wFooXI_wBarY__[D], 4, "sub"); + /* */test("S_T___wFooXI_wBarY_f", new S_T___wFooXI_wBarY_f[D], 4, "bar"); + // */test("S_T___wFooXI_wBarYI_", new S_T___wFooXI_wBarYI_[D], 4, "sub"); + // */test("S_T___wFooXI_wBarYIf", new S_T___wFooXI_wBarYIf[D], 4, "bar"); + /* */test("S_T___wFooXIf ", new S_T___wFooXIf [D], 3, "foo"); + /* */test("S_T___wFooXIfwBar___", new S_T___wFooXIfwBar___[D], 4, "foo"); + // */test("S_T___wFooXIfwBar__f", new S_T___wFooXIfwBar__f[D], 4, "bar"); + // */test("S_T___wFooXIfwBar_I_", new S_T___wFooXIfwBar_I_[D], 4, "foo"); + // */test("S_T___wFooXIfwBar_If", new S_T___wFooXIfwBar_If[D], 4, "bar"); + /* */test("S_T___wFooXIfwBarY__", new S_T___wFooXIfwBarY__[D], 4, "foo"); + // */test("S_T___wFooXIfwBarY_f", new S_T___wFooXIfwBarY_f[D], 4, "bar"); + // */test("S_T___wFooXIfwBarYI_", new S_T___wFooXIfwBarYI_[D], 4, "foo"); + // */test("S_T___wFooXIfwBarYIf", new S_T___wFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_T__fwFoo___ ", new S_T__fwFoo___ [D], 3, "mix"); + /* */test("S_T__fwFoo___wBar___", new S_T__fwFoo___wBar___[D], 4, "mix"); + /* */test("S_T__fwFoo___wBar__f", new S_T__fwFoo___wBar__f[D], 4, "mix"); + /* */test("S_T__fwFoo___wBar_I_", new S_T__fwFoo___wBar_I_[D], 4, "mix"); + /* */test("S_T__fwFoo___wBar_If", new S_T__fwFoo___wBar_If[D], 4, "mix"); + /* */test("S_T__fwFoo___wBarY__", new S_T__fwFoo___wBarY__[D], 4, "mix"); + /* */test("S_T__fwFoo___wBarY_f", new S_T__fwFoo___wBarY_f[D], 4, "mix"); + /* */test("S_T__fwFoo___wBarYI_", new S_T__fwFoo___wBarYI_[D], 4, "mix"); + /* */test("S_T__fwFoo___wBarYIf", new S_T__fwFoo___wBarYIf[D], 4, "mix"); + /* */test("S_T__fwFoo__f ", new S_T__fwFoo__f [D], 3, "mix"); + /* */test("S_T__fwFoo__fwBar___", new S_T__fwFoo__fwBar___[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBar__f", new S_T__fwFoo__fwBar__f[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBar_I_", new S_T__fwFoo__fwBar_I_[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBar_If", new S_T__fwFoo__fwBar_If[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBarY__", new S_T__fwFoo__fwBarY__[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBarY_f", new S_T__fwFoo__fwBarY_f[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBarYI_", new S_T__fwFoo__fwBarYI_[D], 4, "mix"); + /* */test("S_T__fwFoo__fwBarYIf", new S_T__fwFoo__fwBarYIf[D], 4, "mix"); + /* */test("S_T__fwFoo_I_ ", new S_T__fwFoo_I_ [D], 3, "mix"); + /* */test("S_T__fwFoo_I_wBar___", new S_T__fwFoo_I_wBar___[D], 4, "mix"); + /* */test("S_T__fwFoo_I_wBar__f", new S_T__fwFoo_I_wBar__f[D], 4, "mix"); + // */test("S_T__fwFoo_I_wBar_I_", new S_T__fwFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_T__fwFoo_I_wBar_If", new S_T__fwFoo_I_wBar_If[D], 4, "mix"); + /* */test("S_T__fwFoo_I_wBarY__", new S_T__fwFoo_I_wBarY__[D], 4, "mix"); + /* */test("S_T__fwFoo_I_wBarY_f", new S_T__fwFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_T__fwFoo_I_wBarYI_", new S_T__fwFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_T__fwFoo_I_wBarYIf", new S_T__fwFoo_I_wBarYIf[D], 4, "mix"); + /* */test("S_T__fwFoo_If ", new S_T__fwFoo_If [D], 3, "mix"); + /* */test("S_T__fwFoo_IfwBar___", new S_T__fwFoo_IfwBar___[D], 4, "mix"); + /* */test("S_T__fwFoo_IfwBar__f", new S_T__fwFoo_IfwBar__f[D], 4, "mix"); + // */test("S_T__fwFoo_IfwBar_I_", new S_T__fwFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_T__fwFoo_IfwBar_If", new S_T__fwFoo_IfwBar_If[D], 4, "mix"); + /* */test("S_T__fwFoo_IfwBarY__", new S_T__fwFoo_IfwBarY__[D], 4, "mix"); + /* */test("S_T__fwFoo_IfwBarY_f", new S_T__fwFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_T__fwFoo_IfwBarYI_", new S_T__fwFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_T__fwFoo_IfwBarYIf", new S_T__fwFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_T__fwFooX__ ", new S_T__fwFooX__ [D], 3, "mix"); + /* */test("S_T__fwFooX__wBar___", new S_T__fwFooX__wBar___[D], 4, "mix"); + /* */test("S_T__fwFooX__wBar__f", new S_T__fwFooX__wBar__f[D], 4, "mix"); + /* */test("S_T__fwFooX__wBar_I_", new S_T__fwFooX__wBar_I_[D], 4, "mix"); + /* */test("S_T__fwFooX__wBar_If", new S_T__fwFooX__wBar_If[D], 4, "mix"); + /* */test("S_T__fwFooX__wBarY__", new S_T__fwFooX__wBarY__[D], 4, "mix"); + /* */test("S_T__fwFooX__wBarY_f", new S_T__fwFooX__wBarY_f[D], 4, "mix"); + /* */test("S_T__fwFooX__wBarYI_", new S_T__fwFooX__wBarYI_[D], 4, "mix"); + /* */test("S_T__fwFooX__wBarYIf", new S_T__fwFooX__wBarYIf[D], 4, "mix"); + /* */test("S_T__fwFooX_f ", new S_T__fwFooX_f [D], 3, "mix"); + /* */test("S_T__fwFooX_fwBar___", new S_T__fwFooX_fwBar___[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBar__f", new S_T__fwFooX_fwBar__f[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBar_I_", new S_T__fwFooX_fwBar_I_[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBar_If", new S_T__fwFooX_fwBar_If[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBarY__", new S_T__fwFooX_fwBarY__[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBarY_f", new S_T__fwFooX_fwBarY_f[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBarYI_", new S_T__fwFooX_fwBarYI_[D], 4, "mix"); + /* */test("S_T__fwFooX_fwBarYIf", new S_T__fwFooX_fwBarYIf[D], 4, "mix"); + /* */test("S_T__fwFooXI_ ", new S_T__fwFooXI_ [D], 3, "mix"); + /* */test("S_T__fwFooXI_wBar___", new S_T__fwFooXI_wBar___[D], 4, "mix"); + /* */test("S_T__fwFooXI_wBar__f", new S_T__fwFooXI_wBar__f[D], 4, "mix"); + // */test("S_T__fwFooXI_wBar_I_", new S_T__fwFooXI_wBar_I_[D], 4, "mix"); + // */test("S_T__fwFooXI_wBar_If", new S_T__fwFooXI_wBar_If[D], 4, "mix"); + /* */test("S_T__fwFooXI_wBarY__", new S_T__fwFooXI_wBarY__[D], 4, "mix"); + /* */test("S_T__fwFooXI_wBarY_f", new S_T__fwFooXI_wBarY_f[D], 4, "mix"); + // */test("S_T__fwFooXI_wBarYI_", new S_T__fwFooXI_wBarYI_[D], 4, "mix"); + // */test("S_T__fwFooXI_wBarYIf", new S_T__fwFooXI_wBarYIf[D], 4, "mix"); + /* */test("S_T__fwFooXIf ", new S_T__fwFooXIf [D], 3, "mix"); + /* */test("S_T__fwFooXIfwBar___", new S_T__fwFooXIfwBar___[D], 4, "mix"); + /* */test("S_T__fwFooXIfwBar__f", new S_T__fwFooXIfwBar__f[D], 4, "mix"); + // */test("S_T__fwFooXIfwBar_I_", new S_T__fwFooXIfwBar_I_[D], 4, "mix"); + // */test("S_T__fwFooXIfwBar_If", new S_T__fwFooXIfwBar_If[D], 4, "mix"); + /* */test("S_T__fwFooXIfwBarY__", new S_T__fwFooXIfwBarY__[D], 4, "mix"); + /* */test("S_T__fwFooXIfwBarY_f", new S_T__fwFooXIfwBarY_f[D], 4, "mix"); + // */test("S_T__fwFooXIfwBarYI_", new S_T__fwFooXIfwBarYI_[D], 4, "mix"); + // */test("S_T__fwFooXIfwBarYIf", new S_T__fwFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_T_I_wFoo___ ", new S_T_I_wFoo___ [D], 3, "sub"); + /* */test("S_T_I_wFoo___wBar___", new S_T_I_wFoo___wBar___[D], 4, "sub"); + /* */test("S_T_I_wFoo___wBar__f", new S_T_I_wFoo___wBar__f[D], 4, "bar"); + // */test("S_T_I_wFoo___wBar_I_", new S_T_I_wFoo___wBar_I_[D], 4, "sub"); + // */test("S_T_I_wFoo___wBar_If", new S_T_I_wFoo___wBar_If[D], 4, "bar"); + /* */test("S_T_I_wFoo___wBarY__", new S_T_I_wFoo___wBarY__[D], 4, "sub"); + /* */test("S_T_I_wFoo___wBarY_f", new S_T_I_wFoo___wBarY_f[D], 4, "bar"); + // */test("S_T_I_wFoo___wBarYI_", new S_T_I_wFoo___wBarYI_[D], 4, "sub"); + // */test("S_T_I_wFoo___wBarYIf", new S_T_I_wFoo___wBarYIf[D], 4, "bar"); + /* */test("S_T_I_wFoo__f ", new S_T_I_wFoo__f [D], 3, "foo"); + /* */test("S_T_I_wFoo__fwBar___", new S_T_I_wFoo__fwBar___[D], 4, "foo"); + // */test("S_T_I_wFoo__fwBar__f", new S_T_I_wFoo__fwBar__f[D], 4, "bar"); + // */test("S_T_I_wFoo__fwBar_I_", new S_T_I_wFoo__fwBar_I_[D], 4, "foo"); + // */test("S_T_I_wFoo__fwBar_If", new S_T_I_wFoo__fwBar_If[D], 4, "bar"); + /* */test("S_T_I_wFoo__fwBarY__", new S_T_I_wFoo__fwBarY__[D], 4, "foo"); + // */test("S_T_I_wFoo__fwBarY_f", new S_T_I_wFoo__fwBarY_f[D], 4, "bar"); + // */test("S_T_I_wFoo__fwBarYI_", new S_T_I_wFoo__fwBarYI_[D], 4, "foo"); + // */test("S_T_I_wFoo__fwBarYIf", new S_T_I_wFoo__fwBarYIf[D], 4, "bar"); + // */test("S_T_I_wFoo_I_ ", new S_T_I_wFoo_I_ [D], 3, "sub"); + // */test("S_T_I_wFoo_I_wBar___", new S_T_I_wFoo_I_wBar___[D], 4, "sub"); + // */test("S_T_I_wFoo_I_wBar__f", new S_T_I_wFoo_I_wBar__f[D], 4, "bar"); + // */test("S_T_I_wFoo_I_wBar_I_", new S_T_I_wFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_T_I_wFoo_I_wBar_If", new S_T_I_wFoo_I_wBar_If[D], 4, "bar"); + // */test("S_T_I_wFoo_I_wBarY__", new S_T_I_wFoo_I_wBarY__[D], 4, "sub"); + // */test("S_T_I_wFoo_I_wBarY_f", new S_T_I_wFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_T_I_wFoo_I_wBarYI_", new S_T_I_wFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_T_I_wFoo_I_wBarYIf", new S_T_I_wFoo_I_wBarYIf[D], 4, "bar"); + // */test("S_T_I_wFoo_If ", new S_T_I_wFoo_If [D], 3, "foo"); + // */test("S_T_I_wFoo_IfwBar___", new S_T_I_wFoo_IfwBar___[D], 4, "foo"); + // */test("S_T_I_wFoo_IfwBar__f", new S_T_I_wFoo_IfwBar__f[D], 4, "bar"); + // */test("S_T_I_wFoo_IfwBar_I_", new S_T_I_wFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_T_I_wFoo_IfwBar_If", new S_T_I_wFoo_IfwBar_If[D], 4, "bar"); + // */test("S_T_I_wFoo_IfwBarY__", new S_T_I_wFoo_IfwBarY__[D], 4, "foo"); + // */test("S_T_I_wFoo_IfwBarY_f", new S_T_I_wFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_T_I_wFoo_IfwBarYI_", new S_T_I_wFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_T_I_wFoo_IfwBarYIf", new S_T_I_wFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_T_I_wFooX__ ", new S_T_I_wFooX__ [D], 3, "sub"); + /* */test("S_T_I_wFooX__wBar___", new S_T_I_wFooX__wBar___[D], 4, "sub"); + /* */test("S_T_I_wFooX__wBar__f", new S_T_I_wFooX__wBar__f[D], 4, "bar"); + // */test("S_T_I_wFooX__wBar_I_", new S_T_I_wFooX__wBar_I_[D], 4, "sub"); + // */test("S_T_I_wFooX__wBar_If", new S_T_I_wFooX__wBar_If[D], 4, "bar"); + /* */test("S_T_I_wFooX__wBarY__", new S_T_I_wFooX__wBarY__[D], 4, "sub"); + /* */test("S_T_I_wFooX__wBarY_f", new S_T_I_wFooX__wBarY_f[D], 4, "bar"); + // */test("S_T_I_wFooX__wBarYI_", new S_T_I_wFooX__wBarYI_[D], 4, "sub"); + // */test("S_T_I_wFooX__wBarYIf", new S_T_I_wFooX__wBarYIf[D], 4, "bar"); + /* */test("S_T_I_wFooX_f ", new S_T_I_wFooX_f [D], 3, "foo"); + /* */test("S_T_I_wFooX_fwBar___", new S_T_I_wFooX_fwBar___[D], 4, "foo"); + // */test("S_T_I_wFooX_fwBar__f", new S_T_I_wFooX_fwBar__f[D], 4, "bar"); + // */test("S_T_I_wFooX_fwBar_I_", new S_T_I_wFooX_fwBar_I_[D], 4, "foo"); + // */test("S_T_I_wFooX_fwBar_If", new S_T_I_wFooX_fwBar_If[D], 4, "bar"); + /* */test("S_T_I_wFooX_fwBarY__", new S_T_I_wFooX_fwBarY__[D], 4, "foo"); + // */test("S_T_I_wFooX_fwBarY_f", new S_T_I_wFooX_fwBarY_f[D], 4, "bar"); + // */test("S_T_I_wFooX_fwBarYI_", new S_T_I_wFooX_fwBarYI_[D], 4, "foo"); + // */test("S_T_I_wFooX_fwBarYIf", new S_T_I_wFooX_fwBarYIf[D], 4, "bar"); + // */test("S_T_I_wFooXI_ ", new S_T_I_wFooXI_ [D], 3, "sub"); + // */test("S_T_I_wFooXI_wBar___", new S_T_I_wFooXI_wBar___[D], 4, "sub"); + // */test("S_T_I_wFooXI_wBar__f", new S_T_I_wFooXI_wBar__f[D], 4, "bar"); + // */test("S_T_I_wFooXI_wBar_I_", new S_T_I_wFooXI_wBar_I_[D], 4, "sub"); + // */test("S_T_I_wFooXI_wBar_If", new S_T_I_wFooXI_wBar_If[D], 4, "bar"); + // */test("S_T_I_wFooXI_wBarY__", new S_T_I_wFooXI_wBarY__[D], 4, "sub"); + // */test("S_T_I_wFooXI_wBarY_f", new S_T_I_wFooXI_wBarY_f[D], 4, "bar"); + // */test("S_T_I_wFooXI_wBarYI_", new S_T_I_wFooXI_wBarYI_[D], 4, "sub"); + // */test("S_T_I_wFooXI_wBarYIf", new S_T_I_wFooXI_wBarYIf[D], 4, "bar"); + // */test("S_T_I_wFooXIf ", new S_T_I_wFooXIf [D], 3, "foo"); + // */test("S_T_I_wFooXIfwBar___", new S_T_I_wFooXIfwBar___[D], 4, "foo"); + // */test("S_T_I_wFooXIfwBar__f", new S_T_I_wFooXIfwBar__f[D], 4, "bar"); + // */test("S_T_I_wFooXIfwBar_I_", new S_T_I_wFooXIfwBar_I_[D], 4, "foo"); + // */test("S_T_I_wFooXIfwBar_If", new S_T_I_wFooXIfwBar_If[D], 4, "bar"); + // */test("S_T_I_wFooXIfwBarY__", new S_T_I_wFooXIfwBarY__[D], 4, "foo"); + // */test("S_T_I_wFooXIfwBarY_f", new S_T_I_wFooXIfwBarY_f[D], 4, "bar"); + // */test("S_T_I_wFooXIfwBarYI_", new S_T_I_wFooXIfwBarYI_[D], 4, "foo"); + // */test("S_T_I_wFooXIfwBarYIf", new S_T_I_wFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_T_IfwFoo___ ", new S_T_IfwFoo___ [D], 3, "mix"); + /* */test("S_T_IfwFoo___wBar___", new S_T_IfwFoo___wBar___[D], 4, "mix"); + /* */test("S_T_IfwFoo___wBar__f", new S_T_IfwFoo___wBar__f[D], 4, "mix"); + // */test("S_T_IfwFoo___wBar_I_", new S_T_IfwFoo___wBar_I_[D], 4, "mix"); + // */test("S_T_IfwFoo___wBar_If", new S_T_IfwFoo___wBar_If[D], 4, "mix"); + /* */test("S_T_IfwFoo___wBarY__", new S_T_IfwFoo___wBarY__[D], 4, "mix"); + /* */test("S_T_IfwFoo___wBarY_f", new S_T_IfwFoo___wBarY_f[D], 4, "mix"); + // */test("S_T_IfwFoo___wBarYI_", new S_T_IfwFoo___wBarYI_[D], 4, "mix"); + // */test("S_T_IfwFoo___wBarYIf", new S_T_IfwFoo___wBarYIf[D], 4, "mix"); + /* */test("S_T_IfwFoo__f ", new S_T_IfwFoo__f [D], 3, "mix"); + /* */test("S_T_IfwFoo__fwBar___", new S_T_IfwFoo__fwBar___[D], 4, "mix"); + /* */test("S_T_IfwFoo__fwBar__f", new S_T_IfwFoo__fwBar__f[D], 4, "mix"); + // */test("S_T_IfwFoo__fwBar_I_", new S_T_IfwFoo__fwBar_I_[D], 4, "mix"); + // */test("S_T_IfwFoo__fwBar_If", new S_T_IfwFoo__fwBar_If[D], 4, "mix"); + /* */test("S_T_IfwFoo__fwBarY__", new S_T_IfwFoo__fwBarY__[D], 4, "mix"); + /* */test("S_T_IfwFoo__fwBarY_f", new S_T_IfwFoo__fwBarY_f[D], 4, "mix"); + // */test("S_T_IfwFoo__fwBarYI_", new S_T_IfwFoo__fwBarYI_[D], 4, "mix"); + // */test("S_T_IfwFoo__fwBarYIf", new S_T_IfwFoo__fwBarYIf[D], 4, "mix"); + // */test("S_T_IfwFoo_I_ ", new S_T_IfwFoo_I_ [D], 3, "mix"); + // */test("S_T_IfwFoo_I_wBar___", new S_T_IfwFoo_I_wBar___[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBar__f", new S_T_IfwFoo_I_wBar__f[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBar_I_", new S_T_IfwFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBar_If", new S_T_IfwFoo_I_wBar_If[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBarY__", new S_T_IfwFoo_I_wBarY__[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBarY_f", new S_T_IfwFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBarYI_", new S_T_IfwFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_T_IfwFoo_I_wBarYIf", new S_T_IfwFoo_I_wBarYIf[D], 4, "mix"); + // */test("S_T_IfwFoo_If ", new S_T_IfwFoo_If [D], 3, "mix"); + // */test("S_T_IfwFoo_IfwBar___", new S_T_IfwFoo_IfwBar___[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBar__f", new S_T_IfwFoo_IfwBar__f[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBar_I_", new S_T_IfwFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBar_If", new S_T_IfwFoo_IfwBar_If[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBarY__", new S_T_IfwFoo_IfwBarY__[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBarY_f", new S_T_IfwFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBarYI_", new S_T_IfwFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_T_IfwFoo_IfwBarYIf", new S_T_IfwFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_T_IfwFooX__ ", new S_T_IfwFooX__ [D], 3, "mix"); + /* */test("S_T_IfwFooX__wBar___", new S_T_IfwFooX__wBar___[D], 4, "mix"); + /* */test("S_T_IfwFooX__wBar__f", new S_T_IfwFooX__wBar__f[D], 4, "mix"); + // */test("S_T_IfwFooX__wBar_I_", new S_T_IfwFooX__wBar_I_[D], 4, "mix"); + // */test("S_T_IfwFooX__wBar_If", new S_T_IfwFooX__wBar_If[D], 4, "mix"); + /* */test("S_T_IfwFooX__wBarY__", new S_T_IfwFooX__wBarY__[D], 4, "mix"); + /* */test("S_T_IfwFooX__wBarY_f", new S_T_IfwFooX__wBarY_f[D], 4, "mix"); + // */test("S_T_IfwFooX__wBarYI_", new S_T_IfwFooX__wBarYI_[D], 4, "mix"); + // */test("S_T_IfwFooX__wBarYIf", new S_T_IfwFooX__wBarYIf[D], 4, "mix"); + /* */test("S_T_IfwFooX_f ", new S_T_IfwFooX_f [D], 3, "mix"); + /* */test("S_T_IfwFooX_fwBar___", new S_T_IfwFooX_fwBar___[D], 4, "mix"); + /* */test("S_T_IfwFooX_fwBar__f", new S_T_IfwFooX_fwBar__f[D], 4, "mix"); + // */test("S_T_IfwFooX_fwBar_I_", new S_T_IfwFooX_fwBar_I_[D], 4, "mix"); + // */test("S_T_IfwFooX_fwBar_If", new S_T_IfwFooX_fwBar_If[D], 4, "mix"); + /* */test("S_T_IfwFooX_fwBarY__", new S_T_IfwFooX_fwBarY__[D], 4, "mix"); + /* */test("S_T_IfwFooX_fwBarY_f", new S_T_IfwFooX_fwBarY_f[D], 4, "mix"); + // */test("S_T_IfwFooX_fwBarYI_", new S_T_IfwFooX_fwBarYI_[D], 4, "mix"); + // */test("S_T_IfwFooX_fwBarYIf", new S_T_IfwFooX_fwBarYIf[D], 4, "mix"); + // */test("S_T_IfwFooXI_ ", new S_T_IfwFooXI_ [D], 3, "mix"); + // */test("S_T_IfwFooXI_wBar___", new S_T_IfwFooXI_wBar___[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBar__f", new S_T_IfwFooXI_wBar__f[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBar_I_", new S_T_IfwFooXI_wBar_I_[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBar_If", new S_T_IfwFooXI_wBar_If[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBarY__", new S_T_IfwFooXI_wBarY__[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBarY_f", new S_T_IfwFooXI_wBarY_f[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBarYI_", new S_T_IfwFooXI_wBarYI_[D], 4, "mix"); + // */test("S_T_IfwFooXI_wBarYIf", new S_T_IfwFooXI_wBarYIf[D], 4, "mix"); + // */test("S_T_IfwFooXIf ", new S_T_IfwFooXIf [D], 3, "mix"); + // */test("S_T_IfwFooXIfwBar___", new S_T_IfwFooXIfwBar___[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBar__f", new S_T_IfwFooXIfwBar__f[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBar_I_", new S_T_IfwFooXIfwBar_I_[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBar_If", new S_T_IfwFooXIfwBar_If[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBarY__", new S_T_IfwFooXIfwBarY__[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBarY_f", new S_T_IfwFooXIfwBarY_f[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBarYI_", new S_T_IfwFooXIfwBarYI_[D], 4, "mix"); + // */test("S_T_IfwFooXIfwBarYIf", new S_T_IfwFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_TZ__wFoo___ ", new S_TZ__wFoo___ [D], 3, "sub"); + /* */test("S_TZ__wFoo___wBar___", new S_TZ__wFoo___wBar___[D], 4, "sub"); + /* */test("S_TZ__wFoo___wBar__f", new S_TZ__wFoo___wBar__f[D], 4, "bar"); + /* */test("S_TZ__wFoo___wBar_I_", new S_TZ__wFoo___wBar_I_[D], 4, "sub"); + /* */test("S_TZ__wFoo___wBar_If", new S_TZ__wFoo___wBar_If[D], 4, "bar"); + /* */test("S_TZ__wFoo___wBarY__", new S_TZ__wFoo___wBarY__[D], 4, "sub"); + /* */test("S_TZ__wFoo___wBarY_f", new S_TZ__wFoo___wBarY_f[D], 4, "bar"); + /* */test("S_TZ__wFoo___wBarYI_", new S_TZ__wFoo___wBarYI_[D], 4, "sub"); + /* */test("S_TZ__wFoo___wBarYIf", new S_TZ__wFoo___wBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFoo__f ", new S_TZ__wFoo__f [D], 3, "foo"); + /* */test("S_TZ__wFoo__fwBar___", new S_TZ__wFoo__fwBar___[D], 4, "foo"); + // */test("S_TZ__wFoo__fwBar__f", new S_TZ__wFoo__fwBar__f[D], 4, "bar"); + /* */test("S_TZ__wFoo__fwBar_I_", new S_TZ__wFoo__fwBar_I_[D], 4, "foo"); + // */test("S_TZ__wFoo__fwBar_If", new S_TZ__wFoo__fwBar_If[D], 4, "bar"); + /* */test("S_TZ__wFoo__fwBarY__", new S_TZ__wFoo__fwBarY__[D], 4, "foo"); + // */test("S_TZ__wFoo__fwBarY_f", new S_TZ__wFoo__fwBarY_f[D], 4, "bar"); + /* */test("S_TZ__wFoo__fwBarYI_", new S_TZ__wFoo__fwBarYI_[D], 4, "foo"); + // */test("S_TZ__wFoo__fwBarYIf", new S_TZ__wFoo__fwBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFoo_I_ ", new S_TZ__wFoo_I_ [D], 3, "sub"); + /* */test("S_TZ__wFoo_I_wBar___", new S_TZ__wFoo_I_wBar___[D], 4, "sub"); + /* */test("S_TZ__wFoo_I_wBar__f", new S_TZ__wFoo_I_wBar__f[D], 4, "bar"); + // */test("S_TZ__wFoo_I_wBar_I_", new S_TZ__wFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_TZ__wFoo_I_wBar_If", new S_TZ__wFoo_I_wBar_If[D], 4, "bar"); + /* */test("S_TZ__wFoo_I_wBarY__", new S_TZ__wFoo_I_wBarY__[D], 4, "sub"); + /* */test("S_TZ__wFoo_I_wBarY_f", new S_TZ__wFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_TZ__wFoo_I_wBarYI_", new S_TZ__wFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_TZ__wFoo_I_wBarYIf", new S_TZ__wFoo_I_wBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFoo_If ", new S_TZ__wFoo_If [D], 3, "foo"); + /* */test("S_TZ__wFoo_IfwBar___", new S_TZ__wFoo_IfwBar___[D], 4, "foo"); + // */test("S_TZ__wFoo_IfwBar__f", new S_TZ__wFoo_IfwBar__f[D], 4, "bar"); + // */test("S_TZ__wFoo_IfwBar_I_", new S_TZ__wFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_TZ__wFoo_IfwBar_If", new S_TZ__wFoo_IfwBar_If[D], 4, "bar"); + /* */test("S_TZ__wFoo_IfwBarY__", new S_TZ__wFoo_IfwBarY__[D], 4, "foo"); + // */test("S_TZ__wFoo_IfwBarY_f", new S_TZ__wFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_TZ__wFoo_IfwBarYI_", new S_TZ__wFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_TZ__wFoo_IfwBarYIf", new S_TZ__wFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFooX__ ", new S_TZ__wFooX__ [D], 3, "sub"); + /* */test("S_TZ__wFooX__wBar___", new S_TZ__wFooX__wBar___[D], 4, "sub"); + /* */test("S_TZ__wFooX__wBar__f", new S_TZ__wFooX__wBar__f[D], 4, "bar"); + /* */test("S_TZ__wFooX__wBar_I_", new S_TZ__wFooX__wBar_I_[D], 4, "sub"); + /* */test("S_TZ__wFooX__wBar_If", new S_TZ__wFooX__wBar_If[D], 4, "bar"); + /* */test("S_TZ__wFooX__wBarY__", new S_TZ__wFooX__wBarY__[D], 4, "sub"); + /* */test("S_TZ__wFooX__wBarY_f", new S_TZ__wFooX__wBarY_f[D], 4, "bar"); + /* */test("S_TZ__wFooX__wBarYI_", new S_TZ__wFooX__wBarYI_[D], 4, "sub"); + /* */test("S_TZ__wFooX__wBarYIf", new S_TZ__wFooX__wBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFooX_f ", new S_TZ__wFooX_f [D], 3, "foo"); + /* */test("S_TZ__wFooX_fwBar___", new S_TZ__wFooX_fwBar___[D], 4, "foo"); + // */test("S_TZ__wFooX_fwBar__f", new S_TZ__wFooX_fwBar__f[D], 4, "bar"); + /* */test("S_TZ__wFooX_fwBar_I_", new S_TZ__wFooX_fwBar_I_[D], 4, "foo"); + // */test("S_TZ__wFooX_fwBar_If", new S_TZ__wFooX_fwBar_If[D], 4, "bar"); + /* */test("S_TZ__wFooX_fwBarY__", new S_TZ__wFooX_fwBarY__[D], 4, "foo"); + // */test("S_TZ__wFooX_fwBarY_f", new S_TZ__wFooX_fwBarY_f[D], 4, "bar"); + /* */test("S_TZ__wFooX_fwBarYI_", new S_TZ__wFooX_fwBarYI_[D], 4, "foo"); + // */test("S_TZ__wFooX_fwBarYIf", new S_TZ__wFooX_fwBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFooXI_ ", new S_TZ__wFooXI_ [D], 3, "sub"); + /* */test("S_TZ__wFooXI_wBar___", new S_TZ__wFooXI_wBar___[D], 4, "sub"); + /* */test("S_TZ__wFooXI_wBar__f", new S_TZ__wFooXI_wBar__f[D], 4, "bar"); + // */test("S_TZ__wFooXI_wBar_I_", new S_TZ__wFooXI_wBar_I_[D], 4, "sub"); + // */test("S_TZ__wFooXI_wBar_If", new S_TZ__wFooXI_wBar_If[D], 4, "bar"); + /* */test("S_TZ__wFooXI_wBarY__", new S_TZ__wFooXI_wBarY__[D], 4, "sub"); + /* */test("S_TZ__wFooXI_wBarY_f", new S_TZ__wFooXI_wBarY_f[D], 4, "bar"); + // */test("S_TZ__wFooXI_wBarYI_", new S_TZ__wFooXI_wBarYI_[D], 4, "sub"); + // */test("S_TZ__wFooXI_wBarYIf", new S_TZ__wFooXI_wBarYIf[D], 4, "bar"); + /* */test("S_TZ__wFooXIf ", new S_TZ__wFooXIf [D], 3, "foo"); + /* */test("S_TZ__wFooXIfwBar___", new S_TZ__wFooXIfwBar___[D], 4, "foo"); + // */test("S_TZ__wFooXIfwBar__f", new S_TZ__wFooXIfwBar__f[D], 4, "bar"); + // */test("S_TZ__wFooXIfwBar_I_", new S_TZ__wFooXIfwBar_I_[D], 4, "foo"); + // */test("S_TZ__wFooXIfwBar_If", new S_TZ__wFooXIfwBar_If[D], 4, "bar"); + /* */test("S_TZ__wFooXIfwBarY__", new S_TZ__wFooXIfwBarY__[D], 4, "foo"); + // */test("S_TZ__wFooXIfwBarY_f", new S_TZ__wFooXIfwBarY_f[D], 4, "bar"); + // */test("S_TZ__wFooXIfwBarYI_", new S_TZ__wFooXIfwBarYI_[D], 4, "foo"); + // */test("S_TZ__wFooXIfwBarYIf", new S_TZ__wFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_TZ_fwFoo___ ", new S_TZ_fwFoo___ [D], 3, "mix"); + /* */test("S_TZ_fwFoo___wBar___", new S_TZ_fwFoo___wBar___[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBar__f", new S_TZ_fwFoo___wBar__f[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBar_I_", new S_TZ_fwFoo___wBar_I_[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBar_If", new S_TZ_fwFoo___wBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBarY__", new S_TZ_fwFoo___wBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBarY_f", new S_TZ_fwFoo___wBarY_f[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBarYI_", new S_TZ_fwFoo___wBarYI_[D], 4, "mix"); + /* */test("S_TZ_fwFoo___wBarYIf", new S_TZ_fwFoo___wBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFoo__f ", new S_TZ_fwFoo__f [D], 3, "mix"); + /* */test("S_TZ_fwFoo__fwBar___", new S_TZ_fwFoo__fwBar___[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBar__f", new S_TZ_fwFoo__fwBar__f[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBar_I_", new S_TZ_fwFoo__fwBar_I_[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBar_If", new S_TZ_fwFoo__fwBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBarY__", new S_TZ_fwFoo__fwBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBarY_f", new S_TZ_fwFoo__fwBarY_f[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBarYI_", new S_TZ_fwFoo__fwBarYI_[D], 4, "mix"); + /* */test("S_TZ_fwFoo__fwBarYIf", new S_TZ_fwFoo__fwBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFoo_I_ ", new S_TZ_fwFoo_I_ [D], 3, "mix"); + /* */test("S_TZ_fwFoo_I_wBar___", new S_TZ_fwFoo_I_wBar___[D], 4, "mix"); + /* */test("S_TZ_fwFoo_I_wBar__f", new S_TZ_fwFoo_I_wBar__f[D], 4, "mix"); + // */test("S_TZ_fwFoo_I_wBar_I_", new S_TZ_fwFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_TZ_fwFoo_I_wBar_If", new S_TZ_fwFoo_I_wBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFoo_I_wBarY__", new S_TZ_fwFoo_I_wBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFoo_I_wBarY_f", new S_TZ_fwFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_TZ_fwFoo_I_wBarYI_", new S_TZ_fwFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_TZ_fwFoo_I_wBarYIf", new S_TZ_fwFoo_I_wBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFoo_If ", new S_TZ_fwFoo_If [D], 3, "mix"); + /* */test("S_TZ_fwFoo_IfwBar___", new S_TZ_fwFoo_IfwBar___[D], 4, "mix"); + /* */test("S_TZ_fwFoo_IfwBar__f", new S_TZ_fwFoo_IfwBar__f[D], 4, "mix"); + // */test("S_TZ_fwFoo_IfwBar_I_", new S_TZ_fwFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_TZ_fwFoo_IfwBar_If", new S_TZ_fwFoo_IfwBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFoo_IfwBarY__", new S_TZ_fwFoo_IfwBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFoo_IfwBarY_f", new S_TZ_fwFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_TZ_fwFoo_IfwBarYI_", new S_TZ_fwFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_TZ_fwFoo_IfwBarYIf", new S_TZ_fwFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFooX__ ", new S_TZ_fwFooX__ [D], 3, "mix"); + /* */test("S_TZ_fwFooX__wBar___", new S_TZ_fwFooX__wBar___[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBar__f", new S_TZ_fwFooX__wBar__f[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBar_I_", new S_TZ_fwFooX__wBar_I_[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBar_If", new S_TZ_fwFooX__wBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBarY__", new S_TZ_fwFooX__wBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBarY_f", new S_TZ_fwFooX__wBarY_f[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBarYI_", new S_TZ_fwFooX__wBarYI_[D], 4, "mix"); + /* */test("S_TZ_fwFooX__wBarYIf", new S_TZ_fwFooX__wBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFooX_f ", new S_TZ_fwFooX_f [D], 3, "mix"); + /* */test("S_TZ_fwFooX_fwBar___", new S_TZ_fwFooX_fwBar___[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBar__f", new S_TZ_fwFooX_fwBar__f[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBar_I_", new S_TZ_fwFooX_fwBar_I_[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBar_If", new S_TZ_fwFooX_fwBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBarY__", new S_TZ_fwFooX_fwBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBarY_f", new S_TZ_fwFooX_fwBarY_f[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBarYI_", new S_TZ_fwFooX_fwBarYI_[D], 4, "mix"); + /* */test("S_TZ_fwFooX_fwBarYIf", new S_TZ_fwFooX_fwBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFooXI_ ", new S_TZ_fwFooXI_ [D], 3, "mix"); + /* */test("S_TZ_fwFooXI_wBar___", new S_TZ_fwFooXI_wBar___[D], 4, "mix"); + /* */test("S_TZ_fwFooXI_wBar__f", new S_TZ_fwFooXI_wBar__f[D], 4, "mix"); + // */test("S_TZ_fwFooXI_wBar_I_", new S_TZ_fwFooXI_wBar_I_[D], 4, "mix"); + // */test("S_TZ_fwFooXI_wBar_If", new S_TZ_fwFooXI_wBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFooXI_wBarY__", new S_TZ_fwFooXI_wBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFooXI_wBarY_f", new S_TZ_fwFooXI_wBarY_f[D], 4, "mix"); + // */test("S_TZ_fwFooXI_wBarYI_", new S_TZ_fwFooXI_wBarYI_[D], 4, "mix"); + // */test("S_TZ_fwFooXI_wBarYIf", new S_TZ_fwFooXI_wBarYIf[D], 4, "mix"); + /* */test("S_TZ_fwFooXIf ", new S_TZ_fwFooXIf [D], 3, "mix"); + /* */test("S_TZ_fwFooXIfwBar___", new S_TZ_fwFooXIfwBar___[D], 4, "mix"); + /* */test("S_TZ_fwFooXIfwBar__f", new S_TZ_fwFooXIfwBar__f[D], 4, "mix"); + // */test("S_TZ_fwFooXIfwBar_I_", new S_TZ_fwFooXIfwBar_I_[D], 4, "mix"); + // */test("S_TZ_fwFooXIfwBar_If", new S_TZ_fwFooXIfwBar_If[D], 4, "mix"); + /* */test("S_TZ_fwFooXIfwBarY__", new S_TZ_fwFooXIfwBarY__[D], 4, "mix"); + /* */test("S_TZ_fwFooXIfwBarY_f", new S_TZ_fwFooXIfwBarY_f[D], 4, "mix"); + // */test("S_TZ_fwFooXIfwBarYI_", new S_TZ_fwFooXIfwBarYI_[D], 4, "mix"); + // */test("S_TZ_fwFooXIfwBarYIf", new S_TZ_fwFooXIfwBarYIf[D], 4, "mix"); + + /* */test("S_TZI_wFoo___ ", new S_TZI_wFoo___ [D], 3, "sub"); + /* */test("S_TZI_wFoo___wBar___", new S_TZI_wFoo___wBar___[D], 4, "sub"); + /* */test("S_TZI_wFoo___wBar__f", new S_TZI_wFoo___wBar__f[D], 4, "bar"); + // */test("S_TZI_wFoo___wBar_I_", new S_TZI_wFoo___wBar_I_[D], 4, "sub"); + // */test("S_TZI_wFoo___wBar_If", new S_TZI_wFoo___wBar_If[D], 4, "bar"); + /* */test("S_TZI_wFoo___wBarY__", new S_TZI_wFoo___wBarY__[D], 4, "sub"); + /* */test("S_TZI_wFoo___wBarY_f", new S_TZI_wFoo___wBarY_f[D], 4, "bar"); + // */test("S_TZI_wFoo___wBarYI_", new S_TZI_wFoo___wBarYI_[D], 4, "sub"); + // */test("S_TZI_wFoo___wBarYIf", new S_TZI_wFoo___wBarYIf[D], 4, "bar"); + /* */test("S_TZI_wFoo__f ", new S_TZI_wFoo__f [D], 3, "foo"); + /* */test("S_TZI_wFoo__fwBar___", new S_TZI_wFoo__fwBar___[D], 4, "foo"); + // */test("S_TZI_wFoo__fwBar__f", new S_TZI_wFoo__fwBar__f[D], 4, "bar"); + // */test("S_TZI_wFoo__fwBar_I_", new S_TZI_wFoo__fwBar_I_[D], 4, "foo"); + // */test("S_TZI_wFoo__fwBar_If", new S_TZI_wFoo__fwBar_If[D], 4, "bar"); + /* */test("S_TZI_wFoo__fwBarY__", new S_TZI_wFoo__fwBarY__[D], 4, "foo"); + // */test("S_TZI_wFoo__fwBarY_f", new S_TZI_wFoo__fwBarY_f[D], 4, "bar"); + // */test("S_TZI_wFoo__fwBarYI_", new S_TZI_wFoo__fwBarYI_[D], 4, "foo"); + // */test("S_TZI_wFoo__fwBarYIf", new S_TZI_wFoo__fwBarYIf[D], 4, "bar"); + // */test("S_TZI_wFoo_I_ ", new S_TZI_wFoo_I_ [D], 3, "sub"); + // */test("S_TZI_wFoo_I_wBar___", new S_TZI_wFoo_I_wBar___[D], 4, "sub"); + // */test("S_TZI_wFoo_I_wBar__f", new S_TZI_wFoo_I_wBar__f[D], 4, "bar"); + // */test("S_TZI_wFoo_I_wBar_I_", new S_TZI_wFoo_I_wBar_I_[D], 4, "sub"); + // */test("S_TZI_wFoo_I_wBar_If", new S_TZI_wFoo_I_wBar_If[D], 4, "bar"); + // */test("S_TZI_wFoo_I_wBarY__", new S_TZI_wFoo_I_wBarY__[D], 4, "sub"); + // */test("S_TZI_wFoo_I_wBarY_f", new S_TZI_wFoo_I_wBarY_f[D], 4, "bar"); + // */test("S_TZI_wFoo_I_wBarYI_", new S_TZI_wFoo_I_wBarYI_[D], 4, "sub"); + // */test("S_TZI_wFoo_I_wBarYIf", new S_TZI_wFoo_I_wBarYIf[D], 4, "bar"); + // */test("S_TZI_wFoo_If ", new S_TZI_wFoo_If [D], 3, "foo"); + // */test("S_TZI_wFoo_IfwBar___", new S_TZI_wFoo_IfwBar___[D], 4, "foo"); + // */test("S_TZI_wFoo_IfwBar__f", new S_TZI_wFoo_IfwBar__f[D], 4, "bar"); + // */test("S_TZI_wFoo_IfwBar_I_", new S_TZI_wFoo_IfwBar_I_[D], 4, "foo"); + // */test("S_TZI_wFoo_IfwBar_If", new S_TZI_wFoo_IfwBar_If[D], 4, "bar"); + // */test("S_TZI_wFoo_IfwBarY__", new S_TZI_wFoo_IfwBarY__[D], 4, "foo"); + // */test("S_TZI_wFoo_IfwBarY_f", new S_TZI_wFoo_IfwBarY_f[D], 4, "bar"); + // */test("S_TZI_wFoo_IfwBarYI_", new S_TZI_wFoo_IfwBarYI_[D], 4, "foo"); + // */test("S_TZI_wFoo_IfwBarYIf", new S_TZI_wFoo_IfwBarYIf[D], 4, "bar"); + /* */test("S_TZI_wFooX__ ", new S_TZI_wFooX__ [D], 3, "sub"); + /* */test("S_TZI_wFooX__wBar___", new S_TZI_wFooX__wBar___[D], 4, "sub"); + /* */test("S_TZI_wFooX__wBar__f", new S_TZI_wFooX__wBar__f[D], 4, "bar"); + // */test("S_TZI_wFooX__wBar_I_", new S_TZI_wFooX__wBar_I_[D], 4, "sub"); + // */test("S_TZI_wFooX__wBar_If", new S_TZI_wFooX__wBar_If[D], 4, "bar"); + /* */test("S_TZI_wFooX__wBarY__", new S_TZI_wFooX__wBarY__[D], 4, "sub"); + /* */test("S_TZI_wFooX__wBarY_f", new S_TZI_wFooX__wBarY_f[D], 4, "bar"); + // */test("S_TZI_wFooX__wBarYI_", new S_TZI_wFooX__wBarYI_[D], 4, "sub"); + // */test("S_TZI_wFooX__wBarYIf", new S_TZI_wFooX__wBarYIf[D], 4, "bar"); + /* */test("S_TZI_wFooX_f ", new S_TZI_wFooX_f [D], 3, "foo"); + /* */test("S_TZI_wFooX_fwBar___", new S_TZI_wFooX_fwBar___[D], 4, "foo"); + // */test("S_TZI_wFooX_fwBar__f", new S_TZI_wFooX_fwBar__f[D], 4, "bar"); + // */test("S_TZI_wFooX_fwBar_I_", new S_TZI_wFooX_fwBar_I_[D], 4, "foo"); + // */test("S_TZI_wFooX_fwBar_If", new S_TZI_wFooX_fwBar_If[D], 4, "bar"); + /* */test("S_TZI_wFooX_fwBarY__", new S_TZI_wFooX_fwBarY__[D], 4, "foo"); + // */test("S_TZI_wFooX_fwBarY_f", new S_TZI_wFooX_fwBarY_f[D], 4, "bar"); + // */test("S_TZI_wFooX_fwBarYI_", new S_TZI_wFooX_fwBarYI_[D], 4, "foo"); + // */test("S_TZI_wFooX_fwBarYIf", new S_TZI_wFooX_fwBarYIf[D], 4, "bar"); + // */test("S_TZI_wFooXI_ ", new S_TZI_wFooXI_ [D], 3, "sub"); + // */test("S_TZI_wFooXI_wBar___", new S_TZI_wFooXI_wBar___[D], 4, "sub"); + // */test("S_TZI_wFooXI_wBar__f", new S_TZI_wFooXI_wBar__f[D], 4, "bar"); + // */test("S_TZI_wFooXI_wBar_I_", new S_TZI_wFooXI_wBar_I_[D], 4, "sub"); + // */test("S_TZI_wFooXI_wBar_If", new S_TZI_wFooXI_wBar_If[D], 4, "bar"); + // */test("S_TZI_wFooXI_wBarY__", new S_TZI_wFooXI_wBarY__[D], 4, "sub"); + // */test("S_TZI_wFooXI_wBarY_f", new S_TZI_wFooXI_wBarY_f[D], 4, "bar"); + // */test("S_TZI_wFooXI_wBarYI_", new S_TZI_wFooXI_wBarYI_[D], 4, "sub"); + // */test("S_TZI_wFooXI_wBarYIf", new S_TZI_wFooXI_wBarYIf[D], 4, "bar"); + // */test("S_TZI_wFooXIf ", new S_TZI_wFooXIf [D], 3, "foo"); + // */test("S_TZI_wFooXIfwBar___", new S_TZI_wFooXIfwBar___[D], 4, "foo"); + // */test("S_TZI_wFooXIfwBar__f", new S_TZI_wFooXIfwBar__f[D], 4, "bar"); + // */test("S_TZI_wFooXIfwBar_I_", new S_TZI_wFooXIfwBar_I_[D], 4, "foo"); + // */test("S_TZI_wFooXIfwBar_If", new S_TZI_wFooXIfwBar_If[D], 4, "bar"); + // */test("S_TZI_wFooXIfwBarY__", new S_TZI_wFooXIfwBarY__[D], 4, "foo"); + // */test("S_TZI_wFooXIfwBarY_f", new S_TZI_wFooXIfwBarY_f[D], 4, "bar"); + // */test("S_TZI_wFooXIfwBarYI_", new S_TZI_wFooXIfwBarYI_[D], 4, "foo"); + // */test("S_TZI_wFooXIfwBarYIf", new S_TZI_wFooXIfwBarYIf[D], 4, "bar"); + + /* */test("S_TZIfwFoo___ ", new S_TZIfwFoo___ [D], 3, "mix"); + /* */test("S_TZIfwFoo___wBar___", new S_TZIfwFoo___wBar___[D], 4, "mix"); + /* */test("S_TZIfwFoo___wBar__f", new S_TZIfwFoo___wBar__f[D], 4, "mix"); + // */test("S_TZIfwFoo___wBar_I_", new S_TZIfwFoo___wBar_I_[D], 4, "mix"); + // */test("S_TZIfwFoo___wBar_If", new S_TZIfwFoo___wBar_If[D], 4, "mix"); + /* */test("S_TZIfwFoo___wBarY__", new S_TZIfwFoo___wBarY__[D], 4, "mix"); + /* */test("S_TZIfwFoo___wBarY_f", new S_TZIfwFoo___wBarY_f[D], 4, "mix"); + // */test("S_TZIfwFoo___wBarYI_", new S_TZIfwFoo___wBarYI_[D], 4, "mix"); + // */test("S_TZIfwFoo___wBarYIf", new S_TZIfwFoo___wBarYIf[D], 4, "mix"); + /* */test("S_TZIfwFoo__f ", new S_TZIfwFoo__f [D], 3, "mix"); + /* */test("S_TZIfwFoo__fwBar___", new S_TZIfwFoo__fwBar___[D], 4, "mix"); + /* */test("S_TZIfwFoo__fwBar__f", new S_TZIfwFoo__fwBar__f[D], 4, "mix"); + // */test("S_TZIfwFoo__fwBar_I_", new S_TZIfwFoo__fwBar_I_[D], 4, "mix"); + // */test("S_TZIfwFoo__fwBar_If", new S_TZIfwFoo__fwBar_If[D], 4, "mix"); + /* */test("S_TZIfwFoo__fwBarY__", new S_TZIfwFoo__fwBarY__[D], 4, "mix"); + /* */test("S_TZIfwFoo__fwBarY_f", new S_TZIfwFoo__fwBarY_f[D], 4, "mix"); + // */test("S_TZIfwFoo__fwBarYI_", new S_TZIfwFoo__fwBarYI_[D], 4, "mix"); + // */test("S_TZIfwFoo__fwBarYIf", new S_TZIfwFoo__fwBarYIf[D], 4, "mix"); + // */test("S_TZIfwFoo_I_ ", new S_TZIfwFoo_I_ [D], 3, "mix"); + // */test("S_TZIfwFoo_I_wBar___", new S_TZIfwFoo_I_wBar___[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBar__f", new S_TZIfwFoo_I_wBar__f[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBar_I_", new S_TZIfwFoo_I_wBar_I_[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBar_If", new S_TZIfwFoo_I_wBar_If[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBarY__", new S_TZIfwFoo_I_wBarY__[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBarY_f", new S_TZIfwFoo_I_wBarY_f[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBarYI_", new S_TZIfwFoo_I_wBarYI_[D], 4, "mix"); + // */test("S_TZIfwFoo_I_wBarYIf", new S_TZIfwFoo_I_wBarYIf[D], 4, "mix"); + // */test("S_TZIfwFoo_If ", new S_TZIfwFoo_If [D], 3, "mix"); + // */test("S_TZIfwFoo_IfwBar___", new S_TZIfwFoo_IfwBar___[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBar__f", new S_TZIfwFoo_IfwBar__f[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBar_I_", new S_TZIfwFoo_IfwBar_I_[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBar_If", new S_TZIfwFoo_IfwBar_If[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBarY__", new S_TZIfwFoo_IfwBarY__[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBarY_f", new S_TZIfwFoo_IfwBarY_f[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBarYI_", new S_TZIfwFoo_IfwBarYI_[D], 4, "mix"); + // */test("S_TZIfwFoo_IfwBarYIf", new S_TZIfwFoo_IfwBarYIf[D], 4, "mix"); + /* */test("S_TZIfwFooX__ ", new S_TZIfwFooX__ [D], 3, "mix"); + /* */test("S_TZIfwFooX__wBar___", new S_TZIfwFooX__wBar___[D], 4, "mix"); + /* */test("S_TZIfwFooX__wBar__f", new S_TZIfwFooX__wBar__f[D], 4, "mix"); + // */test("S_TZIfwFooX__wBar_I_", new S_TZIfwFooX__wBar_I_[D], 4, "mix"); + // */test("S_TZIfwFooX__wBar_If", new S_TZIfwFooX__wBar_If[D], 4, "mix"); + /* */test("S_TZIfwFooX__wBarY__", new S_TZIfwFooX__wBarY__[D], 4, "mix"); + /* */test("S_TZIfwFooX__wBarY_f", new S_TZIfwFooX__wBarY_f[D], 4, "mix"); + // */test("S_TZIfwFooX__wBarYI_", new S_TZIfwFooX__wBarYI_[D], 4, "mix"); + // */test("S_TZIfwFooX__wBarYIf", new S_TZIfwFooX__wBarYIf[D], 4, "mix"); + /* */test("S_TZIfwFooX_f ", new S_TZIfwFooX_f [D], 3, "mix"); + /* */test("S_TZIfwFooX_fwBar___", new S_TZIfwFooX_fwBar___[D], 4, "mix"); + /* */test("S_TZIfwFooX_fwBar__f", new S_TZIfwFooX_fwBar__f[D], 4, "mix"); + // */test("S_TZIfwFooX_fwBar_I_", new S_TZIfwFooX_fwBar_I_[D], 4, "mix"); + // */test("S_TZIfwFooX_fwBar_If", new S_TZIfwFooX_fwBar_If[D], 4, "mix"); + /* */test("S_TZIfwFooX_fwBarY__", new S_TZIfwFooX_fwBarY__[D], 4, "mix"); + /* */test("S_TZIfwFooX_fwBarY_f", new S_TZIfwFooX_fwBarY_f[D], 4, "mix"); + // */test("S_TZIfwFooX_fwBarYI_", new S_TZIfwFooX_fwBarYI_[D], 4, "mix"); + // */test("S_TZIfwFooX_fwBarYIf", new S_TZIfwFooX_fwBarYIf[D], 4, "mix"); + // */test("S_TZIfwFooXI_ ", new S_TZIfwFooXI_ [D], 3, "mix"); + // */test("S_TZIfwFooXI_wBar___", new S_TZIfwFooXI_wBar___[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBar__f", new S_TZIfwFooXI_wBar__f[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBar_I_", new S_TZIfwFooXI_wBar_I_[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBar_If", new S_TZIfwFooXI_wBar_If[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBarY__", new S_TZIfwFooXI_wBarY__[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBarY_f", new S_TZIfwFooXI_wBarY_f[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBarYI_", new S_TZIfwFooXI_wBarYI_[D], 4, "mix"); + // */test("S_TZIfwFooXI_wBarYIf", new S_TZIfwFooXI_wBarYIf[D], 4, "mix"); + // */test("S_TZIfwFooXIf ", new S_TZIfwFooXIf [D], 3, "mix"); + // */test("S_TZIfwFooXIfwBar___", new S_TZIfwFooXIfwBar___[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBar__f", new S_TZIfwFooXIfwBar__f[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBar_I_", new S_TZIfwFooXIfwBar_I_[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBar_If", new S_TZIfwFooXIfwBar_If[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBarY__", new S_TZIfwFooXIfwBarY__[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBarY_f", new S_TZIfwFooXIfwBarY_f[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBarYI_", new S_TZIfwFooXIfwBarYI_[D], 4, "mix"); + // */test("S_TZIfwFooXIfwBarYIf", new S_TZIfwFooXIfwBarYIf[D], 4, "mix"); + + if (errors > 0) { + Console.println; + Console.println(errors + " error" + (if (errors > 1) "s" else "")); + } + } +} diff --git a/tests/pending/run/buffer-slice.check b/tests/pending/run/buffer-slice.check new file mode 100644 index 000000000000..5287aa9d7bf3 --- /dev/null +++ b/tests/pending/run/buffer-slice.check @@ -0,0 +1 @@ +ArrayBuffer() diff --git a/tests/pending/run/buffer-slice.scala b/tests/pending/run/buffer-slice.scala new file mode 100644 index 000000000000..ddd82e07512d --- /dev/null +++ b/tests/pending/run/buffer-slice.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + println(scala.collection.mutable.ArrayBuffer().slice(102450392, -2045033354)) + } +} diff --git a/tests/pending/run/bugs.check b/tests/pending/run/bugs.check new file mode 100644 index 000000000000..261c74ad15e8 --- /dev/null +++ b/tests/pending/run/bugs.check @@ -0,0 +1,96 @@ +<<< bug 98 +mycase +>>> bug 98 + +<<< bug 120 +one +A +B +C +>>> bug 120 + +<<< bug 135 +Some(The answer) +>>> bug 135 + +<<< bug 142 +ok +ok +ok +ok +ok +ok +ok +ok +>>> bug 142 + +<<< bug 166 +>>> bug 166 + +<<< bug 167 +>>> bug 167 + +<<< bug 168 +>>> bug 168 + +<<< bug 174 +>>> bug 174 + +<<< bug 176 +1 +>>> bug 176 + +<<< bug 199 +>>> bug 199 + +<<< bug 213 +Cannot cast unit to Nothing +Cannot cast empty string to Null +>>> bug 213 + +<<< bug 217 +>>> bug 217 + +<<< bug 222 +>>> bug 222 + +<<< bug 225 +>>> bug 225 + +<<< bug 226 +>>> bug 226 + +<<< bug 233 +true +>>> bug 233 + +<<< bug 250 +>>> bug 250 + +<<< bug 257 +I should come 1st and 2nd +I should come 1st and 2nd +I should come last +>>> bug 257 + +<<< bug 266 +hello +4 +>>> bug 266 + +<<< bug 316 +>>> bug 316 + +<<< bug 328 +>>> bug 328 + +<<< bug 396 +A +B +C +>>> bug 396 + +<<< bug 399 +a +>>> bug 399 + diff --git a/tests/pending/run/bugs.scala b/tests/pending/run/bugs.scala new file mode 100644 index 000000000000..381cf807b2a6 --- /dev/null +++ b/tests/pending/run/bugs.scala @@ -0,0 +1,489 @@ +//############################################################################ +// Bugs +//############################################################################ + +//############################################################################ +// Bug 98 + +object Bug98Test { + object MyCase { def name = "mycase" } + def test(args: Array[String]): Unit = { + println(MyCase.name) + } +} + +//############################################################################ +// Bug 120 + +class Bug120A(x: Int) { + println("A") +} + +trait Bug120B { + println("B") +} +class Bug120C(x: Int) + extends Bug120A(Bug120Test.print("one", 1)) + with Bug120B { + println("C") +} +object Bug120Test { + def print[A](str: String, res: A): A = { + println(str); res + } + def test(args: Array[String]): Unit = { + val c = new Bug120C(1) + () + } +} + +//############################################################################ +// Bug 135 + +object Bug135Test { + + import scala.collection.immutable.TreeMap + + def test(args: Array[String]): Unit = { + val myMap:TreeMap[Int, String] = new TreeMap + val map1 = myMap + ((42, "The answer")) + println(map1.get(42)) + } + +} + +//############################################################################ +// Bug 142 + +abstract class Bug142Foo1 { class Inner; def foo: Inner; foo; } +abstract class Bug142Foo2 { class Inner; def foo: Inner = {Console.println("ok"); null};} +abstract class Bug142Foo3 { type Inner; def foo: Inner; foo; } +abstract class Bug142Foo4 { type Inner; def foo: Inner = {Console.println("ok"); null.asInstanceOf[Inner]}; } + +trait Bug142Bar1 { type Inner; def foo: Inner = {Console.println("ok"); null.asInstanceOf[Inner]}; } +trait Bug142Bar2 { type Inner; def foo: Inner; foo; } +trait Bug142Bar3 { class Inner; def foo: Inner = {Console.println("ok"); null}; } +trait Bug142Bar4 { class Inner; def foo: Inner; foo; } + +object Bug142Test1 extends Bug142Foo1 with Bug142Bar1 { def test(args: Array[String]): Unit = {} } +object Bug142Test2 extends Bug142Foo2 with Bug142Bar2 { def test(args: Array[String]): Unit = {} } +object Bug142Test3 extends Bug142Foo3 with Bug142Bar3 { def test(args: Array[String]): Unit = {} } +object Bug142Test4 extends Bug142Foo4 with Bug142Bar4 { def test(args: Array[String]): Unit = {} } +object Bug142Test5 extends Bug142Foo1 with Bug142Bar1 { def test(args: Array[String]): Unit = {} } +object Bug142Test6 extends Bug142Foo2 with Bug142Bar2 { def test(args: Array[String]): Unit = {} } +object Bug142Test7 extends Bug142Foo3 with Bug142Bar3 { def test(args: Array[String]): Unit = {} } +object Bug142Test8 extends Bug142Foo4 with Bug142Bar4 { def test(args: Array[String]): Unit = {} } + +object Bug142Test { + def test(args:Array[String]): Unit = { + Bug142Test1; + Bug142Test2; + Bug142Test3; + Bug142Test4; + Bug142Test5; + Bug142Test6; + Bug142Test7; + Bug142Test8; + () + } +} + +//############################################################################ +// Bug 166 + +object Bug166Test { + import scala.collection.mutable.HashMap + def test(args: Array[String]): Unit = { + val m: HashMap[String,String] = new HashMap[String, String] + m.update("foo","bar") + } +} + +//############################################################################ +// Bug 167 + +class Bug167Node(bar:Int) { + val foo = { + val bar = 1; + bar + } +} + +object Bug167Test { + def test(args: Array[String]): Unit = { + if (new Bug167Node(0).foo != 1) println("bug 167"); + } +} + +//############################################################################ +// Bug 168 + +class Bug168Foo { + class Bar + def foo = new Bar +} + +object Bug168Test { + def test(args: Array[String]): Unit = { + (new Bug168Foo).foo + () + } +} + +//############################################################################ +// Bug 174 + +class Bug174Foo[X] { + + class Tree + class Node extends Tree + + + val inner: Inner = new SubInner + + trait Inner { + def test: Bug174Foo[X]#Tree + } + + class SubInner extends Inner { + def test = new Node + } + +} + +object Bug174Test { + def test(args: Array[String]): Unit = { + (new Bug174Foo[Int]).inner.test + () + } +} + + +//############################################################################ +// Bug 176 + +trait Bug176A { + type T; + def foo(x: T): Int; + def bar: T; + def test = foo(bar); +} +trait Bug176B { + type S <: AnyRef; + type T = S; + def foo(x: S): Int; + def bar: S; +} +class Bug176C extends Bug176A with Bug176B { + class S; + def foo(x: S) = 1; + def bar = new S; +} +object Bug176Test { + def test(args: Array[String]): Unit = { + val x: Bug176A = new Bug176C; + Console.println(x.test); + } +} + +//############################################################################ +// Bug 199 + +class Bug199C { object o; } +object Bug199Test { + def test(args: Array[String]) = { + (new Bug199C).o; () + } +} + +//############################################################################ +// Bug 213 + +trait Bug213Foo { + def testAll: Unit; + def testAllRef: String; +} + +class Bug213Bar extends Bug213Foo { + def testAll = (().asInstanceOf[Nothing] : Nothing); + def testAllRef = ("".asInstanceOf[Null] : Null); +} + +object Bug213Test { + def test(args: Array[String]): Unit = { + val foo: Bug213Foo = new Bug213Bar; + try { + foo.testAll; + } catch { + case e: ClassCastException => + Console.println("Cannot cast unit to Nothing"); + } + try { + foo.testAllRef; + } catch { + case e: ClassCastException => + Console.println("Cannot cast empty string to Null"); + } + () + } +} + +//############################################################################ +// Bug 217 + +object Bug217Test { + def foo[t](fun: Function0[t]): t = fun(); + def bar(x: Int): Unit = { + foo(() => 0); + () + } + def test(args: Array[String]): Unit = bar(32); +} + +//############################################################################ +// Bug 222 + +object Bug222Test { + def test(args:Array[String]): Unit = { + val array: Array[String] = new Array(16); + () + } +} + +//############################################################################ +// Bug 225 + +case class Bug225C(); + +object Bug225Test { + + def test(args: Array[String]): Unit = { + val a = new Array[Array[Bug225C]](2); + a(0) = new Array[Bug225C](2); + a(0)(0) = new Bug225C(); + } +} + +//############################################################################ +// Bug 226 + +object Bug226Test { + + def id[a](xs: Array[a]): Array[a] = xs; + + def test(args: Array[String]): Unit = { + var xs = new Array[Int](1); + class X { xs }; + xs = id(xs); + id(xs); + () + } + +} + +//############################################################################ +// Bug 233 + +object Bug233Test { + val b: Array[String] = null; + def test(args: Array[String]): Unit = + Console.println(b == null); +} + +//############################################################################ +// Bug 250 + +object Bug250Test { + def test(args: Array[String]): Unit = { + if (true) null; + () + } +} + +//############################################################################ +// Bug 257 + +object Bug257Test { + def sayhello(): Unit = { Console.println("I should come 1st and 2nd"); }; + def sayhi(): Unit = { Console.println("I should come last"); }; + + def f1(x: Unit): Unit = (); + def f2(x: Unit)(y: Unit): Unit = (); + + def f(x: => Unit): Unit => Unit = { + f1(x); + f2(x); + } + + def test(args: Array[String]): Unit = { + f(sayhello())(sayhi()) + } +} + +//############################################################################ +// Bug 266 + +// version - A + +abstract class Bug266AFoo { + type T >: Null <: AnyRef; + abstract class I0 { def f(x: T): Unit; f(null); } +} + +object Bug266ATest extends Bug266AFoo { + type T = String; + class I1 extends I0 { def f(x: String): Unit = { Console.println("hello") } } + def test(args: Array[String]): Unit = { new I1; () } +} + +// version - B + +abstract class Bug266BA { + type t + abstract class P { + def f(x: t): Unit + } +} + +abstract class Bug266BA1 extends Bug266BA { + def mkP: Bug266BA1.this.P; + val in: t; +} + +trait Bug266BB extends Bug266BA { + type t = Int; + class P1 extends Bug266BB.this.P { + def f(x: Int): Unit = { Console.println(x + 1) } + } + def mkP = new P1; + val in = 3; +} + +object Bug266BTest { + val a: Bug266BA1 = new Bug266BA1 with Bug266BB; + def test(args: Array[String]): Unit = a.mkP.f(a.in); +} + +// main + +object Bug266Test { + def test(args: Array[String]): Unit = { + Bug266ATest.test(args); + Bug266BTest.test(args); + } +} + +//############################################################################ +// Bug 316 + +class Bug316MyIterator extends Iterator[Int] { + def hasNext = false + def next = 42 +} + +object Bug316Test { + def test(args: Array[String]): Unit = + (new Bug316MyIterator) filter { x: Int => x == 1 }; +} + +//############################################################################ +// Bug 328 + +object Bug328Test { + def test0(f: Function1[Int,String]): Unit = {} + def test(args: Array[String]): Unit = test0(args); +} + +//############################################################################ +// Bug 396 + +trait Bug396A { + class I { + def run = Console.println("A"); + } +} +trait Bug396B extends Bug396A { + class I extends super.I { + override def run = { super.run; Console.println("B"); } + } +} +trait Bug396C extends Bug396A { + trait I extends super.I { + override def run = { super.run; Console.println("C"); } + } +} +object Bug396Test extends Bug396B with Bug396C { + class I2 extends super[Bug396B].I with super[Bug396C].I; + def test(args: Array[String]): Unit = (new I2).run +} + +//############################################################################ +// Bug 399 + +object Bug399Test { + def f(x: String): String = { + trait C { def f: String = x; } + class D extends C; + trait F extends C; + class G extends D with F; + (new G).f + } + + def test(args: Array[String]): Unit = { + Console.println(f("a")); + } +} + +//############################################################################ +// Main + +object Test { + var errors: Int = 0 + def test(bug: Int, test: => Unit): Unit = { + Console.println("<<< bug " + bug) + try { + test; + } catch { + case exception: Throwable => + Console.print("Exception in thread \"" + Thread.currentThread + "\" " + exception); + Console.println; + errors += 1 + } + Console.println(">>> bug " + bug) + Console.println + } + + def main(args: Array[String]): Unit = { + + test( 98, Bug98Test.test(args)); + test(120, Bug120Test.test(args)); + test(135, Bug135Test.test(args)); + test(142, Bug142Test.test(args)); + test(166, Bug166Test.test(args)); + test(167, Bug167Test.test(args)); + test(168, Bug168Test.test(args)); + test(174, Bug174Test.test(args)); + test(176, Bug176Test.test(args)); + test(199, Bug199Test.test(args)); + test(213, Bug213Test.test(args)); + test(217, Bug217Test.test(args)); + test(222, Bug222Test.test(args)); + test(225, Bug225Test.test(args)); + test(226, Bug226Test.test(args)); + test(233, Bug233Test.test(args)); + test(250, Bug250Test.test(args)); + test(257, Bug257Test.test(args)); + test(266, Bug266Test.test(args)); + test(316, Bug316Test.test(args)); + test(328, Bug328Test.test(args)); + test(396, Bug396Test.test(args)); + test(399, Bug399Test.test(args)); + + if (errors > 0) { + Console.println; + Console.println(errors + " error" + (if (errors > 1) "s" else "")); + } + } +} + +//############################################################################ diff --git a/tests/pending/run/byname.check b/tests/pending/run/byname.check new file mode 100644 index 000000000000..7e49eedec111 --- /dev/null +++ b/tests/pending/run/byname.check @@ -0,0 +1,24 @@ +test no braces completed properly +test no braces r completed properly +test plain completed properly +test plain r completed properly +test old by name completed properly +test old by name r completed properly +test old by name s completed properly +test reg then by name completed properly +test reg then by name s completed properly +test varargs completed properly +test varargs r completed properly +test all completed properly +test all r completed properly +test all s completed properly +test c00 completed properly +test c00 r completed properly +test c00 rr completed properly +test cbb completed properly +test cbb r completed properly +test cbb rr completed properly +test cvv completed properly +test cvv r completed properly +test cvv rs completed properly +$ diff --git a/tests/pending/run/byname.scala b/tests/pending/run/byname.scala new file mode 100644 index 000000000000..f825744c0b94 --- /dev/null +++ b/tests/pending/run/byname.scala @@ -0,0 +1,84 @@ +object Test extends dotty.runtime.LegacyApp { + +def test[A](name: String, expect: A, actual: => A): Unit = { + if (expect != actual) throw new AssertionError("test " + name + " failed") + else println("test " + name + " completed properly") +} + +def testNoBraces = 1 +test("no braces", 1, testNoBraces) + +val testNoBracesR = testNoBraces _ +test("no braces r", 1, testNoBracesR()) + +def testPlain(x: String, y: String): String = x + y +test("plain", "ab", testPlain("a", "b")) + +val testPlainR = testPlain _ +test("plain r", "cd", testPlainR("c", "d")) + +def testOldByName(x: => Int) = x + 1 +test("old by name", 3, testOldByName(1 + 1)) + +val testOldByNameR = testOldByName _ +test("old by name r", 3, testOldByNameR(1 + 1)) + +val testOldByNameS: (=> Int) => Int = testOldByName _ +test("old by name s", 3, testOldByNameS(2)) + +def testRegThenByName(x: Int, y: => Int): Int = x + y +test("reg then by name", 7, testRegThenByName(3, 2 * 2)) + +val testRegThenByNameS: (Int, =>Int) => Int = testRegThenByName _ +test("reg then by name s", 8, testRegThenByNameS(2, 12 / 2)) + +def testVarargs(x: Int*) = x.reduceLeft((x: Int, y: Int) => x + y) +test("varargs", 4, testVarargs(1, 2, 1)) + +val testVarargsR = testVarargs _ +test("varargs r", 4, testVarargsR(Seq(1, 2, 1))) + +def testAll(x: Int, y: => Int, z: Int*) = x + y + z.size +test("all", 5, testAll(1, 2, 22, 23)) + +val testAllR = testAll _ +test("all r", 7, testAllR(2, 3, Seq(34, 35))) + +val testAllS: (Int, =>Int, Int*) => Int = testAll _ +test("all s", 8, testAllS(1, 5, 78, 89)) + +// test currying + +def testC00()(): Int = 1 +test("c00", 1, testC00()()) + +val testC00R = testC00 _ +test("c00 r", 1, testC00R()()) + +val testC00RR = testC00() _ +test("c00 rr", 1, testC00RR()) + + +def testCBB(a: => Int)(b: => Int) = a + b +test("cbb", 3, testCBB(1)(2)) + +val testCBBR = testCBB _ +test("cbb r", 5, testCBBR(1)(4)) + +val testCBBRR = testCBB(4) _ +test("cbb rr", 6, testCBBRR(2)) + + +def testCVV(a: Int*)(z: String, b: Int*) = a.size + b.size +test("cvv", 3, testCVV(1, 2)("", 8)) + +val testCVVR = testCVV _ +test("cvv r", 3, testCVVR(Seq(1))("", Seq(8, 9))) + +val testCVVRS: (String, Int*) => Int = testCVV(2, 3) +test("cvv rs", 4, testCVVRS("", 5, 6)) + +println("$") + +// vim: set ts=4 sw=4 et: +} diff --git a/tests/pending/run/bytecodecs.scala b/tests/pending/run/bytecodecs.scala new file mode 100644 index 000000000000..454958dfab58 --- /dev/null +++ b/tests/pending/run/bytecodecs.scala @@ -0,0 +1,39 @@ +import scala.reflect.internal.pickling.ByteCodecs._ + +object Test { + + def test8to7(xs: Array[Byte]): Unit = { + val ys = encode8to7(xs) + decode7to8(ys, ys.length) + assert(ys.take(xs.length).deep == xs.deep, + "test8to7("+xs.deep+") failed, result = "+ys.take(xs.length).deep) + } + + def testAll(xs: Array[Byte]): Unit = { + val ys = encode(xs) + decode(ys) + assert(ys.take(xs.length).deep == xs.deep, + "testAll("+xs.deep+") failed, result = "+ys.take(xs.length).deep) + } + + def test(inputs: Array[Byte]*): Unit = { + for (input <- inputs) { + test8to7(input) + testAll(input) + } + } + + def main(args: Array[String]): Unit = { + test( + Array(1, 2, 3), + Array(1, 2, 3, 4, 5, 6, 7), + Array(1, -2, 0, -3, -5, -6, -7), + Array(1, 3, -1, -128, 0, 0, -128, 1, 2, 3)) + val rand = new scala.util.Random() + for (i <- 1 until 5000) { + var xs = new Array[Byte](i) + rand.nextBytes(xs) + test(xs) + } + } +} diff --git a/tests/pending/run/case-class-23.check b/tests/pending/run/case-class-23.check new file mode 100644 index 000000000000..888ed2c9ebc2 --- /dev/null +++ b/tests/pending/run/case-class-23.check @@ -0,0 +1,2 @@ +23 +(1,23) diff --git a/tests/pending/run/case-class-23.scala b/tests/pending/run/case-class-23.scala new file mode 100644 index 000000000000..a6d78763c963 --- /dev/null +++ b/tests/pending/run/case-class-23.scala @@ -0,0 +1,33 @@ +case class TwentyThree( + _1: Int, + _2: Int, + _3: Int, + _4: Int, + _5: Int, + _6: Int, + _7: Int, + _8: Int, + _9: Int, + _10: Int, + _11: Int, + _12: Int, + _13: Int, + _14: Int, + _15: Int, + _16: Int, + _17: Int, + _18: Int, + _19: Int, + _20: Int, + _21: Int, + _22: Int, + _23: Int +) + +object Test extends dotty.runtime.LegacyApp { + val x = new TwentyThree(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) + println(x._23) + assert(x.copy(_1 = 1) == x) + val TwentyThree(a, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, b) = x + println((a, b)) +} diff --git a/tests/pending/run/caseClassEquality.scala b/tests/pending/run/caseClassEquality.scala new file mode 100644 index 000000000000..c11d7ad0d19c --- /dev/null +++ b/tests/pending/run/caseClassEquality.scala @@ -0,0 +1,36 @@ +object Test { + abstract class A1 + case class C1(x: Int) extends A1 + class C2(x: Int) extends C1(x) { + override def productPrefix = "Shazbot!" + } + class C3(x: Int) extends C1(x) { + override def canEqual(other: Any) = other.isInstanceOf[C3] + override def equals(other: Any) = other match { + case ob: C3 => x == ob.x + case _ => false + } + } + + case class CS1(xs: Any*) + class CS2(xs: Seq[_]*) extends CS1(xs: _*) + class CS3(xs: IndexedSeq[Int]*) extends CS2(xs: _*) + + case class H1(x: Int, y: Double) + class H2(x: Double, y: Int) extends H1(y, x) + + def main(args: Array[String]): Unit = { + assert(C1(5) == new C2(5)) + assert(new C2(5) == C1(5)) + assert(C1(5).hashCode == new C2(5).hashCode) + assert(new C2(5).hashCode == C1(5).hashCode) + + assert(C1(5) != new C3(5)) + assert(new C3(5) != C1(5)) + + assert(CS1(List(1d,2d), Seq[Float](3f, 4f)) == new CS3(IndexedSeq(1,2), IndexedSeq(3, 4))) + + assert(H1(5, 10d) == new H2(10d, 5)) + assert(H1(5, 10d).hashCode == new H2(10d, 5).hashCode) + } +} diff --git a/tests/pending/run/caseClassHash.check b/tests/pending/run/caseClassHash.check new file mode 100644 index 000000000000..b5a6f08e9980 --- /dev/null +++ b/tests/pending/run/caseClassHash.check @@ -0,0 +1,9 @@ +Foo(true,-1,-1,d,-5,-10,500.0,500.0,List(),5.0) +Foo(true,-1,-1,d,-5,-10,500.0,500.0,List(),5) +1383698062 +1383698062 +true +## method 1: 1383698062 +## method 2: 1383698062 + Murmur 1: 1383698062 + Murmur 2: 1383698062 diff --git a/tests/pending/run/caseClassHash.scala b/tests/pending/run/caseClassHash.scala new file mode 100644 index 000000000000..c5cb09c355d6 --- /dev/null +++ b/tests/pending/run/caseClassHash.scala @@ -0,0 +1,37 @@ +case class Foo[T](a: Boolean, b: Byte, c: Short, d: Char, e: Int, f: Long, g: Double, h: Float, i: AnyRef, j: T) { } + +object Test { + def mkFoo[T](x: T) = Foo[T](true, -1, -1, 100, -5, -10, 500d, 500f, Nil, x) + + def main(args: Array[String]): Unit = { + val foo1 = mkFoo[Double](5.0d) + val foo2 = mkFoo[Long](5l) + + List(foo1, foo2, foo1.##, foo2.##, foo1 == foo2) foreach println + + println("## method 1: " + foo1.##) + println("## method 2: " + foo2.##) + println(" Murmur 1: " + scala.util.hashing.MurmurHash3.productHash(foo1)) + println(" Murmur 2: " + scala.util.hashing.MurmurHash3.productHash(foo2)) + } +} + +object Timing { + var hash = 0 + def mkFoo(i: Int) = Foo(i % 2 == 0, i.toByte, i.toShort, i.toChar, i, i, 1.1, 1.1f, this, this) + + def main(args: Array[String]): Unit = { + val reps = if (args.isEmpty) 100000000 else args(0).toInt + val start = System.nanoTime + + println("Warmup.") + 1 to 10000 foreach mkFoo + + hash = 0 + 1 to reps foreach (i => hash += mkFoo(i).##) + + val end = System.nanoTime + println("hash = " + hash) + println("Elapsed: " + ((end - start) / 1e6) + " ms.") + } +} diff --git a/tests/pending/run/caseclasses.check b/tests/pending/run/caseclasses.check new file mode 100644 index 000000000000..7eb54ea631bb --- /dev/null +++ b/tests/pending/run/caseclasses.check @@ -0,0 +1,3 @@ +OK +creating C(hi) +OK diff --git a/tests/pending/run/caseclasses.scala b/tests/pending/run/caseclasses.scala new file mode 100644 index 000000000000..f94bcab954ad --- /dev/null +++ b/tests/pending/run/caseclasses.scala @@ -0,0 +1,51 @@ +case class Foo(x: Int)(y: Int) + +case class Bar() + +abstract class Base +abstract case class Abs(x: Int) extends Base + +object M { + abstract case class C(x: String) {} + object C extends (String => C) { + def apply(x: String): C = { + println("creating C("+x+")") + new C(x) {} + } + } +} + +object Test extends dotty.runtime.LegacyApp { + + def Abs(x: Int) = new Abs(x * 2){} + Abs(2) match { + case Abs(4) => ; + } + + def fn[a,b](x: a => b) = x; + val f = fn(Foo(1)) + (f(2): AnyRef) match { + case Foo(1) => Console.println("OK") + case Bar() => Console.println("NO") + } + try { + Bar() productElement 3 + throw new NullPointerException("duh") + } catch { + case x:IndexOutOfBoundsException => + } + + M.C("hi") match { + case M.C("hi") => println("OK") + case _ => println("NO") + } + + try { + f(2) productElement 3 + throw new NullPointerException("duh") + } catch { + case x:IndexOutOfBoundsException => + } + +} + diff --git a/tests/pending/run/castsingleton.check b/tests/pending/run/castsingleton.check new file mode 100644 index 000000000000..49742281f0d1 --- /dev/null +++ b/tests/pending/run/castsingleton.check @@ -0,0 +1,2 @@ +L() +L() diff --git a/tests/pending/run/castsingleton.scala b/tests/pending/run/castsingleton.scala new file mode 100644 index 000000000000..3f2b6fca5585 --- /dev/null +++ b/tests/pending/run/castsingleton.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + case class L(); + object N extends L(); + + def empty(xs : L) : Unit = xs match { + case x@N => println(x); println(x); + case x => println(x); println(x); + } + + empty(L()) +} diff --git a/tests/pending/run/checked.check b/tests/pending/run/checked.check new file mode 100644 index 000000000000..258e93e5b240 --- /dev/null +++ b/tests/pending/run/checked.check @@ -0,0 +1,14 @@ +sum = 12 +[OK] Caught UFE: Uninitialized field: checked.scala: 42 +2 +[OK] Caught UFE: Uninitialized field: checked.scala: 73 +x = 10 +y = 11 +lz1 = 1 +lz2 = 2 +[OK]: 24 +x = 10 +y = 11 +lz1 = 1 +lz2 = 2 +[OK]: 24 diff --git a/tests/pending/run/checked.flags b/tests/pending/run/checked.flags new file mode 100644 index 000000000000..bcfd4cc1dbd9 --- /dev/null +++ b/tests/pending/run/checked.flags @@ -0,0 +1 @@ +-Xcheckinit -nowarn diff --git a/tests/pending/run/checked.scala b/tests/pending/run/checked.scala new file mode 100644 index 000000000000..a61547b81b5d --- /dev/null +++ b/tests/pending/run/checked.scala @@ -0,0 +1,126 @@ +/* Test checked initializers. Needs to be run with -Xexperimental and -checkinit + */ + +// 0 inherited fields +class A { + val x = 1 + val y = 2 + var z = 3 +} + +// 3 inherited fields +class B extends A { + val b1 = 1 + var b2 = 2 +} + + +trait T { + val t1 = 1 + var t2 = 2 +} + +// Should not throw +class D extends B with T { + val sum = x + y + z + b1 + b2 + t1 + t2 + override def toString = + "sum = " + sum + +} + +abstract class NeedsXEarly { + val x: Int + val y = x + 1 +} + +// should pass +class GoodX extends NeedsXEarly { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 1 +// END copied early initializers + +} + +// should throw +class BadX extends NeedsXEarly { + val x = 1 + println(y) +} + +// should pass +class UglyX extends NeedsXEarly { + lazy val x = 1 + println(y) +} + +trait XY { + val x = 1 + val y = 2 +} + +// needs x and y early +trait LazyFields { + lazy val lz1 = 1 + lazy val lz2 = 2 + val x: Int + val y: Int + val needsSomeEarly = { + println("x = " + x) + println("y = " + y) + println("lz1 = " + lz1) + println("lz2 = " + lz2) + x + y + lz1 + lz2 + } +} + +// will fail at init +class BadMixin extends LazyFields with XY { + println("[OK]: " + needsSomeEarly) +} + +// should print 24 +class GoodMixin extends LazyFields with XY { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +override val x = 10 + override val y = 11 +// END copied early initializers + + println("[OK]: " + needsSomeEarly) +} + +class TestInterference extends A with T with LazyFields { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +override val x = 10 + override val y = 11 +// END copied early initializers + + println("[OK]: " + needsSomeEarly) +} + + +object Test extends dotty.runtime.LegacyApp { + + def shouldThrow(t: => Unit) = try { + t + println("[FAIL]: No UFE thrown") + } catch { + case UninitializedFieldError(msg) => + println("[OK] Caught UFE: " + msg) + } + + + val d = new D() + println(d) + + shouldThrow(new BadX) + (new GoodX) + (new UglyX) + + shouldThrow(new BadMixin) + (new GoodMixin) + + (new TestInterference) +} diff --git a/tests/pending/run/class-symbol-contravariant.check b/tests/pending/run/class-symbol-contravariant.check new file mode 100644 index 000000000000..cbb90b52c238 --- /dev/null +++ b/tests/pending/run/class-symbol-contravariant.check @@ -0,0 +1,36 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> val u = rootMirror.universe +u: $r.intp.global.type = + +scala> import u._, scala.reflect.internal.Flags +import u._ +import scala.reflect.internal.Flags + +scala> class C +defined class C + +scala> val sym = u.typeOf[C].typeSymbol +sym: u.Symbol = class C + +scala> sym.isContravariant +res0: Boolean = false + +scala> sym setFlag Flags.INCONSTRUCTOR +res1: sym.type = class C + +scala> sym.isClassLocalToConstructor +res2: Boolean = true + +scala> sym.isContravariant // was true +res3: Boolean = false + +scala> :quit diff --git a/tests/pending/run/class-symbol-contravariant.scala b/tests/pending/run/class-symbol-contravariant.scala new file mode 100644 index 000000000000..6a84944e3bbc --- /dev/null +++ b/tests/pending/run/class-symbol-contravariant.scala @@ -0,0 +1,15 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ + |:power + |val u = rootMirror.universe + |import u._, scala.reflect.internal.Flags + |class C + |val sym = u.typeOf[C].typeSymbol + |sym.isContravariant + |sym setFlag Flags.INCONSTRUCTOR + |sym.isClassLocalToConstructor + |sym.isContravariant // was true + |""".stripMargin.trim +} \ No newline at end of file diff --git a/tests/pending/run/classfile-format-51.scala b/tests/pending/run/classfile-format-51.scala new file mode 100644 index 000000000000..24b1ee8397eb --- /dev/null +++ b/tests/pending/run/classfile-format-51.scala @@ -0,0 +1,126 @@ +import java.io.{File, FileOutputStream} + +import scala.tools.nsc.settings.ScalaVersion +import scala.tools.partest._ +import scala.tools.asm +import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes} +import Opcodes._ + +// This test ensures that we can read JDK 7 (classfile format 51) files, including those +// with invokeDynamic instructions and associated constant pool entries +// to do that it first uses ASM to generate a class called DynamicInvoker. Then +// it runs a normal compile on the source in the 'code' field that refers to +// DynamicInvoker. Any failure will be dumped to std out. +// +// By it's nature the test can only work on JDK 7+ because under JDK 6 some of the +// classes referred to by DynamicInvoker won't be available and DynamicInvoker won't +// verify. So the test includes a version check that short-circuites the whole test +// on JDK 6 +object Test extends DirectTest { + override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path + + def generateClass() { + val invokerClassName = "DynamicInvoker" + val bootstrapMethodName = "bootstrap" + val bootStrapMethodType = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" + val targetMethodName = "target" + val targetMethodType = "()Ljava/lang/String;" + + val cw = new ClassWriter(0) + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, invokerClassName, null, "java/lang/Object", null) + + val constructor = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null) + constructor.visitCode() + constructor.visitVarInsn(ALOAD, 0) + constructor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false) + constructor.visitInsn(RETURN) + constructor.visitMaxs(1, 1) + constructor.visitEnd() + + val target = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, targetMethodName, targetMethodType, null, null) + target.visitCode() + target.visitLdcInsn("hello") + target.visitInsn(ARETURN) + target.visitMaxs(1, 1) + target.visitEnd() + + val bootstrap = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, bootstrapMethodName, bootStrapMethodType, null, null) + bootstrap.visitCode() +// val lookup = MethodHandles.lookup(); + bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", false) + bootstrap.visitVarInsn(ASTORE, 3) // lookup + +// val clazz = lookup.lookupClass(); + bootstrap.visitVarInsn(ALOAD, 3) // lookup + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "lookupClass", "()Ljava/lang/Class;", false) + bootstrap.visitVarInsn(ASTORE, 4) // clazz + +// val methodType = MethodType.fromMethodDescriptorString("()Ljava/lang/String, clazz.getClassLoader()") + bootstrap.visitLdcInsn("()Ljava/lang/String;") + bootstrap.visitVarInsn(ALOAD, 4) // CLAZZ + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getClassLoader", "()Ljava/lang/ClassLoader;", false) + bootstrap.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodType", "fromMethodDescriptorString", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/invoke/MethodType;", false) + bootstrap.visitVarInsn(ASTORE, 5) // methodType + +// val methodHandle = lookup.findStatic(thisClass, "target", methodType) + bootstrap.visitVarInsn(ALOAD, 3) // lookup + bootstrap.visitVarInsn(ALOAD, 4) // clazz + bootstrap.visitLdcInsn("target") + bootstrap.visitVarInsn(ALOAD, 5) // methodType + bootstrap.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandles$Lookup", "findStatic", "(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;", false) + bootstrap.visitVarInsn(ASTORE, 6) // methodHandle + +// new ConstantCallSite(methodHandle) + bootstrap.visitTypeInsn(NEW, "java/lang/invoke/ConstantCallSite") + bootstrap.visitInsn(DUP) + bootstrap.visitVarInsn(ALOAD, 6) // methodHandle + bootstrap.visitMethodInsn(INVOKESPECIAL, "java/lang/invoke/ConstantCallSite", "", "(Ljava/lang/invoke/MethodHandle;)V", false) + bootstrap.visitInsn(ARETURN) + bootstrap.visitMaxs(4,7) + bootstrap.visitEnd() + + val test = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "test", s"()Ljava/lang/String;", null, null) + test.visitCode() + val bootstrapHandle = new Handle(H_INVOKESTATIC, invokerClassName, bootstrapMethodName, bootStrapMethodType) + test.visitInvokeDynamicInsn("invoke", targetMethodType, bootstrapHandle) + test.visitInsn(ARETURN) + test.visitMaxs(1, 1) + test.visitEnd() + + cw.visitEnd() + val bytes = cw.toByteArray() + + val fos = new FileOutputStream(new File(s"${testOutput.path}/$invokerClassName.class")) + try + fos write bytes + finally + fos.close() + + } + + def code = +""" +object Driver { + val invoker = new DynamicInvoker() + println(invoker.test()) +} +""" + + override def show(): Unit = { + // redirect err to out, for logging + val prevErr = System.err + System.setErr(System.out) + try { + // this test is only valid under JDK 1.7+ + testUnderJavaAtLeast("1.7") { + generateClass() + compile() + () + } otherwise { + () + } + } + finally + System.setErr(prevErr) + } +} diff --git a/tests/pending/run/classfile-format-52.check b/tests/pending/run/classfile-format-52.check new file mode 100644 index 000000000000..5d24ef03cc7a --- /dev/null +++ b/tests/pending/run/classfile-format-52.check @@ -0,0 +1,2 @@ +hello from publicMethod +hello from staticMethod diff --git a/tests/pending/run/classfile-format-52.scala b/tests/pending/run/classfile-format-52.scala new file mode 100644 index 000000000000..e12c84124c02 --- /dev/null +++ b/tests/pending/run/classfile-format-52.scala @@ -0,0 +1,77 @@ +import java.io.{File, FileOutputStream} + +import scala.tools.nsc.settings.ScalaVersion +import scala.tools.partest._ +import scala.tools.asm +import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes} +import Opcodes._ + +// This test ensures that we can read JDK 8 (classfile format 52) files, including those +// with default methods. To do that it first uses ASM to generate an interface called +// HasDefaultMethod. Then it runs a normal compile on Scala source that extends that +// interface. Any failure will be dumped to std out. +// +// By it's nature the test can only work on JDK 8+ because under JDK 7- the +// interface won't verify. +object Test extends DirectTest { + override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path + + def generateInterface() { + val interfaceName = "HasDefaultMethod" + val methodType = "()Ljava/lang/String;" + + val cw = new ClassWriter(0) + cw.visit(52, ACC_PUBLIC+ACC_ABSTRACT+ACC_INTERFACE, interfaceName, null, "java/lang/Object", null) + + def createMethod(flags:Int, name: String) { + val method = cw.visitMethod(flags, name, methodType, null, null) + method.visitCode() + method.visitLdcInsn(s"hello from $name") + method.visitInsn(ARETURN) + method.visitMaxs(1, 1) + method.visitEnd() + } + + createMethod(ACC_PUBLIC, "publicMethod") + createMethod(ACC_PUBLIC+ACC_STATIC, "staticMethod") + createMethod(ACC_PRIVATE, "privateMethod") + + cw.visitEnd() + val bytes = cw.toByteArray() + + val fos = new FileOutputStream(new File(s"${testOutput.path}/$interfaceName.class")) + try + fos write bytes + finally + fos.close() + + } + + def code = +""" +class Driver extends HasDefaultMethod { + println(publicMethod()) + println(HasDefaultMethod.staticMethod()) +} +""" + + override def show(): Unit = { + // redirect err to out, for logging + val prevErr = System.err + System.setErr(System.out) + try { + // this test is only valid under JDK 1.8+ + testUnderJavaAtLeast("1.8") { + generateInterface() + compile() + Class.forName("Driver").newInstance() + () + } otherwise { + println("hello from publicMethod") + println("hello from staticMethod") + } + } + finally + System.setErr(prevErr) + } +} diff --git a/tests/pending/run/classmanifests_new_alias.check b/tests/pending/run/classmanifests_new_alias.check new file mode 100644 index 000000000000..032521a9295e --- /dev/null +++ b/tests/pending/run/classmanifests_new_alias.check @@ -0,0 +1,2 @@ +Int +true diff --git a/tests/pending/run/classmanifests_new_alias.scala b/tests/pending/run/classmanifests_new_alias.scala new file mode 100644 index 000000000000..38af0ede3d22 --- /dev/null +++ b/tests/pending/run/classmanifests_new_alias.scala @@ -0,0 +1,7 @@ + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + type CM[T] = ClassManifest[T] + println(implicitly[CM[Int]]) + println(implicitly[CM[Int]] eq Manifest.Int) +} diff --git a/tests/pending/run/classmanifests_new_core.check b/tests/pending/run/classmanifests_new_core.check new file mode 100644 index 000000000000..032521a9295e --- /dev/null +++ b/tests/pending/run/classmanifests_new_core.check @@ -0,0 +1,2 @@ +Int +true diff --git a/tests/pending/run/classmanifests_new_core.scala b/tests/pending/run/classmanifests_new_core.scala new file mode 100644 index 000000000000..a916b750c7be --- /dev/null +++ b/tests/pending/run/classmanifests_new_core.scala @@ -0,0 +1,5 @@ +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + println(classManifest[Int]) + println(classManifest[Int] eq Manifest.Int) +} diff --git a/tests/pending/run/classof.check b/tests/pending/run/classof.check new file mode 100644 index 000000000000..83e292352d11 --- /dev/null +++ b/tests/pending/run/classof.check @@ -0,0 +1,22 @@ +Value types: +void +boolean +byte +short +char +int +long +float +double +Class types +class SomeClass +class scala.collection.immutable.List +class scala.Tuple2 +Arrays: +class [Lscala.runtime.BoxedUnit; +class [I +class [D +class [Lscala.collection.immutable.List; +Functions: +interface scala.Function2 +interface scala.Function1 diff --git a/tests/pending/run/classof.scala b/tests/pending/run/classof.scala new file mode 100644 index 000000000000..257829e9768f --- /dev/null +++ b/tests/pending/run/classof.scala @@ -0,0 +1,32 @@ +class SomeClass + +object Test { + def main(args: Array[String]): Unit = { + val cls: Predef.Class[SomeClass] = classOf[SomeClass] + println("Value types:") + println(classOf[Unit]) + println(classOf[Boolean]) + println(classOf[Byte]) + println(classOf[Short]) + println(classOf[Char]) + println(classOf[Int]) + println(classOf[Long]) + println(classOf[Float]) + println(classOf[Double]) + + println("Class types") + println(classOf[SomeClass]) + println(classOf[List[Array[Float]]]) + println(classOf[(String, Map[Int, String])]) + + println("Arrays:") + println(classOf[Array[Unit]]) + println(classOf[Array[Int]]) + println(classOf[Array[Double]]) + println(classOf[Array[List[String]]]) + + println("Functions:") + println(classOf[(Int, Int) => Unit]) + println(classOf[Int => Boolean]) + } +} diff --git a/tests/pending/run/classtags_contextbound.check b/tests/pending/run/classtags_contextbound.check new file mode 100644 index 000000000000..604122846eac --- /dev/null +++ b/tests/pending/run/classtags_contextbound.check @@ -0,0 +1 @@ +class [I diff --git a/tests/pending/run/classtags_contextbound.scala b/tests/pending/run/classtags_contextbound.scala new file mode 100644 index 000000000000..1edce82a2737 --- /dev/null +++ b/tests/pending/run/classtags_contextbound.scala @@ -0,0 +1,7 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + def mkArray[T: ClassTag] = Array[T]() + def foo[T: ClassTag] = mkArray[T] + println(foo[Int].getClass) +} diff --git a/tests/pending/run/classtags_core.check b/tests/pending/run/classtags_core.check new file mode 100644 index 000000000000..d5c4386482e5 --- /dev/null +++ b/tests/pending/run/classtags_core.check @@ -0,0 +1,30 @@ +true +Byte +true +Short +true +Char +true +Int +true +Long +true +Float +true +Double +true +Boolean +true +Unit +true +Any +true +AnyVal +true +Object +true +Object +true +Null +true +Nothing diff --git a/tests/pending/run/classtags_core.scala b/tests/pending/run/classtags_core.scala new file mode 100644 index 000000000000..a30652d5f38f --- /dev/null +++ b/tests/pending/run/classtags_core.scala @@ -0,0 +1,34 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[ClassTag[Byte]] eq ClassTag.Byte) + println(implicitly[ClassTag[Byte]]) + println(implicitly[ClassTag[Short]] eq ClassTag.Short) + println(implicitly[ClassTag[Short]]) + println(implicitly[ClassTag[Char]] eq ClassTag.Char) + println(implicitly[ClassTag[Char]]) + println(implicitly[ClassTag[Int]] eq ClassTag.Int) + println(implicitly[ClassTag[Int]]) + println(implicitly[ClassTag[Long]] eq ClassTag.Long) + println(implicitly[ClassTag[Long]]) + println(implicitly[ClassTag[Float]] eq ClassTag.Float) + println(implicitly[ClassTag[Float]]) + println(implicitly[ClassTag[Double]] eq ClassTag.Double) + println(implicitly[ClassTag[Double]]) + println(implicitly[ClassTag[Boolean]] eq ClassTag.Boolean) + println(implicitly[ClassTag[Boolean]]) + println(implicitly[ClassTag[Unit]] eq ClassTag.Unit) + println(implicitly[ClassTag[Unit]]) + println(implicitly[ClassTag[Any]] eq ClassTag.Any) + println(implicitly[ClassTag[Any]]) + println(implicitly[ClassTag[AnyVal]] eq ClassTag.AnyVal) + println(implicitly[ClassTag[AnyVal]]) + println(implicitly[ClassTag[AnyRef]] eq ClassTag.AnyRef) + println(implicitly[ClassTag[AnyRef]]) + println(implicitly[ClassTag[Object]] eq ClassTag.Object) + println(implicitly[ClassTag[Object]]) + println(implicitly[ClassTag[Null]] eq ClassTag.Null) + println(implicitly[ClassTag[Null]]) + println(implicitly[ClassTag[Nothing]] eq ClassTag.Nothing) + println(implicitly[ClassTag[Nothing]]) +} diff --git a/tests/pending/run/classtags_multi.check b/tests/pending/run/classtags_multi.check new file mode 100644 index 000000000000..56da87eeb10c --- /dev/null +++ b/tests/pending/run/classtags_multi.check @@ -0,0 +1,5 @@ +Int +Array[int] +Array[Array[int]] +Array[Array[Array[int]]] +Array[Array[Array[Array[int]]]] diff --git a/tests/pending/run/classtags_multi.scala b/tests/pending/run/classtags_multi.scala new file mode 100644 index 000000000000..19f6aa7730ac --- /dev/null +++ b/tests/pending/run/classtags_multi.scala @@ -0,0 +1,9 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + println(classTag[Int]) + println(classTag[Array[Int]]) + println(classTag[Array[Array[Int]]]) + println(classTag[Array[Array[Array[Int]]]]) + println(classTag[Array[Array[Array[Array[Int]]]]]) +} diff --git a/tests/pending/run/collection-conversions.check b/tests/pending/run/collection-conversions.check new file mode 100644 index 000000000000..5e43d25f7e84 --- /dev/null +++ b/tests/pending/run/collection-conversions.check @@ -0,0 +1,126 @@ +-- Testing iterator --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing Vector --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing List --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing Buffer --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing ParVector --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing ParArray --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing Set --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing SetView --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK +-- Testing BufferView --- + :[Direct] Vector : OK + :[Copy] Vector : OK + :[Direct] Buffer : OK + :[Copy] Buffer : OK + :[Direct] GenSeq : OK + :[Copy] GenSeq : OK + :[Copy] Seq : OK + :[Direct] Stream : OK + :[Copy] Stream : OK + :[Direct] Array : OK + :[Copy] Array : OK + :[Copy] ParVector: OK + :[Copy] ParArray : OK \ No newline at end of file diff --git a/tests/pending/run/collection-conversions.scala b/tests/pending/run/collection-conversions.scala new file mode 100644 index 000000000000..cd05f68e2626 --- /dev/null +++ b/tests/pending/run/collection-conversions.scala @@ -0,0 +1,64 @@ +import collection._ +import mutable.Buffer +import parallel.immutable.ParVector +import parallel.mutable.ParArray +import reflect.ClassTag + +object Test { + + def printResult[A,B](msg: String, obj: A, expected: B)(implicit tag: ClassTag[A], tag2: ClassTag[B]) = { + print(" :" + msg +": ") + val isArray = obj match { + case x: Array[Int] => true + case _ => false + } + val expectedEquals = + if(isArray) obj.asInstanceOf[Array[Int]].toSeq == expected.asInstanceOf[Array[Int]].toSeq + else obj == expected + val tagEquals = tag == tag2 + if(expectedEquals && tagEquals) print("OK") + else print("FAILED") + if(!expectedEquals) print(", " + obj + " != " + expected) + if(!tagEquals) print(", " + tag + " != " + tag2) + println("") + } + + val testVector = Vector(1,2,3) + val testBuffer = Buffer(1,2,3) + val testGenSeq = GenSeq(1,2,3) + val testSeq = Seq(1,2,3) + val testStream = Stream(1,2,3) + val testArray = Array(1,2,3) + val testParVector = ParVector(1,2,3) + val testParArray = ParArray(1,2,3) + + def testConversion[A: ClassTag](name: String, col: => GenTraversableOnce[A]): Unit = { + val tmp = col + println("-- Testing " + name + " ---") + printResult("[Direct] Vector ", col.toVector, testVector) + printResult("[Copy] Vector ", col.to[Vector], testVector) + printResult("[Direct] Buffer ", col.toBuffer, testBuffer) + printResult("[Copy] Buffer ", col.to[Buffer], testBuffer) + printResult("[Direct] GenSeq ", col.toSeq, testGenSeq) + printResult("[Copy] GenSeq ", col.to[GenSeq], testGenSeq) + printResult("[Copy] Seq ", col.to[Seq], testSeq) + printResult("[Direct] Stream ", col.toStream, testStream) + printResult("[Copy] Stream ", col.to[Stream], testStream) + printResult("[Direct] Array ", col.toArray, testArray) + printResult("[Copy] Array ", col.to[Array], testArray) + printResult("[Copy] ParVector", col.to[ParVector], testParVector) + printResult("[Copy] ParArray ", col.to[ParArray], testParArray) + } + + def main(args: Array[String]): Unit = { + testConversion("iterator", (1 to 3).iterator) + testConversion("Vector", Vector(1,2,3)) + testConversion("List", List(1,2,3)) + testConversion("Buffer", Buffer(1,2,3)) + testConversion("ParVector", ParVector(1,2,3)) + testConversion("ParArray", ParArray(1,2,3)) + testConversion("Set", Set(1,2,3)) + testConversion("SetView", Set(1,2,3).view) + testConversion("BufferView", Buffer(1,2,3).view) + } +} diff --git a/tests/pending/run/collection-stacks.check b/tests/pending/run/collection-stacks.check new file mode 100644 index 000000000000..3a366bfcdfd9 --- /dev/null +++ b/tests/pending/run/collection-stacks.check @@ -0,0 +1,15 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +3-2-1: true +3-2-1: true +apply +3: true +3: true +1: true +1: true +top +3: true +3: true +pop +2-1: true +3: true +2-1: true diff --git a/tests/pending/run/collection-stacks.scala b/tests/pending/run/collection-stacks.scala new file mode 100644 index 000000000000..a41bef37ca8b --- /dev/null +++ b/tests/pending/run/collection-stacks.scala @@ -0,0 +1,38 @@ +import scala.collection.{ immutable, mutable } + +object Test extends dotty.runtime.LegacyApp { + def mutableStack[T](xs: T*): mutable.Stack[T] = { + val s = new mutable.Stack[T] + s.pushAll(xs) + s + } + + def immutableStack[T](xs: T*): immutable.Stack[T] = { + immutable.Stack.empty[T] pushAll xs + } + + def check[T](expected: T, got: T): Unit = { + println(got + ": " + (expected == got)) + } + + // check #957 + check("3-2-1", immutableStack(1, 2, 3).iterator.mkString("-")) + check("3-2-1", mutableStack(1, 2, 3).iterator.mkString("-")) + + println("apply") + check(3, immutableStack(1, 2, 3).apply(0)) + check(3, mutableStack(1, 2, 3).apply(0)) + check(1, immutableStack(1, 2, 3).apply(2)) + check(1, mutableStack(1, 2, 3).apply(2)) + + println("top") + check(3, immutableStack(1, 2, 3).top) + check(3, mutableStack(1, 2, 3).top) + + println("pop") + check("2-1", immutableStack(1, 2, 3).pop.mkString("-")) + check(3, mutableStack(1, 2, 3).pop()) + check("2-1", { val s = mutableStack(1, 2, 3); s.pop(); s.toList.mkString("-") }) +} + +// vim: set ts=2 sw=2 et: diff --git a/tests/pending/run/collections-toSelf.scala b/tests/pending/run/collections-toSelf.scala new file mode 100644 index 000000000000..02f1dd6a95e3 --- /dev/null +++ b/tests/pending/run/collections-toSelf.scala @@ -0,0 +1,11 @@ +object Test { + val map = Map(1 -> 2) + val set = Set(1, 2) + val seq = collection.immutable.Seq(1, 2) + + def main(args: Array[String]): Unit = { + assert(map.toMap eq map) + assert(set.toSet eq set) + assert(seq.toSeq eq seq) + } +} diff --git a/tests/pending/run/collections.check b/tests/pending/run/collections.check new file mode 100644 index 000000000000..c24150b24dc5 --- /dev/null +++ b/tests/pending/run/collections.check @@ -0,0 +1,42 @@ +***** mutable.HashSet: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** mutable.LinkedHashSet: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** immutable.Set: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** immutable.ListSet: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** immutable.TreeSet: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** mutable.HashMap: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** mutable.LinkedHashMap: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +***** immutable.Map: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +test4: 25005003 +***** immutable.TreeMap: +test1: 14005 +test2: 25005003, iters = 5000 +test3: 25005003 +test4: 25005003 +***** immutable.ListMap: +test1: 14005 +test2: 9007003, iters = 3000 +test3: 9007003 diff --git a/tests/pending/run/collections.scala b/tests/pending/run/collections.scala new file mode 100644 index 000000000000..acc2d93fff82 --- /dev/null +++ b/tests/pending/run/collections.scala @@ -0,0 +1,119 @@ +import scala.collection._ +import scala.compat.Platform.currentTime +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + + val printTime = false + + def sum[A](xs: Iterable[Int]) = (0 /: xs)((x, y) => x + y) + + def time(op: => Unit): Unit = { + val start = currentTime + op + if (printTime) println(" time = "+(currentTime - start)+"ms") + } + + def test(msg: String, s0: collection.immutable.Set[Int], iters: Int) = { + println("***** "+msg+":") + var s = s0 + s = s + 2 + s = s + (3, 4000, 10000) + println("test1: "+sum(s)) + time { + s = s ++ (List.range(0, iters) map (2*)) + println("test2: "+sum(s)+", iters = "+iters) + } + time { + var x = 0 + for (i <- 0 to 10000) + if (s contains i) x += i + println("test3: "+x) + } + } + + def test(msg: String, s0: collection.mutable.Set[Int], iters: Int) = { + println("***** "+msg+":") + var s = s0 + s = s + 2 + s = s + (3, 4000, 10000) + println("test1: "+sum(s)) + time { + s = s ++ (List.range(0, iters) map (2*)) + println("test2: "+sum(s)+", iters = "+iters) + } + time { + var x = 0 + for (i <- 0 to 10000) + if (s contains i) x += i + println("test3: "+x) + } + } + + def test(msg: String, s0: collection.immutable.Map[Int, Int], iters: Int) = { + println("***** "+msg+":") + var s = s0 + s = s + (2 -> 2) + s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000) + println("test1: "+sum(s map (_._2))) + time { + s = s ++ (List.range(0, iters) map (x => x * 2 -> x * 2)) + println("test2: "+sum(s map (_._2))+", iters = "+iters) + } + time { + var x = 0 + for (i <- 0 to 10000) + s get i match { + case Some(i) => x += i + case None => + } + println("test3: "+x) + } + if (iters == 5000) { + time { + var s1 = s + var x = 0 + for (i <- 0 to 10000) { + s get i match { + case Some(i) => x += i + case None => + } + s1 = s1 + ((i + 10000) -> i) + } + println("test4: "+x) + } + } + } + + def test(msg: String, s0: collection.mutable.Map[Int, Int], iters: Int) = { + println("***** "+msg+":") + var s = s0 + s = s + (2 -> 2) + s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000) + println("test1: "+sum(s map (_._2))) + time { + s = s ++ (List.range(0, iters) map (x => x * 2 -> x * 2)) + println("test2: "+sum(s map (_._2))+", iters = "+iters) + } + time { + var x = 0 + for (i <- 0 to 10000) + s get i match { + case Some(i) => x += i + case None => + } + println("test3: "+x) + } + } + + test("mutable.HashSet", new mutable.HashSet[Int], 5000) + test("mutable.LinkedHashSet", new mutable.LinkedHashSet[Int], 5000) + test("immutable.Set", immutable.Set[Int](), 5000) + test("immutable.ListSet", new immutable.ListSet[Int], 5000) + test("immutable.TreeSet", new immutable.TreeSet[Int], 5000) + test("mutable.HashMap", new mutable.HashMap[Int, Int], 5000) + test("mutable.LinkedHashMap", new mutable.LinkedHashMap[Int, Int], 5000) + test("immutable.Map", immutable.Map[Int, Int](), 5000) + test("immutable.TreeMap", new immutable.TreeMap[Int, Int], 5000) + test("immutable.ListMap", new immutable.ListMap[Int, Int], 3000) +} diff --git a/tests/pending/run/colltest.check b/tests/pending/run/colltest.check new file mode 100644 index 000000000000..9579d781aac6 --- /dev/null +++ b/tests/pending/run/colltest.check @@ -0,0 +1,9 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details +true +false +true +false +true +false +succeeded for 10 iterations. +succeeded for 10 iterations. diff --git a/tests/pending/run/colltest.scala b/tests/pending/run/colltest.scala new file mode 100644 index 000000000000..3f9ff3ba76b2 --- /dev/null +++ b/tests/pending/run/colltest.scala @@ -0,0 +1,66 @@ +import collection.mutable._ +class TestSet(s0: Set[Int], s1: Set[Int]) { + val Iterations = 10 + val Range = 100000 + val testEachStep = false + val Threshold = 20000 + val r = new java.util.Random(12345) + def test(s: Set[Int], n: Int): Any = { + val v = n >> 3 + n & 7 match { + case 0 | 1 | 2 => s contains v + case 3 => s += v + case 4 => s -= v + case 5 => if (s.size > Threshold) s -= v else s += v + case 6 => s += v + case 7 => s.size + } + } + def explain(n: Int, s: Set[Int]): String = n & 7 match { + case 0 | 1 | 2 => "contains" + case 3 => "add" + case 4 => "remove" + case 5 => if (s.size > Threshold) "remove" else "add" + case 6 => "add" + case 7 => "size" + } + def checkSubSet(pre: String, s0: Set[Int], s1: Set[Int]): Unit = { + for (e <- s0.iterator) + if (!(s1 contains e)) { + assert(false, pre+" element: "+e+"\n S0 = "+s0+"\n S1 = "+s1) + } + } + for (i <- 0 until Iterations) { + val n = r.nextInt(Range) + val res0 = test(s0, n) + val res1 = test(s1, n) + //Console.println("operation = "+explain(n, s0)+", value ="+(n >> 3)+", result0 = "+res0) + if (testEachStep) { + checkSubSet("superfluous", s0, s1) + checkSubSet("missing", s1, s0) + } + if (res0 != res1) + assert(false, "DIFFERENCE , operation = "+explain(n, s0)+", value ="+(n >> 3)+ + ", result0 = "+res0+", result1 = "+res1) + } + Console.println("succeeded for "+Iterations+" iterations.") +} +object Test extends dotty.runtime.LegacyApp { + def t3954: Unit = { + import scala.collection.mutable + import scala.collection.immutable + val result = new mutable.ImmutableSetAdaptor(immutable.ListSet.empty[Int]) + println(result.add(1)) + println(result.add(1)) + val result2 = new mutable.HashSet[Int] + println(result2.add(1)) + println(result2.add(1)) + val result3 = new java.util.HashSet[Int]() + println(result3.add(1)) + println(result3.add(1)) + } + t3954 + + new TestSet(HashSet.empty, new LinkedHashSet) + new TestSet(new ImmutableSetAdaptor(collection.immutable.Set.empty[Int]), new LinkedHashSet) +} diff --git a/tests/pending/run/colltest1.check b/tests/pending/run/colltest1.check new file mode 100644 index 000000000000..5ec6286d9ef2 --- /dev/null +++ b/tests/pending/run/colltest1.check @@ -0,0 +1,111 @@ +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with Stream() +10: Stream(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: Stream(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +Stream(1, ?) +new test starting with WrappedArray() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with ArrayBuffer() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with ListBuffer() +10: ListBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ListBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +ListBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with ArrayBuffer() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with ArrayBuffer() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with ArrayBuffer() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with Vector() +10: Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: Vector(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with Vector() +10: Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: Vector(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with List() +10: List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: List(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +new test starting with ArrayBuffer() +10: ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +9: ArrayBuffer(2, 3, 4, 5, 6, 7, 8, 9, 10) +1 +ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) +true +false +true +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) +List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z)) diff --git a/tests/pending/run/colltest1.scala b/tests/pending/run/colltest1.scala new file mode 100644 index 000000000000..3f1fe5530fea --- /dev/null +++ b/tests/pending/run/colltest1.scala @@ -0,0 +1,243 @@ +/* + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ +import scala.collection._ +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + + def orderedTraversableTest(empty: Traversable[Int]): Unit = { + println("new test starting with "+empty) + assert(empty.isEmpty) + val ten = empty ++ List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + println(ten.size+": "+ten) + println(ten.tail.size+": "+ten.tail) + assert(ten == empty ++ (1 to 10)) + assert(ten.size == 10) + assert(ten forall (_ <= 10)) + assert(ten exists (_ == 5)) + assert((ten count (_ % 2 == 0)) == 5) + assert((ten find (_ % 2 == 0)) == Some(2)) + assert((0 /: ten)(_ + _) == 55) + assert((ten :\ 0)(_ + _) == 55) + println(ten.head) + val x = ten reduceLeft (_ + _) + assert(x == 55, x) + assert((ten reduceRight (_ + _)) == 55) + val firstFive = empty ++ (1 to 5) + val secondFive = empty ++ (6 to 10) + assert(firstFive ++ secondFive == ten, firstFive ++ secondFive) + val odds = ten filter (_ % 2 != 0) + val evens = ten filterNot (_ % 2 != 0) + assert(odds.size == evens.size) + val (o, e) = ten.partition(_ % 2 == 0) + assert(o.size == e.size) + val gs = ten groupBy (x => x / 4) + val vs1 = (for (k <- gs.keysIterator; v <- gs(k).toIterable.iterator) yield v).toList.sorted + val vs2 = gs.values.toList.flatten.sorted +// val vs2 = gs.values.toList flatMap (xs => xs) + assert(ten.head == 1) + assert(ten.tail.head == 2) + assert(ten.tail.size == 9) + assert(ten.tail.foldLeft(10)(_ + _) == 64) + assert(ten.last == 10) + assert(List(ten.head) ++ ten.tail == ten) + assert(ten.init ++ List(ten.last) == ten, ten.init) + assert(vs1 == vs2, vs1+"!="+vs2) + assert(vs1 == ten) + assert((ten take 5) == firstFive) + assert((ten drop 5) == secondFive) + assert(ten slice (3, 3) isEmpty) + assert((ten slice (3, 6)) == List(4, 5, 6), ten slice (3, 6)) + assert((ten takeWhile (_ <= 5)) == firstFive) + assert((ten dropWhile (_ <= 5)) == secondFive) + assert((ten span (_ <= 5)) == (firstFive, secondFive)) + assert((ten splitAt 5) == (firstFive, secondFive), ten splitAt 5) + val buf = new mutable.ArrayBuffer[Int] + firstFive copyToBuffer buf + secondFive copyToBuffer buf + assert(buf.result == ten, buf.result) + assert(ten.toArray.size == 10) + assert(ten.toArray.toSeq == ten, ten.toArray.toSeq) + assert(ten.toIterable == ten) + assert(ten.toList == ten) + assert(ten.toSeq == ten) + assert(ten.toStream == ten) + assert(ten.toString endsWith "(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)") + assert(ten.mkString("[", "; ", "]") endsWith "[1; 2; 3; 4; 5; 6; 7; 8; 9; 10]") + } + + def orderedIterableTest(empty: Iterable[Int]): Unit = { + orderedTraversableTest(empty) + val six = empty ++ List(1, 2, 3, 4, 5, 6) + assert(six.iterator.toStream == six) + assert(six.takeRight(4) == List(3, 4, 5, 6), six.takeRight(4)) + assert(six.dropRight(3) == List(1, 2, 3)) + assert(six sameElements (1 to 6)) + } + + def sequenceTest(empty: Seq[Int]): Unit = { + orderedIterableTest(empty) + val ten = empty ++ (1 to 10) + println(ten) + val tenPlus = ten map (_ + 1) + assert((ten zip tenPlus) forall { case (x, y) => x + 1 == y }) + val dble = ten flatMap (x => List(x, x)) + assert(dble.distinct == ten) + assert(ten.length == 10) + assert(ten(0) == 1 && ten(9) == 10) + assert((ten lengthCompare 10) == 0 && (ten lengthCompare 1) > 0 && (ten lengthCompare 11) < 0) + assert((ten isDefinedAt 0) && (ten isDefinedAt 9)) + assert(!(ten isDefinedAt -1)); + assert(!(ten isDefinedAt 10)) + val tenten = ten zip ten + assert((tenten map (_._1)) == ten) + assert((tenten map (_._2)) == ten) + assert(ten.zipWithIndex forall { case (x, y) => x == y + 1 }) + assert(ten.segmentLength(_ <= 8, 4) == 4, ten.segmentLength(_ <= 8, 4)) + assert(ten.prefixLength(_ <= 8) == 8) + assert(ten.indexWhere(_ >= 8, 4) == 7, ten.indexWhere(_ >= 8, 4)) + assert(ten.indexWhere(_ >= 8) == 7) + assert(ten.indexOf(5) == 4) + assert(ten.indexOf(5, 4) == 4) + assert(ten.indexOf(5, 5) == -1) + assert(ten.lastIndexOf(5) == 4, ten.lastIndexOf(5)) + assert(ten.lastIndexOf(5, 4) == 4) + assert(ten.lastIndexOf(5, 3) == -1) + assert(ten.lastIndexWhere(_ <= 8) == 7) + assert(ten.lastIndexWhere(_ <= 8, 6) == 6) + assert(ten.lastIndexWhere(_ <= 8, 8) == 7) + assert(ten.reverse startsWith List(10, 9, 8), ten.reverse.take(10).toList) + assert(ten.reverse.length == 10) + assert(ten.reverse.reverse == ten) + assert(ten.reverseIterator.toList.reverse == ten, ten.reverseIterator.toList) + assert(ten.startsWith(List(1))) + assert(ten.startsWith(List(3, 4), 2)) + assert(ten.endsWith(List(9, 10))) + assert(ten.endsWith(List())) + assert(ten.indexOfSlice(List(3, 4, 5)) == 2, ten.indexOfSlice(List(3, 4, 5))) + assert(ten.lastIndexOfSlice(List(8, 9, 10)) == 7) + assert(ten.lastIndexOfSlice(List(1, 2, 3)) == 0) + assert(ten.lastIndexOfSlice(List(9, 10, 11)) == -1) + assert(ten contains 1) + assert(ten contains 10) + assert(!(ten contains 0)) + assert((empty ++ (1 to 7) union empty ++ (3 to 10)) == List(1, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 9, 10)) + assert((ten diff ten).isEmpty) + assert((ten diff List()) == ten) + assert((ten diff (ten filter (_ % 2 == 0))) == (ten filterNot (_ % 2 == 0))) + assert((ten intersect ten) == ten) + assert((ten intersect List(5)) == List(5)) + assert((ten ++ ten).distinct == ten) + assert(ten.patch(3, List(4, 5, 6, 7), 4) == ten) + assert(ten.patch(0, List(1, 2, 3), 9) == List(1, 2, 3, 10)) + assert(empty.padTo(10, 7) == Array.fill(10)(7).toSeq) + assert((ten zip ten.indices) == ten.zipWithIndex) + assert(ten.sortWith(_ < _) == ten) + assert(ten.sortWith(_ > _) == ten.reverse) + } + + def setTest(empty: => Set[String]): Unit = { + var s = empty + "A" + "B" + "C" + s += ("D", "E", "F") + s ++= List("G", "H", "I") + s ++= ('J' to 'Z') map (_.toString) + assert(s forall (s contains)) + assert(s contains "X") + assert(!(s contains "0")) + s = s + "0" + assert(s contains "0") + s = s - "X" + assert(!(s contains "X")) + assert(empty.isEmpty) + assert(!s.isEmpty) + assert((s intersect s) == s) + assert((empty intersect s) == empty) + assert(!s.isEmpty) + val s1 = s intersect empty + assert(s1 == empty, s1) + def abc = empty + ("a", "b", "c") + def bc = empty + ("b", "c") + assert(bc subsetOf abc) + } + + def rangeTest(r: Range): Unit = { + val ten = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + assert(r == ten) + assert(r.toList == ten) + assert((r filter (_ % 2 == 0)) == (ten filter (_ % 2 == 0))) + println((r map (_ + 1)) == (ten map (_ + 1))) + println((r map (_ * 2)) == (ten map (_ + 1))) + println((r flatMap (i => 0 until i)) == (ten flatMap (i => 0 until i))) + } + + def mapTest(empty: => Map[String, String]) = { + var m = empty + ("A" -> "A") + ("B" -> "B") + ("C" -> "C") + m += (("D" -> "D"), ("E" -> "E"), ("F" -> "F")) + m ++= List(("G" -> "G"), ("H" -> "H"), ("I" -> "I")) + m ++= ('J' to 'Z') map (x => (x.toString -> x.toString)) + println(m.toList.sorted) + assert(!m.isEmpty) + assert(m.keySet forall (k => (m get k) == Some(k))) + assert(m.keySet forall (k => (m apply k) == k)) + assert(m.keySet forall (m contains)) + assert(m.getOrElse("7", "@") == "@") + assert(m.keySet.size == 26) + assert(m.size == 26) + assert(m.keySet == Set() ++ m.keysIterator) + assert(m.keySet == m.keysIterator.toList.toSet, m.keySet.toList+"!="+m.keysIterator.toList.toSet) + val m1 = empty ++ m + val mm = m -- m.keySet.toList + assert(mm.isEmpty, mm) + def m3 = empty ++ m1 + assert(m1 == m3) + println(m3.toList.sorted) + val m4 = m3 filterNot { case (k, v) => k != "A" } + assert(m4.size == 1, m4) + } + + def mutableMapTest(empty: => mutable.Map[String, String]) = { + mapTest(empty) + val m1 = empty ++ (('A' to 'Z') map (_.toString) map (x => (x, x))) + val m2 = m1 retain ((k, v) => k == "N") + assert(m2.size == 1, m2) + } + + sequenceTest(Nil) + sequenceTest(List()) + sequenceTest(Stream.empty) + sequenceTest(Array[Int]()) + sequenceTest(mutable.ArrayBuffer()) + sequenceTest(mutable.ListBuffer()) + orderedTraversableTest(Traversable()) + orderedTraversableTest(mutable.Traversable()) + orderedTraversableTest(immutable.Traversable()) + orderedIterableTest(Iterable()) + orderedIterableTest(mutable.Iterable()) + orderedIterableTest(immutable.Iterable()) + sequenceTest(Seq()) + sequenceTest(mutable.Seq()) + sequenceTest(immutable.Seq()) + sequenceTest(LinearSeq()) + sequenceTest(IndexedSeq()) + sequenceTest(Vector()) +// sequenceTest(mutable.LinearSeq()) + sequenceTest(immutable.LinearSeq()) + sequenceTest(mutable.IndexedSeq()) + rangeTest(1 to 10) + + setTest(Set()) + setTest(mutable.Set()) + setTest(immutable.Set()) + setTest(mutable.HashSet()) + setTest(mutable.LinkedHashSet()) + setTest(immutable.HashSet()) + + mapTest(Map()) + mutableMapTest(mutable.Map()) + mapTest(immutable.Map()) + mapTest(immutable.TreeMap()) + mutableMapTest(mutable.HashMap()) + mutableMapTest(mutable.LinkedHashMap()) + mapTest(immutable.HashMap()) +} diff --git a/tests/pending/run/comparable-comparator.scala b/tests/pending/run/comparable-comparator.scala new file mode 100644 index 000000000000..f059cc52f377 --- /dev/null +++ b/tests/pending/run/comparable-comparator.scala @@ -0,0 +1,29 @@ + +object Test { + import java.util.Comparator + + class C1(val s: String) extends Comparable[C1] { + def compareTo(other: C1) = s compareTo other.s + override def toString = s + } + class C2(val s: String) { + def compareTo(other: C2) = s compareTo other.s + override def toString = s + } + + implicit val cmp: Comparator[C2] = new Comparator[C2] { + def compare(p1: C2, p2: C2) = p2.s compareTo p1.s + } + + val words = "zip foo bar baz aggle bing bong" split ' ' + val strs = words.toList + val c1s = strs map (x => new C1(x)) + val c2s = strs map (x => new C2(x)) + + val sorted1 = c1s.sorted map (_.s) + val sorted2 = c2s.sorted map (_.s) + + def main(args: Array[String]): Unit = { + assert(sorted1 == sorted2.reverse) + } +} diff --git a/tests/pending/run/compiler-asSeenFrom.check b/tests/pending/run/compiler-asSeenFrom.check new file mode 100644 index 000000000000..7305504115a2 --- /dev/null +++ b/tests/pending/run/compiler-asSeenFrom.check @@ -0,0 +1,417 @@ +class C { + type seen from prefix is + ---- ---------------- -- + C.this.I[Int] C[List[T3]] C[List[T3]]#I[Int] + C.this.I[Int] C[T1] C[T1]#I[Int] + C.this.I[Int] D[A1] D[A1]#I[Int] + C.this.I[Int] D[T3] D[T3]#I[Int] + C.this.I[List[Int]] C[List[T3]] C[List[T3]]#I[List[Int]] + C.this.I[List[Int]] C[T1] C[T1]#I[List[Int]] + C.this.I[List[Int]] D[A1] D[A1]#I[List[Int]] + C.this.I[List[Int]] D[T3] D[T3]#I[List[Int]] + C.this.I[T1] C[List[T3]] C[List[T3]]#I[List[T3]] + C.this.I[T1] C[T1] C[T1]#I[T1] + C.this.I[T1] D[A1] D[A1]#I[A1] + C.this.I[T1] D[T3] D[T3]#I[T3] + C.this.I[T2] C[List[T3]] C[List[T3]]#I[T2] + C.this.I[T2] C[T1] C[T1]#I[T2] + C.this.I[T2] D[A1] D[A1]#I[T2] + C.this.I[T2] D[T3] D[T3]#I[T2] + C.this.I[T3] C[List[T3]] C[List[T3]]#I[T3] + C.this.I[T3] C[T1] C[T1]#I[T3] + C.this.I[T3] D[A1] D[A1]#I[T3] + C.this.I[T3] D[T3] D[T3]#I[T3] + C.this.I[T4] C[List[T3]] C[List[T3]]#I[T4] + C.this.I[T4] C[T1] C[T1]#I[T4] + C.this.I[T4] D[A1] D[A1]#I[T4] + C.this.I[T4] D[T3] D[T3]#I[T4] + C.this.J[Int] C[List[T3]] C[List[T3]]#J[Int] + C.this.J[Int] C[T1] C[T1]#J[Int] + C.this.J[Int] D[A1] D[A1]#J[Int] + C.this.J[Int] D[T3] D[T3]#J[Int] + C.this.J[List[Int]] C[List[T3]] C[List[T3]]#J[List[Int]] + C.this.J[List[Int]] C[T1] C[T1]#J[List[Int]] + C.this.J[List[Int]] D[A1] D[A1]#J[List[Int]] + C.this.J[List[Int]] D[T3] D[T3]#J[List[Int]] + C.this.J[T1] C[List[T3]] C[List[T3]]#J[List[T3]] + C.this.J[T1] C[T1] C[T1]#J[T1] + C.this.J[T1] D[A1] D[A1]#J[A1] + C.this.J[T1] D[T3] D[T3]#J[T3] + C.this.J[T2] C[List[T3]] C[List[T3]]#J[T2] + C.this.J[T2] C[T1] C[T1]#J[T2] + C.this.J[T2] D[A1] D[A1]#J[T2] + C.this.J[T2] D[T3] D[T3]#J[T2] + C.this.J[T3] C[List[T3]] C[List[T3]]#J[T3] + C.this.J[T3] C[T1] C[T1]#J[T3] + C.this.J[T3] D[A1] D[A1]#J[T3] + C.this.J[T3] D[T3] D[T3]#J[T3] + C.this.J[T4] C[List[T3]] C[List[T3]]#J[T4] + C.this.J[T4] C[T1] C[T1]#J[T4] + C.this.J[T4] D[A1] D[A1]#J[T4] + C.this.J[T4] D[T3] D[T3]#J[T4] + C[List[T3]]#I[T1] D[A1] C[List[T3]]#I[A1] + C[List[T3]]#I[T1] D[T3] C[List[T3]]#I[T3] + C[List[T3]]#J[T1] D[A1] C[List[T3]]#J[A1] + C[List[T3]]#J[T1] D[T3] C[List[T3]]#J[T3] + C[T1]#I[Int] C[List[T3]] C[List[T3]]#I[Int] + C[T1]#I[Int] D[A1] C[A1]#I[Int] + C[T1]#I[Int] D[T3] C[T3]#I[Int] + C[T1]#I[List[Int]] C[List[T3]] C[List[T3]]#I[List[Int]] + C[T1]#I[List[Int]] D[A1] C[A1]#I[List[Int]] + C[T1]#I[List[Int]] D[T3] C[T3]#I[List[Int]] + C[T1]#I[T1] C[List[T3]] C[List[T3]]#I[List[T3]] + C[T1]#I[T1] D[A1] C[A1]#I[A1] + C[T1]#I[T1] D[T3] C[T3]#I[T3] + C[T1]#I[T2] C[List[T3]] C[List[T3]]#I[T2] + C[T1]#I[T2] D[A1] C[A1]#I[T2] + C[T1]#I[T2] D[T3] C[T3]#I[T2] + C[T1]#I[T3] C[List[T3]] C[List[T3]]#I[T3] + C[T1]#I[T3] D[A1] C[A1]#I[T3] + C[T1]#I[T3] D[T3] C[T3]#I[T3] + C[T1]#I[T4] C[List[T3]] C[List[T3]]#I[T4] + C[T1]#I[T4] D[A1] C[A1]#I[T4] + C[T1]#I[T4] D[T3] C[T3]#I[T4] + C[T1]#J[Int] C[List[T3]] C[List[T3]]#J[Int] + C[T1]#J[Int] D[A1] C[A1]#J[Int] + C[T1]#J[Int] D[T3] C[T3]#J[Int] + C[T1]#J[List[Int]] C[List[T3]] C[List[T3]]#J[List[Int]] + C[T1]#J[List[Int]] D[A1] C[A1]#J[List[Int]] + C[T1]#J[List[Int]] D[T3] C[T3]#J[List[Int]] + C[T1]#J[T1] C[List[T3]] C[List[T3]]#J[List[T3]] + C[T1]#J[T1] D[A1] C[A1]#J[A1] + C[T1]#J[T1] D[T3] C[T3]#J[T3] + C[T1]#J[T2] C[List[T3]] C[List[T3]]#J[T2] + C[T1]#J[T2] D[A1] C[A1]#J[T2] + C[T1]#J[T2] D[T3] C[T3]#J[T2] + C[T1]#J[T3] C[List[T3]] C[List[T3]]#J[T3] + C[T1]#J[T3] D[A1] C[A1]#J[T3] + C[T1]#J[T3] D[T3] C[T3]#J[T3] + C[T1]#J[T4] C[List[T3]] C[List[T3]]#J[T4] + C[T1]#J[T4] D[A1] C[A1]#J[T4] + C[T1]#J[T4] D[T3] C[T3]#J[T4] + D[T3]#J[T1] C[List[T3]] D[T3]#J[List[T3]] + D[T3]#J[T1] D[A1] D[T3]#J[A1] + D[A1]#J[T1] C[List[T3]] D[A1]#J[List[T3]] + D[A1]#J[T1] D[T3] D[A1]#J[T3] +} +class D { + type seen from prefix is + ---- ---------------- -- + C.this.I[T3] D[A1] C.this.I[A1] + C.this.J[T3] D[A1] C.this.J[A1] + C[List[T3]]#I[Int] D[A1] C[List[A1]]#I[Int] + C[List[T3]]#I[List[Int]] D[A1] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[T1] D[A1] C[List[A1]]#I[T1] + C[List[T3]]#I[T2] D[A1] C[List[A1]]#I[T2] + C[List[T3]]#I[T3] D[A1] C[List[A1]]#I[A1] + C[List[T3]]#I[T4] D[A1] C[List[A1]]#I[T4] + C[List[T3]]#J[Int] D[A1] C[List[A1]]#J[Int] + C[List[T3]]#J[List[Int]] D[A1] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[T1] D[A1] C[List[A1]]#J[T1] + C[List[T3]]#J[T2] D[A1] C[List[A1]]#J[T2] + C[List[T3]]#J[T3] D[A1] C[List[A1]]#J[A1] + C[List[T3]]#J[T4] D[A1] C[List[A1]]#J[T4] + C[T1]#I[T3] D[A1] C[T1]#I[A1] + C[T1]#J[T3] D[A1] C[T1]#J[A1] + D[T3]#J[Int] D[A1] D[A1]#J[Int] + D[T3]#J[List[Int]] D[A1] D[A1]#J[List[Int]] + D[T3]#J[T1] D[A1] D[A1]#J[T1] + D[T3]#J[T2] D[A1] D[A1]#J[T2] + D[T3]#J[T3] D[A1] D[A1]#J[A1] + D[T3]#J[T4] D[A1] D[A1]#J[T4] +} +class I { + type seen from prefix is + ---- ---------------- -- + C.this.I[Int] D.this.J[T4] D.this.cD.I[Int] + C.this.I[Int] Z.dZ.J[A2] Z.dZ.cD.I[Int] + C.this.I[Int] Z.dZ.J[P] Z.dZ.cD.I[Int] + C.this.I[List[Int]] D.this.J[T4] D.this.cD.I[List[Int]] + C.this.I[List[Int]] Z.dZ.J[A2] Z.dZ.cD.I[List[Int]] + C.this.I[List[Int]] Z.dZ.J[P] Z.dZ.cD.I[List[Int]] + C.this.I[T1] D.this.J[T4] D.this.cD.I[List[T3]] + C.this.I[T1] Z.dZ.J[A2] Z.dZ.cD.I[List[A1]] + C.this.I[T1] Z.dZ.J[P] Z.dZ.cD.I[List[A1]] + C.this.I[T2] D.this.J[T4] D.this.cD.I[T4] + C.this.I[T2] Z.dZ.J[A2] Z.dZ.cD.I[A2] + C.this.I[T2] Z.dZ.J[P] Z.dZ.cD.I[P] + C.this.I[T3] D.this.J[T4] D.this.cD.I[T3] + C.this.I[T3] Z.dZ.J[A2] Z.dZ.cD.I[T3] + C.this.I[T3] Z.dZ.J[P] Z.dZ.cD.I[T3] + C.this.I[T4] D.this.J[T4] D.this.cD.I[T4] + C.this.I[T4] Z.dZ.J[A2] Z.dZ.cD.I[T4] + C.this.I[T4] Z.dZ.J[P] Z.dZ.cD.I[T4] + C.this.J[Int] D.this.J[T4] D.this.cD.J[Int] + C.this.J[Int] Z.dZ.J[A2] Z.dZ.cD.J[Int] + C.this.J[Int] Z.dZ.J[P] Z.dZ.cD.J[Int] + C.this.J[List[Int]] D.this.J[T4] D.this.cD.J[List[Int]] + C.this.J[List[Int]] Z.dZ.J[A2] Z.dZ.cD.J[List[Int]] + C.this.J[List[Int]] Z.dZ.J[P] Z.dZ.cD.J[List[Int]] + C.this.J[T1] D.this.J[T4] D.this.cD.J[List[T3]] + C.this.J[T1] Z.dZ.J[A2] Z.dZ.cD.J[List[A1]] + C.this.J[T1] Z.dZ.J[P] Z.dZ.cD.J[List[A1]] + C.this.J[T2] D.this.J[T4] D.this.cD.J[T4] + C.this.J[T2] Z.dZ.J[A2] Z.dZ.cD.J[A2] + C.this.J[T2] Z.dZ.J[P] Z.dZ.cD.J[P] + C.this.J[T3] D.this.J[T4] D.this.cD.J[T3] + C.this.J[T3] Z.dZ.J[A2] Z.dZ.cD.J[T3] + C.this.J[T3] Z.dZ.J[P] Z.dZ.cD.J[T3] + C.this.J[T4] D.this.J[T4] D.this.cD.J[T4] + C.this.J[T4] Z.dZ.J[A2] Z.dZ.cD.J[T4] + C.this.J[T4] Z.dZ.J[P] Z.dZ.cD.J[T4] + C[List[T3]]#I[T1] D.this.J[T4] C[List[T3]]#I[List[T3]] + C[List[T3]]#I[T1] Z.dZ.J[A2] C[List[T3]]#I[List[A1]] + C[List[T3]]#I[T1] Z.dZ.J[P] C[List[T3]]#I[List[A1]] + C[List[T3]]#I[T2] D.this.J[T4] C[List[T3]]#I[T4] + C[List[T3]]#I[T2] Z.dZ.J[A2] C[List[T3]]#I[A2] + C[List[T3]]#I[T2] Z.dZ.J[P] C[List[T3]]#I[P] + C[List[T3]]#J[T1] D.this.J[T4] C[List[T3]]#J[List[T3]] + C[List[T3]]#J[T1] Z.dZ.J[A2] C[List[T3]]#J[List[A1]] + C[List[T3]]#J[T1] Z.dZ.J[P] C[List[T3]]#J[List[A1]] + C[List[T3]]#J[T2] D.this.J[T4] C[List[T3]]#J[T4] + C[List[T3]]#J[T2] Z.dZ.J[A2] C[List[T3]]#J[A2] + C[List[T3]]#J[T2] Z.dZ.J[P] C[List[T3]]#J[P] + C[T1]#I[Int] D.this.J[T4] C[List[T3]]#I[Int] + C[T1]#I[Int] Z.dZ.J[A2] C[List[A1]]#I[Int] + C[T1]#I[Int] Z.dZ.J[P] C[List[A1]]#I[Int] + C[T1]#I[List[Int]] D.this.J[T4] C[List[T3]]#I[List[Int]] + C[T1]#I[List[Int]] Z.dZ.J[A2] C[List[A1]]#I[List[Int]] + C[T1]#I[List[Int]] Z.dZ.J[P] C[List[A1]]#I[List[Int]] + C[T1]#I[T1] D.this.J[T4] C[List[T3]]#I[List[T3]] + C[T1]#I[T1] Z.dZ.J[A2] C[List[A1]]#I[List[A1]] + C[T1]#I[T1] Z.dZ.J[P] C[List[A1]]#I[List[A1]] + C[T1]#I[T2] D.this.J[T4] C[List[T3]]#I[T4] + C[T1]#I[T2] Z.dZ.J[A2] C[List[A1]]#I[A2] + C[T1]#I[T2] Z.dZ.J[P] C[List[A1]]#I[P] + C[T1]#I[T3] D.this.J[T4] C[List[T3]]#I[T3] + C[T1]#I[T3] Z.dZ.J[A2] C[List[A1]]#I[T3] + C[T1]#I[T3] Z.dZ.J[P] C[List[A1]]#I[T3] + C[T1]#I[T4] D.this.J[T4] C[List[T3]]#I[T4] + C[T1]#I[T4] Z.dZ.J[A2] C[List[A1]]#I[T4] + C[T1]#I[T4] Z.dZ.J[P] C[List[A1]]#I[T4] + C[T1]#J[Int] D.this.J[T4] C[List[T3]]#J[Int] + C[T1]#J[Int] Z.dZ.J[A2] C[List[A1]]#J[Int] + C[T1]#J[Int] Z.dZ.J[P] C[List[A1]]#J[Int] + C[T1]#J[List[Int]] D.this.J[T4] C[List[T3]]#J[List[Int]] + C[T1]#J[List[Int]] Z.dZ.J[A2] C[List[A1]]#J[List[Int]] + C[T1]#J[List[Int]] Z.dZ.J[P] C[List[A1]]#J[List[Int]] + C[T1]#J[T1] D.this.J[T4] C[List[T3]]#J[List[T3]] + C[T1]#J[T1] Z.dZ.J[A2] C[List[A1]]#J[List[A1]] + C[T1]#J[T1] Z.dZ.J[P] C[List[A1]]#J[List[A1]] + C[T1]#J[T2] D.this.J[T4] C[List[T3]]#J[T4] + C[T1]#J[T2] Z.dZ.J[A2] C[List[A1]]#J[A2] + C[T1]#J[T2] Z.dZ.J[P] C[List[A1]]#J[P] + C[T1]#J[T3] D.this.J[T4] C[List[T3]]#J[T3] + C[T1]#J[T3] Z.dZ.J[A2] C[List[A1]]#J[T3] + C[T1]#J[T3] Z.dZ.J[P] C[List[A1]]#J[T3] + C[T1]#J[T4] D.this.J[T4] C[List[T3]]#J[T4] + C[T1]#J[T4] Z.dZ.J[A2] C[List[A1]]#J[T4] + C[T1]#J[T4] Z.dZ.J[P] C[List[A1]]#J[T4] + D[T3]#J[T1] D.this.J[T4] D[T3]#J[List[T3]] + D[T3]#J[T1] Z.dZ.J[A2] D[T3]#J[List[A1]] + D[T3]#J[T1] Z.dZ.J[P] D[T3]#J[List[A1]] + D[T3]#J[T2] D.this.J[T4] D[T3]#J[T4] + D[T3]#J[T2] Z.dZ.J[A2] D[T3]#J[A2] + D[T3]#J[T2] Z.dZ.J[P] D[T3]#J[P] + D[A1]#J[T1] D.this.J[T4] D[A1]#J[List[T3]] + D[A1]#J[T1] Z.dZ.J[A2] D[A1]#J[List[A1]] + D[A1]#J[T1] Z.dZ.J[P] D[A1]#J[List[A1]] + D[A1]#J[T2] D.this.J[T4] D[A1]#J[T4] + D[A1]#J[T2] Z.dZ.J[A2] D[A1]#J[A2] + D[A1]#J[T2] Z.dZ.J[P] D[A1]#J[P] +} +class J { + type seen from prefix is + ---- ---------------- -- + C.this.I[T3] Z.dZ.J[A2] C.this.I[A1] + C.this.I[T3] Z.dZ.J[P] C.this.I[A1] + C.this.I[T4] Z.dZ.J[A2] C.this.I[A2] + C.this.I[T4] Z.dZ.J[P] C.this.I[P] + C.this.J[T3] Z.dZ.J[A2] C.this.J[A1] + C.this.J[T3] Z.dZ.J[P] C.this.J[A1] + C.this.J[T4] Z.dZ.J[A2] C.this.J[A2] + C.this.J[T4] Z.dZ.J[P] C.this.J[P] + C[List[T3]]#I[Int] Z.dZ.J[A2] C[List[A1]]#I[Int] + C[List[T3]]#I[Int] Z.dZ.J[P] C[List[A1]]#I[Int] + C[List[T3]]#I[List[Int]] Z.dZ.J[A2] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[List[Int]] Z.dZ.J[P] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[T1] Z.dZ.J[A2] C[List[A1]]#I[T1] + C[List[T3]]#I[T1] Z.dZ.J[P] C[List[A1]]#I[T1] + C[List[T3]]#I[T2] Z.dZ.J[A2] C[List[A1]]#I[T2] + C[List[T3]]#I[T2] Z.dZ.J[P] C[List[A1]]#I[T2] + C[List[T3]]#I[T3] Z.dZ.J[A2] C[List[A1]]#I[A1] + C[List[T3]]#I[T3] Z.dZ.J[P] C[List[A1]]#I[A1] + C[List[T3]]#I[T4] Z.dZ.J[A2] C[List[A1]]#I[A2] + C[List[T3]]#I[T4] Z.dZ.J[P] C[List[A1]]#I[P] + C[List[T3]]#J[Int] Z.dZ.J[A2] C[List[A1]]#J[Int] + C[List[T3]]#J[Int] Z.dZ.J[P] C[List[A1]]#J[Int] + C[List[T3]]#J[List[Int]] Z.dZ.J[A2] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[List[Int]] Z.dZ.J[P] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[T1] Z.dZ.J[A2] C[List[A1]]#J[T1] + C[List[T3]]#J[T1] Z.dZ.J[P] C[List[A1]]#J[T1] + C[List[T3]]#J[T2] Z.dZ.J[A2] C[List[A1]]#J[T2] + C[List[T3]]#J[T2] Z.dZ.J[P] C[List[A1]]#J[T2] + C[List[T3]]#J[T3] Z.dZ.J[A2] C[List[A1]]#J[A1] + C[List[T3]]#J[T3] Z.dZ.J[P] C[List[A1]]#J[A1] + C[List[T3]]#J[T4] Z.dZ.J[A2] C[List[A1]]#J[A2] + C[List[T3]]#J[T4] Z.dZ.J[P] C[List[A1]]#J[P] + C[T1]#I[T3] Z.dZ.J[A2] C[T1]#I[A1] + C[T1]#I[T3] Z.dZ.J[P] C[T1]#I[A1] + C[T1]#I[T4] Z.dZ.J[A2] C[T1]#I[A2] + C[T1]#I[T4] Z.dZ.J[P] C[T1]#I[P] + C[T1]#J[T3] Z.dZ.J[A2] C[T1]#J[A1] + C[T1]#J[T3] Z.dZ.J[P] C[T1]#J[A1] + C[T1]#J[T4] Z.dZ.J[A2] C[T1]#J[A2] + C[T1]#J[T4] Z.dZ.J[P] C[T1]#J[P] + D[T3]#J[Int] Z.dZ.J[A2] D[A1]#J[Int] + D[T3]#J[Int] Z.dZ.J[P] D[A1]#J[Int] + D[T3]#J[List[Int]] Z.dZ.J[A2] D[A1]#J[List[Int]] + D[T3]#J[List[Int]] Z.dZ.J[P] D[A1]#J[List[Int]] + D[T3]#J[T1] Z.dZ.J[A2] D[A1]#J[T1] + D[T3]#J[T1] Z.dZ.J[P] D[A1]#J[T1] + D[T3]#J[T2] Z.dZ.J[A2] D[A1]#J[T2] + D[T3]#J[T2] Z.dZ.J[P] D[A1]#J[T2] + D[T3]#J[T3] Z.dZ.J[A2] D[A1]#J[A1] + D[T3]#J[T3] Z.dZ.J[P] D[A1]#J[A1] + D[T3]#J[T4] Z.dZ.J[A2] D[A1]#J[A2] + D[T3]#J[T4] Z.dZ.J[P] D[A1]#J[P] + D[A1]#J[T3] Z.dZ.J[A2] D[A1]#J[A1] + D[A1]#J[T3] Z.dZ.J[P] D[A1]#J[A1] + D[A1]#J[T4] Z.dZ.J[A2] D[A1]#J[A2] + D[A1]#J[T4] Z.dZ.J[P] D[A1]#J[P] +} +class D { // after parser + private[this] val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +class D { // after uncurry + private[this] val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +class D { // after erasure + private[this] val cD: ll.C + val cD(): ll.C +} + +object Z { // after parser + def kz[P <: ll.Z.dZ.J[ll.A2]]: ll.Z.dZ.J[P] + private[this] val jZ: ll.Z.dZ.J[ll.A2] + val jZ: ll.Z.dZ.J[ll.A2] + private[this] val dZ: ll.D[ll.A1] + val dZ: ll.D[ll.A1] +} + +object Z { // after uncurry + def kz[P <: ll.Z.dZ.J[ll.A2]](): ll.Z.dZ.J[P] + private[this] val jZ: ll.Z.dZ.J[ll.A2] + val jZ(): ll.Z.dZ.J[ll.A2] + private[this] val dZ: ll.D[ll.A1] + val dZ(): ll.D[ll.A1] +} + +object Z { // after erasure + def kz(): ll.D#J + private[this] val jZ: ll.D#J + val jZ(): ll.D#J + private[this] val dZ: ll.D + val dZ(): ll.D +} + +object Z { // after flatten + def kz(): ll.D#D$J + private[this] val jZ: ll.D#D$J + val jZ(): ll.D#D$J + private[this] val dZ: ll.D + val dZ(): ll.D +} + +value dZ { // after parser + private[this] val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value dZ { // after parser + private[this] val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value dZ { // after uncurry + private[this] val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +value dZ { // after erasure + private[this] val cD: ll.C + val cD(): ll.C +} + +value jZ { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after explicitouter + protected val $outer: D.this.type + val $outer(): D.this.type + val $outer(): C.this.type + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after erasure + protected val $outer: ll.D + val $outer(): ll.D + protected val $outer: ll.C + val $outer(): ll.C + def thisI(): ll.C#I + def thisC(): ll.C + def t2(): Object + def t1(): Object +} + +value jZ { // after flatten + protected val $outer: ll.D + val $outer(): ll.D + protected val $outer: ll.C + val $outer(): ll.C + def thisI(): ll.C#C$I + def thisC(): ll.C + def t2(): Object + def t1(): Object +} + +method kz { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value $outer { // after parser + private[this] val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value $outer { // after uncurry + private[this] val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +value $outer { // after erasure + private[this] val cD: ll.C + val cD(): ll.C +} + diff --git a/tests/pending/run/compiler-asSeenFrom.scala b/tests/pending/run/compiler-asSeenFrom.scala new file mode 100644 index 000000000000..677dd40ddc4a --- /dev/null +++ b/tests/pending/run/compiler-asSeenFrom.scala @@ -0,0 +1,171 @@ +/* + * filter: inliner warning; re-run with -Yinline-warnings for details + */ +import scala.tools.nsc._ +import scala.tools.partest.DirectTest +import scala.collection.{ mutable, immutable, generic } +import scala.language.{postfixOps, implicitConversions} +import scala.reflect.runtime.{universe => ru} + +// necessary to avoid bincompat with scala-partest compiled against the old compiler +abstract class CompilerTest extends DirectTest { + def check(source: String, unit: global.CompilationUnit): Unit + + lazy val global: Global = newCompiler() + lazy val units: List[global.CompilationUnit] = compilationUnits(global)(sources: _ *) + import global._ + import definitions.{ compilerTypeFromTag } + + override def extraSettings = "-feature -usejavacp -d " + testOutput.path + + def show() = (sources, units).zipped foreach check + + // Override at least one of these... + def code = "" + def sources: List[String] = List(code) + + // Utility functions + class MkType(sym: Symbol) { + def apply[M](implicit t: ru.TypeTag[M]): Type = + if (sym eq NoSymbol) NoType + else appliedType(sym, compilerTypeFromTag(t)) + } + implicit def mkMkType(sym: Symbol) = new MkType(sym) + + def allMembers(root: Symbol): List[Symbol] = { + def loop(seen: Set[Symbol], roots: List[Symbol]): List[Symbol] = { + val latest = roots flatMap (_.info.members) filterNot (seen contains _) + if (latest.isEmpty) seen.toList.sortWith(_ isLess _) + else loop(seen ++ latest, latest) + } + loop(Set(), List(root)) + } + + class SymsInPackage(pkgName: String) { + def pkg = rootMirror.getPackage(TermName(pkgName)) + def classes = allMembers(pkg) filter (_.isClass) + def modules = allMembers(pkg) filter (_.isModule) + def symbols = classes ++ terms filterNot (_ eq NoSymbol) + def terms = allMembers(pkg) filter (s => s.isTerm && !s.isConstructor) + def tparams = classes flatMap (_.info.typeParams) + def tpes = symbols map (_.tpe) distinct + } +} + +/** It's too messy but it's better than not having it. + */ +object Test extends CompilerTest { + import global._ + import definitions._ + + override def sources = List(lambdaLift) + def lambdaLift = """ +package ll { + class A1 + class A2 + class X + class C[T1]() { + class I[T2]() { + def t1(): T1 = ??? + def t2(): T2 = ??? + def thisC(): C.this.type = ??? + def thisI(): I.this.type = ??? + } + } + class D[T3]() extends C[T3]() { + val cD: C[List[T3]] = ??? + class J[T4]() extends cD.I[T4]() + } + object Z { + val dZ: D[A1] = ??? + val jZ: dZ.J[A2] = ??? + + def kz[P <: dZ.J[A2]]: dZ.J[P] = ??? + } +} +""" + + object syms extends SymsInPackage("ll") { + def isPossibleEnclosure(encl: Symbol, sym: Symbol) = sym.enclClassChain drop 1 exists (_ isSubClass encl) + def isInterestingPrefix(pre: Type) = pre.typeConstructor.typeParams.nonEmpty && pre.members.exists(_.isType) + + def asSeenPrefixes = tpes map (_.finalResultType) distinct + def typeRefPrefixes = asSeenPrefixes filter isInterestingPrefix + + def nestsIn(outer: Symbol) = classes filter (c => c.enclClassChain drop 1 exists(_ isSubClass outer)) + def typeRefs(targs: List[Type]) = ( + for (p <- typeRefPrefixes ; c <- classes filter (isPossibleEnclosure(p.typeSymbol, _)) ; a <- targs) yield + typeRef(p, c, List(a)) + ) + + val wfmt = "%-" + 25 + "s" + def to_s(x: Any): String = wfmt.format(x.toString.replaceAll("""\bll\.""", "")) + + def fmt(args: Any*): String = { + (args map to_s mkString " ").replaceAll("""\s+$""", "") + } + def fname(sym: Symbol) = { + val p = "" + sym.owner.name + val x = if (sym.owner.isPackageClass || sym.owner.isModuleClass || sym.owner.isTerm) "." else "#" + sym.kindString + " " + p + x + sym.name + } + + def permuteAsSeenFrom(targs: List[Type]) = ( + for { + tp <- typeRefs(targs filterNot (_ eq NoType)) + prefix <- asSeenPrefixes + if tp.prefix != prefix + site <- classes + seen = tp.asSeenFrom(prefix, site) + if tp != seen + if !seen.isInstanceOf[ExistentialType] + } + yield ((site, tp, prefix, seen)) + ) + + def block(label: Any)(lines: List[String]): List[String] = { + val first = "" + label + " {" + val last = "}" + + first +: lines.map(" " + _) :+ last + } + + def permute(targs: List[Type]): List[String] = { + permuteAsSeenFrom(targs).groupBy(_._1).toList.sortBy(_._1.toString) flatMap { + case (site, xs) => + block(fmt(site)) { + fmt("type", "seen from prefix", "is") :: + fmt("----", "----------------", "--") :: { + xs.groupBy(_._2).toList.sortBy(_._1.toString) flatMap { + case (tp, ys) => + (ys map { case (_, _, prefix, seen) => fmt(tp, prefix, seen) }).sorted.distinct + } + } + } + } + } + } + + def pretty(xs: List[_]) = if (xs.isEmpty) "" else xs.mkString("\n ", "\n ", "\n") + + def signaturesIn(info: Type): List[String] = ( + info.members.toList + filterNot (s => s.isType || s.owner == ObjectClass || s.owner == AnyClass || s.isConstructor) + map (_.defString) + ) + + def check(source: String, unit: global.CompilationUnit) = { + import syms._ + + exitingTyper { + val typeArgs = List[Type](IntClass.tpe, ListClass[Int]) ++ tparams.map(_.tpe) + permute(typeArgs) foreach println + } + for (x <- classes ++ terms) { + afterEachPhase(signaturesIn(x.tpe)) collect { + case (ph, sigs) if sigs.nonEmpty => + println(sigs.mkString(x + " { // after " + ph + "\n ", "\n ", "\n}\n")) + } + } + } +} diff --git a/tests/pending/run/complicatedmatch.check b/tests/pending/run/complicatedmatch.check new file mode 100644 index 000000000000..501b7a32d6aa --- /dev/null +++ b/tests/pending/run/complicatedmatch.check @@ -0,0 +1,6 @@ +1 +42 +42 +11 +7 +13 diff --git a/tests/pending/run/complicatedmatch.scala b/tests/pending/run/complicatedmatch.scala new file mode 100644 index 000000000000..7a7438445553 --- /dev/null +++ b/tests/pending/run/complicatedmatch.scala @@ -0,0 +1,31 @@ +object Bar{ + def unapply(x : String) = x == "bar"; +} + +object Even{ + def unapply(x : Int) = if (x % 2 == 0) Some(x / 2) else None; +} + +object Test extends dotty.runtime.LegacyApp{ + val LongWord = "supercalifragilisticexpialadocious"; + + def foo(x : Int, y : String) : Int = (x, y) match { + case (Even(i), "bar") => 1 + case (1 | 2 | 3, "foo") => 42; + case (x, y) if y.length < x => 11; + case (1 | 2 | 3, Bar()) => 7; + case (1 | 2 | 3, "bar") => 8 + case (Even(Even(3)), Bar()) => 13; + case (Even(Even(3)), LongWord) => 13; + case _ => 0; + } + + List( + 2 -> "bar", + 2 -> "foo", + 3 -> "foo", + 7 -> "flob", + 3 -> "bar", + 12 -> LongWord + ).foreach({case (x, y) => println(foo(x, y))}); +} diff --git a/tests/pending/run/concat-two-strings.scala b/tests/pending/run/concat-two-strings.scala new file mode 100644 index 000000000000..c8881aa14627 --- /dev/null +++ b/tests/pending/run/concat-two-strings.scala @@ -0,0 +1,15 @@ +/** This doesn't test that the optimization is working, only that + * nothing is exploding. + */ +object Test { + def f1(x: AnyRef) = "" + x + def f2(x: Int) = "" + x + def f3(x: Array[Char]) = "" + x + def f4(x: List[Int]) = "" + x + def f5(x: Any) = "" + x + def f6(x: AnyVal) = "" + x + + def main(args: Array[String]): Unit = { + List(f1("a"), f2(5), f3(null), f3(Array('a')), f4(List(1)), f5(null), f6(55d)) mkString "" + } +} diff --git a/tests/pending/run/concurrent-map-conversions.scala b/tests/pending/run/concurrent-map-conversions.scala new file mode 100644 index 000000000000..225efe1da76d --- /dev/null +++ b/tests/pending/run/concurrent-map-conversions.scala @@ -0,0 +1,36 @@ + + + + + +object Test { + + def main(args: Array[String]): Unit = { + testConversions() + testConverters() + } + + def needPackageConcurrentMap(map: collection.concurrent.Map[Int, Int]): Unit = { + } + def needJavaConcurrent(map: java.util.concurrent.ConcurrentMap[Int, Int]): Unit = { + } + + def testConversions(): Unit = { + import collection.JavaConversions._ + val skiplist = new java.util.concurrent.ConcurrentSkipListMap[Int, Int] + val ctrie = new collection.concurrent.TrieMap[Int, Int] + + needPackageConcurrentMap(skiplist) + needJavaConcurrent(ctrie) + } + + def testConverters(): Unit = { + import collection.JavaConverters._ + val skiplist = new java.util.concurrent.ConcurrentSkipListMap[Int, Int] + val ctrie = new collection.concurrent.TrieMap[Int, Int] + + needPackageConcurrentMap(skiplist.asScala) + needJavaConcurrent(ctrie.asJava) + } + +} diff --git a/tests/pending/run/concurrent-stream.check b/tests/pending/run/concurrent-stream.check new file mode 100644 index 000000000000..d4adf84490e0 --- /dev/null +++ b/tests/pending/run/concurrent-stream.check @@ -0,0 +1,3 @@ +Testing standard cons. +Evaluation 0: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) +Evaluation 1: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) diff --git a/tests/pending/run/concurrent-stream.scala b/tests/pending/run/concurrent-stream.scala new file mode 100644 index 000000000000..8946a85fd182 --- /dev/null +++ b/tests/pending/run/concurrent-stream.scala @@ -0,0 +1,37 @@ +// test concurrent calls to Stream.tail +@deprecated("Suppress warnings", since="2.11") +object Test { + + def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = { + var current = from + def next: Stream[Int] = { + Thread.sleep(100) + if (current >= until) Stream.empty + else { + val stream = cons(current, next) + current += 1 + stream + } + } + next + } + + def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = { + import scala.actors.Actor._ + + val stream = slowRange(0, 10, cons) + val main = self + actor { main ! stream.toList } + actor { main ! stream.toList } + val eval0 = receive { case list: List[Int @unchecked] => list } + val eval1 = receive { case list: List[Int @unchecked] => list } + println("Evaluation 0: " + eval0) + println("Evaluation 1: " + eval1) + } + + def main(args: Array[String]): Unit = { + println("Testing standard cons.") + testCons(Stream.cons.apply(_, _)) + } +} + diff --git a/tests/pending/run/constant-optimization.check b/tests/pending/run/constant-optimization.check new file mode 100644 index 000000000000..957ffc5a8721 --- /dev/null +++ b/tests/pending/run/constant-optimization.check @@ -0,0 +1,5 @@ +testBothReachable: good +testOneReachable: good +testAllReachable: good +testOneUnreachable: good +testDefaultUnreachable: good diff --git a/tests/pending/run/constant-optimization.flags b/tests/pending/run/constant-optimization.flags new file mode 100644 index 000000000000..c9b68d70dc6a --- /dev/null +++ b/tests/pending/run/constant-optimization.flags @@ -0,0 +1 @@ +-optimise diff --git a/tests/pending/run/constant-optimization.scala b/tests/pending/run/constant-optimization.scala new file mode 100644 index 000000000000..83cabf85654f --- /dev/null +++ b/tests/pending/run/constant-optimization.scala @@ -0,0 +1,61 @@ +object Test extends dotty.runtime.LegacyApp { + def testBothReachable(): Unit = { + val i = util.Random.nextInt + val x = if (i % 2 == 0) null else "good" + val y = if (x == null) "good" else x + "" + println(s"testBothReachable: $y") + } + + def testOneReachable(): Unit = { + val i = 1 + val x = if (i != 1) null else "good" + val y = if (x == null) "good" else x + "" + println(s"testOneReachable: $y") + } + + def testAllReachable(): Unit = { + val i = util.Random.nextInt + val y = (i % 2) match { + case 0 => "good" + case 1 => "good" + case _ => "good" + } + println(s"testAllReachable: $y") + } + + def testOneUnreachable(): Unit = { + val i = util.Random.nextInt + val x = if (i % 2 == 0) { + 1 + } else { + 2 + } + val y = x match { + case 0 => "good" + case 1 => "good" + case _ => "good" + } + println(s"testOneUnreachable: $y") + } + + def testDefaultUnreachable(): Unit = { + val i = util.Random.nextInt + val x = if (i % 2 == 0) { + 1 + } else { + 2 + } + val y = x match { + case 1 => "good" + case 2 => "good" + case _ => "good" + } + println(s"testDefaultUnreachable: $y") + } + + testBothReachable() + testOneReachable() + testAllReachable() + testOneUnreachable() + testDefaultUnreachable() +} diff --git a/tests/pending/run/constant-type.check b/tests/pending/run/constant-type.check new file mode 100644 index 000000000000..a7ba5a46c2a3 --- /dev/null +++ b/tests/pending/run/constant-type.check @@ -0,0 +1,26 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> val s = transformedType(StringClass.toType).asInstanceOf[Type] +s: $r.intp.global.Type = String + +scala> { println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))) } +Class[String](classOf[java.lang.String]) + +scala> { exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))) } +Class(classOf[java.lang.String]) + +scala> { ConstantType(Constant(s)); println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))); } +Class[String](classOf[java.lang.String]) + +scala> { ConstantType(Constant(s)); exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))); } +Class(classOf[java.lang.String]) + +scala> :quit diff --git a/tests/pending/run/constant-type.scala b/tests/pending/run/constant-type.scala new file mode 100644 index 000000000000..373746af4a48 --- /dev/null +++ b/tests/pending/run/constant-type.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.ReplTest + +// see the commit message to understand what this stuff is about +// just a quick note: +// transformedType returns an erased version of the type +// as explained in the commit message, Type.erasure won't do for this test +// because it does some postprocessing to the result of transformedType +object Test extends ReplTest { + def code = """ +:power +val s = transformedType(StringClass.toType).asInstanceOf[Type] +{ println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))) } +{ exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))) } +{ ConstantType(Constant(s)); println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))); } +{ ConstantType(Constant(s)); exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))); } + """ +} diff --git a/tests/pending/run/constrained-types.check b/tests/pending/run/constrained-types.check new file mode 100644 index 000000000000..89a08d5ccbc8 --- /dev/null +++ b/tests/pending/run/constrained-types.check @@ -0,0 +1,151 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint +defined class Annot + +scala> + +scala> class A { + val x = "hello" + val y: Int @Annot(x) = 10 + override def toString = "an A" +} +defined class A + +scala> + +scala> val a = new A +a: A = an A + +scala> val y = a.y // should rewrite "this.x" to "a.x" +y: Int @Annot(a.x) = 10 + +scala> var a2 = new A +a2: A = an A + +scala> val y2 = a2.y // should drop the annotation +y2: Int = 10 + +scala> + +scala> object Stuff { + val x = "hello" + val y : Int @Annot(x) = 10 +} +defined object Stuff + +scala> + +scala> val y = Stuff.y // should rewrite the annotation +y: Int @Annot(Stuff.x) = 10 + +scala> + +scala> class B { + val y: Int @Annot(Stuff.x) = 10 + override def toString = "a B" +} +defined class B + +scala> + +scala> val b = new B +b: B = a B + +scala> val y = b.y // should keep the annotation +y: Int @Annot(Stuff.x) = 10 + +scala> def m(x: String): String @Annot(x) = x +m: (x: String)String @Annot(x) + +scala> + +scala> val three = "three" +three: String = three + +scala> val three2 = m(three:three.type) // should change x to three +three2: String @Annot(three) = three + +scala> var four = "four" +four: String = four + +scala> val four2 = m(four) // should have an existential bound +warning: there was one feature warning; re-run with -feature for details +four2: String @Annot(x) forSome { val x: String } = four + +scala> val four3 = four2 // should have the same type as four2 +warning: there was one feature warning; re-run with -feature for details +four3: String @Annot(x) forSome { val x: String } = four + +scala> val stuff = m("stuff") // should not crash +stuff: String @Annot("stuff") = stuff + +scala> + +scala> class peer extends annotation.Annotation // should not crash +defined class peer + +scala> + +scala> class NPE[T <: NPE[T] @peer] // should not crash +defined class NPE + +scala> + +scala> def m = { + val x = "three" + val y : String @Annot(x) = x + y +} // x should not escape the local scope with a narrow type +warning: there was one feature warning; re-run with -feature for details +m: String @Annot(x) forSome { val x: String } + +scala> + +scala> def n(y: String) = { + def m(x: String) : String @Annot(x) = { + (if (x == "") + m("default") + else + x) + } + m("stuff".stripMargin) +} // x should be existentially bound +warning: there was one feature warning; re-run with -feature for details +n: (y: String)String @Annot(x) forSome { val x: String } + +scala> + +scala> class rep extends annotation.Annotation { } +defined class rep + +scala> + +scala> object A { val x = "hello" : String @ rep } +defined object A +warning: previously defined class A is not a companion to object A. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> + +scala> val y = a.x // should drop the annotation +y: String = hello + +scala> + +scala> val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message +:8: error: not found: value e + val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message + ^ +:8: error: not found: value f + val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message + ^ +:8: error: not found: value g + val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message + ^ +:8: error: not found: value h + val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message + ^ + +scala> :quit diff --git a/tests/pending/run/constrained-types.scala b/tests/pending/run/constrained-types.scala new file mode 100644 index 000000000000..7ec8f93d381b --- /dev/null +++ b/tests/pending/run/constrained-types.scala @@ -0,0 +1,84 @@ +/* Check on the processing of annotated types. Initially this tested + * asSeenFrom, but now it also tests packedType and the treatment + * of DeBruijn's . It runs the test using the interpreter so that + * the resulting annotated types can be printed out. + */ +import scala.tools.nsc.Settings +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + +class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint + +class A { + val x = "hello" + val y: Int @Annot(x) = 10 + override def toString = "an A" +} + +val a = new A +val y = a.y // should rewrite "this.x" to "a.x" +var a2 = new A +val y2 = a2.y // should drop the annotation + +object Stuff { + val x = "hello" + val y : Int @Annot(x) = 10 +} + +val y = Stuff.y // should rewrite the annotation + +class B { + val y: Int @Annot(Stuff.x) = 10 + override def toString = "a B" +} + +val b = new B +val y = b.y // should keep the annotation +def m(x: String): String @Annot(x) = x + +val three = "three" +val three2 = m(three:three.type) // should change x to three +var four = "four" +val four2 = m(four) // should have an existential bound +val four3 = four2 // should have the same type as four2 +val stuff = m("stuff") // should not crash + +class peer extends annotation.Annotation // should not crash + +class NPE[T <: NPE[T] @peer] // should not crash + +def m = { + val x = "three" + val y : String @Annot(x) = x + y +} // x should not escape the local scope with a narrow type + +def n(y: String) = { + def m(x: String) : String @Annot(x) = { + (if (x == "") + m("default") + else + x) + } + m("stuff".stripMargin) +} // x should be existentially bound + +class rep extends annotation.Annotation { } + +object A { val x = "hello" : String @ rep } + +val y = a.x // should drop the annotation + +val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message +""" + + override def transformSettings(s: Settings): Settings = { + s.Xexperimental.value = true + s.deprecation.value = true + // when running that compiler, give it a scala-library to the classpath + s.classpath.value = sys.props("java.class.path") + s + } +} diff --git a/tests/pending/run/constructors.check b/tests/pending/run/constructors.check new file mode 100644 index 000000000000..0743b7e296a7 --- /dev/null +++ b/tests/pending/run/constructors.check @@ -0,0 +1,5 @@ +x=1 y=2 +x=3 y=3 +x=1 y=1 +x=1 y=2 a=1 b=2 c=a +x=3 y=3 a=3 b=3 c=b diff --git a/tests/pending/run/constructors.scala b/tests/pending/run/constructors.scala new file mode 100644 index 000000000000..90926431f967 --- /dev/null +++ b/tests/pending/run/constructors.scala @@ -0,0 +1,27 @@ +// Test constructors, including multiple ones. + +class A(x: Int, y: Int) { + def this(x: Int) = this(x, x); + def this() = this(1); + override def toString() = "x=" + x + " y=" + y; + class B(a: Int, b: Int, c: String) { + def this(str: String) = this(x, y, str); + override def toString() = + "x=" + x + " y=" + y + " a=" + a + " b=" + b + " c=" + c; + } +} + +object Test { + def main(args: Array[String]): Unit = { + val a1 = new A(1,2); + val a2 = new A(3); + val a3 = new A(); + val b1 = new a1.B(1,2,"a"); + val b2 = new a2.B("b"); + Console.println(a1); + Console.println(a2); + Console.println(a3); + Console.println(b1); + Console.println(b2); + } +} diff --git a/tests/pending/run/contrib674.check b/tests/pending/run/contrib674.check new file mode 100644 index 000000000000..78325c18105a --- /dev/null +++ b/tests/pending/run/contrib674.check @@ -0,0 +1,3 @@ +contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 1 + ^ diff --git a/tests/pending/run/contrib674.scala b/tests/pending/run/contrib674.scala new file mode 100644 index 000000000000..fe7ebcccd44c --- /dev/null +++ b/tests/pending/run/contrib674.scala @@ -0,0 +1,19 @@ +// causes VerifyError with scala-2.5.1 + +object Test extends dotty.runtime.LegacyApp { + def bad(): Unit = { + try { + 1 + } catch { + case e: Throwable => + } finally { + try { + } catch { + case e: Throwable => + } + } + 1 + } + + bad +} diff --git a/tests/pending/run/ctor-order.check b/tests/pending/run/ctor-order.check new file mode 100644 index 000000000000..b2f7f08c1707 --- /dev/null +++ b/tests/pending/run/ctor-order.check @@ -0,0 +1,2 @@ +10 +10 diff --git a/tests/pending/run/ctor-order.scala b/tests/pending/run/ctor-order.scala new file mode 100644 index 000000000000..2456925e62c6 --- /dev/null +++ b/tests/pending/run/ctor-order.scala @@ -0,0 +1,27 @@ + +/** Test that constructor operations are reordered correctly. */ +class Outer { + + object global { + val x = 10; + } + + class X extends AnyRef with M1 { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val outer = Outer.this +// END copied early initializers +} + + trait M1 { self: X => + Console.println(global.x); + Console.println(outer.global.x); + } + +} + +object Test extends AnyRef with App { + val o = new Outer; + + new o.X; +} diff --git a/tests/pending/run/ctries-new/DumbHash.scala b/tests/pending/run/ctries-new/DumbHash.scala new file mode 100644 index 000000000000..8ef325b67c86 --- /dev/null +++ b/tests/pending/run/ctries-new/DumbHash.scala @@ -0,0 +1,14 @@ + + + + + + +class DumbHash(val i: Int) { + override def equals(other: Any) = other match { + case that: DumbHash => that.i == this.i + case _ => false + } + override def hashCode = i % 5 + override def toString = "DH(%s)".format(i) +} diff --git a/tests/pending/run/ctries-new/Wrap.scala b/tests/pending/run/ctries-new/Wrap.scala new file mode 100644 index 000000000000..7b645c1612a7 --- /dev/null +++ b/tests/pending/run/ctries-new/Wrap.scala @@ -0,0 +1,9 @@ + + + + + + +case class Wrap(i: Int) { + override def hashCode = i * 0x9e3775cd +} diff --git a/tests/pending/run/ctries-new/concmap.scala b/tests/pending/run/ctries-new/concmap.scala new file mode 100644 index 000000000000..cd54f91ae14a --- /dev/null +++ b/tests/pending/run/ctries-new/concmap.scala @@ -0,0 +1,188 @@ + + + +import collection.concurrent.TrieMap + + +object ConcurrentMapSpec extends Spec { + + val initsz = 500 + val secondsz = 750 + + def test(): Unit = { + "support put" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) assert(ct.put(new Wrap(i), i) == None) + for (i <- 0 until initsz) assert(ct.put(new Wrap(i), -i) == Some(i)) + } + + "support put if absent" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new Wrap(i), -i) == None) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new Wrap(i), i) == Some(-i)) + } + + "support remove if mapped to a specific value" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), -i - 1) == false) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), i) == true) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), i) == false) + } + + "support replace if mapped to a specific value" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i - 1, -i - 2) == false) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i, -i - 2) == true) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i, -i - 2) == false) + for (i <- initsz until secondsz) assert(ct.replace(new Wrap(i), i, 0) == false) + } + + "support replace if present" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i) == Some(-i)) + for (i <- initsz until secondsz) assert(ct.replace(new Wrap(i), i) == None) + } + + def assertEqual(a: Any, b: Any) = { + if (a != b) println(a, b) + assert(a == b) + } + + "support replace if mapped to a specific value, using several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 55000 + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + class Updater(index: Int, offs: Int) extends Thread { + override def run(): Unit = { + var repeats = 0 + for (i <- 0 until sz) { + val j = (offs + i) % sz + var k = Int.MaxValue + do { + if (k != Int.MaxValue) repeats += 1 + k = ct.lookup(new Wrap(j)) + } while (!ct.replace(new Wrap(j), k, -k)) + } + //println("Thread %d repeats: %d".format(index, repeats)) + } + } + + val threads = for (i <- 0 until 16) yield new Updater(i, sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assertEqual(ct(new Wrap(i)), i) + + val threads2 = for (i <- 0 until 15) yield new Updater(i, sz / 32 * i) + threads2.foreach(_.start()) + threads2.foreach(_.join()) + + for (i <- 0 until sz) assertEqual(ct(new Wrap(i)), -i) + } + + "support put if absent, several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 110000 + + class Updater(offs: Int) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + val j = (offs + i) % sz + ct.putIfAbsent(new Wrap(j), j) + assert(ct.lookup(new Wrap(j)) == j) + } + } + } + + val threads = for (i <- 0 until 16) yield new Updater(sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assert(ct(new Wrap(i)) == i) + } + + "support remove if mapped to a specific value, several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 55000 + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + class Remover(offs: Int) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + val j = (offs + i) % sz + ct.remove(new Wrap(j), j) + assert(ct.get(new Wrap(j)) == None) + } + } + } + + val threads = for (i <- 0 until 16) yield new Remover(sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assert(ct.get(new Wrap(i)) == None) + } + + "have all or none of the elements depending on the oddity" in { + val ct = new TrieMap[Wrap, Int] + val sz = 65000 + for (i <- 0 until sz) ct(new Wrap(i)) = i + + class Modifier(index: Int, offs: Int) extends Thread { + override def run(): Unit = { + for (j <- 0 until sz) { + val i = (offs + j) % sz + var success = false + do { + if (ct.contains(new Wrap(i))) { + success = ct.remove(new Wrap(i)) != None + } else { + success = ct.putIfAbsent(new Wrap(i), i) == None + } + } while (!success) + } + } + } + + def modify(n: Int) = { + val threads = for (i <- 0 until n) yield new Modifier(i, sz / n * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + } + + modify(16) + for (i <- 0 until sz) assertEqual(ct.get(new Wrap(i)), Some(i)) + modify(15) + for (i <- 0 until sz) assertEqual(ct.get(new Wrap(i)), None) + } + + "compute size correctly" in { + val ct = new TrieMap[Wrap, Int] + val sz = 36450 + for (i <- 0 until sz) ct(new Wrap(i)) = i + + assertEqual(ct.size, sz) + assertEqual(ct.size, sz) + } + + "compute size correctly in parallel" in { + val ct = new TrieMap[Wrap, Int] + val sz = 36450 + for (i <- 0 until sz) ct(new Wrap(i)) = i + val pct = ct.par + + assertEqual(pct.size, sz) + assertEqual(pct.size, sz) + } + + } + +} diff --git a/tests/pending/run/ctries-new/iterator.scala b/tests/pending/run/ctries-new/iterator.scala new file mode 100644 index 000000000000..9bb9390ed7d4 --- /dev/null +++ b/tests/pending/run/ctries-new/iterator.scala @@ -0,0 +1,275 @@ +import collection._ +import collection.concurrent.TrieMap + +object IteratorSpec extends Spec { + + def test(): Unit = { + "work for an empty trie" in { + val ct = new TrieMap + val it = ct.iterator + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + } + + def nonEmptyIteratorCheck(sz: Int): Unit = { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + val it = ct.iterator + val tracker = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) { + assert(it.hasNext == true) + tracker += it.next + } + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + tracker.size shouldEqual (sz) + tracker shouldEqual (ct) + } + + "work for a 1 element trie" in { + nonEmptyIteratorCheck(1) + } + + "work for a 2 element trie" in { + nonEmptyIteratorCheck(2) + } + + "work for a 3 element trie" in { + nonEmptyIteratorCheck(3) + } + + "work for a 5 element trie" in { + nonEmptyIteratorCheck(5) + } + + "work for a 10 element trie" in { + nonEmptyIteratorCheck(10) + } + + "work for a 20 element trie" in { + nonEmptyIteratorCheck(20) + } + + "work for a 50 element trie" in { + nonEmptyIteratorCheck(50) + } + + "work for a 100 element trie" in { + nonEmptyIteratorCheck(100) + } + + "work for a 1k element trie" in { + nonEmptyIteratorCheck(1000) + } + + "work for a 5k element trie" in { + nonEmptyIteratorCheck(5000) + } + + "work for a 75k element trie" in { + nonEmptyIteratorCheck(75000) + } + + "work for a 250k element trie" in { + nonEmptyIteratorCheck(500000) + } + + def nonEmptyCollideCheck(sz: Int): Unit = { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until sz) ct.put(new DumbHash(i), i) + + val it = ct.iterator + val tracker = mutable.Map[DumbHash, Int]() + for (i <- 0 until sz) { + assert(it.hasNext == true) + tracker += it.next + } + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + tracker.size shouldEqual (sz) + tracker shouldEqual (ct) + } + + "work for colliding hashcodes, 2 element trie" in { + nonEmptyCollideCheck(2) + } + + "work for colliding hashcodes, 3 element trie" in { + nonEmptyCollideCheck(3) + } + + "work for colliding hashcodes, 5 element trie" in { + nonEmptyCollideCheck(5) + } + + "work for colliding hashcodes, 10 element trie" in { + nonEmptyCollideCheck(10) + } + + "work for colliding hashcodes, 100 element trie" in { + nonEmptyCollideCheck(100) + } + + "work for colliding hashcodes, 500 element trie" in { + nonEmptyCollideCheck(500) + } + + "work for colliding hashcodes, 5k element trie" in { + nonEmptyCollideCheck(5000) + } + + def assertEqual(a: Map[Wrap, Int], b: Map[Wrap, Int]): Unit = { + if (a != b) { + println(a.size + " vs " + b.size) + } + assert(a == b) + } + + "be consistent when taken with concurrent modifications" in { + val sz = 25000 + val W = 15 + val S = 5 + val checks = 5 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + class Modifier extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) ct.putIfAbsent(new Wrap(i), i) match { + case Some(_) => ct.remove(new Wrap(i)) + case None => + } + } + } + + def consistentIteration(ct: TrieMap[Wrap, Int], checks: Int): Unit = { + class Iter extends Thread { + override def run(): Unit = { + val snap = ct.readOnlySnapshot() + val initial = mutable.Map[Wrap, Int]() + for (kv <- snap) initial += kv + + for (i <- 0 until checks) { + assertEqual(snap.iterator.toMap, initial) + } + } + } + + val iter = new Iter + iter.start() + iter.join() + } + + val threads = for (_ <- 0 until W) yield new Modifier + threads.foreach(_.start()) + for (_ <- 0 until S) consistentIteration(ct, checks) + threads.foreach(_.join()) + } + + "be consistent with a concurrent removal with a well defined order" in { + val sz = 150000 + val sgroupsize = 10 + val sgroupnum = 5 + val removerslowdown = 50 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + class Remover extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(ct.remove(new Wrap(i)) == Some(i)) + for (i <- 0 until removerslowdown) ct.get(new Wrap(i)) // slow down, mate + } + } + } + + def consistentIteration(it: Iterator[(Wrap, Int)]) = { + class Iter extends Thread { + override def run(): Unit = { + val elems = it.toBuffer + if (elems.nonEmpty) { + val minelem = elems.minBy((x: (Wrap, Int)) => x._1.i)._1.i + assert(elems.forall(_._1.i >= minelem)) + } + } + } + new Iter + } + + val remover = new Remover + remover.start() + for (_ <- 0 until sgroupnum) { + val iters = for (_ <- 0 until sgroupsize) yield consistentIteration(ct.iterator) + iters.foreach(_.start()) + iters.foreach(_.join()) + } + remover.join() + } + + "be consistent with a concurrent insertion with a well defined order" in { + val sz = 150000 + val sgroupsize = 10 + val sgroupnum = 10 + val inserterslowdown = 50 + val ct = new TrieMap[Wrap, Int] + + class Inserter extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(ct.put(new Wrap(i), i) == None) + for (i <- 0 until inserterslowdown) ct.get(new Wrap(i)) // slow down, mate + } + } + } + + def consistentIteration(it: Iterator[(Wrap, Int)]) = { + class Iter extends Thread { + override def run(): Unit = { + val elems = it.toSeq + if (elems.nonEmpty) { + val maxelem = elems.maxBy((x: (Wrap, Int)) => x._1.i)._1.i + assert(elems.forall(_._1.i <= maxelem)) + } + } + } + new Iter + } + + val inserter = new Inserter + inserter.start() + for (_ <- 0 until sgroupnum) { + val iters = for (_ <- 0 until sgroupsize) yield consistentIteration(ct.iterator) + iters.foreach(_.start()) + iters.foreach(_.join()) + } + inserter.join() + } + + "work on a yet unevaluated snapshot" in { + val sz = 50000 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + val snap = ct.snapshot() + val it = snap.iterator + + while (it.hasNext) it.next() + } + + "be duplicated" in { + val sz = 50 + val ct = collection.parallel.mutable.ParTrieMap((0 until sz) zip (0 until sz): _*) + val it = ct.splitter + for (_ <- 0 until (sz / 2)) it.next() + val dupit = it.dup + + it.toList shouldEqual dupit.toList + } + + } + +} diff --git a/tests/pending/run/ctries-new/lnode.scala b/tests/pending/run/ctries-new/lnode.scala new file mode 100644 index 000000000000..d4b47c20cd96 --- /dev/null +++ b/tests/pending/run/ctries-new/lnode.scala @@ -0,0 +1,61 @@ + + + +import collection.concurrent.TrieMap + + +object LNodeSpec extends Spec { + + val initsz = 1500 + val secondsz = 1750 + + def test(): Unit = { + "accept elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + } + + "lookup elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + for (i <- 0 until initsz) assert(ct.get(new DumbHash(i)) == Some(i)) + for (i <- initsz until secondsz) assert(ct.get(new DumbHash(i)) == None) + } + + "remove elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + for (i <- 0 until initsz) { + val remelem = ct.remove(new DumbHash(i)) + assert(remelem == Some(i), "removing " + i + " yields " + remelem) + } + for (i <- 0 until initsz) assert(ct.get(new DumbHash(i)) == None) + } + + "put elements with the same hash codes if absent" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.put(new DumbHash(i), i) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new DumbHash(i), i) == Some(i)) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new DumbHash(i), i) == None) + for (i <- initsz until secondsz) assert(ct.lookup(new DumbHash(i)) == i) + } + + "replace elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) + for (i <- 0 until initsz) assert(ct.replace(new DumbHash(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == -i) + for (i <- 0 until initsz) assert(ct.replace(new DumbHash(i), -i, i) == true) + } + + "remove elements with the same hash codes if mapped to a specific value" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) + for (i <- 0 until initsz) assert(ct.remove(new DumbHash(i), i) == true) + } + + } + +} diff --git a/tests/pending/run/ctries-new/main.scala b/tests/pending/run/ctries-new/main.scala new file mode 100644 index 000000000000..5c93dd7574ac --- /dev/null +++ b/tests/pending/run/ctries-new/main.scala @@ -0,0 +1,50 @@ +import scala.reflect.{ClassTag, classTag} + + + + + + + + +object Test { + + def main(args: Array[String]): Unit = { + ConcurrentMapSpec.test() + IteratorSpec.test() + LNodeSpec.test() + SnapshotSpec.test() + } + +} + + +trait Spec { + + implicit def implicitously: languageFeature.implicitConversions = scala.language.implicitConversions + implicit def reflectively : languageFeature.reflectiveCalls = scala.language.reflectiveCalls + + implicit def str2ops(s: String): AnyRef{def in[U](body: => U): Unit} = new { + def in[U](body: =>U): Unit = { + // just execute body + body + } + } + + implicit def any2ops(a: Any): AnyRef{def shouldEqual(other: Any): Unit} = new { + def shouldEqual(other: Any) = assert(a == other) + } + + def evaluating[U](body: =>U) = new { + def shouldProduce[T <: Throwable: ClassTag]() = { + var produced = false + try body + catch { + case e: Throwable => if (e.getClass == implicitly[ClassTag[T]].runtimeClass) produced = true + } finally { + assert(produced, "Did not produce exception of type: " + implicitly[ClassTag[T]]) + } + } + } + +} diff --git a/tests/pending/run/ctries-new/snapshot.scala b/tests/pending/run/ctries-new/snapshot.scala new file mode 100644 index 000000000000..f05fd8e7a6bd --- /dev/null +++ b/tests/pending/run/ctries-new/snapshot.scala @@ -0,0 +1,267 @@ + + + + +import collection._ +import collection.concurrent.TrieMap + + + +object SnapshotSpec extends Spec { + + def test(): Unit = { + "support snapshots" in { + val ctn = new TrieMap + ctn.snapshot() + ctn.readOnlySnapshot() + + val ct = new TrieMap[Int, Int] + for (i <- 0 until 100) ct.put(i, i) + ct.snapshot() + ct.readOnlySnapshot() + } + + "empty 2 quiescent snapshots in isolation" in { + val sz = 4000 + + class Worker(trie: TrieMap[Wrap, Int]) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(trie.remove(new Wrap(i)) == Some(i)) + for (j <- 0 until sz) + if (j <= i) assert(trie.get(new Wrap(j)) == None) + else assert(trie.get(new Wrap(j)) == Some(j)) + } + } + } + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + val snapt = ct.snapshot() + + val original = new Worker(ct) + val snapshot = new Worker(snapt) + original.start() + snapshot.start() + original.join() + snapshot.join() + + for (i <- 0 until sz) { + assert(ct.get(new Wrap(i)) == None) + assert(snapt.get(new Wrap(i)) == None) + } + } + + def consistentReadOnly(name: String, readonly: Map[Wrap, Int], sz: Int, N: Int): Unit = { + @volatile var e: Exception = null + + // reads possible entries once and stores them + // then reads all these N more times to check if the + // state stayed the same + class Reader(trie: Map[Wrap, Int]) extends Thread { + setName("Reader " + name) + + override def run() = + try check() + catch { + case ex: Exception => e = ex + } + + def check(): Unit = { + val initial = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) trie.get(new Wrap(i)) match { + case Some(i) => initial.put(new Wrap(i), i) + case None => // do nothing + } + + for (k <- 0 until N) { + for (i <- 0 until sz) { + val tres = trie.get(new Wrap(i)) + val ires = initial.get(new Wrap(i)) + if (tres != ires) println(i, "initially: " + ires, "traversal %d: %s".format(k, tres)) + assert(tres == ires) + } + } + } + } + + val reader = new Reader(readonly) + reader.start() + reader.join() + + if (e ne null) { + e.printStackTrace() + throw e + } + } + + // traverses the trie `rep` times and modifies each entry + class Modifier(trie: TrieMap[Wrap, Int], index: Int, rep: Int, sz: Int) extends Thread { + setName("Modifier %d".format(index)) + + override def run(): Unit = { + for (k <- 0 until rep) { + for (i <- 0 until sz) trie.putIfAbsent(new Wrap(i), i) match { + case Some(_) => trie.remove(new Wrap(i)) + case None => // do nothing + } + } + } + } + + // removes all the elements from the trie + class Remover(trie: TrieMap[Wrap, Int], index: Int, totremovers: Int, sz: Int) extends Thread { + setName("Remover %d".format(index)) + + override def run(): Unit = { + for (i <- 0 until sz) trie.remove(new Wrap((i + sz / totremovers * index) % sz)) + } + } + + "have a consistent quiescent read-only snapshot" in { + val sz = 10000 + val N = 100 + val W = 10 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val readonly = ct.readOnlySnapshot() + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + consistentReadOnly("qm", readonly, sz, N) + threads.foreach(_.join()) + } + + // now, we check non-quiescent snapshots, as these permit situations + // where a thread is caught in the middle of the update when a snapshot is taken + + "have a consistent non-quiescent read-only snapshot, concurrent with removes only" in { + val sz = 1250 + val W = 100 + val S = 5000 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Remover(ct, i, W, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) consistentReadOnly("non-qr", ct.readOnlySnapshot(), sz, 5) + threads.foreach(_.join()) + } + + "have a consistent non-quiescent read-only snapshot, concurrent with modifications" in { + val sz = 1000 + val N = 7000 + val W = 10 + val S = 7000 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) consistentReadOnly("non-qm", ct.readOnlySnapshot(), sz, 5) + threads.foreach(_.join()) + } + + def consistentNonReadOnly(name: String, trie: TrieMap[Wrap, Int], sz: Int, N: Int): Unit = { + @volatile var e: Exception = null + + // reads possible entries once and stores them + // then reads all these N more times to check if the + // state stayed the same + class Worker extends Thread { + setName("Worker " + name) + + override def run() = + try check() + catch { + case ex: Exception => e = ex + } + + def check(): Unit = { + val initial = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) trie.get(new Wrap(i)) match { + case Some(i) => initial.put(new Wrap(i), i) + case None => // do nothing + } + + for (k <- 0 until N) { + // modify + for ((key, value) <- initial) { + val oldv = if (k % 2 == 0) value else -value + val newv = -oldv + trie.replace(key, oldv, newv) + } + + // check + for (i <- 0 until sz) if (initial.contains(new Wrap(i))) { + val expected = if (k % 2 == 0) -i else i + //println(trie.get(new Wrap(i))) + assert(trie.get(new Wrap(i)) == Some(expected)) + } else { + assert(trie.get(new Wrap(i)) == None) + } + } + } + } + + val worker = new Worker + worker.start() + worker.join() + + if (e ne null) { + e.printStackTrace() + throw e + } + } + + "have a consistent non-quiescent snapshot, concurrent with modifications" in { + val sz = 9000 + val N = 1000 + val W = 10 + val S = 400 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) { + consistentReadOnly("non-qm", ct.snapshot(), sz, 5) + consistentNonReadOnly("non-qsnap", ct.snapshot(), sz, 5) + } + threads.foreach(_.join()) + } + + "work when many concurrent snapshots are taken, concurrent with modifications" in { + val sz = 12000 + val W = 10 + val S = 10 + val modifytimes = 1200 + val snaptimes = 600 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + + class Snapshooter extends Thread { + setName("Snapshooter") + override def run(): Unit = { + for (k <- 0 until snaptimes) { + val snap = ct.snapshot() + for (i <- 0 until sz) snap.remove(new Wrap(i)) + for (i <- 0 until sz) assert(!snap.contains(new Wrap(i))) + } + } + } + + val mods = for (i <- 0 until W) yield new Modifier(ct, i, modifytimes, sz) + val shooters = for (i <- 0 until S) yield new Snapshooter + val threads = mods ++ shooters + threads.foreach(_.start()) + threads.foreach(_.join()) + } + + } + +} diff --git a/tests/pending/run/ctries-old/DumbHash.scala b/tests/pending/run/ctries-old/DumbHash.scala new file mode 100644 index 000000000000..8ef325b67c86 --- /dev/null +++ b/tests/pending/run/ctries-old/DumbHash.scala @@ -0,0 +1,14 @@ + + + + + + +class DumbHash(val i: Int) { + override def equals(other: Any) = other match { + case that: DumbHash => that.i == this.i + case _ => false + } + override def hashCode = i % 5 + override def toString = "DH(%s)".format(i) +} diff --git a/tests/pending/run/ctries-old/Wrap.scala b/tests/pending/run/ctries-old/Wrap.scala new file mode 100644 index 000000000000..7b645c1612a7 --- /dev/null +++ b/tests/pending/run/ctries-old/Wrap.scala @@ -0,0 +1,9 @@ + + + + + + +case class Wrap(i: Int) { + override def hashCode = i * 0x9e3775cd +} diff --git a/tests/pending/run/ctries-old/concmap.scala b/tests/pending/run/ctries-old/concmap.scala new file mode 100644 index 000000000000..e08b28d43bef --- /dev/null +++ b/tests/pending/run/ctries-old/concmap.scala @@ -0,0 +1,189 @@ + + + +import collection.concurrent.TrieMap +import Test.Spec + + +object ConcurrentMapSpec extends Spec { + + val initsz = 500 + val secondsz = 750 + + def test(): Unit = { + "support put" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) assert(ct.put(new Wrap(i), i) == None) + for (i <- 0 until initsz) assert(ct.put(new Wrap(i), -i) == Some(i)) + } + + "support put if absent" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new Wrap(i), -i) == None) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new Wrap(i), i) == Some(-i)) + } + + "support remove if mapped to a specific value" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), -i - 1) == false) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), i) == true) + for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), i) == false) + } + + "support replace if mapped to a specific value" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i - 1, -i - 2) == false) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i, -i - 2) == true) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i, -i - 2) == false) + for (i <- initsz until secondsz) assert(ct.replace(new Wrap(i), i, 0) == false) + } + + "support replace if present" in { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until initsz) ct.update(new Wrap(i), i) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i) == Some(-i)) + for (i <- initsz until secondsz) assert(ct.replace(new Wrap(i), i) == None) + } + + def assertEqual(a: Any, b: Any) = { + if (a != b) println(a, b) + assert(a == b) + } + + "support replace if mapped to a specific value, using several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 55000 + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + class Updater(index: Int, offs: Int) extends Thread { + override def run(): Unit = { + var repeats = 0 + for (i <- 0 until sz) { + val j = (offs + i) % sz + var k = Int.MaxValue + do { + if (k != Int.MaxValue) repeats += 1 + k = ct.lookup(new Wrap(j)) + } while (!ct.replace(new Wrap(j), k, -k)) + } + //println("Thread %d repeats: %d".format(index, repeats)) + } + } + + val threads = for (i <- 0 until 16) yield new Updater(i, sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assertEqual(ct(new Wrap(i)), i) + + val threads2 = for (i <- 0 until 15) yield new Updater(i, sz / 32 * i) + threads2.foreach(_.start()) + threads2.foreach(_.join()) + + for (i <- 0 until sz) assertEqual(ct(new Wrap(i)), -i) + } + + "support put if absent, several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 110000 + + class Updater(offs: Int) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + val j = (offs + i) % sz + ct.putIfAbsent(new Wrap(j), j) + assert(ct.lookup(new Wrap(j)) == j) + } + } + } + + val threads = for (i <- 0 until 16) yield new Updater(sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assert(ct(new Wrap(i)) == i) + } + + "support remove if mapped to a specific value, several threads" in { + val ct = new TrieMap[Wrap, Int] + val sz = 55000 + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + class Remover(offs: Int) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + val j = (offs + i) % sz + ct.remove(new Wrap(j), j) + assert(ct.get(new Wrap(j)) == None) + } + } + } + + val threads = for (i <- 0 until 16) yield new Remover(sz / 32 * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + + for (i <- 0 until sz) assert(ct.get(new Wrap(i)) == None) + } + + "have all or none of the elements depending on the oddity" in { + val ct = new TrieMap[Wrap, Int] + val sz = 65000 + for (i <- 0 until sz) ct(new Wrap(i)) = i + + class Modifier(index: Int, offs: Int) extends Thread { + override def run(): Unit = { + for (j <- 0 until sz) { + val i = (offs + j) % sz + var success = false + do { + if (ct.contains(new Wrap(i))) { + success = ct.remove(new Wrap(i)) != None + } else { + success = ct.putIfAbsent(new Wrap(i), i) == None + } + } while (!success) + } + } + } + + def modify(n: Int) = { + val threads = for (i <- 0 until n) yield new Modifier(i, sz / n * i) + threads.foreach(_.start()) + threads.foreach(_.join()) + } + + modify(16) + for (i <- 0 until sz) assertEqual(ct.get(new Wrap(i)), Some(i)) + modify(15) + for (i <- 0 until sz) assertEqual(ct.get(new Wrap(i)), None) + } + + "compute size correctly" in { + val ct = new TrieMap[Wrap, Int] + val sz = 36450 + for (i <- 0 until sz) ct(new Wrap(i)) = i + + assertEqual(ct.size, sz) + assertEqual(ct.size, sz) + } + + "compute size correctly in parallel" in { + val ct = new TrieMap[Wrap, Int] + val sz = 36450 + for (i <- 0 until sz) ct(new Wrap(i)) = i + val pct = ct.par + + assertEqual(pct.size, sz) + assertEqual(pct.size, sz) + } + + } + +} diff --git a/tests/pending/run/ctries-old/iterator.scala b/tests/pending/run/ctries-old/iterator.scala new file mode 100644 index 000000000000..d304cf0d6a0f --- /dev/null +++ b/tests/pending/run/ctries-old/iterator.scala @@ -0,0 +1,290 @@ + + + + +import collection._ +import collection.concurrent.TrieMap + +import Test.Spec + + +object IteratorSpec extends Spec { + + def test(): Unit = { + "work for an empty trie" in { + val ct = new TrieMap + val it = ct.iterator + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + } + + def nonEmptyIteratorCheck(sz: Int): Unit = { + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + val it = ct.iterator + val tracker = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) { + assert(it.hasNext == true) + tracker += it.next + } + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + tracker.size shouldEqual (sz) + tracker shouldEqual (ct) + } + + "work for a 1 element trie" in { + nonEmptyIteratorCheck(1) + } + + "work for a 2 element trie" in { + nonEmptyIteratorCheck(2) + } + + "work for a 3 element trie" in { + nonEmptyIteratorCheck(3) + } + + "work for a 5 element trie" in { + nonEmptyIteratorCheck(5) + } + + "work for a 10 element trie" in { + nonEmptyIteratorCheck(10) + } + + "work for a 20 element trie" in { + nonEmptyIteratorCheck(20) + } + + "work for a 50 element trie" in { + nonEmptyIteratorCheck(50) + } + + "work for a 100 element trie" in { + nonEmptyIteratorCheck(100) + } + + "work for a 1k element trie" in { + nonEmptyIteratorCheck(1000) + } + + "work for a 5k element trie" in { + nonEmptyIteratorCheck(5000) + } + + "work for a 75k element trie" in { + nonEmptyIteratorCheck(75000) + } + + "work for a 250k element trie" in { + nonEmptyIteratorCheck(500000) + } + + def nonEmptyCollideCheck(sz: Int): Unit = { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until sz) ct.put(new DumbHash(i), i) + + val it = ct.iterator + val tracker = mutable.Map[DumbHash, Int]() + for (i <- 0 until sz) { + assert(it.hasNext == true) + tracker += it.next + } + + it.hasNext shouldEqual (false) + evaluating { it.next() }.shouldProduce [NoSuchElementException] + tracker.size shouldEqual (sz) + tracker shouldEqual (ct) + } + + "work for colliding hashcodes, 2 element trie" in { + nonEmptyCollideCheck(2) + } + + "work for colliding hashcodes, 3 element trie" in { + nonEmptyCollideCheck(3) + } + + "work for colliding hashcodes, 5 element trie" in { + nonEmptyCollideCheck(5) + } + + "work for colliding hashcodes, 10 element trie" in { + nonEmptyCollideCheck(10) + } + + "work for colliding hashcodes, 100 element trie" in { + nonEmptyCollideCheck(100) + } + + "work for colliding hashcodes, 500 element trie" in { + nonEmptyCollideCheck(500) + } + + "work for colliding hashcodes, 5k element trie" in { + nonEmptyCollideCheck(5000) + } + + def assertEqual(a: Map[Wrap, Int], b: Map[Wrap, Int]): Unit = { + if (a != b) { + println(a.size + " vs " + b.size) + // println(a) + // println(b) + // println(a.toSeq.sortBy((x: (Wrap, Int)) => x._1.i)) + // println(b.toSeq.sortBy((x: (Wrap, Int)) => x._1.i)) + } + assert(a == b) + } + + "be consistent when taken with concurrent modifications" in { + val sz = 25000 + val W = 15 + val S = 5 + val checks = 5 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + class Modifier extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) ct.putIfAbsent(new Wrap(i), i) match { + case Some(_) => ct.remove(new Wrap(i)) + case None => + } + } + } + + def consistentIteration(ct: TrieMap[Wrap, Int], checks: Int): Unit = { + class Iter extends Thread { + override def run(): Unit = { + val snap = ct.readOnlySnapshot() + val initial = mutable.Map[Wrap, Int]() + for (kv <- snap) initial += kv + + for (i <- 0 until checks) { + assertEqual(snap.iterator.toMap, initial) + } + } + } + + val iter = new Iter + iter.start() + iter.join() + } + + val threads = for (_ <- 0 until W) yield new Modifier + threads.foreach(_.start()) + for (_ <- 0 until S) consistentIteration(ct, checks) + threads.foreach(_.join()) + } + + "be consistent with a concurrent removal with a well defined order" in { + val sz = 150000 + val sgroupsize = 10 + val sgroupnum = 5 + val removerslowdown = 50 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + + class Remover extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(ct.remove(new Wrap(i)) == Some(i)) + for (i <- 0 until removerslowdown) ct.get(new Wrap(i)) // slow down, mate + } + //println("done removing") + } + } + + def consistentIteration(it: Iterator[(Wrap, Int)]) = { + class Iter extends Thread { + override def run(): Unit = { + val elems = it.toBuffer + if (elems.nonEmpty) { + val minelem = elems.minBy((x: (Wrap, Int)) => x._1.i)._1.i + assert(elems.forall(_._1.i >= minelem)) + } + } + } + new Iter + } + + val remover = new Remover + remover.start() + for (_ <- 0 until sgroupnum) { + val iters = for (_ <- 0 until sgroupsize) yield consistentIteration(ct.iterator) + iters.foreach(_.start()) + iters.foreach(_.join()) + } + //println("done with iterators") + remover.join() + } + + "be consistent with a concurrent insertion with a well defined order" in { + val sz = 150000 + val sgroupsize = 10 + val sgroupnum = 10 + val inserterslowdown = 50 + val ct = new TrieMap[Wrap, Int] + + class Inserter extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(ct.put(new Wrap(i), i) == None) + for (i <- 0 until inserterslowdown) ct.get(new Wrap(i)) // slow down, mate + } + //println("done inserting") + } + } + + def consistentIteration(it: Iterator[(Wrap, Int)]) = { + class Iter extends Thread { + override def run(): Unit = { + val elems = it.toSeq + if (elems.nonEmpty) { + val maxelem = elems.maxBy((x: (Wrap, Int)) => x._1.i)._1.i + assert(elems.forall(_._1.i <= maxelem)) + } + } + } + new Iter + } + + val inserter = new Inserter + inserter.start() + for (_ <- 0 until sgroupnum) { + val iters = for (_ <- 0 until sgroupsize) yield consistentIteration(ct.iterator) + iters.foreach(_.start()) + iters.foreach(_.join()) + } + //println("done with iterators") + inserter.join() + } + + "work on a yet unevaluated snapshot" in { + val sz = 50000 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.update(new Wrap(i), i) + + val snap = ct.snapshot() + val it = snap.iterator + + while (it.hasNext) it.next() + } + + "be duplicated" in { + val sz = 50 + val ct = collection.parallel.mutable.ParTrieMap((0 until sz) zip (0 until sz): _*) + val it = ct.splitter + for (_ <- 0 until (sz / 2)) it.next() + val dupit = it.dup + + it.toList shouldEqual dupit.toList + } + + } + +} diff --git a/tests/pending/run/ctries-old/lnode.scala b/tests/pending/run/ctries-old/lnode.scala new file mode 100644 index 000000000000..342aeca06e6a --- /dev/null +++ b/tests/pending/run/ctries-old/lnode.scala @@ -0,0 +1,62 @@ + + + +import collection.concurrent.TrieMap + +import Test.Spec + +object LNodeSpec extends Spec { + + val initsz = 1500 + val secondsz = 1750 + + def test(): Unit = { + "accept elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + } + + "lookup elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + for (i <- 0 until initsz) assert(ct.get(new DumbHash(i)) == Some(i)) + for (i <- initsz until secondsz) assert(ct.get(new DumbHash(i)) == None) + } + + "remove elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.update(new DumbHash(i), i) + for (i <- 0 until initsz) { + val remelem = ct.remove(new DumbHash(i)) + assert(remelem == Some(i), "removing " + i + " yields " + remelem) + } + for (i <- 0 until initsz) assert(ct.get(new DumbHash(i)) == None) + } + + "put elements with the same hash codes if absent" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) ct.put(new DumbHash(i), i) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) + for (i <- 0 until initsz) assert(ct.putIfAbsent(new DumbHash(i), i) == Some(i)) + for (i <- initsz until secondsz) assert(ct.putIfAbsent(new DumbHash(i), i) == None) + for (i <- initsz until secondsz) assert(ct.lookup(new DumbHash(i)) == i) + } + + "replace elements with the same hash codes" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) + for (i <- 0 until initsz) assert(ct.replace(new DumbHash(i), -i) == Some(i)) + for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == -i) + for (i <- 0 until initsz) assert(ct.replace(new DumbHash(i), -i, i) == true) + } + + "remove elements with the same hash codes if mapped to a specific value" in { + val ct = new TrieMap[DumbHash, Int] + for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) + for (i <- 0 until initsz) assert(ct.remove(new DumbHash(i), i) == true) + } + + } + +} diff --git a/tests/pending/run/ctries-old/main.scala b/tests/pending/run/ctries-old/main.scala new file mode 100644 index 000000000000..09401a371c0a --- /dev/null +++ b/tests/pending/run/ctries-old/main.scala @@ -0,0 +1,49 @@ + + + + + + + +@deprecated("Suppress warnings", since="2.11") +object Test { + + def main(args: Array[String]): Unit = { + ConcurrentMapSpec.test() + IteratorSpec.test() + LNodeSpec.test() + SnapshotSpec.test() + } + + + +trait Spec { + + implicit def implicitously: languageFeature.implicitConversions = scala.language.implicitConversions + implicit def reflectively : languageFeature.reflectiveCalls = scala.language.reflectiveCalls + + implicit def str2ops(s: String): AnyRef{def in[U](body: => U): Unit} = new { + def in[U](body: =>U): Unit = { + // just execute body + body + } + } + + implicit def any2ops(a: Any): AnyRef{def shouldEqual(other: Any): Unit} = new { + def shouldEqual(other: Any) = assert(a == other) + } + + def evaluating[U](body: =>U) = new { + def shouldProduce[T <: Throwable: ClassManifest]() = { + var produced = false + try body + catch { + case e: Throwable => if (e.getClass == implicitly[ClassManifest[T]].runtimeClass) produced = true + } finally { + assert(produced, "Did not produce exception of type: " + implicitly[ClassManifest[T]]) + } + } + } + +} +} diff --git a/tests/pending/run/ctries-old/snapshot.scala b/tests/pending/run/ctries-old/snapshot.scala new file mode 100644 index 000000000000..92232c7e49e0 --- /dev/null +++ b/tests/pending/run/ctries-old/snapshot.scala @@ -0,0 +1,268 @@ + + + + +import collection._ +import collection.concurrent.TrieMap + +import Test.Spec + + +object SnapshotSpec extends Spec { + + def test(): Unit = { + "support snapshots" in { + val ctn = new TrieMap + ctn.snapshot() + ctn.readOnlySnapshot() + + val ct = new TrieMap[Int, Int] + for (i <- 0 until 100) ct.put(i, i) + ct.snapshot() + ct.readOnlySnapshot() + } + + "empty 2 quiescent snapshots in isolation" in { + val sz = 4000 + + class Worker(trie: TrieMap[Wrap, Int]) extends Thread { + override def run(): Unit = { + for (i <- 0 until sz) { + assert(trie.remove(new Wrap(i)) == Some(i)) + for (j <- 0 until sz) + if (j <= i) assert(trie.get(new Wrap(j)) == None) + else assert(trie.get(new Wrap(j)) == Some(j)) + } + } + } + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct.put(new Wrap(i), i) + val snapt = ct.snapshot() + + val original = new Worker(ct) + val snapshot = new Worker(snapt) + original.start() + snapshot.start() + original.join() + snapshot.join() + + for (i <- 0 until sz) { + assert(ct.get(new Wrap(i)) == None) + assert(snapt.get(new Wrap(i)) == None) + } + } + + def consistentReadOnly(name: String, readonly: Map[Wrap, Int], sz: Int, N: Int): Unit = { + @volatile var e: Exception = null + + // reads possible entries once and stores them + // then reads all these N more times to check if the + // state stayed the same + class Reader(trie: Map[Wrap, Int]) extends Thread { + setName("Reader " + name) + + override def run() = + try check() + catch { + case ex: Exception => e = ex + } + + def check(): Unit = { + val initial = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) trie.get(new Wrap(i)) match { + case Some(i) => initial.put(new Wrap(i), i) + case None => // do nothing + } + + for (k <- 0 until N) { + for (i <- 0 until sz) { + val tres = trie.get(new Wrap(i)) + val ires = initial.get(new Wrap(i)) + if (tres != ires) println(i, "initially: " + ires, "traversal %d: %s".format(k, tres)) + assert(tres == ires) + } + } + } + } + + val reader = new Reader(readonly) + reader.start() + reader.join() + + if (e ne null) { + e.printStackTrace() + throw e + } + } + + // traverses the trie `rep` times and modifies each entry + class Modifier(trie: TrieMap[Wrap, Int], index: Int, rep: Int, sz: Int) extends Thread { + setName("Modifier %d".format(index)) + + override def run(): Unit = { + for (k <- 0 until rep) { + for (i <- 0 until sz) trie.putIfAbsent(new Wrap(i), i) match { + case Some(_) => trie.remove(new Wrap(i)) + case None => // do nothing + } + } + } + } + + // removes all the elements from the trie + class Remover(trie: TrieMap[Wrap, Int], index: Int, totremovers: Int, sz: Int) extends Thread { + setName("Remover %d".format(index)) + + override def run(): Unit = { + for (i <- 0 until sz) trie.remove(new Wrap((i + sz / totremovers * index) % sz)) + } + } + + "have a consistent quiescent read-only snapshot" in { + val sz = 10000 + val N = 100 + val W = 10 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val readonly = ct.readOnlySnapshot() + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + consistentReadOnly("qm", readonly, sz, N) + threads.foreach(_.join()) + } + + // now, we check non-quiescent snapshots, as these permit situations + // where a thread is caught in the middle of the update when a snapshot is taken + + "have a consistent non-quiescent read-only snapshot, concurrent with removes only" in { + val sz = 1250 + val W = 100 + val S = 5000 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Remover(ct, i, W, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) consistentReadOnly("non-qr", ct.readOnlySnapshot(), sz, 5) + threads.foreach(_.join()) + } + + "have a consistent non-quiescent read-only snapshot, concurrent with modifications" in { + val sz = 1000 + val N = 7000 + val W = 10 + val S = 7000 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) consistentReadOnly("non-qm", ct.readOnlySnapshot(), sz, 5) + threads.foreach(_.join()) + } + + def consistentNonReadOnly(name: String, trie: TrieMap[Wrap, Int], sz: Int, N: Int): Unit = { + @volatile var e: Exception = null + + // reads possible entries once and stores them + // then reads all these N more times to check if the + // state stayed the same + class Worker extends Thread { + setName("Worker " + name) + + override def run() = + try check() + catch { + case ex: Exception => e = ex + } + + def check(): Unit = { + val initial = mutable.Map[Wrap, Int]() + for (i <- 0 until sz) trie.get(new Wrap(i)) match { + case Some(i) => initial.put(new Wrap(i), i) + case None => // do nothing + } + + for (k <- 0 until N) { + // modify + for ((key, value) <- initial) { + val oldv = if (k % 2 == 0) value else -value + val newv = -oldv + trie.replace(key, oldv, newv) + } + + // check + for (i <- 0 until sz) if (initial.contains(new Wrap(i))) { + val expected = if (k % 2 == 0) -i else i + //println(trie.get(new Wrap(i))) + assert(trie.get(new Wrap(i)) == Some(expected)) + } else { + assert(trie.get(new Wrap(i)) == None) + } + } + } + } + + val worker = new Worker + worker.start() + worker.join() + + if (e ne null) { + e.printStackTrace() + throw e + } + } + + "have a consistent non-quiescent snapshot, concurrent with modifications" in { + val sz = 9000 + val N = 1000 + val W = 10 + val S = 400 + + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) + + threads.foreach(_.start()) + for (i <- 0 until S) { + consistentReadOnly("non-qm", ct.snapshot(), sz, 5) + consistentNonReadOnly("non-qsnap", ct.snapshot(), sz, 5) + } + threads.foreach(_.join()) + } + + "work when many concurrent snapshots are taken, concurrent with modifications" in { + val sz = 12000 + val W = 10 + val S = 10 + val modifytimes = 1200 + val snaptimes = 600 + val ct = new TrieMap[Wrap, Int] + for (i <- 0 until sz) ct(new Wrap(i)) = i + + class Snapshooter extends Thread { + setName("Snapshooter") + override def run(): Unit = { + for (k <- 0 until snaptimes) { + val snap = ct.snapshot() + for (i <- 0 until sz) snap.remove(new Wrap(i)) + for (i <- 0 until sz) assert(!snap.contains(new Wrap(i))) + } + } + } + + val mods = for (i <- 0 until W) yield new Modifier(ct, i, modifytimes, sz) + val shooters = for (i <- 0 until S) yield new Snapshooter + val threads = mods ++ shooters + threads.foreach(_.start()) + threads.foreach(_.join()) + } + + } + +} diff --git a/tests/pending/run/dead-code-elimination.flags b/tests/pending/run/dead-code-elimination.flags new file mode 100644 index 000000000000..49d036a8879c --- /dev/null +++ b/tests/pending/run/dead-code-elimination.flags @@ -0,0 +1 @@ +-optimize diff --git a/tests/pending/run/dead-code-elimination.scala b/tests/pending/run/dead-code-elimination.scala new file mode 100644 index 000000000000..fd3f2a996a20 --- /dev/null +++ b/tests/pending/run/dead-code-elimination.scala @@ -0,0 +1,33 @@ + +// This testcase is a snippet that did not compile correctly under +// pre-release 2.10.x. The relevant discussion around it can be +// found at: +// https://groups.google.com/forum/?fromgroups#!topic/scala-internals/qcyTjk8euUI[1-25] +// +// The reason it did not compile is related to the fact that ICode +// ops did not correctly define the stack entries they consumed and +// the dead code elimination phase was unable to correctly reconstruct +// the stack after code elimination. +// +// Originally, this did not compile, but I included it in the run +// tests because this was ASM-dependand and did not happen for GenJVM. +// +// Thus, we run the code and force the loading of class B -- if the +// bytecode is incorrect, it will fail the test. + +final class A { + def f1 = true + def f2 = true + @inline def f3 = f1 || f2 + class B { + def f() = 1 to 10 foreach (_ => f3) + } + def f = (new B).f() +} + +object Test { + def main(args: Array[String]): Unit = { + // force the loading of B + (new A).f + } +} diff --git a/tests/pending/run/deeps.check b/tests/pending/run/deeps.check new file mode 100644 index 000000000000..a68e474f62ab --- /dev/null +++ b/tests/pending/run/deeps.check @@ -0,0 +1,87 @@ +testEquals1 +false +false +true + +testEquals2 +false +false +true + +testEquals3 +x=Array(1) +y=Array(1) +false +false +true + +x=Array(Array(1), Array(1)) +y=Array(Array(1), Array(1)) +false +false +true + +x=Array(Array(Array(1), Array(1)), Array(Array(1), Array(1))) +y=Array(Array(Array(1), Array(1)), Array(Array(1), Array(1))) +false +false +true + +testEquals4 +false +false +true +false +false +true +Array(true, false) +Array(true, false) +[true;false] +true;false + +Array(Array(true, false), Array(true, false)) +Array(Array(true, false), Array(true, false)) +[Array(true, false);Array(true, false)] +Array(true, false);Array(true, false) + +Array(Array(Array(true, false), Array(true, false)), Array(Array(true, false), Array(true, false))) +Array(Array(Array(true, false), Array(true, false)), Array(Array(true, false), Array(true, false))) +[Array(Array(true, false), Array(true, false));Array(Array(true, false), Array(true, false))] +Array(Array(true, false), Array(true, false));Array(Array(true, false), Array(true, false)) + +Array(1.0, 0.0) +Array(1.0, 0.0) +[1.0;0.0] +1.0;0.0 + +Array(Array(1.0, 0.0), Array(1.0, 0.0)) +Array(Array(1.0, 0.0), Array(1.0, 0.0)) +[Array(1.0, 0.0);Array(1.0, 0.0)] +Array(1.0, 0.0);Array(1.0, 0.0) + +Array(Array(Array(1.0, 0.0), Array(1.0, 0.0)), Array(Array(1.0, 0.0), Array(1.0, 0.0))) +Array(Array(Array(1.0, 0.0), Array(1.0, 0.0)), Array(Array(1.0, 0.0), Array(1.0, 0.0))) +[Array(Array(1.0, 0.0), Array(1.0, 0.0));Array(Array(1.0, 0.0), Array(1.0, 0.0))] +Array(Array(1.0, 0.0), Array(1.0, 0.0));Array(Array(1.0, 0.0), Array(1.0, 0.0)) + +Array(a, b) +Array(a, b) +[a;b] +a;b + +Array(Array(a, b), Array(a, b)) +Array(Array(a, b), Array(a, b)) +[Array(a, b);Array(a, b)] +Array(a, b);Array(a, b) + +Array(Array(Array(a, b), Array(a, b)), Array(Array(a, b), Array(a, b))) +Array(Array(Array(a, b), Array(a, b)), Array(Array(a, b), Array(a, b))) +[Array(Array(a, b), Array(a, b));Array(Array(a, b), Array(a, b))] +Array(Array(a, b), Array(a, b));Array(Array(a, b), Array(a, b)) + +[Array(true, false); Array(false)] +[Array(1, 2); Array(3)] +[Array(1, 2); Array(3)] + +Array(boo, and, foo) +Array(a) diff --git a/tests/pending/run/deeps.scala b/tests/pending/run/deeps.scala new file mode 100644 index 000000000000..0cb6d623196b --- /dev/null +++ b/tests/pending/run/deeps.scala @@ -0,0 +1,114 @@ +//############################################################################ +// deepEquals / deep.toString +//############################################################################ + +//############################################################################ +// need to revisit array equqality +object Test { + + def testEquals1: Unit = { + println(Array(1) == Array(1)) + println(Array(1) equals Array(1)) + println(Array(1).deep == Array(1).deep) + println + } + + def testEquals2: Unit = { + println(Array(Array(1), Array(2)) == Array(Array(1), Array(2))) + println(Array(Array(1), Array(2)) equals Array(Array(1), Array(2))) + println(Array(Array(1), Array(2)).deep equals Array(Array(1), Array(2)).deep) + println + } + + def testEquals3: Unit = { + val a1 = Array(1) + val b1 = Array(1) + val a2 = Array(a1, b1) + val b2 = Array(a1, b1) + val a3 = Array(a2, b2) + val b3 = Array(a2, b2) + def test[T](x: Array[T], y: Array[T]): Unit = { + println("x=" + x.deep.toString) + println("y=" + y.deep.toString) + println(x == y) + println(x equals y) + println(x.deep == y.deep) + println + } + test(a1, b1) + test(a2, b2) + test(a3, b3) + } + + def testEquals4: Unit = { + println("boo:and:foo".split(':') == "boo:and:foo".split(':')) + println("boo:and:foo".split(':') equals "boo:and:foo".split(':')) + println("boo:and:foo".split(':').deep == "boo:and:foo".split(':').deep) + + val xs = new java.util.ArrayList[String](); xs.add("a") + val ys = new java.util.ArrayList[String](); ys.add("a") + println(xs.toArray == ys.toArray) + println(xs.toArray equals ys.toArray) + println(xs.toArray.deep == ys.toArray.deep) + } + + def testToString1: Unit = { + def sweep(s: String) = ( + s.replaceAll("D@[0-9a-fA-F]+", "D@0000000") + .replaceAll("Z@[0-9a-fA-F]+", "Z@0000000") + .replaceAll(";@[0-9a-fA-F]+", ";@0000000") + ) + def test[T](a: Array[T]): Unit = { + println(sweep(a.deep.toString)) + println(a.deep.toString) + println(a.deep.mkString("[", ";", "]")) + println(a.deep.mkString(";")) + println + } + + val ba1 = Array(true, false) + val ba2 = Array(ba1, ba1) + val ba3 = Array(ba2, ba2) + test(ba1) + test(ba2) + test(ba3) + + val da1 = Array(1.0d, 0.0d) + val da2 = Array(da1, da1) + val da3 = Array(da2, da2) + test(da1) + test(da2) + test(da3) + + val sa1 = Array("a", "b") + val sa2 = Array(sa1, sa1) + val sa3 = Array(sa2, sa2) + test(sa1) + test(sa2) + test(sa3) + } + + def testToString2: Unit = { + println(Array(Array(true, false), Array(false)).deep.mkString("[", "; ", "]")) + println(Array(Array('1', '2'), Array('3')).deep.mkString("[", "; ", "]")) + println(Array(Array(1, 2), Array(3)).deep.mkString("[", "; ", "]")) + println + } + + def testToString3: Unit = { + println("boo:and:foo".split(':').deep.toString) + + val xs = new java.util.ArrayList[String](); xs.add("a") + println(xs.toArray.deep.toString) + } + + def main(args: Array[String]): Unit = { + println("testEquals1") ; testEquals1 + println("testEquals2") ; testEquals2 + println("testEquals3") ; testEquals3 + println("testEquals4") ; testEquals4 + testToString1 + testToString2 + testToString3 + } +} diff --git a/tests/pending/run/delambdafy-dependent-on-param-subst-2.scala b/tests/pending/run/delambdafy-dependent-on-param-subst-2.scala new file mode 100644 index 000000000000..4f7b2dc6e7b4 --- /dev/null +++ b/tests/pending/run/delambdafy-dependent-on-param-subst-2.scala @@ -0,0 +1,20 @@ +trait M[-X] { + def m(x: X): Boolean +} + +class C +class A { class C } + +object Test { + def main(args: Array[String]): Unit = { + val a = new A + + // class O extends M[a.C] { def m(x: a.C) = true } + // (new O: M[Null]).m(null) // Okay + + ((a: A) => { + class N extends M[a.C] { def m(x: a.C) = true } + new N: M[Null] + }).apply(a).m(null) // NPE, missing bridge + } +} diff --git a/tests/pending/run/delambdafy-dependent-on-param-subst.flags b/tests/pending/run/delambdafy-dependent-on-param-subst.flags new file mode 100644 index 000000000000..2b27e1983084 --- /dev/null +++ b/tests/pending/run/delambdafy-dependent-on-param-subst.flags @@ -0,0 +1 @@ +-Ydelambdafy:method \ No newline at end of file diff --git a/tests/pending/run/delambdafy-dependent-on-param-subst.scala b/tests/pending/run/delambdafy-dependent-on-param-subst.scala new file mode 100644 index 000000000000..4f7b2dc6e7b4 --- /dev/null +++ b/tests/pending/run/delambdafy-dependent-on-param-subst.scala @@ -0,0 +1,20 @@ +trait M[-X] { + def m(x: X): Boolean +} + +class C +class A { class C } + +object Test { + def main(args: Array[String]): Unit = { + val a = new A + + // class O extends M[a.C] { def m(x: a.C) = true } + // (new O: M[Null]).m(null) // Okay + + ((a: A) => { + class N extends M[a.C] { def m(x: a.C) = true } + new N: M[Null] + }).apply(a).m(null) // NPE, missing bridge + } +} diff --git a/tests/pending/run/delambdafy-nested-by-name.check b/tests/pending/run/delambdafy-nested-by-name.check new file mode 100644 index 000000000000..94954abda49d --- /dev/null +++ b/tests/pending/run/delambdafy-nested-by-name.check @@ -0,0 +1,2 @@ +hello +world diff --git a/tests/pending/run/delambdafy-nested-by-name.scala b/tests/pending/run/delambdafy-nested-by-name.scala new file mode 100644 index 000000000000..37aa86a0477c --- /dev/null +++ b/tests/pending/run/delambdafy-nested-by-name.scala @@ -0,0 +1,11 @@ +// during development of delayed delambdafication I created a bug where calling a by-name method with a by-name argument that +// itself contained a by-name argument would cause a class cast exception. That bug wasn't found in the existing test suite +// so this test covers that case +object Test { + def meth1(arg1: => String) = arg1 + def meth2(arg2: => String) = meth1({println("hello"); arg2}) + + def main(args: Array[String]): Unit = { + println(meth2("world")) + } +} diff --git a/tests/pending/run/delambdafy-two-lambdas.check b/tests/pending/run/delambdafy-two-lambdas.check new file mode 100644 index 000000000000..ed9ea404dd7f --- /dev/null +++ b/tests/pending/run/delambdafy-two-lambdas.check @@ -0,0 +1,2 @@ +13 +24 diff --git a/tests/pending/run/delambdafy-two-lambdas.scala b/tests/pending/run/delambdafy-two-lambdas.scala new file mode 100644 index 000000000000..decede74a44a --- /dev/null +++ b/tests/pending/run/delambdafy-two-lambdas.scala @@ -0,0 +1,12 @@ +/* + * Tests if two lambdas defined in the same class do not lead to + * name clashes. + */ +object Test { + def takeLambda(f: Int => Int ): Int = f(12) + + def main(args: Array[String]): Unit = { + println(takeLambda(x => x+1)) + println(takeLambda(x => x*2)) + } +} diff --git a/tests/pending/run/delambdafyLambdaClassNames.check b/tests/pending/run/delambdafyLambdaClassNames.check new file mode 100644 index 000000000000..d425d15dd0b6 --- /dev/null +++ b/tests/pending/run/delambdafyLambdaClassNames.check @@ -0,0 +1 @@ +A$$nestedInAnon$1$lambda$$run$1 diff --git a/tests/pending/run/delambdafyLambdaClassNames.flags b/tests/pending/run/delambdafyLambdaClassNames.flags new file mode 100644 index 000000000000..b10233d3226f --- /dev/null +++ b/tests/pending/run/delambdafyLambdaClassNames.flags @@ -0,0 +1 @@ +-Ybackend:GenBCode -Ydelambdafy:method \ No newline at end of file diff --git a/tests/pending/run/delambdafyLambdaClassNames/A_1.scala b/tests/pending/run/delambdafyLambdaClassNames/A_1.scala new file mode 100644 index 000000000000..10489414b77d --- /dev/null +++ b/tests/pending/run/delambdafyLambdaClassNames/A_1.scala @@ -0,0 +1,5 @@ +class A { + def f = new Runnable { + def run(): Unit = List(1,2).foreach(println) + } +} diff --git a/tests/pending/run/delambdafyLambdaClassNames/Test.scala b/tests/pending/run/delambdafyLambdaClassNames/Test.scala new file mode 100644 index 000000000000..92a3d621c500 --- /dev/null +++ b/tests/pending/run/delambdafyLambdaClassNames/Test.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val c = Class.forName("A$$nestedInAnon$1$lambda$$run$1") + println(c.getName) +} diff --git a/tests/pending/run/delambdafy_t6028.check b/tests/pending/run/delambdafy_t6028.check new file mode 100644 index 000000000000..7bd8cd720232 --- /dev/null +++ b/tests/pending/run/delambdafy_t6028.check @@ -0,0 +1,57 @@ +[[syntax trees at end of lambdalift]] // newSource1.scala +package { + class T extends Object { + private[this] val classParam: Int = _; + def (classParam: Int): T = { + T.super.(); + () + }; + private[this] val field: Int = 0; + def field(): Int = T.this.field; + def foo(methodParam: Int): Function0 = { + val methodLocal: Int = 0; + { + (() => T.this.$anonfun$1(methodParam, methodLocal)).$asInstanceOf[Function0]() + } + }; + def bar(barParam: Int): Object = { + @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = scala.runtime.VolatileObjectRef.zero(); + T.this.MethodLocalObject$1(barParam, MethodLocalObject$module) + }; + def tryy(tryyParam: Int): Function0 = { + var tryyLocal: runtime.IntRef = scala.runtime.IntRef.create(0); + { + (() => T.this.$anonfun$2(tryyParam, tryyLocal)).$asInstanceOf[Function0]() + } + }; + final private[this] def $anonfun$1(methodParam$1: Int, methodLocal$1: Int): Int = T.this.classParam.+(T.this.field()).+(methodParam$1).+(methodLocal$1); + abstract trait MethodLocalTrait$1 extends Object { + def $outer(): T + }; + object MethodLocalObject$2 extends Object with T#MethodLocalTrait$1 { + def ($outer: T, barParam$1: Int): T#MethodLocalObject$2.type = { + MethodLocalObject$2.super.(); + MethodLocalObject$2.this.$asInstanceOf[T#MethodLocalTrait$1$class]()./*MethodLocalTrait$1$class*/$init$(barParam$1); + () + }; + private[this] val $outer: T = _; + def $outer(): T = MethodLocalObject$2.this.$outer; + def $outer(): T = MethodLocalObject$2.this.$outer + }; + final private[this] def MethodLocalObject$1(barParam$1: Int, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = { + MethodLocalObject$module$1.elem = new T#MethodLocalObject$2.type(T.this, barParam$1); + MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]() + }; + abstract trait MethodLocalTrait$1$class extends Object with T#MethodLocalTrait$1 { + def /*MethodLocalTrait$1$class*/$init$(barParam$1: Int): Unit = { + () + }; + scala.this.Predef.print(scala.Int.box(barParam$1)) + }; + final private[this] def $anonfun$2(tryyParam$1: Int, tryyLocal$1: runtime.IntRef): Unit = try { + tryyLocal$1.elem = tryyParam$1 + } finally () + } +} + +warning: there was one feature warning; re-run with -feature for details diff --git a/tests/pending/run/delambdafy_t6028.scala b/tests/pending/run/delambdafy_t6028.scala new file mode 100644 index 000000000000..0b7ef48c3df8 --- /dev/null +++ b/tests/pending/run/delambdafy_t6028.scala @@ -0,0 +1,21 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Ydelambdafy:method -Xprint:lambdalift -d " + testOutput.path + + override def code = """class T(classParam: Int) { + | val field: Int = 0 + | def foo(methodParam: Int) = {val methodLocal = 0 ; () => classParam + field + methodParam + methodLocal } + | def bar(barParam: Int) = { trait MethodLocalTrait { print(barParam) }; object MethodLocalObject extends MethodLocalTrait; MethodLocalObject } + | def tryy(tryyParam: Int) = { var tryyLocal = 0; () => try { tryyLocal = tryyParam } finally () } + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delambdafy_t6555.check b/tests/pending/run/delambdafy_t6555.check new file mode 100644 index 000000000000..6b174c0d2abf --- /dev/null +++ b/tests/pending/run/delambdafy_t6555.check @@ -0,0 +1,15 @@ +[[syntax trees at end of specialize]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + private[this] val f: Int => Int = { + final def $anonfun(param: Int): Int = param; + ((param: Int) => $anonfun(param)) + }; + def f(): Int => Int = Foo.this.f + } +} + diff --git a/tests/pending/run/delambdafy_t6555.scala b/tests/pending/run/delambdafy_t6555.scala new file mode 100644 index 000000000000..a1dcfe790c3b --- /dev/null +++ b/tests/pending/run/delambdafy_t6555.scala @@ -0,0 +1,15 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:specialize -Ydelambdafy:method -d " + testOutput.path + + override def code = "class Foo { val f = (param: Int) => param } " + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delambdafy_uncurry_byname_inline.check b/tests/pending/run/delambdafy_uncurry_byname_inline.check new file mode 100644 index 000000000000..d96a995f4479 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_byname_inline.check @@ -0,0 +1,21 @@ +[[syntax trees at end of uncurry]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + def bar(x: () => Int): Int = x.apply(); + def foo(): Int = Foo.this.bar({ + @SerialVersionUID(value = 0) final class $anonfun extends scala.runtime.AbstractFunction0[Int] with Serializable { + def (): <$anon: () => Int> = { + $anonfun.super.(); + () + }; + final def apply(): Int = 1 + }; + (new <$anon: () => Int>(): () => Int) + }) + } +} + diff --git a/tests/pending/run/delambdafy_uncurry_byname_inline.scala b/tests/pending/run/delambdafy_uncurry_byname_inline.scala new file mode 100644 index 000000000000..8f480fa80488 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_byname_inline.scala @@ -0,0 +1,20 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:inline -d " + testOutput.path + + override def code = """class Foo { + | def bar(x: => Int) = x + | + | def foo = bar(1) + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delambdafy_uncurry_byname_method.check b/tests/pending/run/delambdafy_uncurry_byname_method.check new file mode 100644 index 000000000000..cd3edc7d6f77 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_byname_method.check @@ -0,0 +1,15 @@ +[[syntax trees at end of uncurry]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + def bar(x: () => Int): Int = x.apply(); + def foo(): Int = Foo.this.bar({ + final def $anonfun(): Int = 1; + (() => $anonfun()) + }) + } +} + diff --git a/tests/pending/run/delambdafy_uncurry_byname_method.scala b/tests/pending/run/delambdafy_uncurry_byname_method.scala new file mode 100644 index 000000000000..1adeec843390 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_byname_method.scala @@ -0,0 +1,20 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path + + override def code = """class Foo { + | def bar(x: => Int) = x + | + | def foo = bar(1) + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delambdafy_uncurry_inline.check b/tests/pending/run/delambdafy_uncurry_inline.check new file mode 100644 index 000000000000..5521cc4a2cc3 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_inline.check @@ -0,0 +1,23 @@ +[[syntax trees at end of uncurry]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + def bar(): Unit = { + val f: Int => Int = { + @SerialVersionUID(value = 0) final class $anonfun extends scala.runtime.AbstractFunction1[Int,Int] with Serializable { + def (): <$anon: Int => Int> = { + $anonfun.super.(); + () + }; + final def apply(x: Int): Int = x.+(1) + }; + (new <$anon: Int => Int>(): Int => Int) + }; + () + } + } +} + diff --git a/tests/pending/run/delambdafy_uncurry_inline.scala b/tests/pending/run/delambdafy_uncurry_inline.scala new file mode 100644 index 000000000000..b42b65f5bbda --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_inline.scala @@ -0,0 +1,20 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:inline -d " + testOutput.path + + override def code = """class Foo { + | def bar = { + | val f = {x: Int => x + 1} + | } + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delambdafy_uncurry_method.check b/tests/pending/run/delambdafy_uncurry_method.check new file mode 100644 index 000000000000..5ee3d174b3a0 --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_method.check @@ -0,0 +1,17 @@ +[[syntax trees at end of uncurry]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + def bar(): Unit = { + val f: Int => Int = { + final def $anonfun(x: Int): Int = x.+(1); + ((x: Int) => $anonfun(x)) + }; + () + } + } +} + diff --git a/tests/pending/run/delambdafy_uncurry_method.scala b/tests/pending/run/delambdafy_uncurry_method.scala new file mode 100644 index 000000000000..a988fb2ee7bf --- /dev/null +++ b/tests/pending/run/delambdafy_uncurry_method.scala @@ -0,0 +1,20 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path + + override def code = """class Foo { + | def bar = { + | val f = {x: Int => x + 1} + | } + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/delay-bad.check b/tests/pending/run/delay-bad.check new file mode 100644 index 000000000000..cb6e329f7ac8 --- /dev/null +++ b/tests/pending/run/delay-bad.check @@ -0,0 +1,54 @@ +delay-bad.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + f(new C { 5 }) + ^ +delay-bad.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + f(new { val x = 5 } with E() { 5 }) + ^ +warning: there was one deprecation warning; re-run with -deprecation for details + + +// new C { } +-A -B -C + +// new C { 5 } +-A -B -C + A+ B+ C+ + +// new D() +-A -B -C -D + A+ B+ C+ D+ + +// new D() { } +-A -B -C -D + A+ B+ C+ D+ + +// new D() { val x = 5 } +-A -B -C -D + A+ B+ C+ D+ + A+ B+ C+ D+ + +// new { val x = 5 } with D() +-A -B -C -D + A+ B+ C+ D+ + +// new E() { val x = 5 } +-A -B -C -D + A+ B+ C+ D+ E+ -E + A+ B+ C+ D+ E+ + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() +-A -B -C -D + A+ B+ C+ D+ E+ -E + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() { } +-A -B -C -D + A+ B+ C+ D+ E+ -E + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() { 5 } +-A -B -C -D + A+ B+ C+ D+ E+ -E + A+ B+ C+ D+ E+ + A+ B+ C+ D+ E+ diff --git a/tests/pending/run/delay-bad.scala b/tests/pending/run/delay-bad.scala new file mode 100644 index 000000000000..f29155109f82 --- /dev/null +++ b/tests/pending/run/delay-bad.scala @@ -0,0 +1,97 @@ +trait A extends DelayedInit +{ + print("-A") + + def delayedInit(body: => Unit) = { + body + postConstructionCode + } + def postConstructionCode: Unit = { + print("\n A+") + } +} +trait B extends A { + print(" -B") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" B+") + } +} + +trait C extends B { + print(" -C") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" C+") + } +} + +class D() extends C { + print(" -D") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" D+") + } +} +class E() extends D() { + print(" -E") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" E+") + } +} + +object Test { + def p(msg: String) = println("\n\n// " + msg) + + def main(args: Array[String]): Unit = { + val f: A => Unit = _ => () + + p("new C { }") + f(new C { }) + p("new C { 5 }") + f(new C { 5 }) + + p("new D()") + f(new D()) + p("new D() { }") + f(new D() { }) + + p("new D() { val x = 5 }") + f(new D() { val x = 5 }) + p("new { val x = 5 } with D()") + f(new D() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +}) + + p("new E() { val x = 5 }") + f(new E() { val x = 5 }) + p("new { val x = 5 } with E()") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +}) + + p("new { val x = 5 } with E() { }") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + }) + p("new { val x = 5 } with E() { 5 }") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + 5 }) + + println("") + } +} diff --git a/tests/pending/run/delay-good.check b/tests/pending/run/delay-good.check new file mode 100644 index 000000000000..b4f6b04af7cb --- /dev/null +++ b/tests/pending/run/delay-good.check @@ -0,0 +1,47 @@ +delay-good.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + f(new C { 5 }) + ^ +delay-good.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + f(new { val x = 5 } with E() { 5 }) + ^ + + +// new C { } +-A -B -C + A+ B+ C+ + +// new C { 5 } +-A -B -C + A+ B+ C+ + +// new D() +-A -B -C -D + A+ B+ C+ D+ + +// new D() { } +-A -B -C -D + A+ B+ C+ D+ + +// new D() { val x = 5 } +-A -B -C -D + A+ B+ C+ D+ + +// new { val x = 5 } with D() +-A -B -C -D + A+ B+ C+ D+ + +// new E() { val x = 5 } +-A -B -C -D -E + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() +-A -B -C -D -E + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() { } +-A -B -C -D -E + A+ B+ C+ D+ E+ + +// new { val x = 5 } with E() { 5 } +-A -B -C -D -E + A+ B+ C+ D+ E+ diff --git a/tests/pending/run/delay-good.scala b/tests/pending/run/delay-good.scala new file mode 100644 index 000000000000..dbeb993a5820 --- /dev/null +++ b/tests/pending/run/delay-good.scala @@ -0,0 +1,97 @@ +trait A +{ + print("-A") + + def delayedInit(body: => Unit) = { + body + postConstructionCode + } + def postConstructionCode: Unit = { + print("\n A+") + } +} +trait B extends A { + print(" -B") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" B+") + } +} + +trait C extends B { + print(" -C") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" C+") + } +} + +class D() extends C { + print(" -D") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" D+") + } +} +class E() extends D() { + print(" -E") + override def postConstructionCode: Unit = { + super.postConstructionCode + print(" E+") + } +} + +object Test { + def p(msg: String) = println("\n\n// " + msg) + + def main(args: Array[String]): Unit = { + val f: A => Unit = _.postConstructionCode + + p("new C { }") + f(new C { }) + p("new C { 5 }") + f(new C { 5 }) + + p("new D()") + f(new D()) + p("new D() { }") + f(new D() { }) + + p("new D() { val x = 5 }") + f(new D() { val x = 5 }) + p("new { val x = 5 } with D()") + f(new D() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +}) + + p("new E() { val x = 5 }") + f(new E() { val x = 5 }) + p("new { val x = 5 } with E()") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +}) + + p("new { val x = 5 } with E() { }") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + }) + p("new { val x = 5 } with E() { 5 }") + f(new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + 5 }) + + println("") + } +} diff --git a/tests/pending/run/deprecate-early-type-defs.check b/tests/pending/run/deprecate-early-type-defs.check new file mode 100644 index 000000000000..1ee01df13e4b --- /dev/null +++ b/tests/pending/run/deprecate-early-type-defs.check @@ -0,0 +1,3 @@ +deprecate-early-type-defs.scala:1: warning: early type members are deprecated. Move them to the regular body: the semantics are the same. +object Test extends { type T = Int } with App + ^ diff --git a/tests/pending/run/deprecate-early-type-defs.flags b/tests/pending/run/deprecate-early-type-defs.flags new file mode 100644 index 000000000000..c36e713ab84b --- /dev/null +++ b/tests/pending/run/deprecate-early-type-defs.flags @@ -0,0 +1 @@ +-deprecation \ No newline at end of file diff --git a/tests/pending/run/deprecate-early-type-defs.scala b/tests/pending/run/deprecate-early-type-defs.scala new file mode 100644 index 000000000000..e617ee54f895 --- /dev/null +++ b/tests/pending/run/deprecate-early-type-defs.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +type T = Int +// END copied early initializers +} diff --git a/tests/pending/run/distinct.check b/tests/pending/run/distinct.check new file mode 100644 index 000000000000..b0883f382e1a --- /dev/null +++ b/tests/pending/run/distinct.check @@ -0,0 +1 @@ +abcdefghijklmnopqrstuvwxyz diff --git a/tests/pending/run/distinct.scala b/tests/pending/run/distinct.scala new file mode 100644 index 000000000000..0b8971e8a98a --- /dev/null +++ b/tests/pending/run/distinct.scala @@ -0,0 +1,15 @@ +/** This is a test to make sure distinct always + * returns the first of any duplicated element. + */ +object Test { + val alphabet = 'a' to 'z' mkString "" + val alphaList = ('a' to 'z').toList + def shuffled = util.Random.shuffle(alphaList) + + def main(args: Array[String]): Unit = { + val longList = alphaList ++ (1 to 9 flatMap (_ => shuffled)) + val result = longList.distinct mkString "" + + println(result) + } +} diff --git a/tests/pending/run/duplicate-meth.check b/tests/pending/run/duplicate-meth.check new file mode 100644 index 000000000000..099250280658 --- /dev/null +++ b/tests/pending/run/duplicate-meth.check @@ -0,0 +1 @@ +verified! diff --git a/tests/pending/run/duplicate-meth.scala b/tests/pending/run/duplicate-meth.scala new file mode 100644 index 000000000000..481c869d9e4a --- /dev/null +++ b/tests/pending/run/duplicate-meth.scala @@ -0,0 +1,23 @@ + +trait Base { + private val secure_# = 10l +} + +class TestUser extends Base { + def clsMeth(x: Int) = x + private def foo(x: Int) = x +} + +object TestUser extends TestUser { + def objMeth = "a" + + private def foo(x: Int) = x +} + +object Test { + def main(args: Array[String]): Unit = { + TestUser.objMeth + // no-op, just check that it passes verification + println("verified!") + } +} diff --git a/tests/pending/run/duration-coarsest.scala b/tests/pending/run/duration-coarsest.scala new file mode 100644 index 000000000000..229b7960b2ba --- /dev/null +++ b/tests/pending/run/duration-coarsest.scala @@ -0,0 +1,28 @@ +import scala.concurrent.duration._ +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + List( + (60 minutes, 1 hour), + (2000 millis, 2 seconds), + (2000 micros, 2 millis), + (2000 nanos, 2 micros), + (2000000 nanos, 2 millis), + (48 hours, 2 days), + (5 seconds, 5 seconds), + (1 second, 1 second) + ) foreach { + case (x, expected) => + val actual = x.toCoarsest + assert(actual.unit == expected.unit, s"$actual, $expected") + assert(actual.length == expected.length, s"$actual, $expected") + } + + List( + 45 minutes, + 500 millis, + 1500 millis, + 23 hours, + 40 days + ) foreach (x => assert(x == x.toCoarsest, x)) +} diff --git a/tests/pending/run/dynamic-anyval.check b/tests/pending/run/dynamic-anyval.check new file mode 100644 index 000000000000..dee7bef8e80f --- /dev/null +++ b/tests/pending/run/dynamic-anyval.check @@ -0,0 +1,4 @@ +().dingo(bippy, 5) +List(1, 2, 3).dingo(bippy, 5) +().dingo(bippy, 5) +List(1, 2, 3).dingo(bippy, 5) diff --git a/tests/pending/run/dynamic-anyval.scala b/tests/pending/run/dynamic-anyval.scala new file mode 100644 index 000000000000..605503d3776d --- /dev/null +++ b/tests/pending/run/dynamic-anyval.scala @@ -0,0 +1,22 @@ +import scala.language.dynamics + +object Test { + implicit class DynamicValue[T](val value: T) extends AnyVal with Dynamic { + def applyDynamic(name: String)(args: Any*) = println(s"""$this.$name(${args mkString ", "})""") + override def toString = "" + value + } + implicit class DynamicValue2[T](val value: T) extends Dynamic { + def applyDynamic(name: String)(args: Any*) = println(s"""$this.$name(${args mkString ", "})""") + override def toString = "" + value + } + + def f[T](x: DynamicValue[T]) = x.dingo("bippy", 5) + def g[T](x: DynamicValue2[T]) = x.dingo("bippy", 5) + + def main(args: Array[String]): Unit = { + f(()) + f(List(1, 2, 3)) + g(()) + g(List(1, 2, 3)) + } +} diff --git a/tests/pending/run/dynamic-applyDynamic.check b/tests/pending/run/dynamic-applyDynamic.check new file mode 100644 index 000000000000..ae6996f8fc27 --- /dev/null +++ b/tests/pending/run/dynamic-applyDynamic.check @@ -0,0 +1,14 @@ +[[syntax trees at end of typer]] // newSource1.scala +[0:67]package [0:0] { + [0:67]object X extends [9:67][67]scala.AnyRef { + [67]def (): [9]X.type = [67]{ + [67][67][67]X.super.(); + [9]() + }; + [17:30]private[this] val d: [21]D = [25:30][25:30][25:30]new [29:30]D(); + [21] def d: [21]D = [21][21]X.this.d; + [37:49][37:38][37:38][37]X.this.d.applyDynamic(<39:45>"method")([46:48]10); + [56:61]<56:57><56:57>[56]X.this.d.applyDynamic(<56:57>"apply")([58:60]10) + } +} + diff --git a/tests/pending/run/dynamic-applyDynamic.scala b/tests/pending/run/dynamic-applyDynamic.scala new file mode 100644 index 000000000000..b06041194c1e --- /dev/null +++ b/tests/pending/run/dynamic-applyDynamic.scala @@ -0,0 +1,26 @@ +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + override def extraSettings: String = + s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + + override def code = """ + object X { + val d = new D + d.method(10) + d(10) + } + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} + +import language.dynamics +class D extends Dynamic { + def applyDynamic(name: String)(value: Any) = ??? +} \ No newline at end of file diff --git a/tests/pending/run/dynamic-applyDynamicNamed.check b/tests/pending/run/dynamic-applyDynamicNamed.check new file mode 100644 index 000000000000..c4e050ba17a4 --- /dev/null +++ b/tests/pending/run/dynamic-applyDynamicNamed.check @@ -0,0 +1,14 @@ +[[syntax trees at end of typer]] // newSource1.scala +[0:97]package [0:0] { + [0:97]object X extends [9:97][97]scala.AnyRef { + [97]def (): [9]X.type = [97]{ + [97][97][97]X.super.(); + [9]() + }; + [17:30]private[this] val d: [21]D = [25:30][25:30][25:30]new [29:30]D(); + [21] def d: [21]D = [21][21]X.this.d; + [37:70][37:38][37:38][37]X.this.d.applyDynamicNamed(<39:43>"meth")([44:55][44][44]scala.Tuple2.apply[[44]String, [44]Int]([44:50]"value1", [53:55]10), [57:69][57][57]scala.Tuple2.apply[[57]String, [57]Int]([57:63]"value2", [66:69]100)); + [77:91]<77:78><77:78>[77]X.this.d.applyDynamicNamed(<77:78>"apply")([79:90][79][79]scala.Tuple2.apply[[79]String, [79]Int]([79:85]"value1", [88:90]10)) + } +} + diff --git a/tests/pending/run/dynamic-applyDynamicNamed.scala b/tests/pending/run/dynamic-applyDynamicNamed.scala new file mode 100644 index 000000000000..cc59f9058be9 --- /dev/null +++ b/tests/pending/run/dynamic-applyDynamicNamed.scala @@ -0,0 +1,26 @@ +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + override def extraSettings: String = + s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + + override def code = """ + object X { + val d = new D + d.meth(value1 = 10, value2 = 100) + d(value1 = 10) + } + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} + +import language.dynamics +class D extends Dynamic { + def applyDynamicNamed(name: String)(value: (String, Any)*) = ??? +} diff --git a/tests/pending/run/dynamic-selectDynamic.check b/tests/pending/run/dynamic-selectDynamic.check new file mode 100644 index 000000000000..9635ca4e6f74 --- /dev/null +++ b/tests/pending/run/dynamic-selectDynamic.check @@ -0,0 +1,13 @@ +[[syntax trees at end of typer]] // newSource1.scala +[0:50]package [0:0] { + [0:50]object X extends [9:50][50]scala.AnyRef { + [50]def (): [9]X.type = [50]{ + [50][50][50]X.super.(); + [9]() + }; + [17:30]private[this] val d: [21]D = [25:30][25:30][25:30]new [29:30]D(); + [21] def d: [21]D = [21][21]X.this.d; + [37:38][37:38][37]X.this.d.selectDynamic(<39:44>"field") + } +} + diff --git a/tests/pending/run/dynamic-selectDynamic.scala b/tests/pending/run/dynamic-selectDynamic.scala new file mode 100644 index 000000000000..bd6c138c5002 --- /dev/null +++ b/tests/pending/run/dynamic-selectDynamic.scala @@ -0,0 +1,25 @@ +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + override def extraSettings: String = + s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + + override def code = """ + object X { + val d = new D + d.field + } + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} + +import language.dynamics +class D extends Dynamic { + def selectDynamic(name: String) = ??? +} diff --git a/tests/pending/run/dynamic-updateDynamic.check b/tests/pending/run/dynamic-updateDynamic.check new file mode 100644 index 000000000000..154fea34cb69 --- /dev/null +++ b/tests/pending/run/dynamic-updateDynamic.check @@ -0,0 +1,14 @@ +[[syntax trees at end of typer]] // newSource1.scala +[0:69]package [0:0] { + [0:69]object X extends [9:69][69]scala.AnyRef { + [69]def (): [9]X.type = [69]{ + [69][69][69]X.super.(); + [9]() + }; + [17:30]private[this] val d: [21]D = [25:30][25:30][25:30]new [29:30]D(); + [21] def d: [21]D = [21][21]X.this.d; + [37:49][37:38][37:38][37]X.this.d.updateDynamic(<39:44>"field")([47:49]10); + [56:57][56:57][56]X.this.d.selectDynamic(<58:63>"field") + } +} + diff --git a/tests/pending/run/dynamic-updateDynamic.scala b/tests/pending/run/dynamic-updateDynamic.scala new file mode 100644 index 000000000000..80fe0ea35f4c --- /dev/null +++ b/tests/pending/run/dynamic-updateDynamic.scala @@ -0,0 +1,28 @@ +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + override def extraSettings: String = + s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + + override def code = """ + object X { + val d = new D + d.field = 10 + d.field + } + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} + +import language.dynamics +class D extends Dynamic { + def selectDynamic(name: String): Any = ??? + def updateDynamic(name: String)(value: Any): Unit = ??? +} + diff --git a/tests/pending/run/elidable-noflags.check b/tests/pending/run/elidable-noflags.check new file mode 100644 index 000000000000..23be9ab4efcd --- /dev/null +++ b/tests/pending/run/elidable-noflags.check @@ -0,0 +1,7 @@ +Good for me, I was not elided. +Good for me, I was not elided. +Good for me, I was not elided. +Good for me, I was not elided. +Good for me, I was not elided. +Good for me, I was not elided. +ESPECIALLY good for me, I was not elided. diff --git a/tests/pending/run/elidable-noflags.scala b/tests/pending/run/elidable-noflags.scala new file mode 100644 index 000000000000..1b9c5118bb3d --- /dev/null +++ b/tests/pending/run/elidable-noflags.scala @@ -0,0 +1,22 @@ +import annotation._ +import elidable._ + +object Test { + @elidable(FINEST) def f1() = println("Good for me, I was not elided.") + @elidable(INFO) def f2() = println("Good for me, I was not elided.") + @elidable(SEVERE) def f3() = println("Good for me, I was not elided.") + @elidable(INFO) def f4() = println("Good for me, I was not elided.") + @elidable(100000) def f5() = println("Good for me, I was not elided.") + @elidable(OFF) def f6() = println("Good for me, I was not elided.") + @elidable(ALL) def f7() = println("ESPECIALLY good for me, I was not elided.") + + def main(args: Array[String]): Unit = { + f1() + f2() + f3() + f4() + f5() + f6() + f7() + } +} diff --git a/tests/pending/run/elidable-opt.check b/tests/pending/run/elidable-opt.check new file mode 100644 index 000000000000..88cf98e0d11f --- /dev/null +++ b/tests/pending/run/elidable-opt.check @@ -0,0 +1,14 @@ +Good for me, I was not elided. Test.f3 +Good for me, I was not elided. O.f3 +Good for me, I was not elided. C.f1 +Good for me, I was not elided. C.f2 +() +false +0 +0 +0 +0 +0 +0.0 +0.0 +null diff --git a/tests/pending/run/elidable-opt.flags b/tests/pending/run/elidable-opt.flags new file mode 100644 index 000000000000..62897ff2186a --- /dev/null +++ b/tests/pending/run/elidable-opt.flags @@ -0,0 +1 @@ +-optimise -Xelide-below 900 diff --git a/tests/pending/run/elidable-opt.scala b/tests/pending/run/elidable-opt.scala new file mode 100644 index 000000000000..7f3b8011dbeb --- /dev/null +++ b/tests/pending/run/elidable-opt.scala @@ -0,0 +1,85 @@ +import annotation._ +import elidable._ + +trait T { + @elidable(FINEST) def f1(): Unit + @elidable(SEVERE) def f2(): Unit + @elidable(FINEST) def f3() = assert(false, "Should have been elided.") + def f4(): Unit +} + +class C extends T { + def f1() = println("Good for me, I was not elided. C.f1") + def f2() = println("Good for me, I was not elided. C.f2") + @elidable(FINEST) def f4() = assert(false, "Should have been elided.") +} + +object O { + @elidable(FINEST) def f1() = assert(false, "Should have been elided.") + @elidable(INFO) def f2() = assert(false, "Should have been elided.") + @elidable(SEVERE) def f3() = println("Good for me, I was not elided. O.f3") + @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).") +} + +object Test { + @elidable(FINEST) def f1() = assert(false, "Should have been elided.") + @elidable(INFO) def f2() = assert(false, "Should have been elided.") + @elidable(SEVERE) def f3() = println("Good for me, I was not elided. Test.f3") + @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).") + + @elidable(FINEST) def f5() = {} + @elidable(FINEST) def f6() = true + @elidable(FINEST) def f7() = 1:Byte + @elidable(FINEST) def f8() = 1:Short + @elidable(FINEST) def f9() = 1:Char + @elidable(FINEST) def fa() = 1 + @elidable(FINEST) def fb() = 1l + @elidable(FINEST) def fc() = 1.0f + @elidable(FINEST) def fd() = 1.0 + @elidable(FINEST) def fe() = "s" + + def main(args: Array[String]): Unit = { + f1() + f2() + f3() + f4 + O.f1() + O.f2() + O.f3() + O.f4 + + val c = new C + c.f1() + c.f2() + c.f3() + c.f4() + + // make sure a return value is still available when eliding a call + println(f5()) + println(f6()) + println(f7()) + println(f8()) + println(f9().toInt) + println(fa()) + println(fb()) + println(fc()) + println(fd()) + println(fe()) + + // this one won't show up in the output because a call to f1 is elidable when accessed through T + (c:T).f1() + + // Test whether the method definitions are still available. + List("Test", "Test$", "O", "O$", "C", "T") foreach { className => + List("f1", "f2", "f3", "f4") foreach { methodName => + Class.forName(className).getMethod(methodName) + } + } + List("Test", "Test$") foreach { className => + List("f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe") foreach { methodName => + Class.forName(className).getMethod(methodName) + } + } + Class.forName("T$class").getMethod("f3", classOf[T]) + } +} diff --git a/tests/pending/run/elidable.check b/tests/pending/run/elidable.check new file mode 100644 index 000000000000..88cf98e0d11f --- /dev/null +++ b/tests/pending/run/elidable.check @@ -0,0 +1,14 @@ +Good for me, I was not elided. Test.f3 +Good for me, I was not elided. O.f3 +Good for me, I was not elided. C.f1 +Good for me, I was not elided. C.f2 +() +false +0 +0 +0 +0 +0 +0.0 +0.0 +null diff --git a/tests/pending/run/elidable.flags b/tests/pending/run/elidable.flags new file mode 100644 index 000000000000..93fd3d531714 --- /dev/null +++ b/tests/pending/run/elidable.flags @@ -0,0 +1 @@ +-Xelide-below 900 diff --git a/tests/pending/run/elidable.scala b/tests/pending/run/elidable.scala new file mode 100644 index 000000000000..7f3b8011dbeb --- /dev/null +++ b/tests/pending/run/elidable.scala @@ -0,0 +1,85 @@ +import annotation._ +import elidable._ + +trait T { + @elidable(FINEST) def f1(): Unit + @elidable(SEVERE) def f2(): Unit + @elidable(FINEST) def f3() = assert(false, "Should have been elided.") + def f4(): Unit +} + +class C extends T { + def f1() = println("Good for me, I was not elided. C.f1") + def f2() = println("Good for me, I was not elided. C.f2") + @elidable(FINEST) def f4() = assert(false, "Should have been elided.") +} + +object O { + @elidable(FINEST) def f1() = assert(false, "Should have been elided.") + @elidable(INFO) def f2() = assert(false, "Should have been elided.") + @elidable(SEVERE) def f3() = println("Good for me, I was not elided. O.f3") + @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).") +} + +object Test { + @elidable(FINEST) def f1() = assert(false, "Should have been elided.") + @elidable(INFO) def f2() = assert(false, "Should have been elided.") + @elidable(SEVERE) def f3() = println("Good for me, I was not elided. Test.f3") + @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).") + + @elidable(FINEST) def f5() = {} + @elidable(FINEST) def f6() = true + @elidable(FINEST) def f7() = 1:Byte + @elidable(FINEST) def f8() = 1:Short + @elidable(FINEST) def f9() = 1:Char + @elidable(FINEST) def fa() = 1 + @elidable(FINEST) def fb() = 1l + @elidable(FINEST) def fc() = 1.0f + @elidable(FINEST) def fd() = 1.0 + @elidable(FINEST) def fe() = "s" + + def main(args: Array[String]): Unit = { + f1() + f2() + f3() + f4 + O.f1() + O.f2() + O.f3() + O.f4 + + val c = new C + c.f1() + c.f2() + c.f3() + c.f4() + + // make sure a return value is still available when eliding a call + println(f5()) + println(f6()) + println(f7()) + println(f8()) + println(f9().toInt) + println(fa()) + println(fb()) + println(fc()) + println(fd()) + println(fe()) + + // this one won't show up in the output because a call to f1 is elidable when accessed through T + (c:T).f1() + + // Test whether the method definitions are still available. + List("Test", "Test$", "O", "O$", "C", "T") foreach { className => + List("f1", "f2", "f3", "f4") foreach { methodName => + Class.forName(className).getMethod(methodName) + } + } + List("Test", "Test$") foreach { className => + List("f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe") foreach { methodName => + Class.forName(className).getMethod(methodName) + } + } + Class.forName("T$class").getMethod("f3", classOf[T]) + } +} diff --git a/tests/pending/run/empty-array.check b/tests/pending/run/empty-array.check new file mode 100644 index 000000000000..bb0b1cf658d1 --- /dev/null +++ b/tests/pending/run/empty-array.check @@ -0,0 +1,3 @@ +0 +0 +0 diff --git a/tests/pending/run/empty-array.scala b/tests/pending/run/empty-array.scala new file mode 100644 index 000000000000..6e37dca37d79 --- /dev/null +++ b/tests/pending/run/empty-array.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + println(Array.emptyByteArray.length) + println(Array.emptyDoubleArray.length) + println(Array.emptyBooleanArray.length) + // okay okay okay + } +} diff --git a/tests/pending/run/emptypf.check b/tests/pending/run/emptypf.check new file mode 100644 index 000000000000..f6c39921bc1a --- /dev/null +++ b/tests/pending/run/emptypf.check @@ -0,0 +1,3 @@ +100 +3 +false diff --git a/tests/pending/run/emptypf.scala b/tests/pending/run/emptypf.scala new file mode 100644 index 000000000000..eb3e3e638077 --- /dev/null +++ b/tests/pending/run/emptypf.scala @@ -0,0 +1,14 @@ +object Test { + val f: PartialFunction[String, Int] = { + PartialFunction.empty[String, Int] orElse { + case "abc" => 100 + case s => s.length + } + } + + def main(args: Array[String]): Unit = { + println(f("abc")) + println(f("def")) + println(PartialFunction.empty[String, Int] isDefinedAt "abc") + } +} diff --git a/tests/pending/run/enrich-gentraversable.check b/tests/pending/run/enrich-gentraversable.check new file mode 100644 index 000000000000..94c66e36921d --- /dev/null +++ b/tests/pending/run/enrich-gentraversable.check @@ -0,0 +1,8 @@ +List(2, 4) +Array(2, 4) +HW +Vector(72, 108, 108, 32, 114, 108, 100) +List(2, 4) +Array(2, 4) +HW +Vector(72, 108, 108, 32, 114, 108, 100) diff --git a/tests/pending/run/enrich-gentraversable.scala b/tests/pending/run/enrich-gentraversable.scala new file mode 100644 index 000000000000..0a4ef9c5eae3 --- /dev/null +++ b/tests/pending/run/enrich-gentraversable.scala @@ -0,0 +1,70 @@ +import scala.language.implicitConversions +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + import scala.collection.{GenTraversableOnce,GenTraversableLike} + import scala.collection.generic._ + + def typed[T](t : => T): Unit = {} + def testTraversableLike = { + class FilterMapImpl[A, Repr](val r: GenTraversableLike[A, Repr]) /* extends AnyVal */ { + final def filterMap[B, That](f: A => Option[B])(implicit cbf: CanBuildFrom[Repr, B, That]): That = + r.flatMap(f(_).toSeq) + } + implicit def filterMap[Repr, A](r: Repr)(implicit fr: IsTraversableLike[Repr]): FilterMapImpl[fr.A,Repr] = + new FilterMapImpl[fr.A, Repr](fr.conversion(r)) + + val l = List(1, 2, 3, 4, 5) + val fml = l.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[List[Int]](fml) + println(fml) + + val a = Array(1, 2, 3, 4, 5) + val fma = a.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[Array[Int]](fma) + println(fma.deep) + + val s = "Hello World" + val fms1 = s.filterMap(c => if(c >= 'A' && c <= 'Z') Some(c) else None) + typed[String](fms1) + println(fms1) + + val fms2 = s.filterMap(c =>if(c % 2 == 0) Some(c.toInt) else None) + typed[IndexedSeq[Int]](fms2) + println(fms2) + } + def testTraversableOnce = { + class FilterMapImpl[A, Repr](val r: GenTraversableOnce[A]) /* extends AnyVal */ { + final def filterMap[B, That](f: A => Option[B])(implicit cbf: CanBuildFrom[Repr, B, That]): That = { + val b = cbf() + for(e <- r.seq) f(e) foreach (b +=) + + b.result + } + } + implicit def filterMap[Repr, A](r: Repr)(implicit fr: IsTraversableOnce[Repr]): FilterMapImpl[fr.A,Repr] = + new FilterMapImpl[fr.A, Repr](fr.conversion(r)) + + val l = List(1, 2, 3, 4, 5) + val fml = l.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[List[Int]](fml) + println(fml) + + val a = Array(1, 2, 3, 4, 5) + val fma = a.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[Array[Int]](fma) + println(fma.deep) + + val s = "Hello World" + val fms1 = s.filterMap(c => if(c >= 'A' && c <= 'Z') Some(c) else None) + typed[String](fms1) + println(fms1) + + val fms2 = s.filterMap(c =>if(c % 2 == 0) Some(c.toInt) else None) + typed[IndexedSeq[Int]](fms2) + println(fms2) + } + + testTraversableLike + testTraversableOnce +} diff --git a/tests/pending/run/enums.check b/tests/pending/run/enums.check new file mode 100644 index 000000000000..93eadae6e3cc --- /dev/null +++ b/tests/pending/run/enums.check @@ -0,0 +1,15 @@ +test Test1 was successful +test Test2 was successful +test Test3 was successful +test Test4 was successful + +D1.ValueSet(North, East) +D2.ValueSet(North, East) +D1.ValueSet(North, East, West) +D2.ValueSet(North, East, West) +List(101) +List(101) +D1.ValueSet(North, East) +D2.ValueSet(North, East) +WeekDays.ValueSet(Tue, Wed, Thu, Fri) + diff --git a/tests/pending/run/enums.scala b/tests/pending/run/enums.scala new file mode 100644 index 000000000000..7630b174ef38 --- /dev/null +++ b/tests/pending/run/enums.scala @@ -0,0 +1,161 @@ +//############################################################################ +// Enumerations +//############################################################################ + +object Test1 { + + object WeekDays extends Enumeration { + val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value + } + + def isWorkingDay(d: WeekDays.Value) = + ! (d == WeekDays.Sat || d == WeekDays.Sun); + + def run: Int = { + val it = WeekDays.values filter (isWorkingDay); + it.toList.length + } +} + +object Test2 { + + object ThreadState extends Enumeration { + val New = Value("NEW"); + val Runnable = Value("RUNNABLE"); + val Blocked = Value("BLOCKED"); + val Waiting = Value("WAITING"); + val TimedWaiting = Value("TIMED_WAITING"); + val Terminated = Value("TERMINATED"); + } + + def run: Int = { + val it = for (s <- ThreadState.values; if s.id != 0) yield s; + it.toList.length + } +} + +object Test3 { + + object Direction extends Enumeration { + val North = Value("North") + val South = Value("South") + val East = Value("East") + val West = Value("West") + } + + def run: Int = { + val it = for (d <- Direction.values; if d.toString() startsWith "N") yield d; + it.toList.length + } +} + +object Test4 { + + object Direction extends Enumeration { + val North = Value("North") + val South = Value("South") + val East = Value("East") + val West = Value("West") + } + + def run: Int = { + val dir = Direction.withName("North") + assert(dir.toString == "North") + try { + Direction.withName("Nord") + assert(false) + } catch { + case e: Exception => /* do nothing */ + } + 0 + } +} + +object Test5 { + + object D1 extends Enumeration(0) { + val North, South, East, West = Value; + } + + object D2 extends Enumeration(-2) { + val North, South, East, West = Value; + } + + object WeekDays extends Enumeration { + val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value + } + + def run: Unit = { + val s1 = D1.ValueSet(D1.North, D1.East) + val s2 = D2.North + D2.East + println(s1) + println(s2) + println(s1 + D1.West) + println(s2 + D2.West) + println(s1.toBitMask.map(_.toBinaryString).toList) + println(s2.toBitMask.map(_.toBinaryString).toList) + println(D1.ValueSet.fromBitMask(s1.toBitMask)) + println(D2.ValueSet.fromBitMask(s2.toBitMask)) + println(WeekDays.values.range(WeekDays.Tue, WeekDays.Sat)) + } +} + +object SerializationTest { + object Types extends Enumeration { val X, Y = Value } + class A extends java.io.Serializable { val types = Types.values } + class B extends java.io.Serializable { val types = Set(Types.X, Types.Y) } + + def serialize(obj: AnyRef) = { + val baos = new java.io.ByteArrayOutputStream() + val oos = new java.io.ObjectOutputStream(baos) + oos.writeObject(obj) + oos.close() + val bais = new java.io.ByteArrayInputStream(baos.toByteArray) + val ois = new java.io.ObjectInputStream(bais) + val prime = ois.readObject() + ois.close() + prime + } + + def run: Unit = { + serialize(new B()) + serialize(new A()) + } +} + +//############################################################################ +// Test code + +object Test { + + def check_success(name: String, closure: => Int, expected: Int): Unit = { + Console.print("test " + name); + try { + val actual: Int = closure; + if (actual == expected) { + Console.print(" was successful"); + } else { + Console.print(" failed: expected "+ expected +", found "+ actual); + } + } catch { + case exception: Throwable => { + Console.print(" raised exception " + exception); + exception.printStackTrace(); + } + } + Console.println; + } + + def main(args: Array[String]): Unit = { + check_success("Test1", Test1.run, 5); + check_success("Test2", Test2.run, 5); + check_success("Test3", Test3.run, 1); + check_success("Test4", Test4.run, 0); + Console.println; + Test5.run; + Console.println; + SerializationTest.run; + } +} + +//############################################################################ diff --git a/tests/pending/run/equality.scala b/tests/pending/run/equality.scala new file mode 100644 index 000000000000..ff5989882196 --- /dev/null +++ b/tests/pending/run/equality.scala @@ -0,0 +1,40 @@ +// a quickly assembled test of equality. Needs work. +object Test +{ + import scala.runtime.ScalaRunTime.hash + + def makeFromInt(x: Int) = List( + x.toByte, x.toShort, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x), BigDecimal(x) + ) ::: ( + if (x < 0) Nil else List(x.toChar) + ) + def makeFromDouble(x: Double) = List( + x.toShort, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x.toInt), BigDecimal(x) + ) + + def main(args: Array[String]): Unit = { + var xs = makeFromInt(5) + for (x <- xs ; y <- xs) { + assert(x == y, x + " == " + y) + assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) + } + + xs = makeFromInt(-5) + for (x <- xs ; y <- xs) { + assert(x == y, x + " == " + y) + assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) + } + + xs = makeFromDouble(500.0) + for (x <- xs ; y <- xs) { + assert(x == y, x + " == " + y) + assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) + } + + // negatives + val bigLong = new java.util.concurrent.atomic.AtomicLong(Long.MaxValue) + assert(-1 != bigLong && bigLong != -1) // bigLong.intValue() == -1 + assert(BigDecimal(1.1) != 1L) + assert(1L != BigDecimal(1.1)) + } +} diff --git a/tests/pending/run/eta-expand-star.check b/tests/pending/run/eta-expand-star.check new file mode 100644 index 000000000000..ce013625030b --- /dev/null +++ b/tests/pending/run/eta-expand-star.check @@ -0,0 +1 @@ +hello diff --git a/tests/pending/run/eta-expand-star.scala b/tests/pending/run/eta-expand-star.scala new file mode 100644 index 000000000000..7717c4bc91ec --- /dev/null +++ b/tests/pending/run/eta-expand-star.scala @@ -0,0 +1,8 @@ +object Test { + def f[T](xs: T*): T = xs.head + def g[T] = f[T] _ + + def main(args: Array[String]): Unit = { + println(g("hello" +: args)) + } +} diff --git a/tests/pending/run/eta-expand-star2.check b/tests/pending/run/eta-expand-star2.check new file mode 100644 index 000000000000..d6929e4969d0 --- /dev/null +++ b/tests/pending/run/eta-expand-star2.check @@ -0,0 +1,2 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +hello diff --git a/tests/pending/run/eta-expand-star2.flags b/tests/pending/run/eta-expand-star2.flags new file mode 100644 index 000000000000..0402fe55a413 --- /dev/null +++ b/tests/pending/run/eta-expand-star2.flags @@ -0,0 +1 @@ +-Yeta-expand-keeps-star \ No newline at end of file diff --git a/tests/pending/run/eta-expand-star2.scala b/tests/pending/run/eta-expand-star2.scala new file mode 100644 index 000000000000..eb650788d074 --- /dev/null +++ b/tests/pending/run/eta-expand-star2.scala @@ -0,0 +1,8 @@ +object Test { + def f[T](xs: T*): T = xs.head + def g[T] = f[T] _ + + def main(args: Array[String]): Unit = { + println(g("hello")) + } +} diff --git a/tests/pending/run/exc.scala b/tests/pending/run/exc.scala new file mode 100644 index 000000000000..be999794a8eb --- /dev/null +++ b/tests/pending/run/exc.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + def foo() = { + while (true) { + try { + } catch { + case ex: Exception => + } + } + } +} diff --git a/tests/pending/run/exc1.scala b/tests/pending/run/exc1.scala new file mode 100644 index 000000000000..c48b4c156f17 --- /dev/null +++ b/tests/pending/run/exc1.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(): Unit = { + while (true) { + try { + } catch { + case ex: Exception => + } + } + } +} diff --git a/tests/pending/run/exc2.scala b/tests/pending/run/exc2.scala new file mode 100644 index 000000000000..4075cb26fcbb --- /dev/null +++ b/tests/pending/run/exc2.scala @@ -0,0 +1,12 @@ +object Test extends dotty.runtime.LegacyApp { + def foo() = { + while (true) { + try { + Console.println("foo") + } catch { + case ex: Exception => + Console.println("bar") + } + } + } +} diff --git a/tests/pending/run/exceptions-2.check b/tests/pending/run/exceptions-2.check new file mode 100644 index 000000000000..4f8244800a7c --- /dev/null +++ b/tests/pending/run/exceptions-2.check @@ -0,0 +1,59 @@ +exceptions-2.scala:267: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + try { 1 } catch { case e: java.io.IOException => () } + ^ +nested1: +Innermost finally +Outermost finally +nested2: +Innermost finally +Outermost finally +mixed: +10 +Finally! +withValue1: +Oh, oh +10 +withValue2: +droped a null +null +method2: +10 +Exception occurred +method3: +Caught an NPE +tryFinallyTry: +Silently ignore exception in finally +valInFinally: +Abc +tryAndValInFinally +Abc +================= +NoExcep.method2: +Hello, world +NoExcep.method3: +method3 +NoExcep.method4: +.. +Return inside body: +Normal execution... +inner finally +Outer finally +Return inside synchronized body: +Synchronized normal execution... +inner finally +Outer finally +Return inside body and return in finally: +Normal execution... +inner finally +Outer finally +Return inside body and return in finally inside finally: +Normal execution... +inner finally +finally inside finally +Outer finally +Throw in catch and finally: +ABC +Return with finally clause that cleans the stack +Normal execution... +inner finally +Outer finally diff --git a/tests/pending/run/exceptions-2.scala b/tests/pending/run/exceptions-2.scala new file mode 100644 index 000000000000..8d755c380969 --- /dev/null +++ b/tests/pending/run/exceptions-2.scala @@ -0,0 +1,349 @@ +/* + * Try exception handling and finally blocks. + */ + +trait Tree extends Exception; + +case class Node(a: Tree, b: Tree) extends Tree; +case class Leaf(x: Int) extends Tree; + + +object NoExcep { + def a = true; + def b = false; + def c = true; + + def method1(t: Tree) = try { + Console.println(t); + } catch { + case Node(Leaf(_), Leaf(_)) => a; + case Leaf(_) => b; + } + + def method2 = try { + Console.println("Hello, world"); + } catch { + case _: Error => Console.println("File error"); + case t: Throwable => Console.println("Unknown error"); + } + + def method3 = try { + try { + Console.println("method3"); + } catch { + case Node(Leaf(_), Leaf(_)) => Console.println("First one"); + case Leaf(_) => Console.println("Second one"); + } + } catch { + case _: Error => Console.println("File error"); + case t: Exception => Console.println("Unknown error"); + } + + def method4 = try { + Console.println(".."); + } catch { + case _: Throwable => sys.error(".."); + } +} + +object Test { + def nested1: Unit = try { + try { + sys.error("nnnnoooo"); + } finally { + Console.println("Innermost finally"); + } + } finally { + Console.println("Outermost finally"); + } + + def nested2 = try { + try { + sys.error("nnnnoooo"); + } finally { + Console.println("Innermost finally"); + } + Console.println("Intermediary step"); + } finally { + Console.println("Outermost finally"); + } + + def mixed = + try { + if (10 > 0) + throw Leaf(10); + Console.println("nooo oneeee can priiiint meee"); + } catch { + case Leaf(a) => Console.println(a); + case _: Exception => Console.println("Exception occurred"); + } finally { + Console.println("Finally!"); + } + + def method2: Unit = { + try { + if (10 > 0) + throw Leaf(10); + Console.println("nooo oneeee can priiiint meee"); + } catch { + case Leaf(a) => Console.println(a); + case _: Exception => Console.println("Exception occurred"); + } + + try { + val a: Leaf = null; + println(a.x); + } catch { + case Leaf(a) => Console.println(a); + case _: NullPointerException => Console.println("Exception occurred"); + } + } + + def method3: Unit = try { + try { + val a: Leaf = null; + println(a.x); + } catch { + case Leaf(a) => Console.println(a); + } + } catch { + case npe: NullPointerException => + Console.println("Caught an NPE"); + } + + def withValue1: Unit = { + val x = try { + 10 + } finally { + Console.println("Oh, oh"); + }; + Console.println(x); + } + + def withValue2: Unit = { + val x = try { + null + } finally { + Console.println("droped a null"); + }; + Console.println(x); + } + + def tryFinallyTry: Unit = { + try { + () + } finally { + try { + sys.error("a"); + } catch { + case _: Throwable => Console.println("Silently ignore exception in finally"); + } + } + } + + def valInFinally: Unit = + try { + } finally { + val fin = "Abc"; + Console.println(fin); + } + + def tryAndValInFinally: Unit = + try { + } finally { + val fin = "Abc"; + try { + Console.println(fin); + } catch { case _: Throwable => () } + } + + def returnInBody: Unit = try { + try { + Console.println("Normal execution..."); + return + Console.println("non reachable code"); + } finally { + Console.println("inner finally"); + } + } finally { + Console.println("Outer finally"); + } + + def returnInBodySynch: Unit = try { + synchronized { + try { + Console.println("Synchronized normal execution..."); + return + Console.println("non reachable code"); + } finally { + Console.println("inner finally"); + } + } + } finally { + Console.println("Outer finally"); + } + + + def returnInBodyAndInFinally: Unit = try { + try { + Console.println("Normal execution..."); + return + Console.println("non reachable code"); + } finally { + Console.println("inner finally"); + return + } + } finally { + Console.println("Outer finally"); + return + } + + def returnInBodyAndInFinally2: Unit = try { + try { + Console.println("Normal execution..."); + return + Console.println("non reachable code"); + } finally { + try { + Console.println("inner finally"); + return + } finally { + Console.println("finally inside finally"); + } + } + } finally { + Console.println("Outer finally"); + return + } + + /** bug #1020, no crash at compile time */ + def tryCatchInFinally: Unit = { + try { + Console.println("Try") + } catch { + case e:java.io.IOException => + throw e + } finally { + val x = 10 + // Always make sure result sets and statements are closed, + // and the connection is returned to the pool + if (x != 10) { + try { Console.println("Fin"); } catch { case e:java.io.IOException => ; } + } + } + } + + def tryThrowFinally: Unit = { + try { + print("A") + throw new Exception + } catch { + case e : Exception => + print("B") + throw e + } finally { + println("C") + } + } + + def execute(f: => Unit) = try { + f; + } catch { + case _: Throwable => () + } + + + def returnWithFinallyClean: Int = try { + try { + Console.println("Normal execution..."); + return 10 + Console.println("non reachable code"); + 11 + } finally { + Console.println("inner finally"); + } + } finally { + Console.println("Outer finally"); + try { 1 } catch { case e: java.io.IOException => () } + } + + /** Test that empty finally clauses containing while are correctly emitted. + */ + class Issue { + var b = 0 + try { + // println("abc") + } finally { + while (b == -1) {b = 0} + } + } + + /* Tests that class Issue passes verification. */ + def whileInFinally = { + new Issue + } + + + + def main(args: Array[String]): Unit = { + Console.println("nested1: "); + execute(nested1); + + Console.println("nested2: "); + execute(nested2); + + Console.println("mixed: "); + execute(mixed); + + Console.println("withValue1:"); + execute(withValue1); + + Console.println("withValue2:"); + execute(withValue2); + + Console.println("method2:"); + execute(method2); + + Console.println("method3:"); + execute(method3); + + Console.println("tryFinallyTry:"); + execute(tryFinallyTry); + + Console.println("valInFinally:"); + execute(valInFinally); + Console.println("tryAndValInFinally"); + execute(tryAndValInFinally); + + Console.println("================="); + + Console.println("NoExcep.method2:"); + execute(NoExcep.method2); + + Console.println("NoExcep.method3:"); + execute(NoExcep.method3); + + Console.println("NoExcep.method4:"); + execute(NoExcep.method4); + + Console.println("Return inside body:"); + execute(returnInBody); + + Console.println("Return inside synchronized body:"); + execute(returnInBodySynch); + + Console.println("Return inside body and return in finally:"); + execute(returnInBodyAndInFinally); + + Console.println("Return inside body and return in finally inside finally:"); + execute(returnInBodyAndInFinally2); + + Console.println("Throw in catch and finally:"); + execute(tryThrowFinally); + + Console.println("Return with finally clause that cleans the stack") + returnWithFinallyClean + + whileInFinally + } +} diff --git a/tests/pending/run/exceptions-nest.check b/tests/pending/run/exceptions-nest.check new file mode 100644 index 000000000000..48725e4d27b7 --- /dev/null +++ b/tests/pending/run/exceptions-nest.check @@ -0,0 +1,13 @@ +2 +23 +2 +5 +2 +4 +OK +4 +OK +10 +1 +() +10 diff --git a/tests/pending/run/exceptions-nest.scala b/tests/pending/run/exceptions-nest.scala new file mode 100644 index 000000000000..87586485c0c9 --- /dev/null +++ b/tests/pending/run/exceptions-nest.scala @@ -0,0 +1,157 @@ +object Test extends dotty.runtime.LegacyApp { + + println(test1) + println(test2) + println(test3) + println(test4) + println(test5) + try { println(test6) } catch { case _: Throwable => println("OK") } + println(test7) + try { println(test8) } catch { case _: Throwable => println("OK") } + println(test9) + println(test10) + println(test11) + println(test12) + + def test1 = { + var x = 1 + try { + x = 2 + } catch { + case _: NullPointerException => x = 3 + case _: Throwable => x = 4 + } + x + } + + def test2 = { + var x = 1 + try { + x = 2 + try { + x = 21 + } catch { + case _: Throwable => x = 22 + } + x = 23 + } catch { + case _: NullPointerException => x = 3 + case _: Throwable => x = 4 + } + x + } + + def test3 = { + var x = 1 + try { + try{x = 2} catch { case _: Throwable => x = 4 } + } catch { + case _: NullPointerException => x = 3 + case _: Throwable => x = 4 + } + x + } + + def test4 = { + var x = 1 + try { + x = 2 + } catch { + case _: NullPointerException => x = 3 + case _: Throwable => x = 4 + } + try { + x = 5 + } catch { + case _: NullPointerException => x = 6 + } + x + } + + def test5 = { + var x = 1 + try { + x = 2 + } catch { + case _: NullPointerException => try { x = 3 } catch { case f: Throwable => throw f } + case _: Throwable => x = 4; try { x = 41 } catch { case _: Exception => x = 42 }; x = 43 + } + x + } + + def test6: Int = { + var x = 1 + try { + x = 2 + (null: String).toString + } catch { + case e: NullPointerException => + throw e + case _: Throwable => + x = 3 + return 1000 + } finally { + x = 4 + println(x) + } + x + } + + def test7 = { + var x = 1 + try { + x = 2 + } finally { + try { + x = 4 + } catch { + case _: Throwable => x = 5 + } + } + x + } + + def test8 = { + var x = 1 + try { + throw new NullPointerException + } catch { + case e: Throwable => throw e + } + x + } + + def test9 = { + try { "" match { + case s: String => 10 + }} catch { case _: Throwable => 20 } + } + + var x10 = 1 + def test10: Int = { + try { 1 } + catch { case e if (x10 == 1) => 1 } + } + + def test11: Unit = { + try { () } + catch { case e: Throwable => () } + } + + class E1 extends Exception + class E2 extends Exception + class E3 extends Exception + + def test12_impl(op: => Int) = try { + op + } catch { + case e: E1 => 2 + case e: E2 => 3 + case e: E3 => 4 + } + def test12 = + test12_impl(1) + + test12_impl(throw new E1) + + test12_impl(throw new E2) + + test12_impl(throw new E3) +} diff --git a/tests/pending/run/exceptions.check b/tests/pending/run/exceptions.check new file mode 100644 index 000000000000..b959df29edca --- /dev/null +++ b/tests/pending/run/exceptions.check @@ -0,0 +1 @@ +ok: lookup(2000) = KO diff --git a/tests/pending/run/exceptions.scala b/tests/pending/run/exceptions.scala new file mode 100644 index 000000000000..f0fe76946b5c --- /dev/null +++ b/tests/pending/run/exceptions.scala @@ -0,0 +1,52 @@ +//############################################################################ +// Exceptions +//############################################################################ + +//############################################################################ + +abstract class IntMap[A] { + def lookup(key: Int): A = this match { + case Empty() => sys.error("KO") + case _ => sys.error("ok") + } +} + +case class Empty[A]() extends IntMap[A]; + +object exceptions { + + def check(what: String, actual: Any, expected: Any): Unit = { + val success: Boolean = actual == expected; + Console.print(if (success) "ok" else "KO"); + var value: String = if (actual == null) "null" else actual.toString(); + if (value == "\u0000") value = "\\u0000"; + Console.print(": " + what + " = " + value); + if (!success) Console.print(" != " + expected); + Console.println; + Console.flush; + } + + def test: Unit = { + val key = 2000; + val map: IntMap[String] = new Empty[String]; + val value = try { + map.lookup(key) + } catch { + case e: Throwable => e.getMessage() + } + check("lookup(" + key + ")", value, "KO"); + } + +} + +//############################################################################ + +object Test { + + def main(args: Array[String]): Unit = { + exceptions.test; + } + +} + +//############################################################################ diff --git a/tests/pending/run/existential-rangepos.check b/tests/pending/run/existential-rangepos.check new file mode 100644 index 000000000000..1212b60bae2c --- /dev/null +++ b/tests/pending/run/existential-rangepos.check @@ -0,0 +1,13 @@ +[[syntax trees at end of patmat]] // newSource1.scala +[0:76]package [0:0] { + [0:76]abstract class A[[17:18]T[17:18]] extends [20:76][76]scala.AnyRef { + [76]def (): [20]A[T] = [76]{ + [76][76][76]A.super.(); + [20]() + }; + [24:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null; + [28] def foo: [28]Set[_ <: T] = [28][28]A.this.foo; + [54:74] def bar: [58]Set[_ <: T] + } +} + diff --git a/tests/pending/run/existential-rangepos.scala b/tests/pending/run/existential-rangepos.scala new file mode 100644 index 000000000000..7d2b0810d342 --- /dev/null +++ b/tests/pending/run/existential-rangepos.scala @@ -0,0 +1,13 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -Yrangepos -Xprint:patmat -Xprint-pos -d " + testOutput.path + + override def code = """ +abstract class A[T] { + val foo: Set[_ <: T] = null + val bar: Set[_ <: T] +}""".trim + + override def show(): Unit = Console.withErr(System.out)(compile()) +} diff --git a/tests/pending/run/existentials-in-compiler.check b/tests/pending/run/existentials-in-compiler.check new file mode 100644 index 000000000000..b0d852865d6f --- /dev/null +++ b/tests/pending/run/existentials-in-compiler.check @@ -0,0 +1,156 @@ +abstract trait Bippy[A <: AnyRef, B] extends AnyRef + extest.Bippy[_ <: AnyRef, _] + +abstract trait BippyBud[A <: AnyRef, B, C <: List[A]] extends AnyRef + extest.BippyBud[A,B,C] forSome { A <: AnyRef; B; C <: List[A] } + +abstract trait BippyLike[A <: AnyRef, B <: List[A], This <: extest.BippyLike[A,B,This] with extest.Bippy[A,B]] extends AnyRef + extest.BippyLike[A,B,This] forSome { A <: AnyRef; B <: List[A]; This <: extest.BippyLike[A,B,This] with extest.Bippy[A,B] } + +abstract trait Contra[-A >: AnyRef, -B] extends AnyRef + extest.Contra[AnyRef, _] + +abstract trait ContraLike[-A >: AnyRef, -B >: List[A]] extends AnyRef + extest.ContraLike[A,B] forSome { -A >: AnyRef; -B >: List[A] } + +abstract trait Cov01[+A <: AnyRef, +B] extends AnyRef + extest.Cov01[AnyRef,Any] + +abstract trait Cov02[+A <: AnyRef, B] extends AnyRef + extest.Cov02[AnyRef, _] + +abstract trait Cov03[+A <: AnyRef, -B] extends AnyRef + extest.Cov03[AnyRef, _] + +abstract trait Cov04[A <: AnyRef, +B] extends AnyRef + extest.Cov04[_ <: AnyRef, Any] + +abstract trait Cov05[A <: AnyRef, B] extends AnyRef + extest.Cov05[_ <: AnyRef, _] + +abstract trait Cov06[A <: AnyRef, -B] extends AnyRef + extest.Cov06[_ <: AnyRef, _] + +abstract trait Cov07[-A <: AnyRef, +B] extends AnyRef + extest.Cov07[_ <: AnyRef, Any] + +abstract trait Cov08[-A <: AnyRef, B] extends AnyRef + extest.Cov08[_ <: AnyRef, _] + +abstract trait Cov09[-A <: AnyRef, -B] extends AnyRef + extest.Cov09[_ <: AnyRef, _] + +abstract trait Cov11[+A <: AnyRef, +B <: List[_]] extends AnyRef + extest.Cov11[AnyRef,List[_]] + +abstract trait Cov12[+A <: AnyRef, B <: List[_]] extends AnyRef + extest.Cov12[AnyRef, _ <: List[_]] + +abstract trait Cov13[+A <: AnyRef, -B <: List[_]] extends AnyRef + extest.Cov13[AnyRef, _ <: List[_]] + +abstract trait Cov14[A <: AnyRef, +B <: List[_]] extends AnyRef + extest.Cov14[_ <: AnyRef, List[_]] + +abstract trait Cov15[A <: AnyRef, B <: List[_]] extends AnyRef + extest.Cov15[_ <: AnyRef, _ <: List[_]] + +abstract trait Cov16[A <: AnyRef, -B <: List[_]] extends AnyRef + extest.Cov16[_ <: AnyRef, _ <: List[_]] + +abstract trait Cov17[-A <: AnyRef, +B <: List[_]] extends AnyRef + extest.Cov17[_ <: AnyRef, List[_]] + +abstract trait Cov18[-A <: AnyRef, B <: List[_]] extends AnyRef + extest.Cov18[_ <: AnyRef, _ <: List[_]] + +abstract trait Cov19[-A <: AnyRef, -B <: List[_]] extends AnyRef + extest.Cov19[_ <: AnyRef, _ <: List[_]] + +abstract trait Cov21[+A, +B] extends AnyRef + extest.Cov21[Any,Any] + +abstract trait Cov22[+A, B] extends AnyRef + extest.Cov22[Any, _] + +abstract trait Cov23[+A, -B] extends AnyRef + extest.Cov23[Any, _] + +abstract trait Cov24[A, +B] extends AnyRef + extest.Cov24[_, Any] + +abstract trait Cov25[A, B] extends AnyRef + extest.Cov25[_, _] + +abstract trait Cov26[A, -B] extends AnyRef + extest.Cov26[_, _] + +abstract trait Cov27[-A, +B] extends AnyRef + extest.Cov27[_, Any] + +abstract trait Cov28[-A, B] extends AnyRef + extest.Cov28[_, _] + +abstract trait Cov29[-A, -B] extends AnyRef + extest.Cov29[_, _] + +abstract trait Cov31[+A, +B, C <: (A, B)] extends AnyRef + extest.Cov31[A,B,C] forSome { +A; +B; C <: (A, B) } + +abstract trait Cov32[+A, B, C <: (A, B)] extends AnyRef + extest.Cov32[A,B,C] forSome { +A; B; C <: (A, B) } + +abstract trait Cov33[+A, -B, C <: Tuple2[A, _]] extends AnyRef + extest.Cov33[A,B,C] forSome { +A; -B; C <: Tuple2[A, _] } + +abstract trait Cov34[A, +B, C <: (A, B)] extends AnyRef + extest.Cov34[A,B,C] forSome { A; +B; C <: (A, B) } + +abstract trait Cov35[A, B, C <: (A, B)] extends AnyRef + extest.Cov35[A,B,C] forSome { A; B; C <: (A, B) } + +abstract trait Cov36[A, -B, C <: Tuple2[A, _]] extends AnyRef + extest.Cov36[A,B,C] forSome { A; -B; C <: Tuple2[A, _] } + +abstract trait Cov37[-A, +B, C <: Tuple2[_, B]] extends AnyRef + extest.Cov37[A,B,C] forSome { -A; +B; C <: Tuple2[_, B] } + +abstract trait Cov38[-A, B, C <: Tuple2[_, B]] extends AnyRef + extest.Cov38[A,B,C] forSome { -A; B; C <: Tuple2[_, B] } + +abstract trait Cov39[-A, -B, C <: Tuple2[_, _]] extends AnyRef + extest.Cov39[_, _, _ <: Tuple2[_, _]] + +abstract trait Cov41[+A >: Null, +B] extends AnyRef + extest.Cov41[Any,Any] + +abstract trait Cov42[+A >: Null, B] extends AnyRef + extest.Cov42[Any, _] + +abstract trait Cov43[+A >: Null, -B] extends AnyRef + extest.Cov43[Any, _] + +abstract trait Cov44[A >: Null, +B] extends AnyRef + extest.Cov44[_ >: Null, Any] + +abstract trait Cov45[A >: Null, B] extends AnyRef + extest.Cov45[_ >: Null, _] + +abstract trait Cov46[A >: Null, -B] extends AnyRef + extest.Cov46[_ >: Null, _] + +abstract trait Cov47[-A >: Null, +B] extends AnyRef + extest.Cov47[_ >: Null, Any] + +abstract trait Cov48[-A >: Null, B] extends AnyRef + extest.Cov48[_ >: Null, _] + +abstract trait Cov49[-A >: Null, -B] extends AnyRef + extest.Cov49[_ >: Null, _] + +abstract trait Covariant[+A <: AnyRef, +B] extends AnyRef + extest.Covariant[AnyRef,Any] + +abstract trait CovariantLike[+A <: AnyRef, +B <: List[A], +This <: extest.CovariantLike[A,B,This] with extest.Covariant[A,B]] extends AnyRef + extest.CovariantLike[A,B,This] forSome { +A <: AnyRef; +B <: List[A]; +This <: extest.CovariantLike[A,B,This] with extest.Covariant[A,B] } + diff --git a/tests/pending/run/existentials-in-compiler.scala b/tests/pending/run/existentials-in-compiler.scala new file mode 100644 index 000000000000..dfc7048b313f --- /dev/null +++ b/tests/pending/run/existentials-in-compiler.scala @@ -0,0 +1,86 @@ +/* + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ +import scala.tools.nsc._ +import scala.tools.partest.CompilerTest +import scala.collection.{ mutable, immutable, generic } + +object Test extends CompilerTest { + import global._ + import rootMirror._ + import definitions._ + + override def code = """ +package extest { + trait Bippy[A <: AnyRef, B] { } // wildcards + trait BippyLike[A <: AnyRef, B <: List[A], This <: BippyLike[A, B, This] with Bippy[A, B]] // no wildcards + trait BippyBud[A <: AnyRef, B, C <: List[A]] + + trait Cov01[+A <: AnyRef, +B] { } + trait Cov02[+A <: AnyRef, B] { } + trait Cov03[+A <: AnyRef, -B] { } + trait Cov04[ A <: AnyRef, +B] { } + trait Cov05[ A <: AnyRef, B] { } + trait Cov06[ A <: AnyRef, -B] { } + trait Cov07[-A <: AnyRef, +B] { } + trait Cov08[-A <: AnyRef, B] { } + trait Cov09[-A <: AnyRef, -B] { } + + trait Cov11[+A <: AnyRef, +B <: List[_]] { } + trait Cov12[+A <: AnyRef, B <: List[_]] { } + trait Cov13[+A <: AnyRef, -B <: List[_]] { } + trait Cov14[ A <: AnyRef, +B <: List[_]] { } + trait Cov15[ A <: AnyRef, B <: List[_]] { } + trait Cov16[ A <: AnyRef, -B <: List[_]] { } + trait Cov17[-A <: AnyRef, +B <: List[_]] { } + trait Cov18[-A <: AnyRef, B <: List[_]] { } + trait Cov19[-A <: AnyRef, -B <: List[_]] { } + + trait Cov21[+A, +B] { } + trait Cov22[+A, B] { } + trait Cov23[+A, -B] { } + trait Cov24[ A, +B] { } + trait Cov25[ A, B] { } + trait Cov26[ A, -B] { } + trait Cov27[-A, +B] { } + trait Cov28[-A, B] { } + trait Cov29[-A, -B] { } + + trait Cov31[+A, +B, C <: ((A, B))] { } + trait Cov32[+A, B, C <: ((A, B))] { } + trait Cov33[+A, -B, C <: ((A, _))] { } + trait Cov34[ A, +B, C <: ((A, B))] { } + trait Cov35[ A, B, C <: ((A, B))] { } + trait Cov36[ A, -B, C <: ((A, _))] { } + trait Cov37[-A, +B, C <: ((_, B))] { } + trait Cov38[-A, B, C <: ((_, B))] { } + trait Cov39[-A, -B, C <: ((_, _))] { } + + trait Cov41[+A >: Null, +B] { } + trait Cov42[+A >: Null, B] { } + trait Cov43[+A >: Null, -B] { } + trait Cov44[ A >: Null, +B] { } + trait Cov45[ A >: Null, B] { } + trait Cov46[ A >: Null, -B] { } + trait Cov47[-A >: Null, +B] { } + trait Cov48[-A >: Null, B] { } + trait Cov49[-A >: Null, -B] { } + + trait Covariant[+A <: AnyRef, +B] { } + trait CovariantLike[+A <: AnyRef, +B <: List[A], +This <: CovariantLike[A, B, This] with Covariant[A, B]] + + trait Contra[-A >: AnyRef, -B] { } + trait ContraLike[-A >: AnyRef, -B >: List[A]] +} + """ + + override def check(source: String, unit: global.CompilationUnit) { + getPackage(TermName("extest")).moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz => + exitingTyper { + clazz.info + println(clazz.defString) + println(" " + classExistentialType(clazz) + "\n") + } + } + } +} diff --git a/tests/pending/run/existentials.check b/tests/pending/run/existentials.check new file mode 100644 index 000000000000..ba96ae68c0a6 --- /dev/null +++ b/tests/pending/run/existentials.check @@ -0,0 +1,6 @@ +Int 2 +Float 2 +Int 2 +Float 2 +Cell(abc) +Cell(abc) diff --git a/tests/pending/run/existentials.scala b/tests/pending/run/existentials.scala new file mode 100644 index 000000000000..6aa4697cd85a --- /dev/null +++ b/tests/pending/run/existentials.scala @@ -0,0 +1,117 @@ +import scala.language.existentials +import scala.language.reflectiveCalls + +class Foo { + class Line { + case class Cell[T](var x: T) + def f[T](x: Any): Line.this.Cell[_] = x match { case y: Cell[t] => y } + + var x: Line.this.Cell[_]Line.this.Cell[_] = new Cell(1) + println({ x = new Cell("abc"); x }) + } +} + +class FooW { + class Line { + case class Cell[T](var x: T) + def f[T](x: Any): Cell[ _ ] = x match { case y: Cell[t] => y } + + var x: Cell[_] = new Cell(1) + println({ x = new Cell("abc"); x }) + } +} + +trait Counter[T] { + def newCounter: T + def get(i: T): Int + def inc(i: T): T +} + +case class C[T](x: T) + +object LUB { + def x = C(1) + def y = C("abc") + var coinflip: Boolean = _ + def z = if (coinflip) x else y + def zz: C[_ >: Int with String] = z + def zzs: C[_ >: Int with java.lang.String] = z +} + +object Bug1189 { + case class Cell[T](x: T) + type U = Bug1189.Cell[_] + def f(x: Any): U = x match { case y: Cell[_] => y } + + var x: U = Cell(1) + println(x) + + println(f(x)) + + x = Cell("abc") + println(x) + println(f(x)) +} + +object Test extends dotty.runtime.LegacyApp { + + val x = { class I; class J; (new C(new I), new C(new J)) } + val y: (C[X], C[Y]) forSome { type X; type Y }(C[X], C[Y]) forSome { type X; type Y } = x + + def foo(x : Counter[T]{def name: String} forSome { type T }) = x match { + case ctr: Counter[t] => + val c = ctr.newCounter + println(ctr.name+" "+ctr.get(ctr.inc(ctr.inc(c)))) + case _ => + } + + def fooW(x : Counter[T]{def name: String} forSome { type T }) = x match { + case ctr: Counter[t] => + val c = ctr.newCounter + println(ctr.name+" "+ctr.get(ctr.inc(ctr.inc(c)))) + case _ => + } + + val ci = new Counter[Int] { + def newCounter = 0 + def get(i: Int) = i + def inc(i: Int) = i+1 + def name = "Int" + } + + val cf = new Counter[Float] { + def newCounter = 0 + def get(i: Float) = i.intValue + def inc(i: Float) = i+1 + def name = "Float" + } + + var ex: Counter[_]Counter[_] = _ + ex = ci + ex = cf + + var exW: Counter[_] = _ + ex = ci + ex = cf + + foo(ci) + foo(cf) + fooW(ci) + fooW(cf) + val foo = new Foo + new foo.Line + val fooW = new FooW + new fooW.Line +} + +trait FooBar[ A <: Option[_]] { def foo: A } +trait SubFooBar[B <: Option[_]] extends FooBar[B] + +object Test1 { + + var pc: List[Product with (Product with Counter[T] forSome { + type T +})] = List() + def f() = pc + pc = f() +} diff --git a/tests/pending/run/existentials3-new.check b/tests/pending/run/existentials3-new.check new file mode 100644 index 000000000000..7f02866a2936 --- /dev/null +++ b/tests/pending/run/existentials3-new.check @@ -0,0 +1,24 @@ +Bar.type, t=TypeRef, s=type Bar.type +Bar, t=TypeRef, s=type Bar +Test.ToS, t=RefinedType, s= +Test.ToS, t=RefinedType, s= +Test.ToS, t=RefinedType, s= +() => Test.ToS, t=TypeRef, s=trait Function0 +() => Test.ToS, t=TypeRef, s=trait Function0 +$anon, t=TypeRef, s=type $anon +$anon, t=TypeRef, s=type $anon +List[AnyRef{type T1}#T1], t=TypeRef, s=class List +List[Seq[Int]], t=TypeRef, s=class List +List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List +Bar.type, t=TypeRef, s=type Bar.type +Bar, t=TypeRef, s=type Bar +Test.ToS, t=RefinedType, s= +Test.ToS, t=RefinedType, s= +Test.ToS, t=RefinedType, s= +() => Test.ToS, t=TypeRef, s=trait Function0 +() => Test.ToS, t=TypeRef, s=trait Function0 +$anon, t=TypeRef, s=type $anon +$anon, t=TypeRef, s=type $anon +List[AnyRef{type T1}#T1], t=TypeRef, s=class List +List[Seq[Int]], t=TypeRef, s=class List +List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List diff --git a/tests/pending/run/existentials3-new.scala b/tests/pending/run/existentials3-new.scala new file mode 100644 index 000000000000..102153e843ac --- /dev/null +++ b/tests/pending/run/existentials3-new.scala @@ -0,0 +1,82 @@ +import scala.language.existentials +import scala.reflect.runtime.universe._ +import internal._ + +object Test { + trait ToS { final override def toString = getClass.getName } + + def f1 = { case class Bar() extends ToS; Bar } + def f2 = { case class Bar() extends ToS; Bar() } + def f3 = { class Bar() extends ToS; object Bar extends ToS; Bar } + def f4 = { class Bar() extends ToS; new Bar() } + def f5 = { object Bar extends ToS; Bar } + def f6 = { () => { object Bar extends ToS ; Bar } } + def f7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f } + + def f8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } } + def f9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } } + + def f10 = { class A { type T1 } ; List[A#T1]() } + def f11 = { abstract class A extends Seq[Int] ; List[A]() } + def f12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } + + val g1 = { case class Bar() extends ToS; Bar } + val g2 = { case class Bar() extends ToS; Bar() } + val g3 = { class Bar() extends ToS; object Bar extends ToS; Bar } + val g4 = { class Bar() extends ToS; new Bar() } + val g5 = { object Bar extends ToS; Bar } + val g6 = { () => { object Bar extends ToS ; Bar } } + val g7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f } + + val g8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } } + val g9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } } + + val g10 = { class A { type T1 } ; List[A#T1]() } + val g11 = { abstract class A extends Seq[Int] ; List[A]() } + val g12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } + + def printTpe(t: Type) = { + val s = if (isFreeType(t.typeSymbol)) t.typeSymbol.info.toString else t.typeSymbol.toString + println("%s, t=%s, s=%s".format(t, t.asInstanceOf[Product].productPrefix, s)) + } + def m[T: TypeTag](x: T) = printTpe(typeOf[T]) + def m2[T: WeakTypeTag](x: T) = printTpe(implicitly[WeakTypeTag[T]].tpe) + + // tags do work for f10/g10 + def main(args: Array[String]): Unit = { + m2(f1) + m2(f2) + m(f3) + m(f4) + m(f5) + m(f6) + m(f7) + m2(f8) + m2(f9) + m2(f10) + m(f11) + m(f12) + m2(g1) + m2(g2) + m(g3) + m(g4) + m(g5) + m(g6) + m(g7) + m2(g8) + m2(g9) + m2(g10) + m(g11) + m(g12) + } +} + +object Misc { + trait Bippy { def bippy = "I'm Bippy!" } + object o1 { + def f1 = { trait A extends Seq[U forSome { type U <: Misc.Bippy }] ; abstract class B extends A ; trait C extends B ; (null: C) } + def f2 = f1.head.bippy + } + def g1 = o1.f1 _ + def g2 = o1.f2 _ +} diff --git a/tests/pending/run/existentials3-old.check b/tests/pending/run/existentials3-old.check new file mode 100644 index 000000000000..36a458daccf4 --- /dev/null +++ b/tests/pending/run/existentials3-old.check @@ -0,0 +1,22 @@ +_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with Test$ToS with scala.Product with scala.Serializable +Object with Test$ToS +Object with Test$ToS +Object with Test$ToS +scala.Function0[Object with Test$ToS] +scala.Function0[Object with Test$ToS] +_ <: Object with _ <: Object with Object with Test$ToS +_ <: Object with _ <: Object with _ <: Object with Test$ToS +scala.collection.immutable.List[Object with scala.collection.Seq[Int]] +scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] +_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with Test$ToS with scala.Product with scala.Serializable +Object with Test$ToS +Object with Test$ToS +Object with Test$ToS +scala.Function0[Object with Test$ToS] +scala.Function0[Object with Test$ToS] +_ <: Object with _ <: Object with Object with Test$ToS +_ <: Object with _ <: Object with _ <: Object with Test$ToS +scala.collection.immutable.List[Object with scala.collection.Seq[Int]] +scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] diff --git a/tests/pending/run/existentials3-old.scala b/tests/pending/run/existentials3-old.scala new file mode 100644 index 000000000000..d305800de48f --- /dev/null +++ b/tests/pending/run/existentials3-old.scala @@ -0,0 +1,75 @@ +import scala.language.existentials + +object Test { + trait ToS { final override def toString = getClass.getName } + + def f1 = { case class Bar() extends ToS; Bar } + def f2 = { case class Bar() extends ToS; Bar() } + def f3 = { class Bar() extends ToS; object Bar extends ToS; Bar } + def f4 = { class Bar() extends ToS; new Bar() } + def f5 = { object Bar extends ToS; Bar } + def f6 = { () => { object Bar extends ToS ; Bar } } + def f7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f } + + def f8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } } + def f9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } } + + def f10 = { class A { type T1 } ; List[A#T1]() } + def f11 = { abstract class A extends Seq[Int] ; List[A]() } + def f12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } + + val g1 = { case class Bar() extends ToS; Bar } + val g2 = { case class Bar() extends ToS; Bar() } + val g3 = { class Bar() extends ToS; object Bar extends ToS; Bar } + val g4 = { class Bar() extends ToS; new Bar() } + val g5 = { object Bar extends ToS; Bar } + val g6 = { () => { object Bar extends ToS ; Bar } } + val g7 = { val f = { () => { object Bar extends ToS ; Bar } } ; f } + + val g8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } } + val g9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } } + + val g10 = { class A { type T1 } ; List[A#T1]() } + val g11 = { abstract class A extends Seq[Int] ; List[A]() } + val g12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } + + def m[T: Manifest](x: T) = println(manifest[T]) + + // manifests don't work for f10/g10 + def main(args: Array[String]): Unit = { + m(f1) + m(f2) + m(f3) + m(f4) + m(f5) + m(f6) + m(f7) + m(f8) + m(f9) + // m(f10) + m(f11) + m(f12) + m(g1) + m(g2) + m(g3) + m(g4) + m(g5) + m(g6) + m(g7) + m(g8) + m(g9) + // m(g10) + m(g11) + m(g12) + } +} + +object Misc { + trait Bippy { def bippy = "I'm Bippy!" } + object o1 { + def f1 = { trait A extends Seq[U forSome { type U <: Misc.Bippy }] ; abstract class B extends A ; trait C extends B ; (null: C) } + def f2 = f1.head.bippy + } + def g1 = o1.f1 _ + def g2 = o1.f2 _ +} diff --git a/tests/pending/run/exoticnames.scala b/tests/pending/run/exoticnames.scala new file mode 100644 index 000000000000..beaea15b18af --- /dev/null +++ b/tests/pending/run/exoticnames.scala @@ -0,0 +1,7 @@ +// this is a run-test because the compiler should emit bytecode that'll pass the JVM's verifier +object Test extends dotty.runtime.LegacyApp { + def `(` = sys.error("bla") + def `.` = sys.error("bla") + def `)` = sys.error("bla") + def `,` = sys.error("bla") +} diff --git a/tests/pending/run/exprs_serialize.check b/tests/pending/run/exprs_serialize.check new file mode 100644 index 000000000000..551823ccdc70 --- /dev/null +++ b/tests/pending/run/exprs_serialize.check @@ -0,0 +1,19 @@ +Expr[Int(2)](2) +Expr[java.lang.String]({ + def foo = "hello"; + foo.$plus("world!") +}) +Expr[Boolean]({ + def foo(x: Int) = { + class Local extends AnyRef { + def () = { + super.(); + () + }; + val f = 2 + }; + val obj = new Local(); + x.$percent(obj.f).$eq$eq(0) + }; + foo(5) +}) diff --git a/tests/pending/run/exprs_serialize.scala b/tests/pending/run/exprs_serialize.scala new file mode 100644 index 000000000000..85cf55e1cb16 --- /dev/null +++ b/tests/pending/run/exprs_serialize.scala @@ -0,0 +1,39 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + def test(expr: Expr[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(expr) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val reexpr = in.readObject().asInstanceOf[ru.Expr[_]].in(cm) + in.close() + fin.close() + + println(reexpr) + } catch { + case ex: Exception => + println(ex) + } + + test(reify(2)) + test(reify{def foo = "hello"; foo + "world!"}) + test(reify { + def foo(x: Int) = { + class Local { + val f = 2 + } + val obj = new Local + x % obj.f == 0 + } + foo(5) + }) +} diff --git a/tests/pending/run/fail-non-value-types.check b/tests/pending/run/fail-non-value-types.check new file mode 100644 index 000000000000..714dce2c507b --- /dev/null +++ b/tests/pending/run/fail-non-value-types.check @@ -0,0 +1,3 @@ +[B, That](f: A => B)(implicit cbf: ImaginaryCanBuildFrom[CompletelyIndependentList.this.Repr,B,That])That +[B, That](f: Int => B)(implicit cbf: ImaginaryCanBuildFrom[CompletelyIndependentList[Int]#Repr,B,That])That +()CompletelyIndependentList[A] diff --git a/tests/pending/run/fail-non-value-types.scala b/tests/pending/run/fail-non-value-types.scala new file mode 100644 index 000000000000..d9a69e17c248 --- /dev/null +++ b/tests/pending/run/fail-non-value-types.scala @@ -0,0 +1,40 @@ +import scala.reflect.runtime.universe._ + +class ImaginaryCanBuildFrom[-From, -Elem, +To] +class CompletelyIndependentList[+A] { + type Repr <: CompletelyIndependentList[A] + def map[B, That](f: A => B)(implicit cbf: ImaginaryCanBuildFrom[Repr, B, That]): That = ??? + def distinct(): CompletelyIndependentList[A] = ??? +} + +object Test { + var failed = false + def expectFailure[T](body: => T): Boolean = { + try { val res = body ; failed = true ; println(res + " failed to fail.") ; false } + catch { case _: AssertionError => true } + } + + /** Attempt to use a method type as a type argument - expect failure. */ + def tcon[T: TypeTag](args: Type*) = appliedType(typeOf[T].typeConstructor, args.toList) + + def cil = typeOf[CompletelyIndependentList[Int]] + def map = cil.member(TermName("map")).asMethod + def distinct = cil.member(TermName("distinct")).asMethod + + def main(args: Array[String]): Unit = { + // Need the assert in there to fail. + // expectFailure(println(tcon[CompletelyIndependentList[Int]](map))) + // expectFailure(tcon[CompletelyIndependentList[Int]](distinct)) + + // Why is the first map signature printing showing an + // uninitialized symbol? + // + // [B <: , That <: ](f: )(implicit cbf: )That + // + + println(map.info) + println(map.infoIn(cil)) + println(distinct.info) + if (failed) sys.exit(1) + } +} diff --git a/tests/pending/run/finally.check b/tests/pending/run/finally.check new file mode 100644 index 000000000000..901a797426a6 --- /dev/null +++ b/tests/pending/run/finally.check @@ -0,0 +1,35 @@ +Running throwCatchFinally +hi +In Finally +java.lang.RuntimeException: ouch +---------------------------------------- +Running retCatch +java.lang.Exception +in finally +---------------------------------------- +Running throwCatch +java.lang.Exception +in finally +COUGHT: java.lang.Exception +---------------------------------------- +Running retBody +in finally +---------------------------------------- +Running throwBody +java.lang.Exception +in finally +---------------------------------------- +Running retFinally +body +in finally 1 +in finally 2 +---------------------------------------- +Running throwFinally +body +in finally +java.lang.Exception +---------------------------------------- +Running nestedFinalies +in finally 1 +in finally 2 +---------------------------------------- diff --git a/tests/pending/run/finally.scala b/tests/pending/run/finally.scala new file mode 100644 index 000000000000..64324abc4b61 --- /dev/null +++ b/tests/pending/run/finally.scala @@ -0,0 +1,127 @@ + +object Test extends dotty.runtime.LegacyApp { + + + // test that finally is not covered by any exception handlers. + def throwCatchFinally: Unit = { + try { + bar + } catch { + case e: Throwable => println(e) + } + } + + // test that finally is not covered by any exception handlers. + def bar: Unit = { + try { + println("hi") + } + catch { + case e: Throwable => println("SHOULD NOT GET HERE") + } + finally { + println("In Finally") + throw new RuntimeException("ouch") + } + } + + // return in catch (finally is executed) + def retCatch: Unit = { + try { + throw new Exception + } catch { + case e: Throwable => + println(e); + return + } finally println("in finally") + } + + // throw in catch (finally is executed, exception propagated) + def throwCatch: Unit = { + try { + throw new Exception + } catch { + case e: Throwable => + println(e); + throw e + } finally println("in finally") + } + + // return inside body (finally is executed) + def retBody: Unit = { + try { + return + } catch { + case e: Throwable => + println(e); + throw e + } finally println("in finally") + } + + // throw inside body (finally and catch are executed) + def throwBody: Unit = { + try { + throw new Exception + } catch { + case e: Throwable => + println(e); + } finally println("in finally") + } + + // return inside finally (each finally is executed once) + def retFinally: Unit = { + try { + try println("body") + finally { + println("in finally 1") + return + } + } finally println("in finally 2") + } + + + // throw inside finally (finally is executed once, exception is propagated) + def throwFinally: Unit = { + try { + try println("body") + finally { + println("in finally") + throw new Exception + } + } catch { + case e: Throwable => println(e) + } + } + + // nested finallies with return value + def nestedFinalies: Int = + try { + try { + return 10 + } finally { + try { () } catch { case _: Throwable => () } + println("in finally 1") + } + } finally { + println("in finally 2") + } + + def test[A](m: => A, name: String): Unit = { + println("Running %s".format(name)) + try { + m + } catch { + case e: Throwable => println("COUGHT: " + e) + } + println("-" * 40) + } + + test(throwCatchFinally, "throwCatchFinally") + test(retCatch, "retCatch") + test(throwCatch, "throwCatch") + test(retBody, "retBody") + test(throwBody, "throwBody") + test(retFinally, "retFinally") + test(throwFinally, "throwFinally") + test(nestedFinalies, "nestedFinalies") +} diff --git a/tests/pending/run/finalvar.check b/tests/pending/run/finalvar.check new file mode 100644 index 000000000000..249629397246 --- /dev/null +++ b/tests/pending/run/finalvar.check @@ -0,0 +1,6 @@ +(2,2,2,2,1) +(2,2,2,2) +(2,2,2,2,1001) +(2,2,2,2) +2 +10 diff --git a/tests/pending/run/finalvar.flags b/tests/pending/run/finalvar.flags new file mode 100644 index 000000000000..aee3039beccc --- /dev/null +++ b/tests/pending/run/finalvar.flags @@ -0,0 +1 @@ +-Yoverride-vars -Yinline \ No newline at end of file diff --git a/tests/pending/run/finalvar.scala b/tests/pending/run/finalvar.scala new file mode 100644 index 000000000000..184b78e98a88 --- /dev/null +++ b/tests/pending/run/finalvar.scala @@ -0,0 +1,37 @@ +object Final { + class X(final var x: Int) { } + def f = new X(0).x += 1 +} + +class A { + var x = 1 + def y0 = x + def y1 = this.x + def y2 = (this: A).x +} + +class B extends A { + override def x = 2 + def z = super.x +} + +object Test { + def main(args: Array[String]): Unit = { + Final.f + val a = new B + println((a.x, a.y0, a.y1, a.y2, a.z)) + val a0: A = a + println((a0.x, a0.y0, a0.y1, a0.y2)) + a.x = 1001 + println((a.x, a.y0, a.y1, a.y2, a.z)) + println((a0.x, a0.y0, a0.y1, a0.y2)) + + val d = new D + println(d.w) + d.ten + println(d.w) + } +} + +class C { var w = 1 ; def ten = this.w = 10 } +class D extends C { override var w = 2 } diff --git a/tests/pending/run/flat-flat-flat.scala b/tests/pending/run/flat-flat-flat.scala new file mode 100644 index 000000000000..80868b9c5e40 --- /dev/null +++ b/tests/pending/run/flat-flat-flat.scala @@ -0,0 +1,11 @@ +object Test { + def f1 = List(Iterator(Some(1), None, Some(2)), Iterator(Some(3), None)) + def f2 = Iterator(List(Some(1), None, Some(2)), List(Some(3), None), Nil) + def f3 = List(Some(Iterator(1)), None, Some(Iterator(2, 3))) + + def main(args: Array[String]): Unit = { + assert(f1.flatten.flatten.toList == List(1, 2, 3)) + assert(f2.flatten.flatten.toList == List(1, 2, 3)) + assert(f3.flatten.flatten.toList == List(1, 2, 3)) + } +} diff --git a/tests/pending/run/fors.check b/tests/pending/run/fors.check new file mode 100644 index 000000000000..b459f00b4910 --- /dev/null +++ b/tests/pending/run/fors.check @@ -0,0 +1,28 @@ + +testOld +1 2 3 +2 +2 +3 +1 2 3 +1 2 3 +0 1 2 3 4 5 6 7 8 9 +0 2 4 6 8 +0 2 4 6 8 +a b c +b c +b c + +testNew +3 +1 2 3 +1 2 3 +0 1 2 3 4 5 6 7 8 9 +0 2 4 6 8 +0 2 4 6 8 +0 2 4 6 8 +0 2 4 6 8 +0 2 4 6 8 +0 2 4 6 8 +0 2 4 6 8 +a b c diff --git a/tests/pending/run/fors.scala b/tests/pending/run/fors.scala new file mode 100644 index 000000000000..1de1640295dc --- /dev/null +++ b/tests/pending/run/fors.scala @@ -0,0 +1,84 @@ +//############################################################################ +// for-comprehensions (old and new syntax) +//############################################################################ + +//############################################################################ + +object Test extends dotty.runtime.LegacyApp { + val xs = List(1, 2, 3) + val ys = List('a, 'b, 'c) + + def it = 0 until 10 + + val ar = "abc".toCharArray + + /////////////////// old syntax /////////////////// + + def testOld: Unit = { + println("\ntestOld") + + // lists + for (x <- xs) print(x + " "); println + for (x <- xs; + if x % 2 == 0) print(x + " "); println + for {x <- xs + if x % 2 == 0} print(x + " "); println + var n = 0 + for (_ <- xs) n += 1; println(n) + for ((x, y) <- xs zip ys) print(x + " "); println + for (p @ (x, y) <- xs zip ys) print(p._1 + " "); println + + // iterators + for (x <- it) print(x + " "); println + for (x <- it; + if x % 2 == 0) print(x + " "); println + for {x <- it + if x % 2 == 0} print(x + " "); println + + // arrays + for (x <- ar) print(x + " "); println + for (x <- ar; + if x.toInt > 97) print(x + " "); println + for {x <- ar + if x.toInt > 97} print(x + " "); println + + } + + /////////////////// new syntax /////////////////// + + def testNew: Unit = { + println("\ntestNew") + + // lists + var n = 0 + for (_ <- xs) n += 1; println(n) + for ((x, y) <- xs zip ys) print(x + " "); println + for (p @ (x, y) <- xs zip ys) print(p._1 + " "); println + + // iterators + for (x <- it) print(x + " "); println + for (x <- it if x % 2 == 0) print(x + " "); println + for (x <- it; if x % 2 == 0) print(x + " "); println + for (x <- it; + if x % 2 == 0) print(x + " "); println + for (x <- it + if x % 2 == 0) print(x + " "); println + for {x <- it + if x % 2 == 0} print(x + " "); println + for (x <- it; + y = 2 + if x % y == 0) print(x + " "); println + for {x <- it + y = 2 + if x % y == 0} print(x + " "); println + + // arrays + for (x <- ar) print(x + " "); println + + } + + //////////////////////////////////////////////////// + + testOld + testNew +} diff --git a/tests/pending/run/forvaleq.check b/tests/pending/run/forvaleq.check new file mode 100644 index 000000000000..ec57719cb42c --- /dev/null +++ b/tests/pending/run/forvaleq.check @@ -0,0 +1,5 @@ +List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) +List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) +List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) +List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) +called 20 times diff --git a/tests/pending/run/forvaleq.scala b/tests/pending/run/forvaleq.scala new file mode 100644 index 000000000000..dac3234a68d6 --- /dev/null +++ b/tests/pending/run/forvaleq.scala @@ -0,0 +1,91 @@ +// test "foo = expr" clauses in for comprehensions + +import scala.collection.immutable.Queue +import scala.{List=>L} + +object Test { + // redefine some symbols to make it extra hard + class List + class Tuple2 + def List[A](as: A*) = 5 + + def firstDigit(x: Int): Int = + x match { + case 0 => 0 + case _ if (x<0) => firstDigit(-x) + case _ if (x<10) => x + case _ => firstDigit(x / 10) + } + + + { + // a basic test case + + val input = L.range(0,20) + val oddFirstTimesTwo = + for {x <- input + xf = firstDigit(x) + if xf % 2 == 1} + yield x*2 + println(oddFirstTimesTwo) + } + + { + // a test case with patterns + + val input = L.range(0, 20) + val oddFirstTimesTwo = + for {x <- input + xf = firstDigit(x) + yf = x - firstDigit(x) / 10 + (a, b) = (xf - yf, xf + yf) + if xf % 2 == 1} + yield a + b + println(oddFirstTimesTwo) + } + + { + // make sure it works on non-Ls + + // val input: Queue = Queue.Empty[int].incl(L.range(0,20)) + val input = L.range(0, 20).iterator + val oddFirstTimesTwo = + for {x <- input + xf = firstDigit(x) + if xf % 2 == 1} + yield x*2 + println(oddFirstTimesTwo.toList) + } + + { + // yield the computed value + + val input = L.range(0,20) + val oddFirstTimesTwo = + for {x <- input + xf = firstDigit(x) + if xf % 2 == 1} + yield xf*2 + println(oddFirstTimesTwo) + } + + { + // make sure the function is only called once + var count: Int = 0 + + def fdct(x: Int) = { + count += 1 + firstDigit(x) + } + + val input = L.range(0,20) + for {x <- input + xf = fdct(x) + if xf % 2 == 1} + yield xf + + println("called " + count + " times") + } + + def main(args: Array[String]): Unit = {} +} diff --git a/tests/pending/run/freetypes_false_alarm1.check b/tests/pending/run/freetypes_false_alarm1.check new file mode 100644 index 000000000000..085b3ee50b13 --- /dev/null +++ b/tests/pending/run/freetypes_false_alarm1.check @@ -0,0 +1 @@ +scala.List[Int] diff --git a/tests/pending/run/freetypes_false_alarm1.scala b/tests/pending/run/freetypes_false_alarm1.scala new file mode 100644 index 000000000000..b06e10efe6af --- /dev/null +++ b/tests/pending/run/freetypes_false_alarm1.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val ru = scala.reflect.runtime.universe + val tpe: ru.Type = ru.typeOf[List[Int]] + println(tpe) + }.eval +} diff --git a/tests/pending/run/freetypes_false_alarm2.check b/tests/pending/run/freetypes_false_alarm2.check new file mode 100644 index 000000000000..02e4a84d62c4 --- /dev/null +++ b/tests/pending/run/freetypes_false_alarm2.check @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/tests/pending/run/freetypes_false_alarm2.scala b/tests/pending/run/freetypes_false_alarm2.scala new file mode 100644 index 000000000000..6e6fd4c9ca83 --- /dev/null +++ b/tests/pending/run/freetypes_false_alarm2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.tools.reflect.Eval +import internal._ + +object Test extends dotty.runtime.LegacyApp { + val tpe = typeOf[ru.Type] + println(isFreeType(tpe.typeSymbol)) +} diff --git a/tests/pending/run/future-flatmap-exec-count.check b/tests/pending/run/future-flatmap-exec-count.check new file mode 100644 index 000000000000..dd9dce64ed78 --- /dev/null +++ b/tests/pending/run/future-flatmap-exec-count.check @@ -0,0 +1,6 @@ +mapping +execute() +flatmapping +execute() +recovering +execute() diff --git a/tests/pending/run/future-flatmap-exec-count.scala b/tests/pending/run/future-flatmap-exec-count.scala new file mode 100644 index 000000000000..849beb6b16c8 --- /dev/null +++ b/tests/pending/run/future-flatmap-exec-count.scala @@ -0,0 +1,61 @@ +import scala.concurrent._ +import java.util.concurrent.atomic.AtomicInteger + +object Test { + def main(args: Array[String]): Unit = { + test() + } + + def test() = { + def await(f: Future[Any]) = + Await.result(f, duration.Duration.Inf) + + val ec = new TestExecutionContext(ExecutionContext.Implicits.global) + + { + val p = Promise[Int]() + val fp = p.future + println("mapping") + val mapped = fp.map(x => x)(ec) + p.success(0) + await(mapped) + } + + { + println("flatmapping") + val p = Promise[Int]() + val fp = p.future + val flatMapped = fp.flatMap({ (x: Int) => + Future.successful(2 * x) + })(ec) + p.success(0) + await(flatMapped) + } + + { + println("recovering") + val recovered = Future.failed(new Throwable()).recoverWith { + case _ => Future.successful(2) + }(ec) + await(recovered) + } + } + + class TestExecutionContext(delegate: ExecutionContext) extends ExecutionContext { + def execute(runnable: Runnable): Unit = ??? + + def reportFailure(t: Throwable): Unit = ??? + + override def prepare(): ExecutionContext = { + val preparedDelegate = delegate.prepare() + return new ExecutionContext { + def execute(runnable: Runnable): Unit = { + println("execute()") + preparedDelegate.execute(runnable) + } + + def reportFailure(t: Throwable): Unit = ??? + } + } + } +} diff --git a/tests/pending/run/gadts.check b/tests/pending/run/gadts.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/gadts.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/gadts.scala b/tests/pending/run/gadts.scala new file mode 100644 index 000000000000..7413df1193db --- /dev/null +++ b/tests/pending/run/gadts.scala @@ -0,0 +1,17 @@ +abstract class Term[T] +case class Lit(x: Int) extends Term[Int] +case class Succ(t: Term[Int]) extends Term[Int] +case class IsZero(t: Term[Int]) extends Term[Boolean] +case class If[T](c: Term[Boolean], + t1: Term[T], + t2: Term[T]) extends Term[T] + +object Test extends dotty.runtime.LegacyApp { + def eval[T](t: Term[T]): T = t match { + case Lit(n) => n + case Succ(u) => eval(u) + 1 + case IsZero(u) => eval(u) == 0 + case If(c, u1, u2) => eval(if (eval(c)) u1 else u2) + } + println(eval(If(IsZero(Lit(1)), Lit(41), Succ(Lit(41))))) +} diff --git a/tests/pending/run/genericValueClass.check b/tests/pending/run/genericValueClass.check new file mode 100644 index 000000000000..ec3a41a6a92f --- /dev/null +++ b/tests/pending/run/genericValueClass.check @@ -0,0 +1,2 @@ +(1,abc) +(2,def) diff --git a/tests/pending/run/genericValueClass.scala b/tests/pending/run/genericValueClass.scala new file mode 100644 index 000000000000..5873eace1443 --- /dev/null +++ b/tests/pending/run/genericValueClass.scala @@ -0,0 +1,20 @@ + +import scala.language.implicitConversions + +object Test extends dotty.runtime.LegacyApp { + class ArrowAssocClass[A](val __leftOfArrow: A) extends AnyVal { + @inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) + def →[B](y: B): Tuple2[A, B] = ->(y) + } + + { + @inline implicit def ArrowAssoc[A](x: A): ArrowAssocClass[A] = new ArrowAssocClass(x) + val x = 1 -> "abc" + println(x) + } + + { + val y = 2 -> "def" + println(y) + } +} diff --git a/tests/pending/run/getClassTest-new.check b/tests/pending/run/getClassTest-new.check new file mode 100644 index 000000000000..94e86c388920 --- /dev/null +++ b/tests/pending/run/getClassTest-new.check @@ -0,0 +1,18 @@ +f1: java.lang.Class +f2: java.lang.Class +f3: java.lang.Class +f4: java.lang.Class +f5: java.lang.Class +f0: T +f1: class java.lang.Object +f2: class java.lang.Object +f3: class AnyRefs$A +f4: class AnyRefs$B +f5: class java.lang.Object +f6: class java.lang.Object +f7: class AnyRefs$A +f8: class AnyRefs$B +f1: java.lang.Class +f2: java.lang.Class +f3: java.lang.Class +f4: java.lang.Class diff --git a/tests/pending/run/getClassTest-new.scala b/tests/pending/run/getClassTest-new.scala new file mode 100644 index 000000000000..9e111bea1bc2 --- /dev/null +++ b/tests/pending/run/getClassTest-new.scala @@ -0,0 +1,68 @@ +import scala.reflect.{ClassTag, classTag} + +class AnyVals { + def f1 = (5: Any).getClass + def f2 = (5: AnyVal).getClass + def f3 = 5.getClass + def f4 = (5: java.lang.Integer).getClass + def f5 = (5.asInstanceOf[AnyRef]).getClass + + // scalap says: + // + // def f1 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ } + // def f2 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ } + // def f3 : java.lang.Class[scala.Int] = { /* compiled code */ } + // def f4 : java.lang.Class[?0] forSome {type ?0 <: java.lang.Integer} = { /* compiled code */ } + // def f5 : java.lang.Class[?0] forSome {type ?0 <: scala.AnyRef} = { /* compiled code */ } + // + // java generic signature says: + // + // f1: java.lang.Class + // f2: java.lang.Class + // f3: java.lang.Class + // f4: java.lang.Class + // f5: java.lang.Class +} + +class AnyRefs { + class A + class B extends A + + def f1 = (new B: Any).getClass().newInstance() + def f2 = (new B: AnyRef).getClass().newInstance() + def f3 = (new B: A).getClass().newInstance() + def f4 = (new B: B).getClass().newInstance() + + def f0[T >: B] = (new B: T).getClass().newInstance() + + def f5 = f0[Any] + def f6 = f0[AnyRef] + def f7 = f0[A] + def f8 = f0[B] +} + +class MoreAnyRefs { + trait A + trait B + + // don't leak anon/refinements + def f1 = (new A with B { }).getClass() + def f2 = (new B with A { }).getClass() + def f3 = (new { def bippy() = 5 }).getClass() + def f4 = (new A { def bippy() = 5 }).getClass() +} + +object Test { + def returnTypes[T: ClassTag] = ( + classTag[T].runtimeClass.getMethods.toList + filter (_.getName startsWith "f") + sortBy (_.getName) + map (m => m.getName + ": " + m.getGenericReturnType.toString) + ) + + def main(args: Array[String]): Unit = { + returnTypes[AnyVals] foreach println + returnTypes[AnyRefs] foreach println + returnTypes[MoreAnyRefs] foreach println + } +} diff --git a/tests/pending/run/getClassTest-old.check b/tests/pending/run/getClassTest-old.check new file mode 100644 index 000000000000..94e86c388920 --- /dev/null +++ b/tests/pending/run/getClassTest-old.check @@ -0,0 +1,18 @@ +f1: java.lang.Class +f2: java.lang.Class +f3: java.lang.Class +f4: java.lang.Class +f5: java.lang.Class +f0: T +f1: class java.lang.Object +f2: class java.lang.Object +f3: class AnyRefs$A +f4: class AnyRefs$B +f5: class java.lang.Object +f6: class java.lang.Object +f7: class AnyRefs$A +f8: class AnyRefs$B +f1: java.lang.Class +f2: java.lang.Class +f3: java.lang.Class +f4: java.lang.Class diff --git a/tests/pending/run/getClassTest-old.scala b/tests/pending/run/getClassTest-old.scala new file mode 100644 index 000000000000..cd1b6b07f630 --- /dev/null +++ b/tests/pending/run/getClassTest-old.scala @@ -0,0 +1,67 @@ +class AnyVals { + def f1 = (5: Any).getClass + def f2 = (5: AnyVal).getClass + def f3 = 5.getClass + def f4 = (5: java.lang.Integer).getClass + def f5 = (5.asInstanceOf[AnyRef]).getClass + + // scalap says: + // + // def f1 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ } + // def f2 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ } + // def f3 : java.lang.Class[scala.Int] = { /* compiled code */ } + // def f4 : java.lang.Class[?0] forSome {type ?0 <: java.lang.Integer} = { /* compiled code */ } + // def f5 : java.lang.Class[?0] forSome {type ?0 <: scala.AnyRef} = { /* compiled code */ } + // + // java generic signature says: + // + // f1: java.lang.Class + // f2: java.lang.Class + // f3: java.lang.Class + // f4: java.lang.Class + // f5: java.lang.Class +} + +class AnyRefs { + class A + class B extends A + + def f1 = (new B: Any).getClass().newInstance() + def f2 = (new B: AnyRef).getClass().newInstance() + def f3 = (new B: A).getClass().newInstance() + def f4 = (new B: B).getClass().newInstance() + + def f0[T >: B] = (new B: T).getClass().newInstance() + + def f5 = f0[Any] + def f6 = f0[AnyRef] + def f7 = f0[A] + def f8 = f0[B] +} + +class MoreAnyRefs { + trait A + trait B + + // don't leak anon/refinements + def f1 = (new A with B { }).getClass() + def f2 = (new B with A { }).getClass() + def f3 = (new { def bippy() = 5 }).getClass() + def f4 = (new A { def bippy() = 5 }).getClass() +} + +@deprecated("Suppress warnings", since="2.11") +object Test { + def returnTypes[T: Manifest] = ( + manifest[T].runtimeClass.getMethods.toList + filter (_.getName startsWith "f") + sortBy (_.getName) + map (m => m.getName + ": " + m.getGenericReturnType.toString) + ) + + def main(args: Array[String]): Unit = { + returnTypes[AnyVals] foreach println + returnTypes[AnyRefs] foreach println + returnTypes[MoreAnyRefs] foreach println + } +} diff --git a/tests/pending/run/getClassTest-valueClass.check b/tests/pending/run/getClassTest-valueClass.check new file mode 100644 index 000000000000..7608d92b4e2f --- /dev/null +++ b/tests/pending/run/getClassTest-valueClass.check @@ -0,0 +1,2 @@ +int +class V diff --git a/tests/pending/run/getClassTest-valueClass.scala b/tests/pending/run/getClassTest-valueClass.scala new file mode 100644 index 000000000000..05a116dfff99 --- /dev/null +++ b/tests/pending/run/getClassTest-valueClass.scala @@ -0,0 +1,10 @@ +class V(val x: Int) extends AnyVal + +object Test { + def main(args: Array[String]) = { + val v = new V(2) + val s: Any = 2 + println(2.getClass) + println(v.getClass) + } +} diff --git a/tests/pending/run/global-showdef.check b/tests/pending/run/global-showdef.check new file mode 100644 index 000000000000..4ac96b43159f --- /dev/null +++ b/tests/pending/run/global-showdef.check @@ -0,0 +1,14 @@ +<<-- class foo.bar.Bippy after phase 'typer' -->> + def showdefTestMemberClass1: Int +<<-- object foo.bar.Bippy after phase 'typer' -->> + def showdefTestMemberObject2: String +<<-- type foo.bar.Bippy.BippyType after phase 'typer' -->> + def showdefTestMemberType1: Unit +<<-- object foo.bar.Bippy.Boppity.Boo after phase 'typer' -->> + def showdefTestMemberObject1: String +<<-- type foo.bar.Bippy.BippyType after phase 'typer' -->> + def showdefTestMemberType2: Unit +<<-- class foo.bar.Bippy.Boppity after phase 'typer' -->> + def showdefTestMemberClass2: Int +<<-- class foo.bar.Bippy.Boppity.Boo after phase 'typer' -->> + def showdefTestMemberClass3: Int diff --git a/tests/pending/run/global-showdef.scala b/tests/pending/run/global-showdef.scala new file mode 100644 index 000000000000..276fcc1e7c95 --- /dev/null +++ b/tests/pending/run/global-showdef.scala @@ -0,0 +1,58 @@ +import scala.tools.partest.DirectTest +import scala.tools.nsc.util.stringFromStream + +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -Yshow:typer -Ystop-after:typer" + + override def code = """ +package foo.bar + +class Bippy { + type BippyType <: { + def showdefTestMemberType1: Unit + } + + def showdefTestMemberClass1 = 5 + class Boppity { + def showdefTestMemberClass2 = 5 + class Boo { + def showdefTestMemberClass3 = 5 + } + object Boo { + def showdefTestMemberObject1 = "abc" + } + } +} + +object Bippy { + type BippyType <: { + def showdefTestMemberType2: Unit + } + + def showdefTestMemberObject2 = "abc" +} + """ + + override def show(): Unit = { + val classes = List("Bippy", "Bippy#BippyType", "Bippy.BippyType", "Bippy#Boppity", "Bippy#Boppity#Boo") + val objects = List("Bippy", "Bippy#Boppity#Boo") + + def interesting(line: String) = (line contains "def showdefTestMember") || (line startsWith "<<-- ") + + def run(args: String*) = slurp(args: _*).lines filter interesting foreach println + + classes.zipAll(objects, "", "") foreach { + case (c, "") => run("-Xshow-class", c) + case (c, o) => run("-Xshow-class", c, "-Xshow-object", o) + } + } + + // slurp the compilation result + def slurp(args: String*): String = stringFromStream { stream => + Console.withOut(stream) { + Console.withErr(stream) { + compile(args: _*) + } + } + } +} diff --git a/tests/pending/run/groupby.scala b/tests/pending/run/groupby.scala new file mode 100644 index 000000000000..9a33ae28968b --- /dev/null +++ b/tests/pending/run/groupby.scala @@ -0,0 +1,18 @@ + + + +// Fixes #3422 +object Test { + + def main(args: Array[String]): Unit = { + val arr = Array.range(0,10) + val map = arr groupBy (_%2) + val v1 = map(0) + val v2 = map(0) + // this should hold, of course, assuming also that group by returns a regular + // map implementation, and does nothing fancy - and it should return just a + // hash map by default. + assert(v1 eq v2) + } + +} diff --git a/tests/pending/run/hashCodeBoxesRunTime.scala b/tests/pending/run/hashCodeBoxesRunTime.scala new file mode 100644 index 000000000000..ba1a30f5fb4a --- /dev/null +++ b/tests/pending/run/hashCodeBoxesRunTime.scala @@ -0,0 +1,28 @@ +// This only tests direct access to the methods in BoxesRunTime, +// not the whole scheme. +object Test +{ + import java.{ lang => jl } + import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject } + + def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs) + + def mkNumbers(x: Int): List[Number] = + List(x.toByte, x.toShort, x, x.toLong, x.toFloat, x.toDouble) + + def testLDF(x: Long) = allSame(List[Number](x, x.toDouble, x.toFloat) map hashFromNumber) + + def main(args: Array[String]): Unit = { + List(Byte.MinValue, -1, 0, 1, Byte.MaxValue) foreach { n => + val hashes = mkNumbers(n) map hashFromNumber + allSame(hashes) + if (n >= 0) { + val charCode = hashFromObject(n.toChar: Character) + assert(charCode == hashes.head) + } + } + + testLDF(Short.MaxValue.toLong) + testLDF(Short.MinValue.toLong) + } +} diff --git a/tests/pending/run/hashCodeDistribution.scala b/tests/pending/run/hashCodeDistribution.scala new file mode 100644 index 000000000000..284f3d977c49 --- /dev/null +++ b/tests/pending/run/hashCodeDistribution.scala @@ -0,0 +1,17 @@ +// See ticket #2537. +object Test { + case class C(x: Int, y: Int) { } + val COUNT = 300 + val totalCodes = COUNT * COUNT + + def main (args: Array[String]) = { + val hashCodes = + for (x <- 0 until COUNT; y <- 0 until COUNT) yield C(x,y).hashCode + + val uniques = hashCodes.distinct + val collisionRate = (totalCodes - uniques.size) * 1000 / totalCodes + + assert(collisionRate < 5, "Collision rate too high: %d / 1000".format(collisionRate)) + // println("collisionRate = %d / 1000".format(collisionRate)) + } +} diff --git a/tests/pending/run/hashhash.scala b/tests/pending/run/hashhash.scala new file mode 100644 index 000000000000..3b9d1479cff3 --- /dev/null +++ b/tests/pending/run/hashhash.scala @@ -0,0 +1,23 @@ +object Test { + def confirmSame(x: Any) = assert(x.## == x.hashCode, "%s.## != %s.hashCode".format(x, x)) + def confirmDifferent(x: Any) = assert(x.## != x.hashCode, "%s.## == %s.hashCode (but should not)".format(x, x)) + + def main(args: Array[String]): Unit = { + /** Just a little sanity check, not to be confused with a unit test. */ + List(5, 5.5f, "abc", new AnyRef, ()) foreach confirmSame + List(5.0f, 1.0d, -(5.0f), (-1.0d)) foreach confirmDifferent + + val x = (BigInt(1) << 64).toDouble + val y: Any = x + val f: Float = x.toFloat + val jn: java.lang.Number = x + val jf: java.lang.Float = x.toFloat + val jd: java.lang.Double = x + + assert(x.## == y.##, ((x, y))) + assert(x.## == f.##, ((x, f))) + assert(x.## == jn.##, ((x, jn))) + assert(x.## == jf.##, ((x, jf))) + assert(x.## == jd.##, ((x, jd))) + } +} diff --git a/tests/pending/run/hashset.check b/tests/pending/run/hashset.check new file mode 100644 index 000000000000..9542a1ff48b5 --- /dev/null +++ b/tests/pending/run/hashset.check @@ -0,0 +1,26 @@ +*** HashSet primitives +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + +*** HashSet Strings with null +null true +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,10,11,12,13,14,15,16,17,18,19,2,3,4,5,6,7,8,9,null +null false +0 false,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true + +*** ParHashSet primitives +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + +*** ParHashSet Strings with null +null true +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,10,11,12,13,14,15,16,17,18,19,2,3,4,5,6,7,8,9,null +null false +0 false,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true + diff --git a/tests/pending/run/hashset.scala b/tests/pending/run/hashset.scala new file mode 100644 index 000000000000..0c305142b110 --- /dev/null +++ b/tests/pending/run/hashset.scala @@ -0,0 +1,48 @@ +import scala.collection.generic.{Growable, Shrinkable} +import scala.collection.GenSet +import scala.collection.mutable.FlatHashTable +import scala.collection.mutable.HashSet +import scala.collection.parallel.mutable.ParHashSet + +object Test extends dotty.runtime.LegacyApp { + test(new Creator{ + def create[A] = new HashSet[A] + def hashSetType = "HashSet" + }) + + test(new Creator{ + def create[A] = new ParHashSet[A] + def hashSetType = "ParHashSet" + }) + + + def test(creator : Creator): Unit = { + println("*** " + creator.hashSetType + " primitives") + val h1 = creator.create[Int] + for (i <- 0 until 20) h1 += i + println((for (i <- 0 until 20) yield i + " " + (h1 contains i)).toList.sorted mkString(",")) + println((for (i <- 20 until 40) yield i + " " + (h1 contains i)).toList.sorted mkString(",")) + println(h1.toList.sorted mkString ",") + println + + println("*** " + creator.hashSetType + " Strings with null") + val h2 = creator.create[String] + h2 += null + for (i <- 0 until 20) h2 += "" + i + println("null " + (h2 contains null)) + println((for (i <- 0 until 20) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println((for (i <- 20 until 40) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println((h2.toList map {x => "" + x}).sorted mkString ",") + + h2 -= null + h2 -= "" + 0 + println("null " + (h2 contains null)) + println((for (i <- 0 until 20) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println + } + + trait Creator { + def create[A] : GenSet[A] with Cloneable with FlatHashTable[A] with Growable[A] with Shrinkable[A] + def hashSetType : String + } +} diff --git a/tests/pending/run/hashsetremove.check b/tests/pending/run/hashsetremove.check new file mode 100644 index 000000000000..8de9826895ce --- /dev/null +++ b/tests/pending/run/hashsetremove.check @@ -0,0 +1,6 @@ +remove 0 should be false, was false +contains 1 should be true, was true +remove 1 should be true, was true +contains 1 should be false, was false +remove 1 should be false, was false +contains 1 should be false, was false diff --git a/tests/pending/run/hashsetremove.scala b/tests/pending/run/hashsetremove.scala new file mode 100644 index 000000000000..e47269a96217 --- /dev/null +++ b/tests/pending/run/hashsetremove.scala @@ -0,0 +1,13 @@ +import scala.collection.mutable.HashSet + + +object Test extends dotty.runtime.LegacyApp { + val h = new HashSet[Int] + h += 1 + println(s"remove 0 should be false, was ${h remove 0}") + println(s"contains 1 should be true, was ${h contains 1}") + println(s"remove 1 should be true, was ${h remove 1}") + println(s"contains 1 should be false, was ${h contains 1}") + println(s"remove 1 should be false, was ${h remove 1}") + println(s"contains 1 should be false, was ${h contains 1}") + } diff --git a/tests/pending/run/icode-reader-dead-code.check b/tests/pending/run/icode-reader-dead-code.check new file mode 100644 index 000000000000..d1739fed3b18 --- /dev/null +++ b/tests/pending/run/icode-reader-dead-code.check @@ -0,0 +1,19 @@ +Bytecode for method f + L0 + LINENUMBER 4 L0 + ICONST_1 + IRETURN + L1 + LOCALVARIABLE this Lp/A; L0 L1 0 + MAXSTACK = 1 + MAXLOCALS = 1 +Bytecode for method f + L0 + LINENUMBER 4 L0 + ICONST_1 + ATHROW + IRETURN + L1 + LOCALVARIABLE this Lp/A; L0 L1 0 + MAXSTACK = 1 + MAXLOCALS = 1 diff --git a/tests/pending/run/icode-reader-dead-code.scala b/tests/pending/run/icode-reader-dead-code.scala new file mode 100644 index 000000000000..00ba58829f71 --- /dev/null +++ b/tests/pending/run/icode-reader-dead-code.scala @@ -0,0 +1,82 @@ +import java.io.{FileOutputStream, FileInputStream} + +import scala.tools.asm.{ClassWriter, Opcodes, ClassReader} +import scala.tools.asm.tree.{InsnNode, ClassNode} +import scala.tools.nsc.backend.jvm.AsmUtils +import scala.tools.partest.DirectTest +import scala.collection.JavaConverters._ + +/** + * Test that the ICodeReader does not crash if the bytecode of a method has unreachable code. + */ +object Test extends DirectTest { + def code: String = ??? + + def show(): Unit = { + // The bytecode of f will be modified using ASM by `addDeadCode` + val aCode = + """ + |package p + |class A { + | @inline final def f = 1 + |} + """.stripMargin + + val bCode = + """ + |package p + |class B { + | def g = (new A()).f + |} + """.stripMargin + + compileString(newCompiler("-usejavacp"))(aCode) + + addDeadCode() + + // If inlining fails, the compiler will issue an inliner warning that is not present in the + // check file + compileString(newCompiler("-usejavacp", "-optimise"))(bCode) + } + + def readClass(file: String) = { + val cnode = new ClassNode() + val is = new FileInputStream(file) + val reader = new ClassReader(is) + reader.accept(cnode, 0) + is.close() + cnode + } + + def writeClass(file: String, cnode: ClassNode): Unit = { + val writer = new ClassWriter(0) + cnode.accept(writer) + + val os = new FileOutputStream(file) + os.write(writer.toByteArray) + os.close() + } + + def addDeadCode() { + val file = (testOutput / "p" / "A.class").path + val cnode = readClass(file) + val method = cnode.methods.asScala.find(_.name == "f").head + + AsmUtils.traceMethod(method) + + val insns = method.instructions + val it = insns.iterator() + while (it.hasNext) { + val in = it.next() + if (in.getOpcode == Opcodes.IRETURN) { + // Insert an ATHROW before the IRETURN. The IRETURN will then be dead code. + // The ICodeReader should not crash if there's dead code. + insns.insert(in.getPrevious, new InsnNode(Opcodes.ATHROW)) + } + } + + AsmUtils.traceMethod(method) + + writeClass(file, cnode) + } +} diff --git a/tests/pending/run/idempotency-case-classes.check b/tests/pending/run/idempotency-case-classes.check new file mode 100644 index 000000000000..5a8d0ad9d326 --- /dev/null +++ b/tests/pending/run/idempotency-case-classes.check @@ -0,0 +1,55 @@ +C(2,3) +() +{ + case class C extends AnyRef with Product with Serializable { + private[this] val x: Int = _; + def x: Int = C.this.x; + private[this] val y: Int = _; + def y: Int = C.this.y; + def (x: Int, y: Int): C = { + C.super.(); + () + }; + def copy(x: Int = x, y: Int = y): C = new C(x, y); + def copy$default$1: Int = C.this.x; + def copy$default$2: Int = C.this.y; + override def productPrefix: String = "C"; + def productArity: Int = 2; + def productElement(x$1: Int): Any = x$1 match { + case 0 => C.this.x + case 1 => C.this.y + case _ => throw new IndexOutOfBoundsException(x$1.toString()) + }; + override def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](C.this); + def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[C](); + override def hashCode(): Int = { + var acc: Int = -889275714; + acc = Statics.this.mix(acc, x); + acc = Statics.this.mix(acc, y); + Statics.this.finalizeHash(acc, 2) + }; + override def toString(): String = ScalaRunTime.this._toString(C.this); + override def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1 match { + case (_: C) => true + case _ => false +}.&&({ + val C$1: C = x$1.asInstanceOf[C]; + C.this.x.==(C$1.x).&&(C.this.y.==(C$1.y)).&&(C$1.canEqual(C.this)) + })) + }; + object C extends scala.runtime.AbstractFunction2[Int,Int,C] with Serializable { + def (): C.type = { + C.super.(); + () + }; + final override def toString(): String = "C"; + case def apply(x: Int, y: Int): C = new C(x, y); + case def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null)) + scala.this.None + else + Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y)); + private def readResolve(): Object = C + }; + Predef.println(C.apply(2, 3)) +} +error! diff --git a/tests/pending/run/idempotency-case-classes.scala b/tests/pending/run/idempotency-case-classes.scala new file mode 100644 index 000000000000..8c2aa70dc845 --- /dev/null +++ b/tests/pending/run/idempotency-case-classes.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val casee = reify { + case class C(x: Int, y: Int) + println(C(2, 3)) + } + println(casee.eval) + val tb = cm.mkToolBox() + val tcasee = tb.typecheck(casee.tree) + println(tcasee) + val rtcasee = tb.untypecheck(tcasee) + try { + println(tb.eval(rtcasee)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5467 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/pending/run/idempotency-extractors.check b/tests/pending/run/idempotency-extractors.check new file mode 100644 index 000000000000..fcd50faa7905 --- /dev/null +++ b/tests/pending/run/idempotency-extractors.check @@ -0,0 +1,5 @@ +2 +2 match { + case Test.this.Extractor.unapply() ((x @ _)) => x +} +error! diff --git a/tests/pending/run/idempotency-extractors.scala b/tests/pending/run/idempotency-extractors.scala new file mode 100644 index 000000000000..f5d6cd193fdd --- /dev/null +++ b/tests/pending/run/idempotency-extractors.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object Extractor { def unapply(x: Int): Option[Int] = Some(x) } + val extractor = reify { + 2 match { case Extractor(x) => x } + } + println(extractor.eval) + val tb = cm.mkToolBox() + val textractor = tb.typecheck(extractor.tree) + println(textractor) + val rtextractor = tb.untypecheck(textractor) + try { + println(tb.eval(rtextractor)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5465 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/pending/run/idempotency-labels.check b/tests/pending/run/idempotency-labels.check new file mode 100644 index 000000000000..8709efeb43e2 --- /dev/null +++ b/tests/pending/run/idempotency-labels.check @@ -0,0 +1,15 @@ +2 +{ + var x: Int = 0; + while$1(){ + if (x.<(2)) + { + x = x.+(1); + while$1() + } + else + () + }; + x +} +2 diff --git a/tests/pending/run/idempotency-labels.scala b/tests/pending/run/idempotency-labels.scala new file mode 100644 index 000000000000..1260633845a1 --- /dev/null +++ b/tests/pending/run/idempotency-labels.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val label = reify { + var x = 0 + while (x < 2) { x += 1 } + x + } + println(label.eval) + val tb = cm.mkToolBox() + val tlabel = tb.typecheck(label.tree) + println(tlabel) + val rtlabel = tb.untypecheck(tlabel) + try { + println(tb.eval(rtlabel)) + } catch { + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/pending/run/idempotency-lazy-vals.check b/tests/pending/run/idempotency-lazy-vals.check new file mode 100644 index 000000000000..15afa5303c4c --- /dev/null +++ b/tests/pending/run/idempotency-lazy-vals.check @@ -0,0 +1,23 @@ +6 +{ + class C extends AnyRef { + def (): C = { + C.super.(); + () + }; + lazy private[this] val x: Int = _; + lazy def x: Int = { + C.this.x = 2; + C.this.x + }; + lazy private[this] val y: Int = _; + implicit lazy def y: Int = { + C.this.y = 3; + C.this.y + } + }; + val c: C = new C(); + import c._; + c.x.*(Predef.implicitly[Int](c.y)) +} +error! diff --git a/tests/pending/run/idempotency-lazy-vals.scala b/tests/pending/run/idempotency-lazy-vals.scala new file mode 100644 index 000000000000..cb757f1ab31e --- /dev/null +++ b/tests/pending/run/idempotency-lazy-vals.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val lazee = reify { + class C { + lazy val x = 2 + implicit lazy val y = 3 + } + val c = new C() + import c._ + x * implicitly[Int] + } + println(lazee.eval) + val tb = cm.mkToolBox() + val tlazee = tb.typecheck(lazee.tree) + println(tlazee) + val rtlazee = tb.untypecheck(tlazee) + try { + println(tb.eval(rtlazee)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5466 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/pending/run/idempotency-this.check b/tests/pending/run/idempotency-this.check new file mode 100644 index 000000000000..88b8288adfe6 --- /dev/null +++ b/tests/pending/run/idempotency-this.check @@ -0,0 +1,4 @@ +List() +List.apply[String]("") +Apply(TypeApply(Select(Ident(scala.collection.immutable.List), TermName("apply")), List(TypeTree().setOriginal(Select(Ident(scala.Predef), TypeName("String"))))), List(Literal(Constant("")))) +List() diff --git a/tests/pending/run/idempotency-this.scala b/tests/pending/run/idempotency-this.scala new file mode 100644 index 000000000000..2e2f7cf668f9 --- /dev/null +++ b/tests/pending/run/idempotency-this.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val thiss = reify { + List[String]("") + } + println(thiss.eval) + val tb = cm.mkToolBox() + val tthiss = tb.typecheck(thiss.tree) + println(tthiss) + println(showRaw(tthiss)) + val rtthiss = tb.untypecheck(tthiss) + try { + println(tb.eval(rtthiss)) + } catch { + // this is the current behaviour, rather than the desired behavior; see SI-5705 + case _: ToolBoxError => println("error!") + } +} diff --git a/tests/pending/run/imain.check b/tests/pending/run/imain.check new file mode 100644 index 000000000000..76df308f3c57 --- /dev/null +++ b/tests/pending/run/imain.check @@ -0,0 +1 @@ +Some(246) diff --git a/tests/pending/run/imain.scala b/tests/pending/run/imain.scala new file mode 100644 index 000000000000..cc939e39fd6d --- /dev/null +++ b/tests/pending/run/imain.scala @@ -0,0 +1,17 @@ +object Test { + import scala.tools.nsc._ + import interpreter._ + import java.io.PrintWriter + + class NullOutputStream extends OutputStream { def write(b: Int): Unit = { } } + + def main(args: Array[String]): Unit = { + val settings = new Settings + settings.classpath.value = System.getProperty("java.class.path") + + val intp = new IMain(settings, new PrintWriter(new NullOutputStream)) + intp.interpret("def x0 = 123") + intp.interpret("val x1 = x0 * 2") + println(intp.valueOfTerm("x1")) + } +} diff --git a/tests/pending/run/impconvtimes.check b/tests/pending/run/impconvtimes.check new file mode 100644 index 000000000000..f08574de3e00 --- /dev/null +++ b/tests/pending/run/impconvtimes.check @@ -0,0 +1 @@ +3.0 * Hour = Measure(3.0,Hour) diff --git a/tests/pending/run/impconvtimes.scala b/tests/pending/run/impconvtimes.scala new file mode 100644 index 000000000000..0dbbf7bca4c2 --- /dev/null +++ b/tests/pending/run/impconvtimes.scala @@ -0,0 +1,19 @@ +import scala.language.implicitConversions + +object Test { + abstract class Unit + object NoUnit extends Unit + object Hour extends Unit { override def toString = "Hour" } + + case class Measure(scalar: Double, unit: Unit) { + def *(newUnit: Unit) = Measure(scalar, newUnit) + } + + implicit def double2Measure(scalar: Double): Test.Measure = + Measure(scalar, NoUnit) + + + def main(args: Array[String]): scala.Unit = { + Console.println("3.0 * Hour = " + (3.0 * Hour)) + } +} diff --git a/tests/pending/run/implicitclasses.scala b/tests/pending/run/implicitclasses.scala new file mode 100644 index 000000000000..fefb69591a12 --- /dev/null +++ b/tests/pending/run/implicitclasses.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + + implicit class C(s: String) { + def nElems = s.length + } + + assert("abc".nElems == 3) + +} + diff --git a/tests/pending/run/implicits.check b/tests/pending/run/implicits.check new file mode 100644 index 000000000000..010571589cec --- /dev/null +++ b/tests/pending/run/implicits.check @@ -0,0 +1,2 @@ +OK +[2] diff --git a/tests/pending/run/implicits.scala b/tests/pending/run/implicits.scala new file mode 100644 index 000000000000..60a361a44d08 --- /dev/null +++ b/tests/pending/run/implicits.scala @@ -0,0 +1,50 @@ +import scala.language.implicitConversions + +object A { + object B { + implicit def int2string(x: Int): String = "["+x.toString+"]" + } +} + +class C(x: String) { + + class Inner { + } + + object Inner { + val s: String = x + implicit def Inner2String(x: Inner): String = s + } +} + +object Test extends dotty.runtime.LegacyApp { + import A.B._ + val c = new C("OK") + val i = new c.Inner + val s: String = i + Console.println(s) + Console.println(2: String) +} + +object TestPriority { + + class C(x: Int) { def foo: Int = x + 1 } + + class D(x: Int) { def foo: Int = x + 2 } + + class IMPL { + implicit def Int2C(x: Int): C = new C(x) + } + + object impl extends IMPL { + implicit def Int2D(x: Int): D = new D(x) + } + + import impl._ + + val x: C = 2 + val y: D = 2 + assert(x.foo == 3, x.foo) + assert(y.foo == 4, y.foo) + assert((2).foo == 4, (2).foo) +} diff --git a/tests/pending/run/imports.check b/tests/pending/run/imports.check new file mode 100644 index 000000000000..56f5e23d4543 --- /dev/null +++ b/tests/pending/run/imports.check @@ -0,0 +1,12 @@ +In C_ico, v_ico .toString() returns C_ico -> ok +In C_ico, field .toString() returns C_ico -> ok +In C_ico, method.toString() returns C_ico -> ok + +In C_ioc, v_ioc .toString() returns C_ioc -> ok +In C_ioc, field .toString() returns C_ioc -> ok +In C_ioc, method.toString() returns C_ioc -> ok + +In C_oic, v_oic .toString() returns C_oic -> ok +In C_oic, field .toString() returns C_oic -> ok +In C_oic, method.toString() returns C_oic -> ok + diff --git a/tests/pending/run/imports.scala b/tests/pending/run/imports.scala new file mode 100644 index 000000000000..4bdbef9f95f2 --- /dev/null +++ b/tests/pending/run/imports.scala @@ -0,0 +1,96 @@ +//############################################################################ +// Import statements +//############################################################################ + +//############################################################################ + +object checker { + def check(location: String, what: String, value: Any): Unit = { + Console.print("In " + location + ", " + what + ".toString() returns "); + Console.flush; + val string: String = if (value == null) "null" else value.toString(); + val test = if (string == location) "ok" else "KO"; + Console.println(string + " -> " + test); + Console.flush; + } +} + +import checker.check; + +//############################################################################ + +//import o_ico.v_ico; + +class C_ico() { + o_ico.v_ico = this; + import o_ico.v_ico; + override def toString(): String = "C_ico"; + def method: C_ico = v_ico; + val field: C_ico = v_ico; + + check("C_ico", "v_ico ", v_ico); + check("C_ico", "field ", field); + check("C_ico", "method", method); + Console.println; +} + +object o_ico { + var v_ico: C_ico = null; + new C_ico(); +} + +//############################################################################ + +object o_ioc { + var v_ioc: C_ioc = null; + new C_ioc(); +} + +import o_ioc.v_ioc; + + +class C_ioc() { + o_ioc.v_ioc = this; + override def toString(): String = "C_ioc"; + def method: C_ioc = v_ioc; + val field: C_ioc = v_ioc; + + check("C_ioc", "v_ioc ", v_ioc); + check("C_ioc", "field ", field); + check("C_ioc", "method", method); + Console.println; +} + +//############################################################################ + +object o_oic { + var v_oic: C_oic = null; + new C_oic(); +} + +import o_oic.v_oic; + +class C_oic() { + o_oic.v_oic = this; + override def toString(): String = "C_oic"; + def method: C_oic = v_oic; + val field: C_oic = v_oic; + + check("C_oic", "v_oic ", v_oic); + check("C_oic", "field ", field); + check("C_oic", "method", method); + Console.println; +} + +//############################################################################ + +object Test { + def main(args: Array[String]): Unit = { + o_ico; + o_ioc; + o_oic; + () + } +} + +//############################################################################ diff --git a/tests/pending/run/indexedSeq-apply.check b/tests/pending/run/indexedSeq-apply.check new file mode 100644 index 000000000000..d86bac9de59a --- /dev/null +++ b/tests/pending/run/indexedSeq-apply.check @@ -0,0 +1 @@ +OK diff --git a/tests/pending/run/indexedSeq-apply.scala b/tests/pending/run/indexedSeq-apply.scala new file mode 100644 index 000000000000..455218d2c93d --- /dev/null +++ b/tests/pending/run/indexedSeq-apply.scala @@ -0,0 +1,15 @@ +object Test extends dotty.runtime.LegacyApp { + val empty = IndexedSeq() + assert(empty.isEmpty) + + val single = IndexedSeq(1) + assert(List(1) == single.toList) + + val two = IndexedSeq("a", "b") + assert("a" == two.head) + assert("b" == two.apply(1)) + + println("OK") +} + +// vim: set ts=2 sw=2 et: diff --git a/tests/pending/run/indexedSeq.scala b/tests/pending/run/indexedSeq.scala new file mode 100644 index 000000000000..b1a2b1bc6060 --- /dev/null +++ b/tests/pending/run/indexedSeq.scala @@ -0,0 +1,11 @@ +object Test { + import scala.collection.immutable + + def checkIdentity[A](xs: immutable.IndexedSeq[A]) = assert(xs.toIndexedSeq eq xs) + + def main(args: Array[String]): Unit = { + def r = 1 to 10 + checkIdentity(immutable.Vector(r: _*)) + checkIdentity(r.toIndexedSeq) + } +} diff --git a/tests/pending/run/inferred-type-constructors.check b/tests/pending/run/inferred-type-constructors.check new file mode 100644 index 000000000000..4a63853bd985 --- /dev/null +++ b/tests/pending/run/inferred-type-constructors.check @@ -0,0 +1,56 @@ +warning: there were two feature warnings; re-run with -feature for details + p.Iterable[Int] + p.Set[Int] + p.Seq[Int] + p.m.Set[Int] + p.m.Seq[Int] + private[m] p.m.ASet[Int] + p.i.Seq[Int] + private[i] p.i.ASet[Int] + private[i] p.i.ASeq[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Set[Int] + p.Iterable[Int] + p.Set[Int] + p.Iterable[Int] + p.Set[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Seq[Int] + p.Iterable[Int] + p.Seq[Int] + p.Iterable[Int] + p.Seq[Int] + p.Iterable[Int] + p.m.Set[Int] + p.Iterable[Int] + p.Set[Int] + p.Iterable[Int] + p.Iterable[Int] + p.Seq[Int] + p.Iterable[Int] + p.Seq[Int] + p.Iterable[Int] + private[p] p.ASet[Int] + private[p] p.AIterable[Int] + p.Iterable[Int] + p.i.Seq[Int] + private[p] p.AIterable[Int] + List[Nothing] + scala.collection.immutable.Vector[Nothing] + scala.collection.immutable.Iterable[(Int, Int)] + scala.collection.immutable.Set[Int] + Seq[Int] + Array[Int] + scala.collection.AbstractSet[Int] + Comparable[java.lang.String] + scala.collection.immutable.LinearSeq[Int] + Iterable[Int] diff --git a/tests/pending/run/inferred-type-constructors.scala b/tests/pending/run/inferred-type-constructors.scala new file mode 100644 index 000000000000..79a8653f686b --- /dev/null +++ b/tests/pending/run/inferred-type-constructors.scala @@ -0,0 +1,125 @@ +package p { + trait TCon[+CC[X]] { + def fPublic: CC[Int] = ??? + private[p] def fPackagePrivate: CC[Int] = ??? + protected[p] def fPackageProtected: CC[Int] = ??? + } + trait Iterable[+A] extends TCon[Iterable] + trait Set[A] extends Iterable[A] with TCon[Set] + trait Seq[+A] extends Iterable[A] with TCon[Seq] + + private[p] abstract class AIterable[+A] extends Iterable[A] + private[p] abstract class ASeq[+A] extends AIterable[A] with Seq[A] + private[p] abstract class ASet[A] extends AIterable[A] with Set[A] + + package m { + private[m] abstract class ASeq[A] extends p.ASeq[A] with Seq[A] + private[m] abstract class ASet[A] extends p.ASet[A] with Set[A] + trait Set[A] extends p.Set[A] with TCon[Set] + trait Seq[A] extends p.Seq[A] with TCon[Seq] + trait BitSet extends ASet[Int] + trait IntSeq extends ASeq[Int] + } + + package i { + private[i] abstract class ASeq[+A] extends p.ASeq[A] with Seq[A] + private[i] abstract class ASet[A] extends p.ASet[A] with Set[A] + trait Set[A] extends p.Set[A] with TCon[Set] + trait Seq[+A] extends p.Seq[A] with TCon[Seq] + trait BitSet extends ASet[Int] + trait IntSeq extends ASeq[Int] + } +} + +object Test { + import scala.reflect.runtime.universe._ + // Complicated by the absence of usable type constructor type tags. + def extract[A, CC[X]](xs: CC[A]): CC[A] = xs + def whatis[T: TypeTag](x: T): Unit = { + val tpe = typeOf[T] + val access = tpe.typeSymbol.asInstanceOf[scala.reflect.internal.HasFlags].accessString.replaceAllLiterally("package ", "") + println(f"$access%15s $tpe") + } + + trait IntIterable extends p.Iterable[Int] + trait IntSet extends p.Set[Int] + trait IntSeq extends p.Seq[Int] + + trait MutableIntSet extends p.m.Set[Int] + trait MutableIntSeq extends p.m.Seq[Int] + + trait ImmutableIntSet extends p.i.Set[Int] + trait ImmutableIntSeq extends p.i.Seq[Int] + + def f1: IntIterable = null + def f2: IntSet = null + def f3: IntSeq = null + + def g1: MutableIntSet = null + def g2: MutableIntSeq = null + def g3: p.m.BitSet = null + + def h1: ImmutableIntSeq = null + def h2: p.i.BitSet = null + def h3: p.i.IntSeq = null + + def main(args: Array[String]): Unit = { + whatis(extract(f1)) + whatis(extract(f2)) + whatis(extract(f3)) + whatis(extract(g1)) + whatis(extract(g2)) + whatis(extract(g3)) + whatis(extract(h1)) + whatis(extract(h2)) + whatis(extract(h3)) + + whatis(extract(if (true) f1 else f2)) + whatis(extract(if (true) f1 else f3)) + whatis(extract(if (true) f1 else g1)) + whatis(extract(if (true) f1 else g2)) + whatis(extract(if (true) f1 else g3)) + whatis(extract(if (true) f1 else h1)) + whatis(extract(if (true) f1 else h2)) + whatis(extract(if (true) f1 else h3)) + whatis(extract(if (true) f2 else f3)) + whatis(extract(if (true) f2 else g1)) + whatis(extract(if (true) f2 else g2)) + whatis(extract(if (true) f2 else g3)) + whatis(extract(if (true) f2 else h1)) + whatis(extract(if (true) f2 else h2)) + whatis(extract(if (true) f2 else h3)) + whatis(extract(if (true) f3 else g1)) + whatis(extract(if (true) f3 else g2)) + whatis(extract(if (true) f3 else g3)) + whatis(extract(if (true) f3 else h1)) + whatis(extract(if (true) f3 else h2)) + whatis(extract(if (true) f3 else h3)) + whatis(extract(if (true) g1 else g2)) + whatis(extract(if (true) g1 else g3)) + whatis(extract(if (true) g1 else h1)) + whatis(extract(if (true) g1 else h2)) + whatis(extract(if (true) g1 else h3)) + whatis(extract(if (true) g2 else g3)) + whatis(extract(if (true) g2 else h1)) + whatis(extract(if (true) g2 else h2)) + whatis(extract(if (true) g2 else h3)) + whatis(extract(if (true) g3 else h1)) + whatis(extract(if (true) g3 else h2)) + whatis(extract(if (true) g3 else h3)) + whatis(extract(if (true) h1 else h2)) + whatis(extract(if (true) h1 else h3)) + whatis(extract(if (true) h2 else h3)) + + whatis(extract(Nil)) + whatis(extract(Vector())) + whatis(extract(Map[Int,Int]())) + whatis(extract(Set[Int]())) + whatis(extract(Seq[Int]())) + whatis(extract(Array[Int]())) + whatis(extract(scala.collection.immutable.BitSet(1))) + whatis(extract("abc")) + whatis(extract(if (true) Stream(1) else List(1))) + whatis(extract(if (true) Seq(1) else Set(1))) + } +} diff --git a/tests/pending/run/infiniteloop.check b/tests/pending/run/infiniteloop.check new file mode 100644 index 000000000000..6f8cf6e4d9cf --- /dev/null +++ b/tests/pending/run/infiniteloop.check @@ -0,0 +1 @@ +Stream(512, 256, 128, 64, 32, 16, 8, 4, 2, 1) diff --git a/tests/pending/run/infiniteloop.scala b/tests/pending/run/infiniteloop.scala new file mode 100644 index 000000000000..2668d5b00297 --- /dev/null +++ b/tests/pending/run/infiniteloop.scala @@ -0,0 +1,13 @@ +/** Tests the optimiser (not to loop on 'reverse'). */ + +object Test extends dotty.runtime.LegacyApp { + def foo: Unit = { + val s3 = Stream.range(1, 1000) //100000 (ticket #153: Stackoverflow) + + // ticket #153 + def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None + println(s3.flatMap(powers).reverse) + } + + foo +} diff --git a/tests/pending/run/infix.check b/tests/pending/run/infix.check new file mode 100644 index 000000000000..dd0457b7769d --- /dev/null +++ b/tests/pending/run/infix.check @@ -0,0 +1,2 @@ +op(op(op(null,0,0),1,1),2,2) +OK diff --git a/tests/pending/run/infix.scala b/tests/pending/run/infix.scala new file mode 100644 index 000000000000..6b754f2f0c4c --- /dev/null +++ b/tests/pending/run/infix.scala @@ -0,0 +1,11 @@ +case class op(x: op, y: Int, z: Int) { + def op(y: Int, z: Int) = new op(this, y, z) +} + +object Test extends dotty.runtime.LegacyApp { + val xs = new op(null, 0, 0) op (1, 1) op (2, 2) + Console.println(xs) + xs match { + case null op (0, 0) op (1, 1) op (2, 2) => Console.println("OK") + } +} diff --git a/tests/pending/run/inline-ex-handlers.check b/tests/pending/run/inline-ex-handlers.check new file mode 100644 index 000000000000..7c885d2cc98a --- /dev/null +++ b/tests/pending/run/inline-ex-handlers.check @@ -0,0 +1,492 @@ +--- a ++++ b +@@ -171,5 +171,5 @@ + def productElement(x$1: Int (INT)): Object { +- locals: value x$1, value x1 ++ locals: value x$1, value x1, variable boxed1 + startBlock: 1 +- blocks: [1,2,3,4] ++ blocks: [1,3,4] + +@@ -186,2 +186,4 @@ + 92 LOAD_LOCAL(value x$1) ++ 92 STORE_LOCAL(variable boxed1) ++ 92 LOAD_LOCAL(variable boxed1) + 92 BOX INT +@@ -194,5 +196,2 @@ + 92 CALL_METHOD MyException.message (dynamic) +- 92 JUMP 2 +- +- 2: + 92 RETURN(REF(class Object)) +@@ -246,3 +245,3 @@ + startBlock: 1 +- blocks: [1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18] ++ blocks: [1,2,3,4,5,6,8,11,12,13,14,15,16,17,18] + +@@ -257,5 +256,2 @@ + 92 SCOPE_ENTER value x1 +- 92 JUMP 7 +- +- 7: + 92 LOAD_LOCAL(value x1) +@@ -390,5 +386,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, value ex6, value x4, value x5, value message, value x ++ locals: value args, variable result, value ex6, value x4, value x5, value x + startBlock: 1 +- blocks: [1,2,3,4,5,8,10,11,13] ++ blocks: [1,2,3,5,8,10,11,13,14] + +@@ -416,4 +412,13 @@ + 103 CALL_METHOD MyException. (static-instance) +- 103 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 14 + ++ 14: ++ 101 LOAD_LOCAL(value ex6) ++ 101 STORE_LOCAL(value x4) ++ 101 SCOPE_ENTER value x4 ++ 106 LOAD_LOCAL(value x4) ++ 106 IS_INSTANCE REF(class MyException) ++ 106 CZJUMP (BOOL)NE ? 5 : 8 ++ + 13: +@@ -429,5 +434,2 @@ + 101 SCOPE_ENTER value x4 +- 101 JUMP 4 +- +- 4: + 106 LOAD_LOCAL(value x4) +@@ -441,8 +443,5 @@ + 106 SCOPE_ENTER value x5 +- 106 LOAD_LOCAL(value x5) +- 106 CALL_METHOD MyException.message (dynamic) +- 106 STORE_LOCAL(value message) +- 106 SCOPE_ENTER value message + 106 LOAD_MODULE object Predef +- 106 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 106 CALL_METHOD MyException.message (dynamic) + 106 CALL_METHOD scala.Predef.println (dynamic) +@@ -518,3 +517,3 @@ + startBlock: 1 +- blocks: [1,2,3,4,6,7,9,10] ++ blocks: [1,3,4,6,7,9,10,11,12,13] + +@@ -547,4 +546,9 @@ + 306 CALL_METHOD MyException. (static-instance) +- 306 THROW(MyException) ++ ? JUMP 11 + ++ 11: ++ ? LOAD_LOCAL(variable monitor4) ++ 305 MONITOR_EXIT ++ ? JUMP 12 ++ + 9: +@@ -553,3 +557,3 @@ + 305 MONITOR_EXIT +- ? THROW(Throwable) ++ ? JUMP 12 + +@@ -559,4 +563,11 @@ + 304 MONITOR_EXIT +- ? THROW(Throwable) ++ ? STORE_LOCAL(value t) ++ ? JUMP 13 + ++ 12: ++ ? LOAD_LOCAL(variable monitor3) ++ 304 MONITOR_EXIT ++ ? STORE_LOCAL(value t) ++ ? JUMP 13 ++ + 3: +@@ -573,5 +584,14 @@ + 310 CALL_METHOD scala.Predef.println (dynamic) +- 310 JUMP 2 ++ 300 RETURN(UNIT) + +- 2: ++ 13: ++ 310 LOAD_MODULE object Predef ++ 310 CALL_PRIMITIVE(StartConcat) ++ 310 CONSTANT("Caught crash: ") ++ 310 CALL_PRIMITIVE(StringConcat(REF(class String))) ++ 310 LOAD_LOCAL(value t) ++ 310 CALL_METHOD java.lang.Throwable.toString (dynamic) ++ 310 CALL_PRIMITIVE(StringConcat(REF(class String))) ++ 310 CALL_PRIMITIVE(EndConcat) ++ 310 CALL_METHOD scala.Predef.println (dynamic) + 300 RETURN(UNIT) +@@ -583,6 +603,6 @@ + with finalizer: null +- catch (Throwable) in ArrayBuffer(7, 9, 10) starting at: 6 ++ catch (Throwable) in ArrayBuffer(7, 9, 10, 11) starting at: 6 + consisting of blocks: List(6) + with finalizer: null +- catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10) starting at: 3 ++ catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10, 11, 12) starting at: 3 + consisting of blocks: List(3) +@@ -618,3 +638,3 @@ + startBlock: 1 +- blocks: [1,3,4,5,6,8,9] ++ blocks: [1,3,4,5,6,8,9,10,11] + +@@ -642,4 +662,10 @@ + 78 CALL_METHOD java.lang.IllegalArgumentException. (static-instance) +- 78 THROW(IllegalArgumentException) ++ ? STORE_LOCAL(value e) ++ ? JUMP 10 + ++ 10: ++ 81 LOAD_LOCAL(value e) ++ ? STORE_LOCAL(variable exc1) ++ ? JUMP 11 ++ + 8: +@@ -668,3 +694,4 @@ + 81 LOAD_LOCAL(value e) +- 81 THROW(Exception) ++ ? STORE_LOCAL(variable exc1) ++ ? JUMP 11 + +@@ -685,2 +712,15 @@ + ++ 11: ++ 83 LOAD_MODULE object Predef ++ 83 CONSTANT("finally") ++ 83 CALL_METHOD scala.Predef.println (dynamic) ++ 84 LOAD_LOCAL(variable result) ++ 84 CONSTANT(1) ++ 84 CALL_PRIMITIVE(Arithmetic(SUB,INT)) ++ 84 CONSTANT(2) ++ 84 CALL_PRIMITIVE(Arithmetic(DIV,INT)) ++ 84 STORE_LOCAL(variable result) ++ 84 LOAD_LOCAL(variable exc1) ++ 84 THROW(Throwable) ++ + } +@@ -690,3 +730,3 @@ + with finalizer: null +- catch () in ArrayBuffer(4, 5, 6, 8) starting at: 3 ++ catch () in ArrayBuffer(4, 5, 6, 8, 10) starting at: 3 + consisting of blocks: List(3) +@@ -714,5 +754,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value message, value x, value ex6, value x4, value x5, value message, value x ++ locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value x, value ex6, value x4, value x5, value x + startBlock: 1 +- blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24] ++ blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24,25,26,27] + +@@ -740,4 +780,11 @@ + 172 CALL_METHOD MyException. (static-instance) +- 172 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 25 + ++ 25: ++ 170 LOAD_LOCAL(value ex6) ++ 170 STORE_LOCAL(value x4) ++ 170 SCOPE_ENTER value x4 ++ 170 JUMP 14 ++ + 23: +@@ -780,8 +827,5 @@ + 175 SCOPE_ENTER value x5 +- 175 LOAD_LOCAL(value x5) +- 175 CALL_METHOD MyException.message (dynamic) +- 175 STORE_LOCAL(value message) +- 175 SCOPE_ENTER value message + 176 LOAD_MODULE object Predef +- 176 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 176 CALL_METHOD MyException.message (dynamic) + 176 CALL_METHOD scala.Predef.println (dynamic) +@@ -789,5 +833,7 @@ + 177 DUP(REF(class MyException)) +- 177 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 177 CALL_METHOD MyException.message (dynamic) + 177 CALL_METHOD MyException. (static-instance) +- 177 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 26 + +@@ -795,3 +841,4 @@ + 170 LOAD_LOCAL(value ex6) +- 170 THROW(Throwable) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 26 + +@@ -805,2 +852,8 @@ + ++ 26: ++ 169 LOAD_LOCAL(value ex6) ++ 169 STORE_LOCAL(value x4) ++ 169 SCOPE_ENTER value x4 ++ 169 JUMP 5 ++ + 5: +@@ -815,8 +868,5 @@ + 180 SCOPE_ENTER value x5 +- 180 LOAD_LOCAL(value x5) +- 180 CALL_METHOD MyException.message (dynamic) +- 180 STORE_LOCAL(value message) +- 180 SCOPE_ENTER value message + 181 LOAD_MODULE object Predef +- 181 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 181 CALL_METHOD MyException.message (dynamic) + 181 CALL_METHOD scala.Predef.println (dynamic) +@@ -824,5 +874,7 @@ + 182 DUP(REF(class MyException)) +- 182 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 182 CALL_METHOD MyException.message (dynamic) + 182 CALL_METHOD MyException. (static-instance) +- 182 THROW(MyException) ++ ? STORE_LOCAL(variable exc2) ++ ? JUMP 27 + +@@ -830,3 +882,4 @@ + 169 LOAD_LOCAL(value ex6) +- 169 THROW(Throwable) ++ ? STORE_LOCAL(variable exc2) ++ ? JUMP 27 + +@@ -847,2 +900,15 @@ + ++ 27: ++ 184 LOAD_MODULE object Predef ++ 184 CONSTANT("finally") ++ 184 CALL_METHOD scala.Predef.println (dynamic) ++ 185 LOAD_LOCAL(variable result) ++ 185 CONSTANT(1) ++ 185 CALL_PRIMITIVE(Arithmetic(SUB,INT)) ++ 185 CONSTANT(2) ++ 185 CALL_PRIMITIVE(Arithmetic(DIV,INT)) ++ 185 STORE_LOCAL(variable result) ++ 185 LOAD_LOCAL(variable exc2) ++ 185 THROW(Throwable) ++ + } +@@ -852,6 +918,6 @@ + with finalizer: null +- catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23) starting at: 4 ++ catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4 + consisting of blocks: List(9, 8, 6, 5, 4) + with finalizer: null +- catch () in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3 ++ catch () in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3 + consisting of blocks: List(3) +@@ -879,5 +945,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, value e, value ex6, value x4, value x5, value message, value x ++ locals: value args, variable result, value e, value ex6, value x4, value x5, value x + startBlock: 1 +- blocks: [1,2,3,6,7,8,11,13,14,16] ++ blocks: [1,2,3,6,7,8,11,13,14,16,17] + +@@ -905,4 +971,11 @@ + 124 CALL_METHOD MyException. (static-instance) +- 124 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 17 + ++ 17: ++ 122 LOAD_LOCAL(value ex6) ++ 122 STORE_LOCAL(value x4) ++ 122 SCOPE_ENTER value x4 ++ 122 JUMP 7 ++ + 16: +@@ -930,8 +1003,5 @@ + 127 SCOPE_ENTER value x5 +- 127 LOAD_LOCAL(value x5) +- 127 CALL_METHOD MyException.message (dynamic) +- 127 STORE_LOCAL(value message) +- 127 SCOPE_ENTER value message + 127 LOAD_MODULE object Predef +- 127 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 127 CALL_METHOD MyException.message (dynamic) + 127 CALL_METHOD scala.Predef.println (dynamic) +@@ -964,3 +1034,3 @@ + with finalizer: null +- catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16) starting at: 3 ++ catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3 + consisting of blocks: List(3) +@@ -988,5 +1058,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, value ex6, value x4, value x5, value message, value x, value e ++ locals: value args, variable result, value ex6, value x4, value x5, value x, value e + startBlock: 1 +- blocks: [1,2,3,4,5,8,12,13,14,16] ++ blocks: [1,2,3,5,8,12,13,14,16,17] + +@@ -1014,4 +1084,13 @@ + 148 CALL_METHOD MyException. (static-instance) +- 148 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 17 + ++ 17: ++ 145 LOAD_LOCAL(value ex6) ++ 145 STORE_LOCAL(value x4) ++ 145 SCOPE_ENTER value x4 ++ 154 LOAD_LOCAL(value x4) ++ 154 IS_INSTANCE REF(class MyException) ++ 154 CZJUMP (BOOL)NE ? 5 : 8 ++ + 16: +@@ -1035,5 +1114,2 @@ + 145 SCOPE_ENTER value x4 +- 145 JUMP 4 +- +- 4: + 154 LOAD_LOCAL(value x4) +@@ -1047,8 +1123,5 @@ + 154 SCOPE_ENTER value x5 +- 154 LOAD_LOCAL(value x5) +- 154 CALL_METHOD MyException.message (dynamic) +- 154 STORE_LOCAL(value message) +- 154 SCOPE_ENTER value message + 154 LOAD_MODULE object Predef +- 154 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 154 CALL_METHOD MyException.message (dynamic) + 154 CALL_METHOD scala.Predef.println (dynamic) +@@ -1269,3 +1342,3 @@ + startBlock: 1 +- blocks: [1,2,3,4,5,7] ++ blocks: [1,2,3,4,5,7,8] + +@@ -1293,4 +1366,11 @@ + 38 CALL_METHOD java.lang.IllegalArgumentException. (static-instance) +- 38 THROW(IllegalArgumentException) ++ ? STORE_LOCAL(value e) ++ ? JUMP 8 + ++ 8: ++ 42 LOAD_MODULE object Predef ++ 42 CONSTANT("IllegalArgumentException") ++ 42 CALL_METHOD scala.Predef.println (dynamic) ++ 42 JUMP 2 ++ + 7: +@@ -1340,5 +1420,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, value ex6, value x4, value x5, value message, value x ++ locals: value args, variable result, value ex6, value x4, value x5, value x + startBlock: 1 +- blocks: [1,2,3,4,5,8,10,11,13,14,16] ++ blocks: [1,2,3,5,8,10,11,13,14,16,17] + +@@ -1366,3 +1446,4 @@ + 203 CALL_METHOD MyException. (static-instance) +- 203 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 17 + +@@ -1386,4 +1467,13 @@ + 209 CALL_METHOD MyException. (static-instance) +- 209 THROW(MyException) ++ ? STORE_LOCAL(value ex6) ++ ? JUMP 17 + ++ 17: ++ 200 LOAD_LOCAL(value ex6) ++ 200 STORE_LOCAL(value x4) ++ 200 SCOPE_ENTER value x4 ++ 212 LOAD_LOCAL(value x4) ++ 212 IS_INSTANCE REF(class MyException) ++ 212 CZJUMP (BOOL)NE ? 5 : 8 ++ + 16: +@@ -1399,5 +1489,2 @@ + 200 SCOPE_ENTER value x4 +- 200 JUMP 4 +- +- 4: + 212 LOAD_LOCAL(value x4) +@@ -1411,8 +1498,5 @@ + 212 SCOPE_ENTER value x5 +- 212 LOAD_LOCAL(value x5) +- 212 CALL_METHOD MyException.message (dynamic) +- 212 STORE_LOCAL(value message) +- 212 SCOPE_ENTER value message + 213 LOAD_MODULE object Predef +- 213 LOAD_LOCAL(value message) ++ ? LOAD_LOCAL(value x5) ++ 213 CALL_METHOD MyException.message (dynamic) + 213 CALL_METHOD scala.Predef.println (dynamic) +@@ -1460,3 +1544,3 @@ + startBlock: 1 +- blocks: [1,2,3,4,5,7] ++ blocks: [1,2,3,4,5,7,8] + +@@ -1484,4 +1568,11 @@ + 58 CALL_METHOD java.lang.IllegalArgumentException. (static-instance) +- 58 THROW(IllegalArgumentException) ++ ? STORE_LOCAL(value e) ++ ? JUMP 8 + ++ 8: ++ 62 LOAD_MODULE object Predef ++ 62 CONSTANT("RuntimeException") ++ 62 CALL_METHOD scala.Predef.println (dynamic) ++ 62 JUMP 2 ++ + 7: +@@ -1533,3 +1624,3 @@ + startBlock: 1 +- blocks: [1,3,4] ++ blocks: [1,3,4,5] + +@@ -1553,4 +1644,9 @@ + 229 CALL_METHOD MyException. (static-instance) +- 229 THROW(MyException) ++ ? JUMP 5 + ++ 5: ++ ? LOAD_LOCAL(variable monitor1) ++ 228 MONITOR_EXIT ++ 228 THROW(Throwable) ++ + 3: +@@ -1559,3 +1655,3 @@ + 228 MONITOR_EXIT +- ? THROW(Throwable) ++ 228 THROW(Throwable) + +@@ -1587,5 +1683,5 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, variable result, variable monitor2, variable monitorResult1 ++ locals: value exception$1, value args, variable result, variable monitor2, variable monitorResult1 + startBlock: 1 +- blocks: [1,3,4] ++ blocks: [1,3,4,5] + +@@ -1612,4 +1708,12 @@ + 245 CALL_METHOD MyException. (static-instance) +- 245 THROW(MyException) ++ ? STORE_LOCAL(value exception$1) ++ ? DROP ConcatClass ++ ? LOAD_LOCAL(value exception$1) ++ ? JUMP 5 + ++ 5: ++ ? LOAD_LOCAL(variable monitor2) ++ 244 MONITOR_EXIT ++ 244 THROW(Throwable) ++ + 3: +@@ -1618,3 +1722,3 @@ + 244 MONITOR_EXIT +- ? THROW(Throwable) ++ 244 THROW(Throwable) + diff --git a/tests/pending/run/inline-ex-handlers.scala b/tests/pending/run/inline-ex-handlers.scala new file mode 100644 index 000000000000..964594d258b5 --- /dev/null +++ b/tests/pending/run/inline-ex-handlers.scala @@ -0,0 +1,329 @@ +import scala.tools.partest.IcodeComparison + +object Test extends IcodeComparison { + override def printIcodeAfterPhase = "inlinehandlers" +} + +import scala.util.Random._ + +/** There should be no inlining taking place in this class */ +object TestInlineHandlersNoInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersNoInline") + var result = -1 + + try { + if (nextInt % 2 == 0) + throw new IllegalArgumentException("something") + result = 1 + } catch { + case e: StackOverflowError => + println("Stack overflow") + } + + result + } +} + +/** Just a simple inlining should take place in this class */ +object TestInlineHandlersSimpleInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSimpleInline") + var result = -1 + + try { + if (nextInt % 2 == 0) + throw new IllegalArgumentException("something") + result = 1 + } catch { + case e: IllegalArgumentException => + println("IllegalArgumentException") + } + + result + } +} + +/** Inlining should take place because the handler is taking a superclass of the exception thrown */ +object TestInlineHandlersSubclassInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSubclassInline") + var result = -1 + + try { + if (nextInt % 2 == 0) + throw new IllegalArgumentException("something") + result = 1 + } catch { + case e: RuntimeException => + println("RuntimeException") + } + + result + } +} + +/** For this class, the finally handler should be inlined */ +object TestInlineHandlersFinallyInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersFinallyInline") + var result = -1 + + try { + if (nextInt % 2 == 0) + throw new IllegalArgumentException("something") + result = 1 + } catch { + case e: Exception => throw e + } finally { + println("finally") + result = (result - 1) / 2 + } + + result + } +} + + +case class MyException(message: String) extends RuntimeException(message) + +/** For this class, we test inlining for a case class error */ +object TestInlineHandlersCaseClassExceptionInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersCaseClassExceptionInline") + var result = -1 + + try { + if (nextInt % 2 == 0) + throw new MyException("something") + result = 1 + } catch { + case MyException(message) => println(message) + } + + result + } +} + + +/** For this class, inline should take place in the inner handler */ +object TestInlineHandlersNestedHandlerInnerInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersNestedHandlersInnerInline") + var result = -1 + + try { + try { + if (nextInt % 2 == 0) + throw new MyException("something") + result = 1 + } catch { + case MyException(message) => println(message) + } + } catch { + case e: IllegalArgumentException => println("IllegalArgumentException") + } + + result + } +} + + +/** For this class, inline should take place in the outer handler */ +object TestInlineHandlersNestedHandlerOuterInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersNestedHandlersOuterInline") + var result = -1 + + try { + try { + if (nextInt % 2 == 0) + throw new MyException("something") + result = 1 + } catch { + case e: IllegalArgumentException => println("IllegalArgumentException") + } + } catch { + case MyException(message) => println(message) + } + + result + } +} + + +/** For this class, inline should take place in the all handlers (inner, outer and finally) */ +object TestInlineHandlersNestedHandlerAllInline { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersNestedHandlersOuterInline") + var result = -1 + + try { + try { + if (nextInt % 2 == 0) + throw new MyException("something") + result = 1 + } catch { + case MyException(message) => + println(message) + throw MyException(message) + } + } catch { + case MyException(message) => + println(message) + throw MyException(message) + } finally { + println("finally") + result = (result - 1) / 2 + } + + result + } +} + + +/** This class is meant to test whether the inline handler is copied only once for multiple inlines */ +object TestInlineHandlersSingleCopy { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSingleCopy") + var result = -1 + + try { + + if (nextInt % 2 == 0) + throw new MyException("something") + + println("A side effect in the middle") + result = 3 // another one + + if (nextInt % 3 == 2) + throw new MyException("something else") + result = 1 + } catch { + case MyException(message) => + println(message) + } + + result + } +} + +/** This should test the special exception handler for synchronized blocks */ +object TestInlineHandlersSynchronized { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSynchronized") + var result = "hello" + + // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :) + result.synchronized { + throw MyException(result) + } + + result.length + } +} + +/** This should test the special exception handler for synchronized blocks with stack */ +object TestInlineHandlersSynchronizedWithStack { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSynchronizedWithStack") + var result = "hello" + + // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :) + result = "abc" + result.synchronized { + throw MyException(result) + } + + result.length + } +} + +/** This test should trigger a bug in the dead code elimination phase - it actually crashes ICodeCheckers +object TestInlineHandlersSynchronizedWithStackDoubleThrow { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersSynchronizedWithStackDoubleThrow") + var result = "a" + + // any exception thrown here will be caught by a default handler that does MONTIOR_EXIT on result :) + result += result.synchronized { throw MyException(result) } + result += result.synchronized { throw MyException(result) } + + result.length + } +} +*/ + +/** This test should check the preciseness of the inliner: it should not do any inlining here +* as it is not able to discern between the different exceptions +*/ +object TestInlineHandlersPreciseness { + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersCorrectHandler") + + try { + val exception: Throwable = + if (scala.util.Random.nextInt % 2 == 0) + new IllegalArgumentException("even") + else + new StackOverflowError("odd") + throw exception + } catch { + case e: IllegalArgumentException => + println("Correct, IllegalArgumentException") + case e: StackOverflowError => + println("Correct, StackOverflowException") + case t: Throwable => + println("WROOOONG, not Throwable!") + } + } +} + +/** This check should verify that the double no-local exception handler is duplicated correctly */ +object TestInlineHandlersDoubleNoLocal { + + val a1: String = "a" + val a2: String = "b" + + def main(args: Array[String]): Unit = { + println("TestInlineHandlersDoubleNoLocal") + + try { + a1.synchronized { + a2. synchronized { + throw new MyException("crash") + } + } + } catch { + case t: Throwable => println("Caught crash: " + t.toString) + } + + /* try { + val exception: Throwable = + if (scala.util.Random.nextInt % 2 == 0) + new IllegalArgumentException("even") + else + new StackOverflowError("odd") + throw exception + } catch { + case e: IllegalArgumentException => + println("Correct, IllegalArgumentException") + case e: StackOverflowError => + println("Correct, StackOverflowException") + case t: Throwable => + println("WROOOONG, not Throwable!") + }*/ + } +} diff --git a/tests/pending/run/inliner-infer.check b/tests/pending/run/inliner-infer.check new file mode 100644 index 000000000000..d702bd602d85 --- /dev/null +++ b/tests/pending/run/inliner-infer.check @@ -0,0 +1,2 @@ +non-empty +empty diff --git a/tests/pending/run/inliner-infer.scala b/tests/pending/run/inliner-infer.scala new file mode 100644 index 000000000000..6a2e47194dc5 --- /dev/null +++ b/tests/pending/run/inliner-infer.scala @@ -0,0 +1,28 @@ + + +/** Test that the inliner is not inferring that `xs' is + * always Nil, removing the call to isEmpty. + */ +object Test extends dotty.runtime.LegacyApp { + + @annotation.tailrec + def walk(xs: MyList): Unit = { + if (xs.isEmpty) + println("empty") + else { + println("non-empty") + walk(MyNil) + } + } + + walk(new MyList) +} + +class MyList { + def isEmpty = false +} + +object MyNil extends MyList { + override def isEmpty = true +} + diff --git a/tests/pending/run/inner-obj-auto.check b/tests/pending/run/inner-obj-auto.check new file mode 100644 index 000000000000..90f7e27b98b9 --- /dev/null +++ b/tests/pending/run/inner-obj-auto.check @@ -0,0 +1,65 @@ +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok +ok diff --git a/tests/pending/run/inner-obj-auto.scala b/tests/pending/run/inner-obj-auto.scala new file mode 100644 index 000000000000..a044ba70470e --- /dev/null +++ b/tests/pending/run/inner-obj-auto.scala @@ -0,0 +1,2092 @@ + + +/* ================================================================================ + Automatically generated on 2011-05-11. Do Not Edit (unless you have to). + (2-level nesting) + ================================================================================ */ + + + +class Class2_1 { + + class Class1_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class1_2).run } +} + + +object Object3_1 { + + class Class1_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class1_2).run } // trigger +} + + +trait Trait4_1 { + + class Class1_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class1_2).run } +} + + +class Class6_1 { + + object Object5_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object5_2.run } +} + + +object Object7_1 { + + object Object5_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object5_2.run } // trigger +} + + +trait Trait8_1 { + + object Object5_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object5_2.run } +} + + +class Class10_1 { + + trait Trait9_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait9_2 {}).run } +} + + +object Object11_1 { + + trait Trait9_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait9_2 {}).run } // trigger +} + + +trait Trait12_1 { + + trait Trait9_2 { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait9_2 {}).run } +} + + +class Class14_1 { + + def method13_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method13_2 } +} + + +object Object15_1 { + + def method13_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method13_2 } // trigger +} + + +trait Trait16_1 { + + def method13_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method13_2 } +} + + +class Class18_1 { + + private def method17_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method17_2 } +} + + +object Object19_1 { + + private def method17_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method17_2 } // trigger +} + + +trait Trait20_1 { + + private def method17_2: Unit = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method17_2 } +} + + +class Class22_1 { + + val fun21_2 = () => { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun21_2() } +} + + +object Object23_1 { + + val fun21_2 = () => { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun21_2() } // trigger +} + + +trait Trait24_1 { + + val fun21_2 = () => { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun21_2() } +} + + +class Class26_1 { + + class Class25_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class25_2) } +} + + +object Object27_1 { + + class Class25_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class25_2) } // trigger +} + + +trait Trait28_1 { + + class Class25_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class25_2) } +} + + +class Class30_1 { + + trait Trait29_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait29_2 {}) } +} + + +object Object31_1 { + + trait Trait29_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait29_2 {}) } // trigger +} + + +trait Trait32_1 { + + trait Trait29_2 { + { // in primary constructor + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait29_2 {}) } +} + + +class Class34_1 { + + lazy val lzvalue33_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { lzvalue33_2 } +} + + +object Object35_1 { + + lazy val lzvalue33_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { lzvalue33_2 } // trigger +} + + +trait Trait36_1 { + + lazy val lzvalue33_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { lzvalue33_2 } +} + + +class Class38_1 { + + val value37_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { value37_2 } +} + + +object Object39_1 { + + val value37_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { value37_2 } // trigger +} + + +trait Trait40_1 { + + val value37_2 = { + var ObjCounter = 0 + + object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { value37_2 } +} + + +class Class42_1 { + + class Class41_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class41_2).run } +} + + +object Object43_1 { + + class Class41_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class41_2).run } // trigger +} + + +trait Trait44_1 { + + class Class41_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class41_2).run } +} + + +class Class46_1 { + + object Object45_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object45_2.run } +} + + +object Object47_1 { + + object Object45_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object45_2.run } // trigger +} + + +trait Trait48_1 { + + object Object45_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object45_2.run } +} + + +class Class50_1 { + + trait Trait49_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait49_2 {}).run } +} + + +object Object51_1 { + + trait Trait49_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait49_2 {}).run } // trigger +} + + +trait Trait52_1 { + + trait Trait49_2 { + var ObjCounter = 0 + + private object Obj { ObjCounter += 1} + Obj // one + + def singleThreadedAccess(x: Any) = { + x == Obj + } + + def runTest: Unit = { + try { + assert(singleThreadedAccess(Obj)) + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait49_2 {}).run } +} + + +class Class54_1 { + + class Class53_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class53_2).run } +} + + +object Object55_1 { + + class Class53_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class53_2).run } // trigger +} + + +trait Trait56_1 { + + class Class53_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Class53_2).run } +} + + +class Class58_1 { + + object Object57_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object57_2.run } +} + + +object Object59_1 { + + object Object57_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object57_2.run } // trigger +} + + +trait Trait60_1 { + + object Object57_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } // trigger + } + + def run: Unit = { Object57_2.run } +} + + +class Class62_1 { + + trait Trait61_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait61_2 {}).run } +} + + +object Object63_1 { + + trait Trait61_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait61_2 {}).run } // trigger +} + + +trait Trait64_1 { + + trait Trait61_2 { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + def run: Unit = { runTest } + } + + def run: Unit = { (new Trait61_2 {}).run } +} + + +class Class66_1 { + + def method65_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method65_2 } +} + + +object Object67_1 { + + def method65_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method65_2 } // trigger +} + + +trait Trait68_1 { + + def method65_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method65_2 } +} + + +class Class70_1 { + + private def method69_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method69_2 } +} + + +object Object71_1 { + + private def method69_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method69_2 } // trigger +} + + +trait Trait72_1 { + + private def method69_2: Unit = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { method69_2 } +} + + +class Class74_1 { + + val fun73_2 = () => { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun73_2() } +} + + +object Object75_1 { + + val fun73_2 = () => { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun73_2() } // trigger +} + + +trait Trait76_1 { + + val fun73_2 = () => { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { fun73_2() } +} + + +class Class78_1 { + + class Class77_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class77_2) } +} + + +object Object79_1 { + + class Class77_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class77_2) } // trigger +} + + +trait Trait80_1 { + + class Class77_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Class77_2) } +} + + +class Class82_1 { + + trait Trait81_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait81_2 {}) } +} + + +object Object83_1 { + + trait Trait81_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait81_2 {}) } // trigger +} + + +trait Trait84_1 { + + trait Trait81_2 { + { // in primary constructor + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + } + + def run: Unit = { (new Trait81_2 {}) } +} + + +class Class90_1 { + + val value89_2 = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { value89_2 } +} + + +trait Trait92_1 { + + val value89_2 = { + @volatile var ObjCounter = 0 + + object Obj { ObjCounter += 1} + + def multiThreadedAccess(): Unit = { + val threads = for (i <- 1 to 5) yield new Thread(new Runnable { + def run = Obj + }) + + threads foreach (_.start()) + threads foreach (_.join()) + } + + def runTest: Unit = { + try { + multiThreadedAccess() + assert(ObjCounter == 1, "multiple instances: " + ObjCounter) + println("ok") + } catch { + case e: Throwable => print("multi-threaded failed "); e.printStackTrace() + } + } + + runTest // trigger + } + + def run: Unit = { value89_2 } +} + + +object Test { + def main(args: Array[String]): Unit = { + (new Class2_1).run + Object3_1.run + (new Trait4_1 {}).run + (new Class6_1).run + Object7_1.run + (new Trait8_1 {}).run + (new Class10_1).run + Object11_1.run + (new Trait12_1 {}).run + (new Class14_1).run + Object15_1.run + (new Trait16_1 {}).run + (new Class18_1).run + Object19_1.run + (new Trait20_1 {}).run + (new Class22_1).run + Object23_1.run + (new Trait24_1 {}).run + (new Class26_1).run + Object27_1.run + (new Trait28_1 {}).run + (new Class30_1).run + Object31_1.run + (new Trait32_1 {}).run + (new Class34_1).run + Object35_1.run + (new Trait36_1 {}).run + (new Class38_1).run + Object39_1.run + (new Trait40_1 {}).run + (new Class42_1).run + Object43_1.run + (new Trait44_1 {}).run + (new Class46_1).run + Object47_1.run + (new Trait48_1 {}).run + (new Class50_1).run + Object51_1.run + (new Trait52_1 {}).run + (new Class54_1).run + Object55_1.run + (new Trait56_1 {}).run + (new Class58_1).run + Object59_1.run + (new Trait60_1 {}).run + (new Class62_1).run + Object63_1.run + (new Trait64_1 {}).run + (new Class66_1).run + Object67_1.run + (new Trait68_1 {}).run + (new Class70_1).run + Object71_1.run + (new Trait72_1 {}).run + (new Class74_1).run + Object75_1.run + (new Trait76_1 {}).run + (new Class78_1).run + Object79_1.run + (new Trait80_1 {}).run + (new Class82_1).run + Object83_1.run + (new Trait84_1 {}).run + (new Class90_1).run + (new Trait92_1 {}).run + } +} + diff --git a/tests/pending/run/interop_classtags_are_classmanifests.check b/tests/pending/run/interop_classtags_are_classmanifests.check new file mode 100644 index 000000000000..5a8fc2b7820a --- /dev/null +++ b/tests/pending/run/interop_classtags_are_classmanifests.check @@ -0,0 +1,3 @@ +Int +java.lang.String +Array[int] diff --git a/tests/pending/run/interop_classtags_are_classmanifests.scala b/tests/pending/run/interop_classtags_are_classmanifests.scala new file mode 100644 index 000000000000..77b6bbbabe1b --- /dev/null +++ b/tests/pending/run/interop_classtags_are_classmanifests.scala @@ -0,0 +1,12 @@ +import scala.reflect.ClassTag + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + def classTagIsClassManifest[T: ClassTag] = { + println(classManifest[T]) + } + + classTagIsClassManifest[Int] + classTagIsClassManifest[String] + classTagIsClassManifest[Array[Int]] +} diff --git a/tests/pending/run/interop_manifests_are_abstypetags.check b/tests/pending/run/interop_manifests_are_abstypetags.check new file mode 100644 index 000000000000..19a35ad3dbde --- /dev/null +++ b/tests/pending/run/interop_manifests_are_abstypetags.check @@ -0,0 +1,3 @@ +Int +java.lang.String +Array[Int] diff --git a/tests/pending/run/interop_manifests_are_abstypetags.scala b/tests/pending/run/interop_manifests_are_abstypetags.scala new file mode 100644 index 000000000000..5dbfdc969a9d --- /dev/null +++ b/tests/pending/run/interop_manifests_are_abstypetags.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def manifestIsWeakTypeTag[T: Manifest] = { + println(implicitly[WeakTypeTag[T]].tpe) + } + + manifestIsWeakTypeTag[Int] + manifestIsWeakTypeTag[String] + manifestIsWeakTypeTag[Array[Int]] +} diff --git a/tests/pending/run/interop_manifests_are_classtags.check b/tests/pending/run/interop_manifests_are_classtags.check new file mode 100644 index 000000000000..f3f704121b47 --- /dev/null +++ b/tests/pending/run/interop_manifests_are_classtags.check @@ -0,0 +1,18 @@ +Int +List() +List(0, 0, 0, 0, 0) +java.lang.String +List() +List(null, null, null, null, null) +Array[Int] +List() +List(null, null, null, null, null) +Int +List() +List(0, 0, 0, 0, 0) +java.lang.String +List() +List(null, null, null, null, null) +Array[Int] +List() +List(null, null, null, null, null) diff --git a/tests/pending/run/interop_manifests_are_classtags.scala b/tests/pending/run/interop_manifests_are_classtags.scala new file mode 100644 index 000000000000..195fac9d99dc --- /dev/null +++ b/tests/pending/run/interop_manifests_are_classtags.scala @@ -0,0 +1,24 @@ +import scala.reflect.{ClassTag, classTag} + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + def classManifestIsClassTag[T: ClassManifest] = { + println(classTag[T]) + println(Array[T]().toList) + println(new Array[T](5).toList) + } + + classManifestIsClassTag[Int] + classManifestIsClassTag[String] + classManifestIsClassTag[Array[Int]] + + def manifestIsClassTag[T: Manifest] = { + println(classTag[T]) + println(Array[T]().toList) + println(new Array[T](5).toList) + } + + manifestIsClassTag[Int] + manifestIsClassTag[String] + manifestIsClassTag[Array[Int]] +} diff --git a/tests/pending/run/interop_manifests_are_typetags.check b/tests/pending/run/interop_manifests_are_typetags.check new file mode 100644 index 000000000000..19a35ad3dbde --- /dev/null +++ b/tests/pending/run/interop_manifests_are_typetags.check @@ -0,0 +1,3 @@ +Int +java.lang.String +Array[Int] diff --git a/tests/pending/run/interop_manifests_are_typetags.scala b/tests/pending/run/interop_manifests_are_typetags.scala new file mode 100644 index 000000000000..dd20c1719672 --- /dev/null +++ b/tests/pending/run/interop_manifests_are_typetags.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def manifestIsTypeTag[T: Manifest] = { + println(typeOf[T]) + } + + manifestIsTypeTag[Int] + manifestIsTypeTag[String] + manifestIsTypeTag[Array[Int]] +} diff --git a/tests/pending/run/interop_typetags_are_manifests.check b/tests/pending/run/interop_typetags_are_manifests.check new file mode 100644 index 000000000000..e02de1fdc20f --- /dev/null +++ b/tests/pending/run/interop_typetags_are_manifests.check @@ -0,0 +1,3 @@ +int +java.lang.String +Array[Int] diff --git a/tests/pending/run/interop_typetags_are_manifests.flags b/tests/pending/run/interop_typetags_are_manifests.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/interop_typetags_are_manifests.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/interop_typetags_are_manifests.scala b/tests/pending/run/interop_typetags_are_manifests.scala new file mode 100644 index 000000000000..5f5781323b0d --- /dev/null +++ b/tests/pending/run/interop_typetags_are_manifests.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag +import internal._ + +object Test extends dotty.runtime.LegacyApp { + def typeTagIsManifest[T: TypeTag : ClassTag] = { + println(manifest[T]) + } + + typeTagIsManifest[Int] + typeTagIsManifest[String] + typeTagIsManifest[Array[Int]] +} diff --git a/tests/pending/run/interpolation.check b/tests/pending/run/interpolation.check new file mode 100644 index 000000000000..997abb449726 --- /dev/null +++ b/tests/pending/run/interpolation.check @@ -0,0 +1,32 @@ +Bob is 1 years old +Bob is 1 years old +Bob will be 2 years old +Bob will be 2 years old +1+1 = 2 +1+1 = 2 +Bob is 12 years old +Bob is 12 years old +Bob will be 13 years old +Bob will be 13 years old +12+1 = 13 +12+1 = 13 +Bob is 123 years old +Bob is 123 years old +Bob will be 124 years old +Bob will be 124 years old +123+1 = 124 +123+1 = 124 +Best price: 10.0 +Best price: 10.00 +10.0% discount included +10.00% discount included +Best price: 13.345 +Best price: 13.35 +13.345% discount included +13.35% discount included + +0 +00 + +0 +00 diff --git a/tests/pending/run/interpolation.scala b/tests/pending/run/interpolation.scala new file mode 100644 index 000000000000..42ac3057e04c --- /dev/null +++ b/tests/pending/run/interpolation.scala @@ -0,0 +1,32 @@ +object Test extends dotty.runtime.LegacyApp { + + def test1(n: Int) = { + println(s"Bob is $n years old") + println(f"Bob is $n%2d years old") + println(s"Bob will be ${n+1} years old") + println(f"Bob will be ${n+1}%2d years old") + println(s"$n+1 = ${n+1}") + println(f"$n%d+1 = ${n+1}%d") + } + + def test2(f: Float) = { + println(s"Best price: $f") + println(f"Best price: $f%.2f") + println(s"$f% discount included") + println(f"$f%3.2f%% discount included") + } + + test1(1) + test1(12) + test1(123) + + test2(10.0f) + test2(13.345f) + + println(s"") + println(s"${0}") + println(s"${0}${0}") + println(f"") + println(f"${0}") + println(f"${0}${0}") +} diff --git a/tests/pending/run/interpolationArgs.check b/tests/pending/run/interpolationArgs.check new file mode 100644 index 000000000000..983214cbee13 --- /dev/null +++ b/tests/pending/run/interpolationArgs.check @@ -0,0 +1,2 @@ +java.lang.IllegalArgumentException: wrong number of arguments (1) for interpolated string with 3 parts +java.lang.IllegalArgumentException: wrong number of arguments (1) for interpolated string with 1 parts diff --git a/tests/pending/run/interpolationArgs.scala b/tests/pending/run/interpolationArgs.scala new file mode 100644 index 000000000000..f4e41557a68a --- /dev/null +++ b/tests/pending/run/interpolationArgs.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + try { scala.StringContext("p1", "p2", "p3").s("e1") } catch { case ex: Throwable => println(ex) } + try { scala.StringContext("p1").s("e1") } catch { case ex: Throwable => println(ex) } +} + diff --git a/tests/pending/run/interpolationMultiline1.check b/tests/pending/run/interpolationMultiline1.check new file mode 100644 index 000000000000..09579a800aee --- /dev/null +++ b/tests/pending/run/interpolationMultiline1.check @@ -0,0 +1,26 @@ +Bob is 1 years old +Bob is 1 years old +Bob will be 2 years old +Bob will be 2 years old +1+1 = 2 +1+1 = 2 +Bob is 12 years old +Bob is 12 years old +Bob will be 13 years old +Bob will be 13 years old +12+1 = 13 +12+1 = 13 +Bob is 123 years old +Bob is 123 years old +Bob will be 124 years old +Bob will be 124 years old +123+1 = 124 +123+1 = 124 +Best price: 10.0 +Best price: 10.00 +10.0% discount included +10.00% discount included +Best price: 13.345 +Best price: 13.35 +13.345% discount included +13.35% discount included diff --git a/tests/pending/run/interpolationMultiline1.scala b/tests/pending/run/interpolationMultiline1.scala new file mode 100644 index 000000000000..5226282566f7 --- /dev/null +++ b/tests/pending/run/interpolationMultiline1.scala @@ -0,0 +1,26 @@ +object Test extends dotty.runtime.LegacyApp { + + def test1(n: Int) = { + println(s"""Bob is $n years old""") + println(f"""Bob is $n%2d years old""") + println(s"""Bob will be ${n+1} years old""") + println(f"""Bob will be ${n+1}%2d years old""") + println(s"""$n+1 = ${n+1}""") + println(f"""$n%d+1 = ${n+1}%d""") + } + + def test2(f: Float) = { + println(s"""Best price: $f""") + println(f"""Best price: $f%.2f""") + println(s"""$f% discount included""") + println(f"""$f%3.2f%% discount included""") + } + + test1(1) + test1(12) + test1(123) + + test2(10.0f) + test2(13.345f) + +} diff --git a/tests/pending/run/interpolationMultiline2.check b/tests/pending/run/interpolationMultiline2.check new file mode 100644 index 000000000000..2218c93a996f --- /dev/null +++ b/tests/pending/run/interpolationMultiline2.check @@ -0,0 +1,26 @@ +Bob is 1 years old! +Bob is 1 years old! +Bob is 1 years old! +Bob is 1 years old! +Bob is 1 years old! +Bob is 1%2d years old! +Bob is 1 years old! +Bob is 1%2d years old! +=============== +Bob is 12 years old! +Bob is 12 years old! +Bob is 12 years old! +Bob is 12 years old! +Bob is 12 years old! +Bob is 12%2d years old! +Bob is 12 years old! +Bob is 12%2d years old! +=============== +Bob is 123 years old! +Bob is 123 years old! +Bob is 123 years old! +Bob is 123 years old! +Bob is 123 years old! +Bob is 123%2d years old! +Bob is 123 years old! +Bob is 123%2d years old! diff --git a/tests/pending/run/interpolationMultiline2.scala b/tests/pending/run/interpolationMultiline2.scala new file mode 100644 index 000000000000..e750c0a553bc --- /dev/null +++ b/tests/pending/run/interpolationMultiline2.scala @@ -0,0 +1,22 @@ +object Test extends dotty.runtime.LegacyApp { + + def test1(n: Int) = { + val old = "old" + val catcher: PartialFunction[Throwable, Unit] = { case e => println(e) } + try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher + try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher + try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher + try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher + try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher + try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher + try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher + try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher + } + + test1(1) + println("===============") + test1(12) + println("===============") + test1(123) + +} diff --git a/tests/pending/run/intmap.scala b/tests/pending/run/intmap.scala new file mode 100644 index 000000000000..593714e2fd97 --- /dev/null +++ b/tests/pending/run/intmap.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp{ + import scala.collection.immutable.IntMap; + + val it = IntMap(8 -> 2, 11 -> 3, 1 -> 2, 7 -> 13); + + assert(it.firstKey == 1); + assert(it.lastKey == 11); +} diff --git a/tests/pending/run/iq.check b/tests/pending/run/iq.check new file mode 100644 index 000000000000..311bf83ed429 --- /dev/null +++ b/tests/pending/run/iq.check @@ -0,0 +1,16 @@ +Empty +q2: Queue(42, 0) +qa: Queue(42, 0) +qb: Queue(42, 0) +qc: Queue(42, 0) +Head: 42 +q5: Queue(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) +q5[5]: 5 +q5 == q5c: true +q5c == q5: true +q8: Queue(2, 3, 4, 5, 6, 7, 8, 9, 10, 11) +q8 == q9: true +Elements: 1 2 3 4 5 6 7 8 9 +String: <1-2-3-4-5-6-7-8-9> +Length: 9 +Front: 1 diff --git a/tests/pending/run/iq.scala b/tests/pending/run/iq.scala new file mode 100644 index 000000000000..e70b6e4f8e39 --- /dev/null +++ b/tests/pending/run/iq.scala @@ -0,0 +1,111 @@ +/* + * Test file for immutable queues. + */ + +import scala.collection.immutable.Queue + +object iq { + def main: Unit = { + /* Create an empty queue. */ + val q: Queue[Int] = Queue.empty + + /* Test isEmpty. + * Expected: Empty + */ + if (q.isEmpty) { + Console.println("Empty") + } + + /* Test enqueing. */ + val q2 = q.enqueue(42).enqueue(0) + val qa = q :+ 42 :+ 0 + assert(q2 == qa) + + val qb = 42 +: 0 +: q + assert(q2 == qb) + val qc = 42 +: q :+ 0 + assert(q2 == qc) + + Console.println("q2: " + q2) + Console.println("qa: " + qa) + Console.println("qb: " + qb) + Console.println("qc: " + qc) + + /* Test is empty and dequeue. + * Expected: Head: 42 + */ + val q4 = + if (q2.isEmpty) { + Console.println("Empty") + q2 + } + else { + val (head, q3) = q2.dequeue + Console.println("Head: " + head) + q3 + } + + /* Test sequence enqueing. */ + val q5: Queue[Any] = q4.enqueue(List(1,2,3,4,5,6,7,8,9)) + /* Test toString. + * Expected: q5: Queue(0,1,2,3,4,5,6,7,8,9) + */ + Console.println("q5: " + q5) + /* Test apply + * Expected: q5[5]: 5 + */ + Console.println("q5[5]: " + q5(5)) + + val q5c: Queue[Int] = Queue.empty.enqueue(List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) + + /* Testing == + * Expected: q5 == q9: true + * q9 == q5: true + */ + Console.println("q5 == q5c: " + (q5 == q5c)) + Console.println("q5c == q5: " + (q5c == q5)) + + val (_, q6) = q5.dequeue + val (_, q7) = q6.dequeue + //val q8 = q7 + 10 + 11 //deprecated + val q8 = q7.enqueue(10).enqueue(11) + /* Test dequeu + * Expected: q8: Queue(2,3,4,5,6,7,8,9,10,11) + */ + Console.println("q8: " + q8) + val q9 = Queue(2,3,4,5,6,7,8,9,10,11) + + /* Testing == + * Expected: q8 == q9: true + */ + Console.println("q8 == q9: " + (q8 == q9)) + + /* Testing elements + * Expected: Elements: 1 2 3 4 5 6 7 8 9 + */ + Console.print("Elements: "); + q6.iterator.foreach(e => Console.print(" "+ e + " ")) + Console.println; + + /* Testing mkString + * Expected: String: <1-2-3-4-5-6-7-8-9> + */ + Console.println("String: " + q6.mkString("<","-",">")) + + /* Testing length + * Expected: Length: 9 + */ + Console.println("Length: " + q6.length) + + /* Testing front + * Expected: Front: 1 + */ + Console.println("Front: " + q6.front); + } +} + +object Test { + def main(args: Array[String]): Unit = { + iq.main + } +} diff --git a/tests/pending/run/is-valid-num.scala b/tests/pending/run/is-valid-num.scala new file mode 100644 index 000000000000..5a4a0503da59 --- /dev/null +++ b/tests/pending/run/is-valid-num.scala @@ -0,0 +1,317 @@ +/* + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ +object Test { + def x = BigInt("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") + def y = BigDecimal("" + (Short.MaxValue + 1) + ".0") + def y1 = BigDecimal("0.1") + def y2 = BigDecimal("0.5") + + def l1 = Int.MaxValue.toLong + 1 + def l2 = Int.MinValue.toLong - 1 + + def main(args: Array[String]): Unit = { +// assert(x.isWhole, x) + assert(!x.isValidDouble, x) + assert(!x.isValidFloat, x) + assert(!x.isValidLong, x) + assert(!x.isValidInt, x) + assert(!x.isValidChar, x) + assert(!x.isValidShort, x) + assert(!x.isValidByte, x) + assert(y.isWhole, y) + assert(!y.isValidShort, y) + assert(y.isValidChar, y) + assert(y.isValidInt, y) + assert(y.isDecimalFloat, y) + assert(y.isDecimalDouble, y) + assert(y.isValidLong, y) + assert(!y.isValidByte, y) + assert(!y1.isWhole) + assert(!y1.isValidLong, y1) + assert(y1.isDecimalFloat, y1) + assert(y1.isDecimalDouble, y1) + assert(!y1.isExactFloat, y1) + assert(!y1.isExactDouble, y1) + assert(!y1.isValidInt, y1) + assert(!y1.isValidChar, y1) + assert(!y1.isValidShort, y1) + assert(!y1.isValidByte, y1) + assert(!y2.isValidLong, y2) + assert(y2.isExactFloat, y2) + assert(y2.isExactDouble, y2) + + assert(!l1.isValidInt && (l1 - 1).isValidInt, l1) + assert(!l2.isValidInt && (l2 + 1).isValidInt, l2) + + testBigInts() + testNonWholeDoubles() + testNaNs() + } + + def testBigInts(): Unit = { + def biExp2(e: Int) = BigInt(1) << e + def checkBigInt2(bi: BigInt): Unit = { checkBigInt(-bi); checkBigInt(bi) } + + val pf = 24 + val pd = 53 + + checkBigInt(BigInt(0)) + checkBigInt2(biExp2(0)) + + checkBigInt2(biExp2(7) - 1) + checkBigInt2(biExp2(7)) + checkBigInt2(biExp2(7) + 1) + + checkBigInt2(biExp2(8) - 1) + checkBigInt2(biExp2(8)) + checkBigInt2(biExp2(8) + 1) + + checkBigInt2(biExp2(15) - 1) + checkBigInt2(biExp2(15)) + checkBigInt2(biExp2(15) + 1) + + checkBigInt2(biExp2(16) - 1) + checkBigInt2(biExp2(16)) + checkBigInt2(biExp2(16) + 1) + + checkBigInt2(biExp2(pf) - 1) + checkBigInt2(biExp2(pf)) + checkBigInt2(biExp2(pf) + 1) + checkBigInt2(biExp2(pf) + 2) + checkBigInt2(biExp2(pf) - 2) + checkBigInt2(biExp2(pf + 1) - 1) + checkBigInt2(biExp2(pf + 1)) + checkBigInt2(biExp2(pf + 1) + 1) + checkBigInt2(biExp2(pf + 1) + 2) + checkBigInt2(biExp2(pf + 1) + 3) + checkBigInt2(biExp2(pf + 1) + 4) + + checkBigInt2(biExp2(31) - 1) + checkBigInt2(biExp2(31)) + checkBigInt2(biExp2(31) + 1) + + checkBigInt2(biExp2(32) - 1) + checkBigInt2(biExp2(32)) + checkBigInt2(biExp2(32) + 1) + checkBigInt2(biExp2(32) + biExp2(64 - pf)) + checkBigInt2(biExp2(32) + biExp2(64 - pf + 1)) + + checkBigInt2(biExp2(pd) - 1) + checkBigInt2(biExp2(pd)) + checkBigInt2(biExp2(pd) + 1) + checkBigInt2(biExp2(pd) + 2) + checkBigInt2(biExp2(pd + 1) - 2) + checkBigInt2(biExp2(pd + 1) - 1) + checkBigInt2(biExp2(pd + 1)) + checkBigInt2(biExp2(pd + 1) + 1) + checkBigInt2(biExp2(pd + 1) + 2) + checkBigInt2(biExp2(pd + 1) + 3) + checkBigInt2(biExp2(pd + 1) + 4) + + checkBigInt2(biExp2(63) - 1) + checkBigInt2(biExp2(63)) + checkBigInt2(biExp2(63) + 1) + checkBigInt2(biExp2(63) + biExp2(63 - pd)) + checkBigInt2(biExp2(63) + biExp2(63 - pd + 1)) + checkBigInt2(biExp2(63) + biExp2(63 - pf)) + checkBigInt2(biExp2(63) + biExp2(63 - pf + 1)) + + checkBigInt2(biExp2(64) - 1) + checkBigInt2(biExp2(64)) + checkBigInt2(biExp2(64) + 1) + checkBigInt2(biExp2(64) + biExp2(64 - pd)) + checkBigInt2(biExp2(64) + biExp2(64 - pd + 1)) + checkBigInt2(biExp2(64) + biExp2(64 - pf)) + checkBigInt2(biExp2(64) + biExp2(64 - pf + 1)) + + checkBigInt2(biExp2(127)) + checkBigInt2(biExp2(128) - biExp2(128 - pf)) + checkBigInt2(biExp2(128) - biExp2(128 - pf - 1)) + checkBigInt2(biExp2(128)) + + checkBigInt2(biExp2(1023)) + checkBigInt2(biExp2(1024) - biExp2(1024 - pd)) + checkBigInt2(biExp2(1024) - biExp2(1024 - pd - 1)) + checkBigInt2(biExp2(1024)) + } + + def testNonWholeDoubles(): Unit = { + checkNonWholeDouble(0.5) + checkNonWholeDouble(-math.E) + checkNonWholeDouble((1L << 51).toDouble + 0.5) + checkNonWholeDouble((1L << 23).toDouble + 0.5) + checkNonWholeDouble(Double.PositiveInfinity) + checkNonWholeDouble(Double.NegativeInfinity) + } + + def testNaNs(): Unit = { + assert(!Double.NaN.isWhole, Double.NaN) +// assert(!Double.NaN.isValidDouble, Double.NaN) +// assert(!Double.NaN.isValidFloat, Double.NaN) +// assert(!Double.NaN.isValidLong, Double.NaN) + assert(!Double.NaN.isValidInt, Double.NaN) + assert(!Double.NaN.isValidChar, Double.NaN) + assert(!Double.NaN.isValidShort, Double.NaN) + assert(!Double.NaN.isValidByte, Double.NaN) + + assert(!Float.NaN.isWhole, Float.NaN) +// assert(!Float.NaN.isValidDouble, Float.NaN) +// assert(!Float.NaN.isValidFloat, Float.NaN) +// assert(!Float.NaN.isValidLong, Float.NaN) + assert(!Float.NaN.isValidInt, Float.NaN) + assert(!Float.NaN.isValidChar, Float.NaN) + assert(!Float.NaN.isValidShort, Float.NaN) + assert(!Float.NaN.isValidByte, Float.NaN) + } + + def checkNonWholeDouble(d: Double): Unit = { + val f = d.toFloat + val isFloat = f == d + + if (!d.isInfinity) { + val bd = BigDecimal(new java.math.BigDecimal(d)) +// assert(!bd.isWhole, bd) + assert(bd.isExactDouble, bd) + assert(bd.isExactFloat == isFloat, bd) + assert(!bd.isValidLong, bd) + assert(!bd.isValidInt, bd) + assert(!bd.isValidChar, bd) + assert(!bd.isValidShort, bd) + assert(!bd.isValidByte, bd) + } + + assert(!d.isWhole, d) +// assert(d.isValidDouble, d) +// assert(d.isValidFloat == isFloat, d) +// assert(!d.isValidLong, d) + assert(!d.isValidInt, d) + assert(!d.isValidChar, d) + assert(!d.isValidShort, d) + assert(!d.isValidByte, d) + + if (isFloat) { + assert(!f.isWhole, f) +// assert(f.isValidDouble, f) +// assert(f.isValidFloat == isFloat, f) +// assert(!f.isValidLong, f) + assert(!f.isValidInt, f) + assert(!f.isValidChar, f) + assert(!f.isValidShort, f) + assert(!f.isValidByte, f) + } + } + + def checkBigInt(bi: BigInt): Unit = { + val bd = BigDecimal(bi, java.math.MathContext.UNLIMITED) + val isByte = bi >= Byte.MinValue && bi <= Byte.MaxValue + val isShort = bi >= Short.MinValue && bi <= Short.MaxValue + val isChar = bi >= Char.MinValue && bi <= Char.MaxValue + val isInt = bi >= Int.MinValue && bi <= Int.MaxValue + val isLong = bi >= Long.MinValue && bi <= Long.MaxValue + val isFloat = !bi.toFloat.isInfinity && bd.compare(BigDecimal(new java.math.BigDecimal(bi.toFloat))) == 0 + val isDouble = !bi.toDouble.isInfinity && bd.compare(BigDecimal(new java.math.BigDecimal(bi.toDouble))) == 0 + + assert(bd.isWhole, bd) + assert(bd.isBinaryDouble == isDouble, bd) + assert(bd.isBinaryFloat == isFloat, bd) + assert(bd.isValidLong == isLong, bd) + assert(bd.isValidInt == isInt, bd) + assert(bd.isValidChar == isChar, bd) + assert(bd.isValidShort == isShort, bd) + assert(bd.isValidByte == isByte, bd) + +// assert(bi.isWhole, bi) + assert(bi.isValidDouble == isDouble, bi) + assert(bi.isValidFloat == isFloat, bi) + assert(bi.isValidLong == isLong, bi) + assert(bi.isValidInt == isInt, bi) + assert(bi.isValidChar == isChar, bi) + assert(bi.isValidShort == isShort, bi) + assert(bi.isValidByte == isByte, bi) + + if (isDouble) { + val d = bi.toDouble + assert(d.isWhole, d) +// assert(d.isValidDouble == isDouble, d) +// assert(d.isValidFloat == isFloat, d) +// assert(d.isValidLong == isLong, d) + assert(d.isValidInt == isInt, d) + assert(d.isValidChar == isChar, d) + assert(d.isValidShort == isShort, d) + assert(d.isValidByte == isByte, d) + } + + if (isFloat) { + val f = bi.toFloat + assert(f.isWhole, f) +// assert(f.isValidDouble == isDouble, f) +// assert(f.isValidFloat == isFloat, f) +// assert(f.isValidLong == isLong, f) + assert(f.isValidInt == isInt, f) + assert(f.isValidChar == isChar, f) + assert(f.isValidShort == isShort, f) + assert(f.isValidByte == isByte, f) + } + + if (isLong) { + val l = bi.toLong + assert(l.isWhole, l) +// assert(l.isValidDouble == isDouble, l) +// assert(l.isValidFloat == isFloat, l) +// assert(l.isValidLong == isLong, l) + assert(l.isValidInt == isInt, l) + assert(l.isValidChar == isChar, l) + assert(l.isValidShort == isShort, l) + assert(l.isValidByte == isByte, l) + } + + if (isInt) { + val i = bi.toInt + assert(i.isWhole, i) +// assert(i.isValidDouble == isDouble, i) +// assert(i.isValidFloat == isFloat, i) +// assert(i.isValidLong == isLong, i) + assert(i.isValidInt == isInt, i) + assert(i.isValidChar == isChar, i) + assert(i.isValidShort == isShort, i) + assert(i.isValidByte == isByte, i) + } + + if (isChar) { + val c = bi.toChar + assert(c.isWhole, c) +// assert(c.isValidDouble == isDouble, c) +// assert(c.isValidFloat == isFloat, c) +// assert(c.isValidLong == isLong, c) + assert(c.isValidInt == isInt, c) + assert(c.isValidChar == isChar, c) + assert(c.isValidShort == isShort, c) + assert(c.isValidByte == isByte, c) + } + + if (isShort) { + val s = bi.toShort + assert(s.isWhole, s) +// assert(s.isValidDouble == isDouble, s) +// assert(s.isValidFloat == isFloat, s) +// assert(s.isValidLong == isLong, s) + assert(s.isValidInt == isInt, s) + assert(s.isValidChar == isChar, s) + assert(s.isValidShort == isShort, s) + assert(s.isValidByte == isByte, s) + } + + if (isByte) { + val b = bi.toByte + assert(b.isWhole, b) +// assert(b.isValidDouble == isDouble, b) +// assert(b.isValidFloat == isFloat, b) +// assert(b.isValidLong == isLong, b) + assert(b.isValidInt == isInt, b) + assert(b.isValidChar == isChar, b) + assert(b.isValidShort == isShort, b) + assert(b.isValidByte == isByte, b) + } + } +} diff --git a/tests/pending/run/issue192.check b/tests/pending/run/issue192.check new file mode 100644 index 000000000000..78cd78d2fc37 --- /dev/null +++ b/tests/pending/run/issue192.check @@ -0,0 +1,36 @@ +f1 = true +f2 = true +f3 = true +f4 = true +f5 = true +f6 = true +f7 = true +f8 = true +f9 = true +f10 = true +f11 = true +f12 = true +f13 = true +f14 = true +f15 = true +f16 = true +f17 = true +f18 = true +f19 = true +f20 = true +f21 = true +f22 = true +f23 = true +f24 = true +f25 = true +f26 = true +f27 = true +f28 = true +f29 = true +f30 = true +f31 = true +f32 = true +f33 = true +f34 = true +f35 = true +ok diff --git a/tests/pending/run/issue192.scala b/tests/pending/run/issue192.scala new file mode 100644 index 000000000000..b00a35917c82 --- /dev/null +++ b/tests/pending/run/issue192.scala @@ -0,0 +1,91 @@ +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + + def f1(p: Any{def unary_+ : Int}) = +p + def f2(p: Any{def unary_- : Int}) = -p + def f3(p: Any{def unary_~ : Int}) = ~p + def f4(p: Any{def unary_! : Boolean}) = !p + + def f5(p: Any{def +(q: Int): Int}) = p + 7 + def f6(p: Any{def -(q: Int): Int}) = p - 7 + def f7(p: Any{def *(q: Int): Int}) = p * 7 + def f8(p: Any{def /(q: Int): Int}) = p / 7 + def f9(p: Any{def %(q: Int): Int}) = p % 7 + + def f10(p: Any{def |(q: Int): Int}) = p | 7 + def f11(p: Any{def |(q: Boolean): Boolean}) = p | true + def f12(p: Any{def ^(q: Int): Int}) = p ^ 7 + def f13(p: Any{def ^(q: Boolean): Boolean}) = p ^ true + def f14(p: Any{def &(q: Int): Int}) = p & 7 + def f15(p: Any{def &(q: Boolean): Boolean}) = p & true + def f16(p: Any{def ||(q: Boolean): Boolean}) = p || true + def f17(p: Any{def &&(q: Boolean): Boolean}) = p && true + + def f18(p: Any{def <<(q: Int): Int}) = p << 7 + def f19(p: Any{def >>(q: Int): Int}) = p >> 7 + def f20(p: Any{def >>>(q: Int): Int}) = p >>> 7 + + def f21(p: Any{def toByte: Byte}) = p.toByte + def f22(p: Any{def toShort: Short}) = p.toShort + def f23(p: Any{def toChar: Char}) = p.toChar + def f24(p: Any{def toInt: Int}) = p.toInt + def f25(p: Any{def toLong: Long}) = p.toLong + def f26(p: Any{def toFloat: Float}) = p.toFloat + def f27(p: Any{def toDouble: Double}) = p.toDouble + + def f28(p: Any{def ==(q: Int): Boolean}) = p == 7 + def f29(p: Any{def !=(q: Int): Boolean}) = p != 7 + def f30(p: Any{def ==(q: Boolean): Boolean}) = p == true + def f31(p: Any{def !=(q: Boolean): Boolean}) = p != true + + def f32(p: Any{def <(q: Int): Boolean}) = p < 7 + def f33(p: Any{def <=(q: Int): Boolean}) = p <= 7 + def f34(p: Any{def >=(q: Int): Boolean}) = p >= 7 + def f35(p: Any{def >(q: Int): Boolean}) = p > 7 + + print("f1 = "); println(f1(1) == +1) + print("f2 = "); println(f2(1) == -1) + print("f3 = "); println(f3(1) == ~1) + print("f4 = "); println(f4(true) == !true) + + print("f5 = "); println(f5(4) == (4 + 7)) + print("f6 = "); println(f6(4) == (4 - 7)) + print("f7 = "); println(f7(4) == (4 * 7)) + print("f8 = "); println(f8(4) == (4 / 7)) + print("f9 = "); println(f9(4) == (4 % 7)) + + print("f10 = "); println(f10(4) == (4 | 7)) + print("f11 = "); println(f11(false) == (false | true)) + print("f12 = "); println(f12(4) == (4 ^ 7)) + print("f13 = "); println(f13(false) == (false ^ true)) + print("f14 = "); println(f14(4) == (4 & 7)) + print("f15 = "); println(f15(false) == (false & true)) + print("f16 = "); println(f16(false) == (false || true)) + print("f17 = "); println(f17(false) == (false && true)) + + print("f18 = "); println(f18(4) == (4 << 7)) + print("f19 = "); println(f19(-4) == (-4 >> 7)) + print("f20 = "); println(f20(-4) == (-4 >>> 7)) + + print("f21 = "); println(f21(4.2) == (4.2.toByte)) + print("f22 = "); println(f22(4.2) == (4.2.toShort)) + print("f23 = "); println(f23(4.2) == (4.2.toChar)) + print("f24 = "); println(f24(4.2) == (4.2.toInt)) + print("f25 = "); println(f25(4.2) == (4.2.toLong)) + print("f26 = "); println(f26(4.2) == (4.2.toFloat)) + print("f27 = "); println(f27(4.2) == (4.2.toDouble)) + + print("f28 = "); println(f28(4) == (4 == 7)) + print("f29 = "); println(f29(4) == (4 != 7)) + print("f30 = "); println(f30(false) == (false == true)) + print("f31 = "); println(f31(false) == (false != true)) + + print("f32 = "); println(f32(4) == (4 < 7)) + print("f33 = "); println(f33(4) == (4 <= 7)) + print("f34 = "); println(f34(4) == (4 >= 7)) + print("f35 = "); println(f35(4) == (4 > 7)) + + println("ok") + +} diff --git a/tests/pending/run/iterables.check b/tests/pending/run/iterables.check new file mode 100644 index 000000000000..aac90b70a909 --- /dev/null +++ b/tests/pending/run/iterables.check @@ -0,0 +1,5 @@ +false +0,1,2,3,4,5,6,7,8,9 +5,6,7,8,9 +0,2,4,6,8 +1,3,5,7,9 diff --git a/tests/pending/run/iterables.scala b/tests/pending/run/iterables.scala new file mode 100644 index 000000000000..251722982660 --- /dev/null +++ b/tests/pending/run/iterables.scala @@ -0,0 +1,26 @@ +object Test extends dotty.runtime.LegacyApp { + class Test(n: Int) extends Iterable[Int] { + private var i = 0 + def iterator = new Iterator[Int] { + def hasNext = i < n + def next = + if (hasNext) { val v = i; i += 1; v } + else throw new IndexOutOfBoundsException("empty iterator") + } + } + { + val x = new Test(10) + println(x.isEmpty) + println(x.mkString(",")) + } + { + val x = new Test(10) + println(x.filter(_ > 4).mkString(",")) + } + { + val x = new Test(10) + val y = x.partition(_ % 2 == 0) + println(y._1.mkString(",")) + println(y._2.mkString(",")) + } +} diff --git a/tests/pending/run/iterator-concat.check b/tests/pending/run/iterator-concat.check new file mode 100644 index 000000000000..23835b07ae31 --- /dev/null +++ b/tests/pending/run/iterator-concat.check @@ -0,0 +1,4 @@ +100 +1000 +10000 +100000 diff --git a/tests/pending/run/iterator-concat.scala b/tests/pending/run/iterator-concat.scala new file mode 100644 index 000000000000..f11363410fe5 --- /dev/null +++ b/tests/pending/run/iterator-concat.scala @@ -0,0 +1,15 @@ +object Test { + // Create `size` Function0s, each of which evaluates to an Iterator + // which produces 1. Then fold them over ++ to get a single iterator, + // which should sum to "size". + def mk(size: Int): Iterator[Int] = { + val closures = (1 to size).toList.map(x => (() => Iterator(1))) + closures.foldLeft(Iterator.empty: Iterator[Int])((res, f) => res ++ f()) + } + def main(args: Array[String]): Unit = { + println(mk(100).sum) + println(mk(1000).sum) + println(mk(10000).sum) + println(mk(100000).sum) + } +} diff --git a/tests/pending/run/iterator-from.scala b/tests/pending/run/iterator-from.scala new file mode 100644 index 000000000000..4f403680c128 --- /dev/null +++ b/tests/pending/run/iterator-from.scala @@ -0,0 +1,71 @@ +/* This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ + +import scala.util.{Random => R} +import scala.collection._ +import scala.math.Ordered + +object Test extends dotty.runtime.LegacyApp { + val maxLength = 25 + val maxKey = 50 + val maxValue = 50 + + def testSet[A <% Ordered[A]](set: SortedSet[A], list: List[A]): Unit = { + val distinctSorted = list.distinct.sorted + assertEquals("Set size wasn't the same as list sze", set.size, distinctSorted.size) + + for(key <- distinctSorted) { + val clazz = set.getClass + val iteratorFrom = (set iteratorFrom key).toList + check(clazz, list, s"set iteratorFrom $key", s"(set from $key).iterator", iteratorFrom, (set from key).iterator.toList) + check(clazz, list, s"set.iteratorFrom $key", s"distinctSorted dropWhile (_ < $key)", iteratorFrom, distinctSorted dropWhile (_ < key)) + check(clazz, list, s"set iteratorFrom $key", s"set keysIterator from $key", iteratorFrom, (set keysIteratorFrom key).toList) + } + } + + def testMap[A <% Ordered[A], B](map: SortedMap[A, B], list: List[(A, B)]): Unit = { + val distinctSorted = distinctByKey(list).sortBy(_._1) + assertEquals("Map size wasn't the same as list sze", map.size, distinctSorted.size) + + for(keyValue <- distinctSorted) { + val key = keyValue._1 + val clazz = map.getClass + val iteratorFrom = (map iteratorFrom key).toList + check(clazz, list, s"map iteratorFrom $key", s"(map from $key).iterator", iteratorFrom, (map from key).iterator.toList) + check(clazz, list, s"map iteratorFrom $key", s"distinctSorted dropWhile (_._1 < $key)", iteratorFrom, distinctSorted dropWhile (_._1 < key)) + check(clazz, list, s"map iteratorFrom $key map (_._1)", s"map keysIteratorFrom $key", iteratorFrom map (_._1), (map keysIteratorFrom key).toList) + check(clazz, list, s"map iteratorFrom $key map (_._2)", s"map valuesIteratorFrom $key", iteratorFrom map (_._2), (map valuesIteratorFrom key).toList) + } + } + + def check[A](clazz: Class[_], list: List[_], m1: String, m2: String, l1: List[A], l2: List[A]): Unit = { + assertEquals(s"$clazz: `$m1` didn't match `$m2` on list $list", l1, l2) + } + + def assertEquals[A](msg: String, x: A, y: A): Unit = { + assert(x == y, s"$msg\n1: $x\n2: $y") + } + + def distinctByKey[A,B](list: List[(A, B)]) : List[(A,B)] = list.groupBy(_._1).map(_._2.last).toList + + object Weekday extends Enumeration { + type Weekday = Value + val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value + } + + 0 until maxLength foreach {length => + val keyValues = (0 until length map {_ => (R nextInt maxKey, R nextInt maxValue)}).toList + val keys = keyValues map (_._2) + testSet(immutable.BitSet(keys:_*), keys) + testSet(immutable.TreeSet(keys:_*), keys) + testSet(mutable.TreeSet(keys:_*), keys) + val days = keys map {n => Weekday(n % Weekday.values.size)} + testSet(Weekday.ValueSet(days:_*), days) + + val treeMap = immutable.TreeMap(keyValues:_*) + testMap(treeMap, keyValues) + testMap(treeMap.filterKeys(_ % 2 == 0), keyValues filter (_._1 % 2 == 0)) + testMap(treeMap mapValues (_ + 1), keyValues map {case (k,v) => (k, v + 1)}) + } +} diff --git a/tests/pending/run/iterator-iterate-lazy.scala b/tests/pending/run/iterator-iterate-lazy.scala new file mode 100644 index 000000000000..92b170062e7a --- /dev/null +++ b/tests/pending/run/iterator-iterate-lazy.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + Iterator.iterate((1 to 5).toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList + } +} diff --git a/tests/pending/run/iterator3444.scala b/tests/pending/run/iterator3444.scala new file mode 100644 index 000000000000..0a8f94291c3b --- /dev/null +++ b/tests/pending/run/iterator3444.scala @@ -0,0 +1,23 @@ + + +// ticked #3444 +object Test { + + def main(args: Array[String]): Unit = { + val it = (1 to 12).toSeq.iterator + + assert(it.next == 1) + assert(it.take(2).toList == List(2, 3)) + + val jt = (4 to 12).toSeq.iterator + assert(jt.next == 4) + assert(jt.drop(5).toList == List(10, 11, 12)) + + val kt = (1 until 10).toSeq.iterator + assert(kt.drop(50).toList == Nil) + + val mt = (1 until 5).toSeq.iterator + assert(mt.take(50).toList == List(1, 2, 3, 4)) + } + +} diff --git a/tests/pending/run/iterators.check b/tests/pending/run/iterators.check new file mode 100644 index 000000000000..bb139c161061 --- /dev/null +++ b/tests/pending/run/iterators.check @@ -0,0 +1,13 @@ +test check_from was successful +test check_range was successful +test check_range2 was successful +test check_range3 was successful +test check_take was successful +test check_drop was successful +test check_foreach was successful +test check_forall was successful +test check_fromArray was successful +test check_toSeq was successful +test check_indexOf was successful +test check_findIndexOf was successful + diff --git a/tests/pending/run/iterators.scala b/tests/pending/run/iterators.scala new file mode 100644 index 000000000000..e2a97ec7a03a --- /dev/null +++ b/tests/pending/run/iterators.scala @@ -0,0 +1,136 @@ +//############################################################################ +// Iterators +//############################################################################ + +//############################################################################ + +import scala.language.postfixOps + +object Test { + + def check_from: Int = { + val it1 = Iterator.from(-1) + val it2 = Iterator.from(0, -1) + it1.next + it2.next + } + + def check_range: Int = { + val xs1 = Iterator.range(0, 10, 2) toList; + val xs2 = Iterator.range(0, 10, -2) toList; + val xs3 = Iterator.range(10, 0, -2) toList; + val xs4 = Iterator.range(10, 0, 2) toList; + val xs5 = Iterator.range(0, 10, 11) toList; + xs1.length + xs2.length + xs3.length + xs4.length + xs5.length + } + + def check_range2: Int = { + val r1start = 0 + val r1end = 10 + val r1step = 1 + val r1 = Iterator.range(r1start, r1end, r1step) toList; + val r2 = Iterator.range(r1start, r1end, r1step + 1) toList; + val r3 = Iterator.range(r1end, r1start, -r1step) toList; + val r4 = Iterator.range(0, 10, 11) toList; + // 10 + 5 + 10 + 1 + r1.length + r2.length + r3.length + r4.length + } + + def check_range3: Int = { + def trues(xs: List[Boolean]) = xs.foldLeft(0)((a, b) => if (b) a+1 else a) + val r1 = Iterator.range(0, 10) + val xs1 = List(r1 contains 5, r1 contains 6) + val r2a = Iterator.range(0, 10, 2) + val r2b = Iterator.range(0, 10, 2) + val xs2 = List(r2a contains 5, r2b contains 6) + val r3 = Iterator.range(0, 10, 11) + val xs3 = List(r3 contains 5, r3 contains 6) + // 2 + 1 + 0 + trues(xs1) + trues(xs2) + trues(xs3) + } + + def check_take: Int = { + val it1 = Iterator.from(0) + val xs1 = it1 take 10 toList; + xs1.length + } + + def check_drop: Int = { + val it1 = Iterator.from(0) + val it2 = it1 map { 2 * _ } + val n1 = it1 drop 2 next + val n2 = it2 drop 2 next; + n1 + n2 + } + + def check_foreach: Int = { + val it1 = Iterator.from(0) take 20 + var n = 0 + it1 foreach { n += _ } + n + } + + def check_forall: Int = { + val it1 = Iterator.from(0) + val it2 = Iterator.from(1) + 0 + } + + def check_fromArray: Int = { // ticket #429 + val a = List(1, 2, 3, 4).toArray + var xs0 = a.iterator.toList; + var xs1 = a.slice(0, 1).iterator.toList; + var xs2 = a.slice(0, 2).iterator.toList; + var xs3 = a.slice(0, 3).iterator.toList; + var xs4 = a.slice(0, 4).iterator.toList; + xs0.length + xs1.length + xs2.length + xs3.length + xs4.length + } + + def check_toSeq: String = + List(1, 2, 3, 4, 5).iterator.toSeq.mkString("x") + + def check_indexOf: String = { + val i = List(1, 2, 3, 4, 5).indexOf(4) + val j = List(1, 2, 3, 4, 5).indexOf(16) + "" + i + "x" + j + } + + def check_findIndexOf: String = { + val i = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 4 } + val j = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 16 } + "" + i + "x" + j + } + + def check_success[A](name: String, closure: => A, expected: A): Unit = { + print("test " + name) + try { + val actual: A = closure + if (actual == expected) + print(" was successful") + else + print(" failed: expected "+ expected +", found "+ actual) + } + catch { + case exception: Throwable => + print(" raised exception " + exception) + } + println() + } + + def main(args: Array[String]): Unit = { + check_success("check_from", check_from, -1) + check_success("check_range", check_range, 11) + check_success("check_range2", check_range2, 26) + check_success("check_range3", check_range3, 3) + check_success("check_take", check_take, 10) + check_success("check_drop", check_drop, 12) + check_success("check_foreach", check_foreach, 190) + check_success("check_forall", check_forall, 0) + check_success("check_fromArray",check_fromArray, 14) + check_success("check_toSeq", check_toSeq, "1x2x3x4x5") + check_success("check_indexOf", check_indexOf, "3x-1") + check_success("check_findIndexOf", check_findIndexOf, "3x-1") + println() + } +} + +//############################################################################ diff --git a/tests/pending/run/java-erasure.check b/tests/pending/run/java-erasure.check new file mode 100644 index 000000000000..f2ad6c76f011 --- /dev/null +++ b/tests/pending/run/java-erasure.check @@ -0,0 +1 @@ +c diff --git a/tests/pending/run/java-erasure.scala b/tests/pending/run/java-erasure.scala new file mode 100644 index 000000000000..c9f9b0ad515c --- /dev/null +++ b/tests/pending/run/java-erasure.scala @@ -0,0 +1,10 @@ +object Test { + val list = new java.util.ArrayList[String] { }; + list add "a" + list add "c" + list add "b" + + def main(args: Array[String]): Unit = { + println(java.util.Collections.max(list)) + } +} diff --git a/tests/pending/run/kind-repl-command.check b/tests/pending/run/kind-repl-command.check new file mode 100644 index 000000000000..586b2710e161 --- /dev/null +++ b/tests/pending/run/kind-repl-command.check @@ -0,0 +1,28 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :kind scala.Option +scala.Option's kind is F[+A] + +scala> :k (Int, Int) => Int +scala.Function2's kind is F[-A1,-A2,+A3] + +scala> :k -v Either +scala.util.Either's kind is F[+A1,+A2] +* -(+)-> * -(+)-> * +This is a type constructor: a 1st-order-kinded type. + +scala> :k -v scala.collection.generic.ImmutableSortedMapFactory +scala.collection.generic.ImmutableSortedMapFactory's kind is X[CC[A,B] <: scala.collection.immutable.SortedMap[A,B] with scala.collection.SortedMapLike[A,B,CC[A,B]]] +(* -> * -> *(scala.collection.immutable.SortedMap[A,B] with scala.collection.SortedMapLike[A,B,CC[A,B]])) -> * +This is a type constructor that takes type constructor(s): a higher-kinded type. + +scala> :k new { def empty = false } +AnyRef{def empty: Boolean}'s kind is A + +scala> :k Nonexisting +:8: error: not found: value Nonexisting + Nonexisting + ^ + +scala> :quit diff --git a/tests/pending/run/kind-repl-command.scala b/tests/pending/run/kind-repl-command.scala new file mode 100644 index 000000000000..df1fafb667ff --- /dev/null +++ b/tests/pending/run/kind-repl-command.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |:kind scala.Option + |:k (Int, Int) => Int + |:k -v Either + |:k -v scala.collection.generic.ImmutableSortedMapFactory + |:k new { def empty = false } + |:k Nonexisting + """.stripMargin +} diff --git a/tests/pending/run/kmpSliceSearch.check b/tests/pending/run/kmpSliceSearch.check new file mode 100644 index 000000000000..9ce0eba5a8e8 --- /dev/null +++ b/tests/pending/run/kmpSliceSearch.check @@ -0,0 +1,4 @@ +6 6 +5 10 +-1 -1 +4 4 diff --git a/tests/pending/run/kmpSliceSearch.scala b/tests/pending/run/kmpSliceSearch.scala new file mode 100644 index 000000000000..4d582bb1c753 --- /dev/null +++ b/tests/pending/run/kmpSliceSearch.scala @@ -0,0 +1,60 @@ +object Test { + import scala.collection.SeqLike + def slowSearch[A](xs: Seq[A], ys: Seq[A], start: Int = 0): Int = { + if (xs startsWith ys) start + else if (xs.isEmpty) -1 + else slowSearch(xs.tail, ys, start+1) + } + def bkwSlowSearch[A](xs: Seq[A], ys: Seq[A]) = { + val i = slowSearch(xs.reverse, ys.reverse) + if (i<0) i + else xs.length - ys.length - i + } + def main(args: Array[String]): Unit = { + val rng = new scala.util.Random(java.lang.Integer.parseInt("kmp",36)) + + // Make sure we agree with naive implementation + for (h <- Array(2,5,1000)) { + for (i <- 0 to 100) { + for (j <- 0 to 10) { + val xs = (0 to j).map(_ => (rng.nextInt & 0x7FFFFFFF) % h) + val xsa = xs.toArray + val xsv = Vector() ++ xs + val xsl = xs.toList + val xss = Vector[Seq[Int]](xs,xsa,xsv,xsl) + for (k <- 0 to 5) { + val ys = (0 to k).map(_ => (rng.nextInt & 0x7FFFFFFF) % h) + val ysa = ys.toArray + val ysv = Vector() ++ ys + val ysl = ys.toList + val yss = Vector[Seq[Int]](ys,ysa,ysv,ysl) + val fwd_slow = slowSearch(xs,ys) + val bkw_slow = bkwSlowSearch(xs,ys) + val fwd_fast = xss.flatMap(xs => yss.map(ys => SeqLike.indexOf(xs,0,xs.length,ys,0,ys.length,0))) + val bkw_fast = xss.flatMap(xs => yss.map(ys => SeqLike.lastIndexOf(xs,0,xs.length,ys,0,ys.length,xs.length))) + assert(fwd_fast.forall(_ == fwd_slow)) + assert(bkw_fast.forall(_ == bkw_slow)) + } + } + } + } + + // Check performance^Wcorrectness of common small test cases + val haystacks = List[Seq[Int]]( + Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), + Vector(99,2,99,99,2,99,99,99,2,99,99,99,99,2), + List(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), + 1 to 15 + ) + val needles = List[Seq[Int]]( + Array(7,8,9,10), + Vector(99,99,99), + List(1,1,1,1,1,2), + 5 to 9 + ) + (haystacks zip needles) foreach { + case (hay, nee) => + println(hay.indexOfSlice(nee,2) + " " + hay.lastIndexOfSlice(nee,13)) + } + } +} diff --git a/tests/pending/run/large_class.check b/tests/pending/run/large_class.check new file mode 100644 index 000000000000..0585c267ac43 --- /dev/null +++ b/tests/pending/run/large_class.check @@ -0,0 +1,3 @@ +newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large! +class BigEnoughToFail { + ^ diff --git a/tests/pending/run/large_class.scala b/tests/pending/run/large_class.scala new file mode 100644 index 000000000000..aa486ef8f7ed --- /dev/null +++ b/tests/pending/run/large_class.scala @@ -0,0 +1,27 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +// a cold run of partest takes about 15s for this test on my laptop +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -d " + testOutput.path + + def s(n: Int) = "\""+n+"\"" + + override def code + = s""" + |class BigEnoughToFail { + | def m(a: String, b: String, c: String, d: String, e: String, f: String) = null + | ${(1 to 5500) map (n => "def f"+n+" = m("+ s(n+10000)+","+ + s(n+20000)+","+ + s(n+30000)+","+ + s(n+40000)+","+ + s(n+50000)+","+ + s(n+60000)+")") mkString ";"} + |}""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/large_code.check b/tests/pending/run/large_code.check new file mode 100644 index 000000000000..6ad50967bc71 --- /dev/null +++ b/tests/pending/run/large_code.check @@ -0,0 +1,3 @@ +newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large! +class BigEnoughToFail { + ^ diff --git a/tests/pending/run/large_code.scala b/tests/pending/run/large_code.scala new file mode 100644 index 000000000000..f9d7f8c95bd0 --- /dev/null +++ b/tests/pending/run/large_code.scala @@ -0,0 +1,24 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +// a cold run of partest takes about 15s for this test on my laptop +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -d " + testOutput.path + + // test that we hit the code size limit and error out gracefully + // 5958 is the magic number (2^16/11 -- each `a(1,2,3,4,5,6)` is 11 bytes of bytecode) + override def code + = s""" + |class BigEnoughToFail { + | def a(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int): Unit = {} + | def tooLong: Unit = { + | ${(1 to 5958) map (_ => "a(1,2,3,4,5,6)") mkString(";")} + | } + |}""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/lazy-concurrent.check b/tests/pending/run/lazy-concurrent.check new file mode 100644 index 000000000000..33cff9d4f813 --- /dev/null +++ b/tests/pending/run/lazy-concurrent.check @@ -0,0 +1 @@ +Initializing singleton. diff --git a/tests/pending/run/lazy-concurrent.scala b/tests/pending/run/lazy-concurrent.scala new file mode 100644 index 000000000000..9acfa7753e3d --- /dev/null +++ b/tests/pending/run/lazy-concurrent.scala @@ -0,0 +1,17 @@ +object Test { + def main(args: Array[String]): Unit = { + class Singleton { + val field = () + println("Initializing singleton.") + } + lazy val Singleton = new Singleton + + var i = 0 + while (i < 4) { + new Thread(new Runnable { + def run = Singleton.field + }).start + i += 1 + } + } +} diff --git a/tests/pending/run/lazy-exprs.check b/tests/pending/run/lazy-exprs.check new file mode 100644 index 000000000000..2efb8ceb4ac1 --- /dev/null +++ b/tests/pending/run/lazy-exprs.check @@ -0,0 +1,21 @@ +lazy-exprs.scala:38: warning: match may not be exhaustive. +It would fail on the following input: Some((x: String forSome x not in Z1)) + t match { + ^ +lazy-exprs.scala:62: warning: match may not be exhaustive. +It would fail on the following input: Some((x: String forSome x not in LazyField)) + t match { + ^ +forced +lazy val in scrutinee: ok +forced +lazy val in case: ok +lazy val in case: forced +ok +lazy val in if condition: forced +ok +lazy val in pattern: forced LazyField +ok +lazy val with patterns: +x and y: xy(x, y) +x1 and y1: x1y1(x1, y1) diff --git a/tests/pending/run/lazy-exprs.scala b/tests/pending/run/lazy-exprs.scala new file mode 100644 index 000000000000..3ba6b46ab216 --- /dev/null +++ b/tests/pending/run/lazy-exprs.scala @@ -0,0 +1,95 @@ +object TestExpressions { + + def patmatchScrut: Unit = { + lazy val z1: Option[String] = { println("forced "); Some("lazy z1") } + + val res = z1 match { + case Some(msg) => msg + case None => "failed" + } + print("lazy val in scrutinee: ") + if (res == "lazy z1") + println("ok") + else + println("failed") + } + + def patmatchCase: Unit = { + val t: Option[String] = Some("test") + val res = t match { + case Some(msg) => + lazy val z1 = { println("forced "); "lazy z1" } + z1 + + case None => "failed" + } + print("lazy val in case: ") + if (res == "lazy z1") + println("ok") + else + println("failed") + } + + + def patmatchPat: Unit = { + lazy val Z1 = { println("forced "); "lazy Z1" } + print("lazy val in case: ") + val t: Option[String] = Some("lazy Z1") + t match { + case Some(Z1) => + println("ok") + + case None => + println("failed") + } + } + + def ifcond: Unit = { + lazy val z1 = { println("forced "); "lazy z1" } + print("lazy val in if condition: ") + if (z1 == "lazy z1") + println("ok") + else + println("failed") + } + + + lazy val LazyField = { println("forced LazyField"); "LazyField" } + + def testPatMatchField: Unit = { + print("lazy val in pattern: ") + val t: Option[String] = Some("LazyField") + t match { + case Some(LazyField) => + println("ok") + + case None => + println("failed") + } + } + + lazy val (x, y) = ({print("x"); "x"}, {print("y"); "y"}) + def testPatLazyVal: Unit = { + println("lazy val with patterns:") + print("x and y: ") + println("(" + x + ", " + y + ")") + lazy val (x1, y1) = ({print("x1"); "x1"}, {print("y1"); "y1"}) + print("x1 and y1: ") + println("(" + x1 + ", " + y1 + ")") + } + + def test: Unit = { + patmatchScrut + patmatchCase + patmatchPat + ifcond + testPatMatchField + testPatLazyVal + } +} + + +object Test extends dotty.runtime.LegacyApp { + + TestExpressions.test +} diff --git a/tests/pending/run/lazy-leaks.scala b/tests/pending/run/lazy-leaks.scala new file mode 100644 index 000000000000..6e5aa41f1e77 --- /dev/null +++ b/tests/pending/run/lazy-leaks.scala @@ -0,0 +1,18 @@ +class Lazy(f: => Int) { + lazy val get: Int = f +} + +object Test extends dotty.runtime.LegacyApp +{ + val buffer = new scala.collection.mutable.ListBuffer[Lazy] + + // This test requires 4 Mb of RAM if Lazy is discarding thunks + // It consumes 4 Gb of RAM if Lazy is not discarding thunks + + for (idx <- Iterator.range(0, 1024)) { + val data = new Array[Int](1024*1024) + val lz: Lazy = new Lazy(data.length) + buffer += lz + lz.get + } +} diff --git a/tests/pending/run/lazy-locals.check b/tests/pending/run/lazy-locals.check new file mode 100644 index 000000000000..9e88a55d1802 --- /dev/null +++ b/tests/pending/run/lazy-locals.check @@ -0,0 +1,86 @@ +lazy-locals.scala:153: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + { + ^ +lazy-locals.scala:159: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + { + ^ +forced lazy val q +q = 10 +forced lazy val t +p = 21 +85 +forced lazy val t31 +forced lazy val t30 +forced lazy val t29 +forced lazy val t28 +forced lazy val t27 +forced lazy val t26 +forced lazy val t25 +forced lazy val t24 +forced lazy val t23 +forced lazy val t22 +forced lazy val t21 +forced lazy val t20 +forced lazy val t19 +forced lazy val t18 +forced lazy val t17 +forced lazy val t16 +forced lazy val t15 +forced lazy val t14 +forced lazy val t13 +forced lazy val t12 +forced lazy val t11 +forced lazy val t10 +forced lazy val t09 +forced lazy val t08 +forced lazy val t07 +forced lazy val t06 +forced lazy val t05 +forced lazy val t04 +forced lazy val t03 +forced lazy val t02 +forced lazy val t01 +forced lazy val t00 +Sum is: 496 +Sum again is: 496 +Sum again again is: 496 +forced lazy val t07 +forced lazy val t06 +forced lazy val t05 +forced lazy val t04 +forced lazy val t03 +forced lazy val t02 +forced lazy val t01 +forced lazy val t00 +Sum is: 28 +Sum again is: 28 +Sum again again is: 28 +forced lazy val t08 +forced lazy val t07 +forced lazy val t06 +forced lazy val t05 +forced lazy val t04 +forced lazy val t03 +forced lazy val t02 +forced lazy val t01 +forced lazy val t00 +Sum is: 36 +Sum again is: 36 +Sum again again is: 36 +forced lazy val t at n = 0 +42 +forced lazy val t at n = 0 +forced lazy val t at n = 1 +forced lazy val t at n = 2 +forced lazy val t at n = 3 +forced lazy val t at n = 4 +forced lazy val t at n = 5 +1764 +First 5 elements of ones: List(1, 1, 1, 1, 1) +I am initialized when the constructor is run +false +forcing x +forcing y +42 +15 +42 diff --git a/tests/pending/run/lazy-locals.scala b/tests/pending/run/lazy-locals.scala new file mode 100644 index 000000000000..cc994513a32c --- /dev/null +++ b/tests/pending/run/lazy-locals.scala @@ -0,0 +1,209 @@ + +object Test extends dotty.runtime.LegacyApp { + + lazy val w = 10 + + /** normal test */ + def testLazy = { + lazy val t = { Console.println("forced lazy val t"); 42 } + lazy val p = t / 2 + lazy val q = { println("forced lazy val q"); 10} + println("q = " + q) + println("p = " + p) + 1 + t + t + } + + /** test 32 lazy vals, which should spill over multiple byte bitmaps. */ + def testLazy32 = { + lazy val t00 = { Console.println("forced lazy val t00"); 0 } + lazy val t01 = { Console.println("forced lazy val t01"); 1 } + lazy val t02 = { Console.println("forced lazy val t02"); 2 } + lazy val t03 = { Console.println("forced lazy val t03"); 3 } + lazy val t04 = { Console.println("forced lazy val t04"); 4 } + lazy val t05 = { Console.println("forced lazy val t05"); 5 } + lazy val t06 = { Console.println("forced lazy val t06"); 6 } + lazy val t07 = { Console.println("forced lazy val t07"); 7 } + lazy val t08 = { Console.println("forced lazy val t08"); 8 } + lazy val t09 = { Console.println("forced lazy val t09"); 9 } + lazy val t10 = { Console.println("forced lazy val t10"); 10 } + lazy val t11 = { Console.println("forced lazy val t11"); 11 } + lazy val t12 = { Console.println("forced lazy val t12"); 12 } + lazy val t13 = { Console.println("forced lazy val t13"); 13 } + lazy val t14 = { Console.println("forced lazy val t14"); 14 } + lazy val t15 = { Console.println("forced lazy val t15"); 15 } + lazy val t16 = { Console.println("forced lazy val t16"); 16 } + lazy val t17 = { Console.println("forced lazy val t17"); 17 } + lazy val t18 = { Console.println("forced lazy val t18"); 18 } + lazy val t19 = { Console.println("forced lazy val t19"); 19 } + lazy val t20 = { Console.println("forced lazy val t20"); 20 } + lazy val t21 = { Console.println("forced lazy val t21"); 21 } + lazy val t22 = { Console.println("forced lazy val t22"); 22 } + lazy val t23 = { Console.println("forced lazy val t23"); 23 } + lazy val t24 = { Console.println("forced lazy val t24"); 24 } + lazy val t25 = { Console.println("forced lazy val t25"); 25 } + lazy val t26 = { Console.println("forced lazy val t26"); 26 } + lazy val t27 = { Console.println("forced lazy val t27"); 27 } + lazy val t28 = { Console.println("forced lazy val t28"); 28 } + lazy val t29 = { Console.println("forced lazy val t29"); 29 } + lazy val t30 = { Console.println("forced lazy val t30"); 30 } + lazy val t31 = { Console.println("forced lazy val t31"); 31 } + + val sum = t31 + t30 + t29 + t28 + t27 + t26 + t25 + t24 + t23 + + t22 + t21 + t20 + t19 + t18 + t17 + t16 + t15 + t14 + + t13 + t12 + t11 + t10 + t09 + t08 + t07 + t06 + t05 + + t04 + t03 + t02 + t01 + t00 + val sum2 = t31 + t30 + t29 + t28 + t27 + t26 + t25 + t24 + t23 + + t22 + t21 + t20 + t19 + t18 + t17 + t16 + t15 + t14 + + t13 + t12 + t11 + t10 + t09 + t08 + t07 + t06 + t05 + + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + t08 + + t09 + t10 + t11 + t12 + t13 + t14 + t15 + t16 + t17 + + t18 + t19 + t20 + t21 + t22 + t23 + t24 + t25 + t26 + + t27 + t28 + t29 + t30 + t31 + + + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) + } + + /** test 8 lazy vals, which should fit one byte bitmap. */ + def testLazy8 = { + lazy val t00 = { Console.println("forced lazy val t00"); 0 } + lazy val t01 = { Console.println("forced lazy val t01"); 1 } + lazy val t02 = { Console.println("forced lazy val t02"); 2 } + lazy val t03 = { Console.println("forced lazy val t03"); 3 } + lazy val t04 = { Console.println("forced lazy val t04"); 4 } + lazy val t05 = { Console.println("forced lazy val t05"); 5 } + lazy val t06 = { Console.println("forced lazy val t06"); 6 } + lazy val t07 = { Console.println("forced lazy val t07"); 7 } + + val sum = t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum2 = t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + + + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) + } + + /** test 9 lazy vals, which should spill over two bitmaps. */ + def testLazy9 = { + lazy val t00 = { Console.println("forced lazy val t00"); 0 } + lazy val t01 = { Console.println("forced lazy val t01"); 1 } + lazy val t02 = { Console.println("forced lazy val t02"); 2 } + lazy val t03 = { Console.println("forced lazy val t03"); 3 } + lazy val t04 = { Console.println("forced lazy val t04"); 4 } + lazy val t05 = { Console.println("forced lazy val t05"); 5 } + lazy val t06 = { Console.println("forced lazy val t06"); 6 } + lazy val t07 = { Console.println("forced lazy val t07"); 7 } + lazy val t08 = { Console.println("forced lazy val t08"); 8 } + + val sum = t08 + t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum2 = t08 + t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + t08 + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) + } + + /** test recursive method with lazy vals and a single forced */ + def testLazyRec(n: Int): Int = { + lazy val t = { println("forced lazy val t at n = " + n); 42 } + if (n > 0) + testLazyRec(n - 1) + else + t + } + + /** test recursive method with lazy vals and all vals forced */ + def testLazyRecMany(n: Int): Int = { + lazy val t = { println("forced lazy val t at n = " + n); 42 } + if (n > 0) { + testLazyRecMany(n - 1); + t*t + } else + t + } + + def testRecVal: Unit = { + lazy val twos: List[Int] = 2 :: twos + lazy val ones: Stream[Int] = Stream.cons(1, ones) + + println("First 5 elements of ones: " + ones.take(5).toList) + } + + // should compile without error + def testMutualRecVal: Unit = { + lazy val odd: Int = 1 + even + lazy val even: Int = 1 + odd + + () + } + + def testReturnInLazyVal: Boolean = { + lazy val go = { return false } + go + } + + { + lazy val inCtor = "I am initialized when the constructor is run" + inCtor + } + + class CtorBlock { + { + lazy val inCtor = { + println("I am initialized when the constructor is run") + 42 + } + inCtor + } + } + + // ticket #1589, should not crash + class Test { + val x = { + lazy val t = "abc"; + t + } + } + + // see #1589 + object NestedLazyVals { + lazy val x = { + lazy val y = { println("forcing y"); 42; } + println("forcing x") + y + } + + val x1 = 5 + { lazy val y = 10 ; y } + + println(x) + println(x1) + } + + trait TNestedLazyVals { + lazy val x = { lazy val y = 42; y } + } + + object ONestedLazyVals extends TNestedLazyVals { + println(x) + } + + println(testLazy) + testLazy32 + testLazy8 + testLazy9 + println(testLazyRec(5)) + println(testLazyRecMany(5)) + testRecVal + new CtorBlock + println(testReturnInLazyVal) + NestedLazyVals + ONestedLazyVals +} diff --git a/tests/pending/run/lazy-override-run.check b/tests/pending/run/lazy-override-run.check new file mode 100644 index 000000000000..a8f658d7b5e1 --- /dev/null +++ b/tests/pending/run/lazy-override-run.check @@ -0,0 +1,3 @@ +a.x=/*A.x*/2 +b.x=/*B.x*/3 +b.z=/*B.z/3 diff --git a/tests/pending/run/lazy-override-run.scala b/tests/pending/run/lazy-override-run.scala new file mode 100644 index 000000000000..3e00f31efc21 --- /dev/null +++ b/tests/pending/run/lazy-override-run.scala @@ -0,0 +1,26 @@ +class A { + lazy val x: Int = { print("/*A.x*/"); 2 } + lazy val y: Int = { print("/*A.y*/"); 2 } + lazy val z: Int = { print("/*A.z*/"); 2 } +} + +class B extends A { + override lazy val x: Int = { print("/*B.x*/"); 3 } + override lazy val y: Int = { print("/*B.y*/"); 3 } + override lazy val z: Int = { print("/*B.z/"); 3 } +} + + + + +object Test extends dotty.runtime.LegacyApp { + val a = new A + print("a.x=") + println(a.x) + + val b = new B + print("b.x=") + println(b.x) + print("b.z=") + println(b.z) +} diff --git a/tests/pending/run/lazy-traits.check b/tests/pending/run/lazy-traits.check new file mode 100644 index 000000000000..2f0bc1869c11 --- /dev/null +++ b/tests/pending/run/lazy-traits.check @@ -0,0 +1,160 @@ +Cls test: + +z1 = lazy z1 +z1 = lazy z1 +z1 = lazy z1 +Cls2 test: + + +z1 = lazy z1 z2 = lazy z2 +z1 = lazy z1 z2 = lazy z2 +z1 = lazy z1 z2 = lazy z2 +Cls with B test: + + + +z1 = lazy z1 zb1 = lazy zb1 zc1 = lazy zc1 +z1 = lazy z1 zb1 = lazy zb1 zc1 = lazy zc1 +z1 = lazy z1 zb1 = lazy zb1 zc1 = lazy zc1 +OverflownLazyFields with A test: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +zc00 = lazy zc00 +zc01 = lazy zc01 +zc02 = lazy zc02 +zc03 = lazy zc03 +zc04 = lazy zc04 +zc05 = lazy zc05 +zc06 = lazy zc06 +zc07 = lazy zc07 +zc08 = lazy zc08 +zc09 = lazy zc09 +zc10 = lazy zc10 +zc11 = lazy zc11 +zc12 = lazy zc12 +zc13 = lazy zc13 +zc14 = lazy zc14 +zc15 = lazy zc15 +zc16 = lazy zc16 +zc17 = lazy zc17 +zc18 = lazy zc18 +zc19 = lazy zc19 +zc20 = lazy zc20 +zc21 = lazy zc21 +zc22 = lazy zc22 +zc23 = lazy zc23 +zc24 = lazy zc24 +zc25 = lazy zc25 +zc26 = lazy zc26 +zc27 = lazy zc27 +zc28 = lazy zc28 +zc29 = lazy zc29 +zc30 = lazy zc30 +zc31 = lazy zc31 +z1 = lazy z1 + +zc00 = lazy zc00 +zc01 = lazy zc01 +zc02 = lazy zc02 +zc03 = lazy zc03 +zc04 = lazy zc04 +zc05 = lazy zc05 +zc06 = lazy zc06 +zc07 = lazy zc07 +zc08 = lazy zc08 +zc09 = lazy zc09 +zc10 = lazy zc10 +zc11 = lazy zc11 +zc12 = lazy zc12 +zc13 = lazy zc13 +zc14 = lazy zc14 +zc15 = lazy zc15 +zc16 = lazy zc16 +zc17 = lazy zc17 +zc18 = lazy zc18 +zc19 = lazy zc19 +zc20 = lazy zc20 +zc21 = lazy zc21 +zc22 = lazy zc22 +zc23 = lazy zc23 +zc24 = lazy zc24 +zc25 = lazy zc25 +zc26 = lazy zc26 +zc27 = lazy zc27 +zc28 = lazy zc28 +zc29 = lazy zc29 +zc30 = lazy zc30 +zc31 = lazy zc31 +z1 = lazy z1 + +zc00 = lazy zc00 +zc01 = lazy zc01 +zc02 = lazy zc02 +zc03 = lazy zc03 +zc04 = lazy zc04 +zc05 = lazy zc05 +zc06 = lazy zc06 +zc07 = lazy zc07 +zc08 = lazy zc08 +zc09 = lazy zc09 +zc10 = lazy zc10 +zc11 = lazy zc11 +zc12 = lazy zc12 +zc13 = lazy zc13 +zc14 = lazy zc14 +zc15 = lazy zc15 +zc16 = lazy zc16 +zc17 = lazy zc17 +zc18 = lazy zc18 +zc19 = lazy zc19 +zc20 = lazy zc20 +zc21 = lazy zc21 +zc22 = lazy zc22 +zc23 = lazy zc23 +zc24 = lazy zc24 +zc25 = lazy zc25 +zc26 = lazy zc26 +zc27 = lazy zc27 +zc28 = lazy zc28 +zc29 = lazy zc29 +zc30 = lazy zc30 +zc31 = lazy zc31 +z1 = lazy z1 +Unit lazy values test: +UnitLazy.lz forced +UnitLazyT.lzt forced +MixedUnitLazy +MixedUnitLazy +MixedUnitLazy diff --git a/tests/pending/run/lazy-traits.scala b/tests/pending/run/lazy-traits.scala new file mode 100644 index 000000000000..89e262824a69 --- /dev/null +++ b/tests/pending/run/lazy-traits.scala @@ -0,0 +1,170 @@ +trait A { + lazy val z1 = { + println("") + "lazy z1" + } +} + +/** Simple class which mixes in one lazy val. */ +class Cls extends AnyRef with A { + override def toString = + "z1 = " + z1 +} + +/** Own lazy val + one mixed in. */ +class Cls2 extends AnyRef with A { + lazy val z2 = { + println("") + "lazy z2" + } + + override def toString = + "z1 = " + z1 + " z2 = " + z2 +} + +trait B extends A { + lazy val zb1 = { + println("") + "lazy zb1" + } +} + +class ClsB extends Object with B { + lazy val zc1 = { + println("") + "lazy zc1" + } + override def toString = + "z1 = " + z1 + " zb1 = " + zb1 + " zc1 = " + zc1 +} + +/** Class with 32 lazy fields mixes in one more. */ +class OverflownLazyFields extends Object with A { + lazy val zc00 = { println(""); "lazy zc00" } + lazy val zc01 = { println(""); "lazy zc01" } + lazy val zc02 = { println(""); "lazy zc02" } + lazy val zc03 = { println(""); "lazy zc03" } + lazy val zc04 = { println(""); "lazy zc04" } + lazy val zc05 = { println(""); "lazy zc05" } + lazy val zc06 = { println(""); "lazy zc06" } + lazy val zc07 = { println(""); "lazy zc07" } + lazy val zc08 = { println(""); "lazy zc08" } + lazy val zc09 = { println(""); "lazy zc09" } + lazy val zc10 = { println(""); "lazy zc10" } + lazy val zc11 = { println(""); "lazy zc11" } + lazy val zc12 = { println(""); "lazy zc12" } + lazy val zc13 = { println(""); "lazy zc13" } + lazy val zc14 = { println(""); "lazy zc14" } + lazy val zc15 = { println(""); "lazy zc15" } + lazy val zc16 = { println(""); "lazy zc16" } + lazy val zc17 = { println(""); "lazy zc17" } + lazy val zc18 = { println(""); "lazy zc18" } + lazy val zc19 = { println(""); "lazy zc19" } + lazy val zc20 = { println(""); "lazy zc20" } + lazy val zc21 = { println(""); "lazy zc21" } + lazy val zc22 = { println(""); "lazy zc22" } + lazy val zc23 = { println(""); "lazy zc23" } + lazy val zc24 = { println(""); "lazy zc24" } + lazy val zc25 = { println(""); "lazy zc25" } + lazy val zc26 = { println(""); "lazy zc26" } + lazy val zc27 = { println(""); "lazy zc27" } + lazy val zc28 = { println(""); "lazy zc28" } + lazy val zc29 = { println(""); "lazy zc29" } + lazy val zc30 = { println(""); "lazy zc30" } + lazy val zc31 = { println(""); "lazy zc31" } + + override def toString = + "\nzc00 = " + zc00 + + "\nzc01 = " + zc01 + + "\nzc02 = " + zc02 + + "\nzc03 = " + zc03 + + "\nzc04 = " + zc04 + + "\nzc05 = " + zc05 + + "\nzc06 = " + zc06 + + "\nzc07 = " + zc07 + + "\nzc08 = " + zc08 + + "\nzc09 = " + zc09 + + "\nzc10 = " + zc10 + + "\nzc11 = " + zc11 + + "\nzc12 = " + zc12 + + "\nzc13 = " + zc13 + + "\nzc14 = " + zc14 + + "\nzc15 = " + zc15 + + "\nzc16 = " + zc16 + + "\nzc17 = " + zc17 + + "\nzc18 = " + zc18 + + "\nzc19 = " + zc19 + + "\nzc20 = " + zc20 + + "\nzc21 = " + zc21 + + "\nzc22 = " + zc22 + + "\nzc23 = " + zc23 + + "\nzc24 = " + zc24 + + "\nzc25 = " + zc25 + + "\nzc26 = " + zc26 + + "\nzc27 = " + zc27 + + "\nzc28 = " + zc28 + + "\nzc29 = " + zc29 + + "\nzc30 = " + zc30 + + "\nzc31 = " + zc31 + + "\nz1 = " + z1 +} + +trait PrivateLazy { + private lazy val str = "z1" +} + +/** Test successful compilation. */ +class InheritPrivateLazy extends AnyRef with PrivateLazy {} + +/** Test successful compilation, see bug #1287. */ +trait LocalLazyVal { + def foo = { + lazy val next = 10 + 1 + next + } +} + +/** Test successful compilation (see ticket #39) */ +package x.y { + + trait Trait { + lazy val v = 1 + } + + class OuterClass { + object InnerObject extends Trait + } +} + +/** Test successful compilation of lazy values of type Unit. */ +class UnitLazy extends A { + lazy val lz = Console.println("UnitLazy.lz forced") +} + +trait UnitLazyT { + lazy val lzt = Console.println("UnitLazyT.lzt forced") +} + +class MixedUnitLazy extends UnitLazy with UnitLazyT { + override def toString() = { + lz + lzt + "MixedUnitLazy" + } +} + +object Test extends dotty.runtime.LegacyApp { + + def test(name: String, v: A): Unit = { + println(name + " test:") + println(v) + println(v) + println(v) + } + + test("Cls", new Cls) + test("Cls2", new Cls2) + test("Cls with B", new ClsB) + test("OverflownLazyFields with A", new OverflownLazyFields) + test("Unit lazy values", new MixedUnitLazy) +} diff --git a/tests/pending/run/lift-and-unlift.scala b/tests/pending/run/lift-and-unlift.scala new file mode 100644 index 000000000000..9cd85666e8b3 --- /dev/null +++ b/tests/pending/run/lift-and-unlift.scala @@ -0,0 +1,27 @@ +import Function.unlift + +object Test { + def evens1(x: Int) = if (x % 2 == 0) Some(x) else None + val evens2: PartialFunction[Int, Int] = { + case x if x % 2 == 0 => x + } + + def main(args: Array[String]): Unit = { + val f1 = evens1 _ + val f2 = evens2.lift + + assert(1 to 10 forall (x => f1(x) == f2(x))) + + val f3 = unlift(f1) + val f4 = unlift(f2) + + assert(1 to 10 forall { x => + if (!f3.isDefinedAt(x)) !f4.isDefinedAt(x) + else f3(x) == f4(x) + }) + + assert(f1 eq f3.lift) + assert(f4 eq unlift(f2)) + assert(f4 eq evens2) + } +} diff --git a/tests/pending/run/list_map.scala b/tests/pending/run/list_map.scala new file mode 100755 index 000000000000..59acf09c6886 --- /dev/null +++ b/tests/pending/run/list_map.scala @@ -0,0 +1,26 @@ +import collection.immutable.ListMap + +object Test { + def testImmutableMinus(): Unit = { + val empty = ListMap.empty[Int, Int] + + val m0 = ListMap(1 -> 1, 2 -> 2) + val m1 = m0 - 3 + assert (m1 eq m0) + val m2 = m0 - 1 + assert (m2.size == 1) + val m3 = m2 - 2 + assert (m3 eq empty) + + val m4 = ListMap(1 -> 1, 2 -> 2, 3 -> 3) + val m5 = m4 - 1 + assert (m5 == ListMap(2 -> 2, 3 -> 3)) + assert (m5.toList == (2, 2)::(3, 3)::Nil) + + assert ((empty - 1) eq empty) + } + + def main(args: Array[String]): Unit = { + testImmutableMinus() + } +} diff --git a/tests/pending/run/lists-run.scala b/tests/pending/run/lists-run.scala new file mode 100644 index 000000000000..713b19659687 --- /dev/null +++ b/tests/pending/run/lists-run.scala @@ -0,0 +1,187 @@ +/** Test the Scala implementation of class scala.List. + * + * @author Stephane Micheloud + */ +import scala.language.postfixOps + +object Test { + def main(args: Array[String]): Unit = { + Test_multiset.run() // multiset operations: union, intersect, diff + Test1.run() //count, exists, filter, .. + Test2.run() //#468 + Test3.run() //#1691 + Test4.run() //#1721 + Test5.run() + } +} + +object Test_multiset { + def run(): Unit = { + def isSubListOf[A](thiz: List[A], that: List[A]): Boolean = + thiz forall (that contains _) + val xs = List(1, 1, 2) + val ys = List(1, 2, 2, 3) + assert(List(1, 1, 2, 1, 2, 2, 3) == (xs union ys), "xs_union_ys") + assert(List(1, 2, 2, 3, 1, 1, 2) == (ys union xs), "ys_union_xs") + assert(List(1, 2) == (xs intersect ys), "xs_intersect_ys") + assert(List(1, 2) == (ys intersect xs), "ys_intersect_xs") + assert(List(1) == (xs diff ys), "xs_diff_ys") + assert(List(2, 3) == (ys diff xs), "ys_diff_xs") + assert(isSubListOf(xs filterNot (ys contains), xs diff ys), "xs_subset_ys") + + val zs = List(0, 1, 1, 2, 2, 2) + assert(List(0, 1, 1, 2, 2, 2, 1, 2, 2, 3) == (zs union ys), "zs_union_ys") + assert(List(1, 2, 2, 3, 0, 1, 1, 2, 2, 2) == (ys union zs), "ys_union_zs") + assert(List(1, 2, 2) == (zs intersect ys), "zs_intersect_ys") + assert(List(1, 2, 2) == (ys intersect zs), "ys_intersect_zs") + assert(List(0, 1, 2) == (zs diff ys), "zs_diff_ys") + assert(List(3) == (ys diff zs), "ys_diff_zs") + assert(isSubListOf(zs filterNot (ys contains), zs diff ys), "xs_subset_ys") + + val ws = List(2) + assert(List(2, 1, 2, 2, 3) == (ws union ys), "ws_union_ys") + assert(List(1, 2, 2, 3, 2) == (ys union ws), "ys_union_ws") + assert(List(2) == (ws intersect ys), "ws_intersect_ys") + assert(List(2) == (ys intersect ws), "ys_intersect_ws") + assert(List() == (ws diff ys), "ws_diff_ys") + assert(List(1, 2, 3) == (ys diff ws), "ys_diff_ws") + assert(isSubListOf(ws filterNot (ys contains), ws diff ys), "ws_subset_ys") + + val vs = List(3, 2, 2, 1) + assert(List(1, 1, 2, 3, 2, 2, 1) == (xs union vs), "xs_union_vs") + assert(List(3, 2, 2, 1, 1, 1, 2) == (vs union xs), "vs_union_xs") + assert(List(1, 2) == (xs intersect vs), "xs_intersect_vs") + assert(List(2, 1) == (vs intersect xs), "vs_intersect_xs") + assert(List(1) == (xs diff vs), "xs_diff_vs") + assert(List(3, 2) == (vs diff xs), "vs_diff_xs") + assert(isSubListOf(xs filterNot (vs contains), xs diff vs), "xs_subset_vs") + + // tests adapted from Thomas Jung + assert({ + def sort(zs: List[Int]) = zs sortWith ( _ > _ ) + sort(xs intersect ys) == sort(ys intersect xs) + }, "be symmetric after sorting") + assert({ + def cardinality[A](zs: List[A], e: A): Int = zs count (e == _) + val intersection = xs intersect ys + xs forall (e => cardinality(intersection, e) == (cardinality(xs, e) +min cardinality(ys, e))) + }, "obey min cardinality") + assert({ + val intersection = xs intersect ys + val unconsumed = xs.foldLeft(intersection){(rest, e) => + if (! rest.isEmpty && e == rest.head) rest.tail else rest + } + unconsumed.isEmpty + }, "maintain order") + assert(xs == (xs intersect xs), + "has the list as again intersection") + } +} + +object Test1 { + def run(): Unit = { + val xs1 = List(1, 2, 3) + val xs2 = List('a', 'b') + val xs3 = List(List(1, 2), List(4, 5)) + val xs4 = List(2, 4, 6, 8) + val xs5 = List(List(3, 4), List(3), List(4, 5)) + + { + val n1 = xs1 count { e => e % 2 != 0 } + val n2 = xs4 count { e => e < 5 } + assert(4 == (n1 + n2), "check_count") + } + { + val b1 = xs1 exists { e => e % 2 == 0 } + val b2 = xs4 exists { e => e == 5 } + assert(!(b1 & b2), "check_exists") + } + { + val ys1 = xs1 filter { e => e % 2 == 0 } + val ys2 = xs4 filter { e => e < 5 } + assert(3 == ys1.length + ys2.length, "check_filter") + } + { + val n1 = xs1.foldLeft(0)((e1, e2) => e1 + e2) + val ys1 = xs4.foldLeft(List[Int]())((e1, e2) => e2 :: e1) + assert(10 == n1 + ys1.length, "check_foldLeft") + } + { + val b1 = xs1 forall { e => e < 10} + val b2 = xs4 forall { e => e % 2 == 0 } + assert(b1 & b2, "check_forall") + } + { + val ys1 = xs1 filterNot { e => e % 2 != 0 } + val ys2 = xs4 filterNot { e => e < 5 } + assert(3 == ys1.length + ys2.length, "check_remove") + } + { + val ys1 = xs1 zip xs2 + val ys2 = xs1 zip xs3 + assert(4 == ys1.length + ys2.length, "check_zip") + } + { + val ys1 = xs1.zipAll(xs2, 0, '_') + val ys2 = xs2.zipAll(xs1, '_', 0) + val ys3 = xs1.zipAll(xs3, 0, List(-1)) + assert(9 == ys1.length + ys2.length + ys3.length, "check_zipAll") + } + } +} + +object Test2 { + def run(): Unit = { + val xs1 = List(1, 2, 3) + val xs2 = List(0) + + val ys1 = xs1 ::: List(4) + assert(List(1, 2, 3, 4) == ys1, "check_:::") + + val ys2 = ys1 filterNot (_ == 4) + assert(xs1 == ys2, "check_-") + + val n2 = (xs1 ++ ys1).length + val n3 = (xs1 ++ Nil).length + val n4 = (xs1 ++ ((new collection.mutable.ArrayBuffer[Int]) += 0)).length + assert(14 == n2 + n3 + n4, "check_++") + } +} + +object Test3 { + def run(): Unit = { + try { + List.range(1, 10, 0) + } catch { + case e: IllegalArgumentException => () + case _: Throwable => throw new Error("List.range(1, 10, 0)") + } + assert(List.range(10, 0, -2) == List(10, 8, 6, 4, 2)) + } +} + +object Test4 { + def run(): Unit = { + assert(List(1,2,3).endsWith(List(2,3))) + assert(!List(1,2,3).endsWith(List(1,3))) + assert(List(1,2,3).endsWith(List())) + assert(!List(1,2,3).endsWith(List(0,1,2,3))) + assert(List(1,2,3).endsWith(List(1,2,3))) + assert(!List().endsWith(List(1,2,3))) + assert(List().endsWith(List())) + } +} + +object Test5 { + def show(xs: List[String]) = xs match { + case "foo" :: args => args.toString + case List(x) => x.toString + case Nil => "Nil" + } + def run(): Unit = { + assert(show(List()) == "Nil") + assert(show(List("a")) == "a") + assert(show(List("foo", "b")) == "List(b)") + } +} diff --git a/tests/pending/run/literals.check b/tests/pending/run/literals.check new file mode 100644 index 000000000000..62c5fd68ae86 --- /dev/null +++ b/tests/pending/run/literals.check @@ -0,0 +1,57 @@ +warning: there were 5 deprecation warnings; re-run with -deprecation for details +test '\u0024' == '$' was successful +test '\u005f' == '_' was successful +test 65.asInstanceOf[Char] == 'A' was successful +test "\141\142" == "ab" was successful +test "\0x61\0x62".trim() == "x61\0x62" was successful + +test (65 : Byte) == 'A' was successful + +test 0X01 == 1 was successful +test 0x01 == 1 was successful +test 0x10 == 16 was successful +test 0xa == 10 was successful +test 0x0a == 10 was successful +test +0x01 == 1 was successful +test +0x10 == 16 was successful +test +0xa == 10 was successful +test +0x0a == 10 was successful +test -0x01 == -1 was successful +test -0x10 == -16 was successful +test -0xa == -10 was successful +test -0x0a == -10 was successful +test 0x7fffffff == 2147483647 was successful +test 0x80000000 == -2147483648 was successful +test 0xffffffff == -1 was successful + +test 1l == 1L was successful +test 1L == 1l was successful +test 1.asInstanceOf[Long] == 1l was successful +test 0x7fffffffffffffffL == 9223372036854775807L was successful +test 0x8000000000000000L == -9223372036854775808L was successful +test 0xffffffffffffffffL == -1L was successful + +test 1e1f == 10.0f was successful +test .3f == 0.3f was successful +test 0f == 0.0f was successful +test 01.23f == 1.23f was successful +test 3.14f == 3.14f was successful +test 6.022e23f == 6.022e23f was successful +test 09f == 9.0f was successful +test 1.asInstanceOf[Float] == 1.0 was successful +test 1l.asInstanceOf[Float] == 1.0 was successful + +test 1e1 == 10.0 was successful +test .3 == 0.3 was successful +test 0.0 == 0.0 was successful +test 0d == 0.0 was successful +test 01.23 == 1.23 was successful +test 01.23d == 1.23d was successful +test 3.14 == 3.14 was successful +test 1e-9d == 1.0e-9 was successful +test 1e137 == 1.0e137 was successful +test 1.asInstanceOf[Double] == 1.0 was successful +test 1l.asInstanceOf[Double] == 1.0 was successful + +test "".length() was successful +test ggg == 3 was successful diff --git a/tests/pending/run/literals.scala b/tests/pending/run/literals.scala new file mode 100644 index 000000000000..705de7726e93 --- /dev/null +++ b/tests/pending/run/literals.scala @@ -0,0 +1,124 @@ +//############################################################################ +// Literals +//############################################################################ + +//############################################################################ + +object Test { + + /* I add a couple of Unicode identifier tests here temporarily */ + + def \u03b1\u03c1\u03b5\u03c4\u03b7 = "alpha rho epsilon tau eta" + + case class GGG(i: Int) { + def \u03b1\u03b1(that: GGG) = i + that.i + } + + def check_success[a](name: String, closure: => a, expected: a): Unit = { + print("test " + name) + try { + val actual: a = closure + if (actual == expected) { + print(" was successful"); + } else { + print(" failed: expected "+ expected +", found "+ actual); + } + } catch { + case exception: Throwable => { + print(" raised exception " + exception); + } + } + println + } + + def main(args: Array[String]): Unit = { + // char + check_success("'\\u0024' == '$'", '\u0024', '$') + check_success("'\\u005f' == '_'", '\u005f', '_') + check_success("65.asInstanceOf[Char] == 'A'", 65.asInstanceOf[Char], 'A') + check_success("\"\\141\\142\" == \"ab\"", "\141\142", "ab") + check_success("\"\\0x61\\0x62\".trim() == \"x61\\0x62\"", "\0x61\0x62".substring(1), "x61\0x62") + + println + + // boolean + check_success("(65 : Byte) == 'A'", (65: Byte) == 'A', true) // contrib #176 + + println + + // int + check_success("0X01 == 1", 0X01, 1) + check_success("0x01 == 1", 0x01, 1) + check_success("0x10 == 16", 0x10, 16) + check_success("0xa == 10", 0xa, 10) + check_success("0x0a == 10", 0x0a, 10) + + check_success("+0x01 == 1", +0x01, 1) + check_success("+0x10 == 16", +0x10, 16) + check_success("+0xa == 10", +0xa, 10) + check_success("+0x0a == 10", +0x0a, 10) + + check_success("-0x01 == -1", -0x01, -1) + check_success("-0x10 == -16", -0x10, -16) + check_success("-0xa == -10", -0xa, -10) + check_success("-0x0a == -10", -0x0a, -10) + + check_success("0x7fffffff == 2147483647", 0x7fffffff, 2147483647) + check_success("0x80000000 == -2147483648", 0x80000000, -2147483648) + check_success("0xffffffff == -1", 0xffffffff, -1) + + println + + // long + check_success("1l == 1L", 1l, 1L) + check_success("1L == 1l", 1L, 1l) + check_success("1.asInstanceOf[Long] == 1l", 1.asInstanceOf[Long], 1l) + + check_success("0x7fffffffffffffffL == 9223372036854775807L", + 0x7fffffffffffffffL, 9223372036854775807L) + check_success("0x8000000000000000L == -9223372036854775808L", + 0x8000000000000000L, -9223372036854775808L) + check_success("0xffffffffffffffffL == -1L", + 0xffffffffffffffffL, -1L) + + println + + // see JLS at address: + // http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#230798 + + // float + check_success("1e1f == 10.0f", 1e1f, 10.0f) + check_success(".3f == 0.3f", .3f, 0.3f) + check_success("0f == 0.0f", 0f, 0.0f) + check_success("01.23f == 1.23f", 01.23f, 1.23f) + check_success("3.14f == 3.14f", 3.14f, 3.14f) + check_success("6.022e23f == 6.022e23f", 6.022e23f, 6.022e23f) + check_success("09f == 9.0f", 09f, 9.0f) + check_success("1.asInstanceOf[Float] == 1.0", 1.asInstanceOf[Float], 1.0f) + check_success("1l.asInstanceOf[Float] == 1.0", 1l.asInstanceOf[Float], 1.0f) + + println + + // double + check_success("1e1 == 10.0", 1e1, 10.0) + check_success(".3 == 0.3", .3, 0.3) + check_success("0.0 == 0.0", 0.0, 0.0) + check_success("0d == 0.0", 0d, 0.0) + check_success("01.23 == 1.23", 01.23, 1.23) + check_success("01.23d == 1.23d", 01.23d, 1.23d) + check_success("3.14 == 3.14", 3.14, 3.14) + check_success("1e-9d == 1.0e-9", 1e-9d, 1.0e-9) + check_success("1e137 == 1.0e137", 1e137, 1.0e137) + check_success("1.asInstanceOf[Double] == 1.0", 1.asInstanceOf[Double], 1.0) + check_success("1l.asInstanceOf[Double] == 1.0", 1l.asInstanceOf[Double], 1.0) + + println + check_success("\"\".length()", "\u001a".length(), 1) + + val ggg = GGG(1) \u03b1\u03b1 GGG(2) + check_success("ggg == 3", ggg, 3) + + } +} + +//############################################################################ diff --git a/tests/pending/run/longmap.scala b/tests/pending/run/longmap.scala new file mode 100644 index 000000000000..b67fc75f1411 --- /dev/null +++ b/tests/pending/run/longmap.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp{ + import scala.collection.immutable.LongMap; + + val it = LongMap(8L -> 2, 11L -> 3, 1L -> 2, 7L -> 13); + + assert(it.firstKey == 1L); + assert(it.lastKey == 11L); +} diff --git a/tests/pending/run/lub-visibility.check b/tests/pending/run/lub-visibility.check new file mode 100644 index 000000000000..70734966f0aa --- /dev/null +++ b/tests/pending/run/lub-visibility.check @@ -0,0 +1,11 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> // should infer List[scala.collection.immutable.Seq[Nothing]] + +scala> // but reverted that for SI-5534. + +scala> val x = List(List(), Vector()) +x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable] = List(List(), Vector()) + +scala> :quit diff --git a/tests/pending/run/lub-visibility.scala b/tests/pending/run/lub-visibility.scala new file mode 100644 index 000000000000..8d5d3ae11ad5 --- /dev/null +++ b/tests/pending/run/lub-visibility.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest +object Test extends ReplTest { + def code = """ + |// should infer List[scala.collection.immutable.Seq[Nothing]] + |// but reverted that for SI-5534. + |val x = List(List(), Vector()) + """.stripMargin +} diff --git a/tests/pending/run/macro-abort-fresh.check b/tests/pending/run/macro-abort-fresh.check new file mode 100644 index 000000000000..5064b96eefdb --- /dev/null +++ b/tests/pending/run/macro-abort-fresh.check @@ -0,0 +1,6 @@ +fresh$macro$1 +qwe$macro$2 +qwe$macro$3 +reflective compilation has failed: + +blargh diff --git a/tests/pending/run/macro-abort-fresh.flags b/tests/pending/run/macro-abort-fresh.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-abort-fresh.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-abort-fresh/Macros_1.scala b/tests/pending/run/macro-abort-fresh/Macros_1.scala new file mode 100644 index 000000000000..2b03512efb36 --- /dev/null +++ b/tests/pending/run/macro-abort-fresh/Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context) = { + import c.universe._ + println(c.fresh()) + println(c.fresh("qwe")) + println(c.fresh(TypeName("qwe"))) + c.abort(NoPosition, "blargh") + } +} + +object Macros { + def foo = macro Impls.impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-abort-fresh/Test_2.scala b/tests/pending/run/macro-abort-fresh/Test_2.scala new file mode 100644 index 000000000000..dea6e6d62268 --- /dev/null +++ b/tests/pending/run/macro-abort-fresh/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-auto-duplicate.check b/tests/pending/run/macro-auto-duplicate.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/macro-auto-duplicate.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/macro-auto-duplicate/Macros_1.scala b/tests/pending/run/macro-auto-duplicate/Macros_1.scala new file mode 100644 index 000000000000..2c910e6af7ef --- /dev/null +++ b/tests/pending/run/macro-auto-duplicate/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + val x = Ident(newTermName("x")) + def defAndUseX(rhs: Tree) = { + Block(List(ValDef(NoMods, newTermName("x"), TypeTree(), rhs)), x) + } + val xi4 = defAndUseX(Literal(Constant(4))) + val xs2 = defAndUseX(Literal(Constant("2"))) + c.Expr[String](Apply(Select(xi4, newTermName("$plus")), List(xs2))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-auto-duplicate/Test_2.scala b/tests/pending/run/macro-auto-duplicate/Test_2.scala new file mode 100644 index 000000000000..eed62a0fe2ad --- /dev/null +++ b/tests/pending/run/macro-auto-duplicate/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi.check b/tests/pending/run/macro-basic-ma-md-mi.check new file mode 100644 index 000000000000..b74e882ae378 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-md-mi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi.flags b/tests/pending/run/macro-basic-ma-md-mi.flags new file mode 100644 index 000000000000..5e5dd6ce794e --- /dev/null +++ b/tests/pending/run/macro-basic-ma-md-mi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala b/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala new file mode 100644 index 000000000000..fc75b99ef254 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-md-mi/Impls_1.scala @@ -0,0 +1,21 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala b/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala new file mode 100644 index 000000000000..527904374651 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-md-mi/Macros_2.scala @@ -0,0 +1,10 @@ +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala b/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala new file mode 100644 index 000000000000..9c45f59d7840 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-md-mi/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi.check b/tests/pending/run/macro-basic-ma-mdmi.check new file mode 100644 index 000000000000..b74e882ae378 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-mdmi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi.flags b/tests/pending/run/macro-basic-ma-mdmi.flags new file mode 100644 index 000000000000..5e5dd6ce794e --- /dev/null +++ b/tests/pending/run/macro-basic-ma-mdmi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala new file mode 100644 index 000000000000..73a5a971a48b --- /dev/null +++ b/tests/pending/run/macro-basic-ma-mdmi/Impls_Macros_1.scala @@ -0,0 +1,32 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} + +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala b/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala new file mode 100644 index 000000000000..9c45f59d7840 --- /dev/null +++ b/tests/pending/run/macro-basic-ma-mdmi/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi.check b/tests/pending/run/macro-basic-mamd-mi.check new file mode 100644 index 000000000000..b74e882ae378 --- /dev/null +++ b/tests/pending/run/macro-basic-mamd-mi.check @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi.flags b/tests/pending/run/macro-basic-mamd-mi.flags new file mode 100644 index 000000000000..5e5dd6ce794e --- /dev/null +++ b/tests/pending/run/macro-basic-mamd-mi.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala b/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala new file mode 100644 index 000000000000..0be915c1196e --- /dev/null +++ b/tests/pending/run/macro-basic-mamd-mi/Impls_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) + } + + def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) + } + + def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala b/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala new file mode 100644 index 000000000000..9bfcbc4a79ca --- /dev/null +++ b/tests/pending/run/macro-basic-mamd-mi/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +} + +class Macros { + def quux(x: Int): Int = macro Impls.quux +} + +object Test extends dotty.runtime.LegacyApp { + import Macros.Shmacros._ + println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-blackbox-materialization.check b/tests/pending/run/macro-blackbox-materialization.check new file mode 100644 index 000000000000..7165b734acb9 --- /dev/null +++ b/tests/pending/run/macro-blackbox-materialization.check @@ -0,0 +1,3 @@ +C(Int) +C(String) +C(Nothing) diff --git a/tests/pending/run/macro-blackbox-materialization/Macros_1.scala b/tests/pending/run/macro-blackbox-materialization/Macros_1.scala new file mode 100644 index 000000000000..ea8d1bed1496 --- /dev/null +++ b/tests/pending/run/macro-blackbox-materialization/Macros_1.scala @@ -0,0 +1,16 @@ +// For the full version of the test, take a look at run/t5923a + +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +case class C[T](t: String) +object C { + implicit def foo[T]: C[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + reify(C[T](c.literal(weakTypeOf[T].toString).splice)) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-blackbox-materialization/Test_2.scala b/tests/pending/run/macro-blackbox-materialization/Test_2.scala new file mode 100644 index 000000000000..1f0413bdfab7 --- /dev/null +++ b/tests/pending/run/macro-blackbox-materialization/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[C[Int]]) + println(implicitly[C[String]]) + println(implicitly[C[Nothing]]) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl.check b/tests/pending/run/macro-bodyexpandstoimpl.check new file mode 100644 index 000000000000..f70d7bba4ae1 --- /dev/null +++ b/tests/pending/run/macro-bodyexpandstoimpl.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl.flags b/tests/pending/run/macro-bodyexpandstoimpl.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-bodyexpandstoimpl.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala b/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala new file mode 100644 index 000000000000..d46af4952dcc --- /dev/null +++ b/tests/pending/run/macro-bodyexpandstoimpl/Impls_1.scala @@ -0,0 +1,16 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +object Impls { + def foo(c: BlackboxContext)(x: c.Expr[Int]) = x + + def refToFoo(dummy: Int): Int = macro refToFoo_impl + def refToFoo_impl(c: WhiteboxContext)(dummy: c.Expr[Int]) = { + import c.universe._ + val body = Select(Ident(TermName("Impls")), TermName("foo")) + val global = c.universe.asInstanceOf[scala.tools.nsc.Global] + global.analyzer.markMacroImplRef(body.asInstanceOf[global.Tree]) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala b/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala new file mode 100644 index 000000000000..f0fe4a8e3277 --- /dev/null +++ b/tests/pending/run/macro-bodyexpandstoimpl/Macros_Test_2.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros + +object Macros { + def foo(x: Int): Int = macro Impls.refToFoo(42) +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-alias.check b/tests/pending/run/macro-bundle-context-alias.check new file mode 100644 index 000000000000..55e4dfcf922b --- /dev/null +++ b/tests/pending/run/macro-bundle-context-alias.check @@ -0,0 +1,4 @@ +C +C +C +C diff --git a/tests/pending/run/macro-bundle-context-alias/Macros_1.scala b/tests/pending/run/macro-bundle-context-alias/Macros_1.scala new file mode 100644 index 000000000000..354c5e0d9208 --- /dev/null +++ b/tests/pending/run/macro-bundle-context-alias/Macros_1.scala @@ -0,0 +1,38 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +object Module { + type BBC = BlackboxContext + type RBBC = BBC { type PrefixType = C } + type WBC = WhiteboxContext + type RWBC = WBC { type PrefixType = C } + + class BlackboxBundle(val c: BBC) { + import c.universe._ + def impl = q"${c.prefix}" + } + + class RefinedBlackboxBundle(val c: RBBC) { + import c.universe._ + def impl = reify(c.prefix.splice) + } + + class WhiteboxBundle(val c: WBC) { + import c.universe._ + def impl = q"${c.prefix}" + } + + class RefinedWhiteboxBundle(val c: RWBC) { + import c.universe._ + def impl = reify(c.prefix.splice) + } +} + +class C { + def blackbox: C = macro Module.BlackboxBundle.impl + def refinedBlackbox: C = macro Module.RefinedBlackboxBundle.impl + def whitebox: C = macro Module.WhiteboxBundle.impl + def refinedWhitebox: C = macro Module.RefinedWhiteboxBundle.impl + override def toString = "C" +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-alias/Test_2.scala b/tests/pending/run/macro-bundle-context-alias/Test_2.scala new file mode 100644 index 000000000000..6c70277ded0b --- /dev/null +++ b/tests/pending/run/macro-bundle-context-alias/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println(new C().blackbox) + println(new C().refinedBlackbox) + println(new C().whitebox) + println(new C().refinedWhitebox) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-refinement.check b/tests/pending/run/macro-bundle-context-refinement.check new file mode 100644 index 000000000000..10f9ebb617a3 --- /dev/null +++ b/tests/pending/run/macro-bundle-context-refinement.check @@ -0,0 +1,2 @@ +C +C diff --git a/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala b/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala new file mode 100644 index 000000000000..d3a5d179c60d --- /dev/null +++ b/tests/pending/run/macro-bundle-context-refinement/Macros_1.scala @@ -0,0 +1,19 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.{Context => BlackboxContext} +import scala.reflect.macros.whitebox.{Context => WhiteboxContext} + +class BlackboxBundle(val c: BlackboxContext { type PrefixType = C }) { + import c.universe._ + def impl = reify(c.prefix.splice) +} + +class WhiteboxBundle(val c: WhiteboxContext { type PrefixType = C }) { + import c.universe._ + def impl = reify(c.prefix.splice) +} + +class C { + def blackbox: C = macro BlackboxBundle.impl + def whitebox: C = macro WhiteboxBundle.impl + override def toString = "C" +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-context-refinement/Test_2.scala b/tests/pending/run/macro-bundle-context-refinement/Test_2.scala new file mode 100644 index 000000000000..d631b8f7ec23 --- /dev/null +++ b/tests/pending/run/macro-bundle-context-refinement/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(new C().blackbox) + println(new C().whitebox) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-repl.check b/tests/pending/run/macro-bundle-repl.check new file mode 100644 index 000000000000..75c5c2addaf2 --- /dev/null +++ b/tests/pending/run/macro-bundle-repl.check @@ -0,0 +1,24 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros +import scala.language.experimental.macros + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl +defined class Bar +defined term macro bar: Unit + +scala> bar + +scala> class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } +defined class Foo + +scala> def foo: Unit = macro Foo.impl +defined term macro foo: Unit + +scala> foo + +scala> :quit diff --git a/tests/pending/run/macro-bundle-repl.scala b/tests/pending/run/macro-bundle-repl.scala new file mode 100644 index 000000000000..8084418454bf --- /dev/null +++ b/tests/pending/run/macro-bundle-repl.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context +class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl +bar +class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } } +def foo: Unit = macro Foo.impl +foo + """ +} diff --git a/tests/pending/run/macro-bundle-static.check b/tests/pending/run/macro-bundle-static.check new file mode 100644 index 000000000000..37c8eaf27aca --- /dev/null +++ b/tests/pending/run/macro-bundle-static.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala new file mode 100644 index 000000000000..0142e5d94547 --- /dev/null +++ b/tests/pending/run/macro-bundle-static/Impls_Macros_1.scala @@ -0,0 +1,30 @@ +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +object Enclosing { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono + } +} + +object Macros { + def mono = macro Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] +} + +package pkg { + object Enclosing { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + } + + object Macros { + def mono = macro Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-static/Test_2.scala b/tests/pending/run/macro-bundle-static/Test_2.scala new file mode 100644 index 000000000000..cfc1e15631cd --- /dev/null +++ b/tests/pending/run/macro-bundle-static/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Enclosing.Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Enclosing.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel.check b/tests/pending/run/macro-bundle-toplevel.check new file mode 100644 index 000000000000..37c8eaf27aca --- /dev/null +++ b/tests/pending/run/macro-bundle-toplevel.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/pending/run/macro-bundle-toplevel.flags b/tests/pending/run/macro-bundle-toplevel.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-bundle-toplevel.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala new file mode 100644 index 000000000000..6fd7be3b2588 --- /dev/null +++ b/tests/pending/run/macro-bundle-toplevel/Impls_Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.blackbox.Context + +class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +} + +package pkg { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + + object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-toplevel/Test_2.scala b/tests/pending/run/macro-bundle-toplevel/Test_2.scala new file mode 100644 index 000000000000..013baa34872f --- /dev/null +++ b/tests/pending/run/macro-bundle-toplevel/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-decl.check b/tests/pending/run/macro-bundle-whitebox-decl.check new file mode 100644 index 000000000000..37c8eaf27aca --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-decl.check @@ -0,0 +1,6 @@ +() +Int +() +true +IntInt +true diff --git a/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala new file mode 100644 index 000000000000..5e1b11895d2b --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala @@ -0,0 +1,26 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +} + +package pkg { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + + object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala new file mode 100644 index 000000000000..013baa34872f --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-decl/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Impl(???).weird) +} \ No newline at end of file diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw.check b/tests/pending/run/macro-bundle-whitebox-use-raw.check new file mode 100644 index 000000000000..5679c5faba82 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-raw.check @@ -0,0 +1,5 @@ +2 +(23,foo,true) +null +C2 +42 diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala new file mode 100644 index 000000000000..de1863418ee9 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-raw/Macros_1.scala @@ -0,0 +1,108 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +// whitebox use case #1: return type refinement + +class ReturnTypeRefinementBundle(val c: Context) { + import c.universe._ + def impl = { + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } +} + +object ReturnTypeRefinement { + def foo: Any = macro ReturnTypeRefinementBundle.impl +} + +// whitebox use case #2: fundep materialization + +trait FundepMaterialization[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +class FundepMaterializationBundle(val c: Context) { + import c.universe._ + import definitions._ + import Flag._ + + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object FundepMaterialization { + implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] +} + +// whitebox use case #3: dynamic materialization + +trait DynamicMaterialization[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: DynamicMaterialization[T] = null +} + +object DynamicMaterialization extends LowPriority { + implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] +} + +class DynamicMaterializationBundle(val c: Context) { + import c.universe._ + def impl[T: c.WeakTypeTag] = { + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" + } +} + +// whitebox use case #4: extractor macros + +object ExtractorMacro { + def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl +} + +class ExtractorBundle(val c: Context) { + import c.universe._ + def unapplyImpl(x: Tree) = { + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala new file mode 100644 index 000000000000..b28ebfd710c0 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-raw/Test_2.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + println(ReturnTypeRefinement.foo.x) + + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) + locally { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } + + println(implicitly[DynamicMaterialization[C1]]) + println(implicitly[DynamicMaterialization[C2]]) + + 42 match { + case ExtractorMacro(x) => println(x) + } +} diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined.check b/tests/pending/run/macro-bundle-whitebox-use-refined.check new file mode 100644 index 000000000000..5679c5faba82 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-refined.check @@ -0,0 +1,5 @@ +2 +(23,foo,true) +null +C2 +42 diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala b/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala new file mode 100644 index 000000000000..de1863418ee9 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-refined/Macros_1.scala @@ -0,0 +1,108 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +// whitebox use case #1: return type refinement + +class ReturnTypeRefinementBundle(val c: Context) { + import c.universe._ + def impl = { + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } +} + +object ReturnTypeRefinement { + def foo: Any = macro ReturnTypeRefinementBundle.impl +} + +// whitebox use case #2: fundep materialization + +trait FundepMaterialization[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +class FundepMaterializationBundle(val c: Context) { + import c.universe._ + import definitions._ + import Flag._ + + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag]: c.Expr[FundepMaterialization[T, U]] = { + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("FundepMaterialization")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[FundepMaterialization[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object FundepMaterialization { + implicit def materializeIso[T, U]: FundepMaterialization[T, U] = macro FundepMaterializationBundle.impl[T, U] +} + +// whitebox use case #3: dynamic materialization + +trait DynamicMaterialization[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: DynamicMaterialization[T] = null +} + +object DynamicMaterialization extends LowPriority { + implicit def moreSpecific[T]: DynamicMaterialization[T] = macro DynamicMaterializationBundle.impl[T] +} + +class DynamicMaterializationBundle(val c: Context) { + import c.universe._ + def impl[T: c.WeakTypeTag] = { + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new DynamicMaterialization[$tpe]{ override def toString = ${tpe.toString} }" + } +} + +// whitebox use case #4: extractor macros + +object ExtractorMacro { + def unapply(x: Int): Any = macro ExtractorBundle.unapplyImpl +} + +class ExtractorBundle(val c: Context) { + import c.universe._ + def unapplyImpl(x: Tree) = { + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala b/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala new file mode 100644 index 000000000000..b28ebfd710c0 --- /dev/null +++ b/tests/pending/run/macro-bundle-whitebox-use-refined/Test_2.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + println(ReturnTypeRefinement.foo.x) + + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: FundepMaterialization[C, L]): L = iso.to(c) + locally { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } + + println(implicitly[DynamicMaterialization[C1]]) + println(implicitly[DynamicMaterialization[C2]]) + + 42 match { + case ExtractorMacro(x) => println(x) + } +} diff --git a/tests/pending/run/macro-def-path-dependent.check b/tests/pending/run/macro-def-path-dependent.check new file mode 100644 index 000000000000..7658ad2c24a4 --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent.check @@ -0,0 +1 @@ +it works diff --git a/tests/pending/run/macro-def-path-dependent.flags b/tests/pending/run/macro-def-path-dependent.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Dummy.scala b/tests/pending/run/macro-def-path-dependent/Dummy.scala new file mode 100644 index 000000000000..2ccaa3940fd4 --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Dummy.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println("it works") +} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_1.scala b/tests/pending/run/macro-def-path-dependent/Test_1.scala new file mode 100644 index 000000000000..4161a643034c --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_1.scala @@ -0,0 +1,25 @@ +// NOTE: blocked by SI-8049 + +// package test1 +// +// import scala.reflect.macros.blackbox.Context +// +// trait Exprs { +// self: Universe => +// +// class Expr[T] +// } +// +// trait Reifiers { +// self: Universe => +// +// type Expr[T] +// +// def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +// } +// +// trait Universe extends Exprs with Reifiers +// +// object Impls { +// def reify[T](cc: Context{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +// } diff --git a/tests/pending/run/macro-def-path-dependent/Test_2.scala b/tests/pending/run/macro-def-path-dependent/Test_2.scala new file mode 100644 index 000000000000..75a03b54e769 --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_2.scala @@ -0,0 +1,22 @@ +package test2 + +import scala.reflect.macros.blackbox.Context + +trait Exprs { + self: Universe => + + class Expr[T] +} + +trait Reifiers { + self: Universe => + +} + +trait Universe extends Exprs with Reifiers { + def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +} + +object Impls { + def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +} diff --git a/tests/pending/run/macro-def-path-dependent/Test_3.scala b/tests/pending/run/macro-def-path-dependent/Test_3.scala new file mode 100644 index 000000000000..1a5da8200b2b --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_3.scala @@ -0,0 +1,22 @@ +package test3 + +import scala.reflect.macros.blackbox.Context + +trait Exprs { + self: Universe => + + class Expr[T] +} + +trait Reifiers { + self: Universe => + +} + +trait Universe extends Exprs with Reifiers { + def reify[T](expr: T): Expr[T] = macro Impls.reify[T] +} + +object Impls { + def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ??? +} diff --git a/tests/pending/run/macro-def-path-dependent/Test_4.scala b/tests/pending/run/macro-def-path-dependent/Test_4.scala new file mode 100644 index 000000000000..67cb88ee6f7d --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_4.scala @@ -0,0 +1,11 @@ +package test4 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Test { + def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro materializeTypeTag_impl[T] + + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? +} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_5.scala b/tests/pending/run/macro-def-path-dependent/Test_5.scala new file mode 100644 index 000000000000..b518ce864c1a --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_5.scala @@ -0,0 +1,9 @@ +package test56 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Impls { + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? +} \ No newline at end of file diff --git a/tests/pending/run/macro-def-path-dependent/Test_6.scala b/tests/pending/run/macro-def-path-dependent/Test_6.scala new file mode 100644 index 000000000000..a8b50ce7d2f0 --- /dev/null +++ b/tests/pending/run/macro-def-path-dependent/Test_6.scala @@ -0,0 +1,9 @@ +package test56 + +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context +import scala.reflect.api.Universe + +object Macros { + def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro Impls.materializeTypeTag_impl[T] +} \ No newline at end of file diff --git a/tests/pending/run/macro-default-params.check b/tests/pending/run/macro-default-params.check new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tests/pending/run/macro-default-params.check @@ -0,0 +1 @@ +0 diff --git a/tests/pending/run/macro-default-params/Macros_1.scala b/tests/pending/run/macro-default-params/Macros_1.scala new file mode 100644 index 000000000000..74588a1cf46b --- /dev/null +++ b/tests/pending/run/macro-default-params/Macros_1.scala @@ -0,0 +1,27 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def id[A]: A = null.asInstanceOf[A] + + def foo: Any = macro impl + def impl(c: Context): c.Tree = { + import c.universe._ + import Flag._ + + lazy val tpe = TypeTree(typeOf[Int]) + + /* If we used this line instead, it would work! */ + // lazy val tpe = tq"Int" + + lazy val param: ValDef = { + val p1 = q"val a: ${tpe.duplicate} = Macros.id[${tpe.duplicate}]" + ValDef(Modifiers(DEFAULTPARAM), p1.name, p1.tpt, p1.rhs) + } + + q""" + class C { def f($param) = a } + println(new C().f()) + """ + } +} diff --git a/tests/pending/run/macro-default-params/Test_2.scala b/tests/pending/run/macro-default-params/Test_2.scala new file mode 100644 index 000000000000..d75fbd0db39e --- /dev/null +++ b/tests/pending/run/macro-default-params/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} diff --git a/tests/pending/run/macro-divergence-spurious.check b/tests/pending/run/macro-divergence-spurious.check new file mode 100644 index 000000000000..19765bd501b6 --- /dev/null +++ b/tests/pending/run/macro-divergence-spurious.check @@ -0,0 +1 @@ +null diff --git a/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala b/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala new file mode 100644 index 000000000000..7ac8fccc3a8c --- /dev/null +++ b/tests/pending/run/macro-divergence-spurious/Impls_Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait Complex[T] + +class Foo(val bar: Bar) +class Bar(val s: String) + +object Complex { + def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = { + import c.universe._ + val tpe = weakTypeOf[T] + for (f <- tpe.decls.collect{case f: TermSymbol if f.isParamAccessor && !f.isMethod => f}) { + val trecur = appliedType(typeOf[Complex[_]], List(f.info)) + val recur = c.inferImplicitValue(trecur, silent = true) + if (recur == EmptyTree) c.abort(c.enclosingPosition, s"couldn't synthesize $trecur") + } + c.Expr[Null](Literal(Constant(null))) + } + + implicit object ComplexString extends Complex[String] + implicit def genComplex[T]: Complex[T] = macro impl[T] +} diff --git a/tests/pending/run/macro-divergence-spurious/Test_2.scala b/tests/pending/run/macro-divergence-spurious/Test_2.scala new file mode 100644 index 000000000000..0a98207016cc --- /dev/null +++ b/tests/pending/run/macro-divergence-spurious/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[Complex[Foo]]) +} \ No newline at end of file diff --git a/tests/pending/run/macro-duplicate.check b/tests/pending/run/macro-duplicate.check new file mode 100644 index 000000000000..58781b719a0a --- /dev/null +++ b/tests/pending/run/macro-duplicate.check @@ -0,0 +1,3 @@ +Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + Macros.foo + ^ diff --git a/tests/pending/run/macro-duplicate.flags b/tests/pending/run/macro-duplicate.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-duplicate.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-duplicate/Impls_Macros_1.scala b/tests/pending/run/macro-duplicate/Impls_Macros_1.scala new file mode 100644 index 000000000000..84fb2c5b6132 --- /dev/null +++ b/tests/pending/run/macro-duplicate/Impls_Macros_1.scala @@ -0,0 +1,29 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val Expr(Block((cdef: ClassDef) :: Nil, _)) = reify { class C { def x = 2 } } + val cdef1 = + new Transformer { + override def transform(tree: Tree): Tree = tree match { + case Template(_, _, ctor :: defs) => + val defs1 = defs collect { + case ddef @ DefDef(mods, name, tparams, vparamss, tpt, body) => + val future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TermName("Future")) + val Future = Select(Select(Ident(TermName("scala")), TermName("concurrent")), TypeName("Future")) + val tpt1 = if (tpt.isEmpty) tpt else AppliedTypeTree(Future, List(tpt)) + val body1 = Apply(future, List(body)) + val name1 = TermName("async" + name.toString.capitalize) + DefDef(mods, name1, tparams, vparamss, tpt1, body1) + } + Template(Nil, emptyValDef, ctor +: defs ::: defs1) + case _ => + super.transform(tree) + } + } transform cdef + c.Expr[Unit](Block(cdef1 :: Nil, Literal(Constant(())))) + } + + def foo = macro impl +} diff --git a/tests/pending/run/macro-duplicate/Test_2.scala b/tests/pending/run/macro-duplicate/Test_2.scala new file mode 100644 index 000000000000..8706883b45dd --- /dev/null +++ b/tests/pending/run/macro-duplicate/Test_2.scala @@ -0,0 +1,6 @@ +import scala.concurrent._ +import ExecutionContext.Implicits.global + +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-detectvar.check b/tests/pending/run/macro-enclosingowner-detectvar.check new file mode 100644 index 000000000000..c8f86ec7351a --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-detectvar.check @@ -0,0 +1,16 @@ +(true,false,false,false) +(true,false,false,false) +(true,false,false,false) +(true,false,false,false) +(false,true,false,false) +(false,true,false,false) +(false,true,false,false) +(false,true,false,false) +(false,false,true,false) +(false,false,true,false) +(false,false,true,false) +(false,false,true,false) +(false,false,false,true) +(false,false,false,true) +(false,false,false,true) +(false,false,false,true) diff --git a/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala b/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala new file mode 100644 index 000000000000..26ed64d8c387 --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-detectvar/Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + def detectFlags(sym: TermSymbol): String = { + (sym.isVal, sym.isVar, !sym.isVal && !sym.isVar && !sym.isLazy, sym.isLazy).toString + } + q"println(${detectFlags(c.internal.enclosingOwner.asTerm)}); 42" + } + + def foo: Int = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala b/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala new file mode 100644 index 000000000000..edc0eb6544d0 --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-detectvar/Test_2.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + val a1 = Macros.foo + val a2 = Predef.identity(Predef.identity(Macros.foo)) + val a3: Int = Macros.foo + val a4: Int = Predef.identity(Predef.identity(Macros.foo)) + + var b1 = Macros.foo + var b2 = Predef.identity(Predef.identity(Macros.foo)) + var b3: Int = Macros.foo + var b4: Int = Predef.identity(Predef.identity(Macros.foo)) + + def c1 = Macros.foo + def c2 = Predef.identity(Predef.identity(Macros.foo)) + def c3: Int = Macros.foo + def c4: Int = Predef.identity(Predef.identity(Macros.foo)) + c1; c2; c3; c4; + + lazy val d1 = Macros.foo + lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) + lazy val d3: Int = Macros.foo + lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) + d1; d2; d3; d4 +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-sbt.check b/tests/pending/run/macro-enclosingowner-sbt.check new file mode 100644 index 000000000000..3c95698e9ac9 --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-sbt.check @@ -0,0 +1,16 @@ +a1 +a2 +a3 +a4 +b1 +b2 +b3 +b4 +c1 +c2 +c3 +c4 +d1 +d2 +d3 +d4 diff --git a/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala b/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala new file mode 100644 index 000000000000..a98a984861ac --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-sbt/Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + def enclosingName(sym: Symbol): String = { + sym.name.toString.stripSuffix(termNames.LOCAL_SUFFIX_STRING) + } + q"println(${enclosingName(c.internal.enclosingOwner).toString}); 42" + } + + def foo: Int = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala b/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala new file mode 100644 index 000000000000..edc0eb6544d0 --- /dev/null +++ b/tests/pending/run/macro-enclosingowner-sbt/Test_2.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + val a1 = Macros.foo + val a2 = Predef.identity(Predef.identity(Macros.foo)) + val a3: Int = Macros.foo + val a4: Int = Predef.identity(Predef.identity(Macros.foo)) + + var b1 = Macros.foo + var b2 = Predef.identity(Predef.identity(Macros.foo)) + var b3: Int = Macros.foo + var b4: Int = Predef.identity(Predef.identity(Macros.foo)) + + def c1 = Macros.foo + def c2 = Predef.identity(Predef.identity(Macros.foo)) + def c3: Int = Macros.foo + def c4: Int = Predef.identity(Predef.identity(Macros.foo)) + c1; c2; c3; c4; + + lazy val d1 = Macros.foo + lazy val d2 = Predef.identity(Predef.identity(Macros.foo)) + lazy val d3: Int = Macros.foo + lazy val d4: Int = Predef.identity(Predef.identity(Macros.foo)) + d1; d2; d3; d4 +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures.check b/tests/pending/run/macro-enclosures.check new file mode 100644 index 000000000000..b6fe7a4a9119 --- /dev/null +++ b/tests/pending/run/macro-enclosures.check @@ -0,0 +1,34 @@ +enclosingPackage = package test { + object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo + } +} +enclosingClass = object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingImpl = object Test extends scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingTemplate = scala.AnyRef { + def () = { + super.(); + () + }; + def test = Macros.foo +} +enclosingMethod = def test = Macros.foo +enclosingDef = def test = Macros.foo +enclosingOwner = method test +enclosingOwnerChain = List(method test, object Test, package test, package ) diff --git a/tests/pending/run/macro-enclosures.flags b/tests/pending/run/macro-enclosures.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-enclosures.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures/Impls_Macros_1.scala b/tests/pending/run/macro-enclosures/Impls_Macros_1.scala new file mode 100644 index 000000000000..564cdfa68f0a --- /dev/null +++ b/tests/pending/run/macro-enclosures/Impls_Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + def chain(sym: Symbol): List[Symbol] = sym.owner match { + case NoSymbol => sym :: Nil + case owner => sym :: chain(owner) + } + q""" + println("enclosingPackage = " + ${c.enclosingPackage.toString}) + println("enclosingClass = " + ${c.enclosingClass.toString}) + println("enclosingImpl = " + ${c.enclosingImpl.toString}) + println("enclosingTemplate = " + ${c.enclosingTemplate.toString}) + println("enclosingMethod = " + ${c.enclosingMethod.toString}) + println("enclosingDef = " + ${c.enclosingDef.toString}) + println("enclosingOwner = " + ${c.internal.enclosingOwner.toString}) + println("enclosingOwnerChain = " + ${chain(c.internal.enclosingOwner).toString}) + """ + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-enclosures/Test_2.scala b/tests/pending/run/macro-enclosures/Test_2.scala new file mode 100644 index 000000000000..8b8dc10cd2de --- /dev/null +++ b/tests/pending/run/macro-enclosures/Test_2.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + test.Test.test +} + +package test { + object Test { + def test = { + Macros.foo + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument.check b/tests/pending/run/macro-expand-implicit-argument.check new file mode 100644 index 000000000000..15a62794a9f5 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-argument.check @@ -0,0 +1 @@ +List(1, 2, 3) diff --git a/tests/pending/run/macro-expand-implicit-argument.flags b/tests/pending/run/macro-expand-implicit-argument.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-argument.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala b/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala new file mode 100644 index 000000000000..465f313ef2cd --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-argument/Macros_1.scala @@ -0,0 +1,59 @@ +import annotation.tailrec +import scala.math.{min, max} +import scala.{specialized => spec} + +import language.experimental.macros + +import scala.reflect.ClassTag +import scala.reflect.macros.blackbox.Context + +object Macros { + def alloc[@spec A:ClassTag](src:Array[A], s1:Int, len:Int) = { + val as = Array.ofDim[A](len) + System.arraycopy(src, s1, as, 0, len) + as + } + + /** + * Efficient alternative to Array.apply. + * + * "As seen on scala-internals!" + */ + def array[A](as:A*)(implicit ct: ClassTag[A]) = macro arrayMacro[A] + + /** + * Takes in something like: + * ArrayUtil.alloc[Int](11, 22, 33, 44)(ct) + * + * and builds a tree like: + * { + * val arr:Array[Int] = ct.newArray(4) + * arr.update(0, 11) + * arr.update(1, 22) + * arr.update(2, 33) + * arr.update(3, 44) + * arr + * } + */ + def arrayMacro[A:c.WeakTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = { + import c.mirror._ + import c.universe._ + def const(x:Int) = Literal(Constant(x)) + + val n = as.length + val arr = TermName("arr") + + val create = Apply(Select(ct.tree, TermName("newArray")), List(const(n))) + val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe) + val valdef = ValDef(Modifiers(), arr, arrtpe, create) + + val updates = (0 until n).map { + i => Apply(Select(Ident(arr), TermName("update")), List(const(i), as(i).tree)) + } + + val exprs = (Seq(valdef) ++ updates ++ Seq(Ident(arr))).toList + val block = Block(exprs.init, exprs.last) + + c.Expr[Array[A]](block) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-argument/Test_2.scala b/tests/pending/run/macro-expand-implicit-argument/Test_2.scala new file mode 100644 index 000000000000..edb1de4135af --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-argument/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(array(1, 2, 3).toList) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit.check b/tests/pending/run/macro-expand-implicit-macro-has-implicit.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-has-implicit.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags b/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-has-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala new file mode 100644 index 000000000000..18c97956e4b1 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(x.tree)) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala new file mode 100644 index 000000000000..2f5648758e33 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + implicit val x = 42 + def foo(implicit x: Int): Unit = macro Impls.foo + foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit.check b/tests/pending/run/macro-expand-implicit-macro-is-implicit.check new file mode 100644 index 000000000000..c205945d051c --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-implicit.check @@ -0,0 +1,2 @@ +Some(2) +2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags b/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala new file mode 100644 index 000000000000..aeceee5a5b55 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { + import c.universe._ + val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) + c.Expr[Option[Int]](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala new file mode 100644 index 000000000000..8f0fbe60e04c --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala @@ -0,0 +1,11 @@ +object Macros { + import scala.language.implicitConversions + implicit def foo(x: String): Option[Int] = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println("2": Option[Int]) + val s: Int = "2" getOrElse 0 + println(s) +} diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val.check b/tests/pending/run/macro-expand-implicit-macro-is-val.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-val.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val.flags b/tests/pending/run/macro-expand-implicit-macro-is-val.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-val.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala new file mode 100644 index 000000000000..fd267d32c44b --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-val/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Literal(Constant(2)) + c.Expr[Int](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala new file mode 100644 index 000000000000..3b851de05e60 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + implicit def foo: Int = macro Impls.foo + def bar(implicit x: Int) = println(x) + bar +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view.check b/tests/pending/run/macro-expand-implicit-macro-is-view.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-view.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala b/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala new file mode 100644 index 000000000000..d72db872e891 --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-view/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = { + import c.universe._ + val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) + c.Expr[Option[Int]](body) + } +} diff --git a/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala new file mode 100644 index 000000000000..c7b09435a2fe --- /dev/null +++ b/tests/pending/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala @@ -0,0 +1,12 @@ + +object Macros { + import scala.language.experimental.macros + import scala.language.implicitConversions + implicit def foo(x: String): Option[Int] = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + def bar[T <% Option[Int]](x: T) = println(x) + println("2") +} diff --git a/tests/pending/run/macro-expand-multiple-arglists.check b/tests/pending/run/macro-expand-multiple-arglists.check new file mode 100644 index 000000000000..c24b6ae77df0 --- /dev/null +++ b/tests/pending/run/macro-expand-multiple-arglists.check @@ -0,0 +1 @@ +38 \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists.flags b/tests/pending/run/macro-expand-multiple-arglists.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-multiple-arglists.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala b/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala new file mode 100644 index 000000000000..9278633c11e3 --- /dev/null +++ b/tests/pending/run/macro-expand-multiple-arglists/Impls_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { + import c.universe._ + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala b/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala new file mode 100644 index 000000000000..09de5e02f9f9 --- /dev/null +++ b/tests/pending/run/macro-expand-multiple-arglists/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int)(y: Int): Unit = macro Impls.foo + foo(40)(2) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic.check b/tests/pending/run/macro-expand-nullary-generic.check new file mode 100644 index 000000000000..0470d239dc9e --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-generic.check @@ -0,0 +1,6 @@ +fooNullary[Int] +fooEmpty[Int] +fooEmpty[Int] +barNullary[Int] +barEmpty[Int] +kkthxbai diff --git a/tests/pending/run/macro-expand-nullary-generic.flags b/tests/pending/run/macro-expand-nullary-generic.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-generic.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala b/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala new file mode 100644 index 000000000000..9362d6c17a10 --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-generic/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl[T: c.WeakTypeTag](c: Context)(meth: String) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]")))) + c.Expr[Unit](body) + } + + def fooNullary[T: c.WeakTypeTag](c: Context) = impl[T](c)("fooNullary") + def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty") + def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary") + def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty") +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala b/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala new file mode 100644 index 000000000000..da418c63c6b9 --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-generic/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + def foo1[T]: Unit = macro Impls.fooNullary[T] + def foo2[T](): Unit = macro Impls.fooEmpty[T] + def bar1[T](x: Int): Unit = macro Impls.barNullary[T] + def bar2[T](x: Int)(): Unit = macro Impls.barEmpty[T] +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo1[Int] + Macros.foo2[Int] + Macros.foo2[Int]() + Macros.bar1[Int](42) + Macros.bar2[Int](42)() + println("kkthxbai") +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric.check b/tests/pending/run/macro-expand-nullary-nongeneric.check new file mode 100644 index 000000000000..cb7e7663943a --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-nongeneric.check @@ -0,0 +1,6 @@ +fooNullary +fooEmpty +fooEmpty +barNullary +barEmpty +kkthxbai diff --git a/tests/pending/run/macro-expand-nullary-nongeneric.flags b/tests/pending/run/macro-expand-nullary-nongeneric.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-nongeneric.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala b/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala new file mode 100644 index 000000000000..c8c3d255c416 --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-nongeneric/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(meth: String) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth)))) + c.Expr[Unit](body) + } + + def fooNullary(c: Context) = impl(c)("fooNullary") + def fooEmpty(c: Context)() = impl(c)("fooEmpty") + def barNullary(c: Context)(x: c.Expr[Int]) = impl(c)("barNullary") + def barEmpty(c: Context)(x: c.Expr[Int])() = impl(c)("barEmpty") +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala b/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala new file mode 100644 index 000000000000..a14d981cee2e --- /dev/null +++ b/tests/pending/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala @@ -0,0 +1,15 @@ +object Macros { + def foo1: Unit = macro Impls.fooNullary + def foo2(): Unit = macro Impls.fooEmpty + def bar1(x: Int): Unit = macro Impls.barNullary + def bar2(x: Int)(): Unit = macro Impls.barEmpty +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 + Macros.foo2() + Macros.bar1(42) + Macros.bar2(42)() + println("kkthxbai") +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload.check b/tests/pending/run/macro-expand-overload.check new file mode 100644 index 000000000000..a2b7b0e78178 --- /dev/null +++ b/tests/pending/run/macro-expand-overload.check @@ -0,0 +1,6 @@ +(fooObjectString,Expr[Nothing](Macros),42) +(fooObjectInt,Expr[Nothing](Macros),42) +fooObjectBoolean +(fooClassString,Expr[Nothing](new Macros()),42) +(fooClassInt,Expr[Nothing](new Macros()),42) +fooClassBoolean diff --git a/tests/pending/run/macro-expand-overload.flags b/tests/pending/run/macro-expand-overload.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-overload.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload/Impls_1.scala b/tests/pending/run/macro-expand-overload/Impls_1.scala new file mode 100644 index 000000000000..ef9d01d4edf6 --- /dev/null +++ b/tests/pending/run/macro-expand-overload/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(tag: String, x: c.Expr[_]) = { + import c.{prefix => prefix} + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + c.Expr[Unit](body) + } + + def fooObjectString(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectString", x) + def fooObjectInt(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectInt", x) + def fooClassString(c: Context)(x: c.Expr[_]) = impl(c)("fooClassString", x) + def fooClassInt(c: Context)(x: c.Expr[_]) = impl(c)("fooClassInt", x) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-overload/Macros_Test_2.scala b/tests/pending/run/macro-expand-overload/Macros_Test_2.scala new file mode 100644 index 000000000000..b367f35b7636 --- /dev/null +++ b/tests/pending/run/macro-expand-overload/Macros_Test_2.scala @@ -0,0 +1,20 @@ +object Macros { + def foo(x: String): Unit = macro Impls.fooObjectString + def foo(x: Int): Unit = macro Impls.fooObjectInt + def foo(x: Boolean): Unit = println("fooObjectBoolean") +} + +class Macros { + def foo(x: String): Unit = macro Impls.fooClassString + def foo(x: Int): Unit = macro Impls.fooClassInt + def foo(x: Boolean): Unit = println("fooClassBoolean") +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo("42") + Macros.foo(42) + Macros.foo(true) + new Macros().foo("42") + new Macros().foo(42) + new Macros().foo(true) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override.check b/tests/pending/run/macro-expand-override.check new file mode 100644 index 000000000000..b41dc156c4b8 --- /dev/null +++ b/tests/pending/run/macro-expand-override.check @@ -0,0 +1,15 @@ +(fooBString,Expr[Nothing](Test.this.dd),42) +(fooDInt,Expr[Nothing](Test.this.dd),42) +fooBBoolean +(fooBString,Expr[Nothing](Test.this.db),42) +(fooBInt,Expr[Nothing](Test.this.db),42) +fooBBoolean +(fooZString,Expr[Nothing](Test.this.zz),42) +(fooDInt,Expr[Nothing](Test.this.zz),42) +fooZBoolean +(fooBString,Expr[Nothing](Test.this.zd),42) +(fooDInt,Expr[Nothing](Test.this.zd),42) +fooZBoolean +(fooBString,Expr[Nothing](Test.this.zb),42) +(fooBInt,Expr[Nothing](Test.this.zb),42) +fooZBoolean diff --git a/tests/pending/run/macro-expand-override.flags b/tests/pending/run/macro-expand-override.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-override.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override/Impls_1.scala b/tests/pending/run/macro-expand-override/Impls_1.scala new file mode 100644 index 000000000000..e6ce18f172e4 --- /dev/null +++ b/tests/pending/run/macro-expand-override/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context)(tag: String, x: c.Expr[_]) = { + import c.{prefix => prefix} + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + c.Expr[Unit](body) + } + + def fooBString(c: Context)(x: c.Expr[_]) = impl(c)("fooBString", x) + def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x) + def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x) + def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-override/Macros_Test_2.scala b/tests/pending/run/macro-expand-override/Macros_Test_2.scala new file mode 100644 index 000000000000..46c1f49cc234 --- /dev/null +++ b/tests/pending/run/macro-expand-override/Macros_Test_2.scala @@ -0,0 +1,43 @@ +class B { + def foo(x: String): Unit = macro Impls.fooBString + def foo(x: Int): Unit = macro Impls.fooBInt + def foo(x: Boolean): Unit = println("fooBBoolean") +} + +class D extends B { + //override def foo(x: String): Unit = println("fooDString") => method cannot override a macro + override def foo(x: Int): Unit = macro Impls.fooDInt +} + +class Z extends D { + override def foo(x: String): Unit = macro Impls.fooZString + override def foo(x: Boolean): Unit = println("fooZBoolean") +} + +object Test extends dotty.runtime.LegacyApp { + + val dd: D = new D() + dd.foo("42") + dd.foo(42) + dd.foo(true) + + val db: B = new D() + db.foo("42") + db.foo(42) + db.foo(true) + + val zz: Z = new Z() + zz.foo("42") + zz.foo(42) + zz.foo(true) + + val zd: D = new Z() + zd.foo("42") + zd.foo(42) + zd.foo(true) + + val zb: B = new Z() + zb.foo("42") + zb.foo(42) + zb.foo(true) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive.check b/tests/pending/run/macro-expand-recursive.check new file mode 100644 index 000000000000..7658ad2c24a4 --- /dev/null +++ b/tests/pending/run/macro-expand-recursive.check @@ -0,0 +1 @@ +it works diff --git a/tests/pending/run/macro-expand-recursive.flags b/tests/pending/run/macro-expand-recursive.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-recursive.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive/Impls_1.scala b/tests/pending/run/macro-expand-recursive/Impls_1.scala new file mode 100644 index 000000000000..3def2d2fbe1d --- /dev/null +++ b/tests/pending/run/macro-expand-recursive/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) + c.Expr[Unit](body) + } + + def fooFoo(c: Context) = { + import c.universe._ + val body = Select(Ident(TermName("Macros")), TermName("foo")) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala b/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala new file mode 100644 index 000000000000..e8a88afc9f6a --- /dev/null +++ b/tests/pending/run/macro-expand-recursive/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo: Unit = macro Impls.foo + def fooFoo: Unit = macro Impls.fooFoo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.fooFoo +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-bounds.check b/tests/pending/run/macro-expand-tparams-bounds.check new file mode 100644 index 000000000000..317e9677c3bc --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-bounds.check @@ -0,0 +1,2 @@ +hello +hello diff --git a/tests/pending/run/macro-expand-tparams-bounds.flags b/tests/pending/run/macro-expand-tparams-bounds.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-bounds.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala b/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala new file mode 100644 index 000000000000..95aaa1c3d71b --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-bounds/Impls_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls1 { + def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } +} + +class C +class D extends C + +object Impls2 { + def foo[U <: C](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") } +} diff --git a/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala new file mode 100644 index 000000000000..f1cab82ec724 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-bounds/Macros_Test_2.scala @@ -0,0 +1,12 @@ +object Macros1 { + def foo[U <: String]: Unit = macro Impls1.foo[U] +} + +object Macros2 { + def foo[T <: D]: Unit = macro Impls2.foo[T] +} + +object Test extends dotty.runtime.LegacyApp { + Macros1.foo[String] + Macros2.foo[D] +} diff --git a/tests/pending/run/macro-expand-tparams-explicit.check b/tests/pending/run/macro-expand-tparams-explicit.check new file mode 100644 index 000000000000..b6b4f6fa3a8e --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-explicit.check @@ -0,0 +1 @@ +WeakTypeTag[Int] diff --git a/tests/pending/run/macro-expand-tparams-explicit.flags b/tests/pending/run/macro-expand-tparams-explicit.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-explicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala b/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala new file mode 100644 index 000000000000..c33ac6d1b786 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-explicit/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U: c.WeakTypeTag](c: Context) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala new file mode 100644 index 000000000000..14154ee03b1c --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-explicit/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U]: Unit = macro Impls.foo[U] + foo[Int] +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit.check b/tests/pending/run/macro-expand-tparams-implicit.check new file mode 100644 index 000000000000..a9bf55423ea6 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-implicit.check @@ -0,0 +1,2 @@ +WeakTypeTag[Int] +WeakTypeTag[String] diff --git a/tests/pending/run/macro-expand-tparams-implicit.flags b/tests/pending/run/macro-expand-tparams-implicit.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-implicit.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala b/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala new file mode 100644 index 000000000000..32cee0d5fbb4 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-implicit/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala new file mode 100644 index 000000000000..3868174693b1 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-implicit/Macros_Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U](x: U): Unit = macro Impls.foo[U] + foo(42) + foo("42") +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-prefix.check b/tests/pending/run/macro-expand-tparams-prefix.check new file mode 100644 index 000000000000..739795806646 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-prefix.check @@ -0,0 +1,20 @@ +===Macros1=== +WeakTypeTag[Int] +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros2=== +WeakTypeTag[Boolean] WeakTypeTag[Int] +WeakTypeTag[Boolean] WeakTypeTag[String] +===Macros3=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros4=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros5=== +WeakTypeTag[T] +WeakTypeTag[U] +WeakTypeTag[Boolean] diff --git a/tests/pending/run/macro-expand-tparams-prefix.flags b/tests/pending/run/macro-expand-tparams-prefix.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-prefix.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala b/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala new file mode 100644 index 000000000000..289f07162b12 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-prefix/Impls_1.scala @@ -0,0 +1,39 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls1 { + def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + c.Expr[Unit](q"println(${U.toString})") + } +} + +object Impls2 { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val T = implicitly[c.WeakTypeTag[T]] + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) + c.Expr[Unit](q"""println(${T.toString} + " " + ${U.toString})""") + } +} + +object Impls345 { + def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + import c.universe._ + c.Expr(q""" + println(${T.toString}) + println(${implicitly[c.WeakTypeTag[U]].toString}) + println(${V.toString}) + """) + } +} + +object Macros4 { + class D[T] { + class C[U] { + def foo[V] = macro Impls345.foo[T, U, V] + } + } +} diff --git a/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala b/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala new file mode 100644 index 000000000000..8916f03e4235 --- /dev/null +++ b/tests/pending/run/macro-expand-tparams-prefix/Macros_Test_2.scala @@ -0,0 +1,57 @@ +object Macros1 { + class C[T] { + def foo[U](x: U): Unit = macro Impls1.foo[U] + } +} + +object Macros2 { + class C[T] { + def foo[U](x: U): Unit = macro Impls2.foo[T, U] + } +} + +object Macros3 { + class D[T] { + class C[U] { + def foo[V]: Unit = macro Impls345.foo[T, U, V] + } + } +} + +// object Macros4 is declared in Impls_1.scala + +object Macros5 { + class D[T] { + class C[U] { + def foo[V]: Unit = macro Impls345.foo[T, U, V] + foo[Boolean] + } + } +} + +object Test extends dotty.runtime.LegacyApp { + println("===Macros1===") + new Macros1.C[Int]().foo(42) + new Macros1.C[Boolean]().foo(42) + new Macros1.C[Int]().foo("42") + new Macros1.C[String]().foo(true) + + println("===Macros2===") + object D2 extends Macros2.C[Boolean] + D2.foo(42) + D2.foo("42") + + println("===Macros3===") + val outer31 = new Macros3.D[Int] + val outer32 = new outer31.C[String] + outer32.foo[Boolean] + + println("===Macros4===") + val outer41 = new Macros4.D[Int] + val outer42 = new outer41.C[String] + outer42.foo[Boolean] + + println("===Macros5===") + val outer1 = new Macros5.D[Int] + new outer1.C[String] +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a.check b/tests/pending/run/macro-expand-unapply-a.check new file mode 100644 index 000000000000..7c2976e51e03 --- /dev/null +++ b/tests/pending/run/macro-expand-unapply-a.check @@ -0,0 +1,2 @@ +(1,2) +(1,2,3) diff --git a/tests/pending/run/macro-expand-unapply-a.flags b/tests/pending/run/macro-expand-unapply-a.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-unapply-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala b/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala new file mode 100644 index 000000000000..64f16c6a8988 --- /dev/null +++ b/tests/pending/run/macro-expand-unapply-a/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.whitebox.Context + +object Helper { + def unapplySeq[T](x: List[T]): Option[Seq[T]] = List.unapplySeq[T](x) +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = { + c.universe.reify(Helper.unapplySeq(x.splice)) + } + + object UnapplyMacro { + def unapplySeq[T](x: List[T]): Option[Seq[T]] = macro impl[T] + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-unapply-a/Test_2.scala b/tests/pending/run/macro-expand-unapply-a/Test_2.scala new file mode 100644 index 000000000000..ce52df8023b2 --- /dev/null +++ b/tests/pending/run/macro-expand-unapply-a/Test_2.scala @@ -0,0 +1,6 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + List(1, 2) match { case UnapplyMacro(x, y) => println((x, y)) } + List(1, 2, 3) match { case UnapplyMacro(x, y, z) => println((x, y, z)) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check new file mode 100644 index 000000000000..2709b57038d6 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.check @@ -0,0 +1,4 @@ +reflective compilation has failed: + +no `: _*' annotation allowed here +(such annotations are only allowed in arguments to *-parameters) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala new file mode 100644 index 000000000000..18af84583a84 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala new file mode 100644 index 000000000000..868fb8d918e7 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala @@ -0,0 +1,12 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(typeNames.WILDCARD_STAR)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check new file mode 100644 index 000000000000..fe90caed3cd2 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.check @@ -0,0 +1 @@ +List(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala new file mode 100644 index 000000000000..eb067c25a588 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val stripped_xs = xs map (_.tree) toList match { + case List(Typed(stripped, Ident(wildstar))) if wildstar == typeNames.WILDCARD_STAR => List(stripped) + case _ => ??? + } + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), stripped_xs) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala new file mode 100644 index 000000000000..7eba411cdaf5 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + val numbers = List(1, 2, 3, 4, 5) + Macros.foo(numbers: _*) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check new file mode 100644 index 000000000000..fe90caed3cd2 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.check @@ -0,0 +1 @@ +List(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-varargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala new file mode 100644 index 000000000000..64ab7de02a32 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def myprintln(xs: Int*) = { + println(xs) + } + + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala new file mode 100644 index 000000000000..7eba411cdaf5 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + val numbers = List(1, 2, 3, 4, 5) + Macros.foo(numbers: _*) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check new file mode 100644 index 000000000000..bcfab1984725 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.check @@ -0,0 +1 @@ +(1,2,3,4,5) diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala new file mode 100644 index 000000000000..18af84583a84 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala new file mode 100644 index 000000000000..f50a5d742f8d --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo(1, 2, 3, 4, 5) +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check new file mode 100644 index 000000000000..2c174a8a994d --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.check @@ -0,0 +1 @@ +WrappedArray(1, 2, 3, 4, 5) diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-varargs.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala new file mode 100644 index 000000000000..64ab7de02a32 --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def myprintln(xs: Int*) = { + println(xs) + } + + def foo(c: Context)(xs: c.Expr[Int]*) = { + import c.universe._ + val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala new file mode 100644 index 000000000000..f50a5d742f8d --- /dev/null +++ b/tests/pending/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo(xs: Int*): Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo(1, 2, 3, 4, 5) +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params.check b/tests/pending/run/macro-impl-default-params.check new file mode 100644 index 000000000000..b32e345706d8 --- /dev/null +++ b/tests/pending/run/macro-impl-default-params.check @@ -0,0 +1,5 @@ +foo_targs: +invoking foo_targs... +type of prefix is: Nothing +type of prefix tree is: Macros[Int] +U is: String diff --git a/tests/pending/run/macro-impl-default-params.flags b/tests/pending/run/macro-impl-default-params.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-impl-default-params.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala b/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala new file mode 100644 index 000000000000..9b1d0eed35f1 --- /dev/null +++ b/tests/pending/run/macro-impl-default-params/Impls_Macros_1.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo_targs[T, U: c.WeakTypeTag](c: Context = null)(x: c.Expr[Int] = null) = { + import c.{prefix => prefix} + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + c.Expr[Unit](q""" + println("invoking foo_targs...") + println("type of prefix is: " + ${prefix.staticType.toString}) + println("type of prefix tree is: " + ${prefix.tree.tpe.toString}) + println("U is: " + ${U.tpe.toString}) + """) + } +} + +class Macros[T] { + def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U] +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-default-params/Test_2.scala b/tests/pending/run/macro-impl-default-params/Test_2.scala new file mode 100644 index 000000000000..476c881f8e74 --- /dev/null +++ b/tests/pending/run/macro-impl-default-params/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println("foo_targs:") + new Macros[Int]().foo_targs[String](42) +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-relaxed.check b/tests/pending/run/macro-impl-relaxed.check new file mode 100644 index 000000000000..487b1165348b --- /dev/null +++ b/tests/pending/run/macro-impl-relaxed.check @@ -0,0 +1,4 @@ +2 +2 +2 +2 diff --git a/tests/pending/run/macro-impl-relaxed/Macros_1.scala b/tests/pending/run/macro-impl-relaxed/Macros_1.scala new file mode 100644 index 000000000000..420eb2a39997 --- /dev/null +++ b/tests/pending/run/macro-impl-relaxed/Macros_1.scala @@ -0,0 +1,14 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def implUU(c: Context)(x: c.Tree): c.Tree = x + def implTU(c: Context)(x: c.Expr[Int]): c.Tree = x.tree + def implUT(c: Context)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x) + def implTT(c: Context)(x: c.Expr[Int]): c.Expr[Int] = x + + def fooUU(x: Int): Int = macro implUU + def fooTU(x: Int): Int = macro implTU + def fooUT(x: Int): Int = macro implUT + def fooTT(x: Int): Int = macro implTT +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-relaxed/Test_2.scala b/tests/pending/run/macro-impl-relaxed/Test_2.scala new file mode 100644 index 000000000000..460626272980 --- /dev/null +++ b/tests/pending/run/macro-impl-relaxed/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.fooUU(2)) + println(Macros.fooTU(2)) + println(Macros.fooUT(2)) + println(Macros.fooTT(2)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-rename-context.check b/tests/pending/run/macro-impl-rename-context.check new file mode 100644 index 000000000000..6a34e5fd87ce --- /dev/null +++ b/tests/pending/run/macro-impl-rename-context.check @@ -0,0 +1,2 @@ +foo +invoking foo... diff --git a/tests/pending/run/macro-impl-rename-context.flags b/tests/pending/run/macro-impl-rename-context.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-impl-rename-context.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala b/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala new file mode 100644 index 000000000000..acc47fcde685 --- /dev/null +++ b/tests/pending/run/macro-impl-rename-context/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(unconventionalName: Context)(x: unconventionalName.Expr[Int]) = { + import unconventionalName.universe._ + unconventionalName.Expr[Unit](q"""println("invoking foo...")""") + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/pending/run/macro-impl-rename-context/Test_2.scala b/tests/pending/run/macro-impl-rename-context/Test_2.scala new file mode 100644 index 000000000000..6b1cdecd048e --- /dev/null +++ b/tests/pending/run/macro-impl-rename-context/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println("foo") + Macros.foo(42) +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl.check b/tests/pending/run/macro-impl-tparam-only-in-impl.check new file mode 100644 index 000000000000..3b18e512dba7 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-only-in-impl.check @@ -0,0 +1 @@ +hello world diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl.flags b/tests/pending/run/macro-impl-tparam-only-in-impl.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-only-in-impl.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala b/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala new file mode 100644 index 000000000000..705defb18fe8 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-only-in-impl/Impls_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") } +} diff --git a/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala b/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala new file mode 100644 index 000000000000..b626ce35ee1e --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Macros { + def foo: Unit = macro Impls.foo[String] +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional.check b/tests/pending/run/macro-impl-tparam-typetag-is-optional.check new file mode 100644 index 000000000000..b4a0f394c1f3 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-typetag-is-optional.check @@ -0,0 +1 @@ +don't know U diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags b/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-typetag-is-optional.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala new file mode 100644 index 000000000000..fc72e7a979d0 --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[U](c: Context) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("don't know U")))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala new file mode 100644 index 000000000000..14154ee03b1c --- /dev/null +++ b/tests/pending/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo[U]: Unit = macro Impls.foo[U] + foo[Int] +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check new file mode 100644 index 000000000000..1d531f6d867a --- /dev/null +++ b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.check @@ -0,0 +1,5 @@ +reflective compilation has failed: + +type mismatch; + found : String("42") + required: Int diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala new file mode 100644 index 000000000000..603500b597c2 --- /dev/null +++ b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context): c.Expr[Int] = { + import c.universe._ + c.Expr(Literal(Constant("42"))) + } +} + +object Macros { + def foo: Int = macro Impls.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala new file mode 100644 index 000000000000..dea6e6d62268 --- /dev/null +++ b/tests/pending/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable.check b/tests/pending/run/macro-invalidret-nontypeable.check new file mode 100644 index 000000000000..25cef2c7862a --- /dev/null +++ b/tests/pending/run/macro-invalidret-nontypeable.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +not found: value IDoNotExist diff --git a/tests/pending/run/macro-invalidret-nontypeable.flags b/tests/pending/run/macro-invalidret-nontypeable.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-invalidret-nontypeable.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala new file mode 100644 index 000000000000..b6b96117433f --- /dev/null +++ b/tests/pending/run/macro-invalidret-nontypeable/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.universe._ + val body = Ident(TermName("IDoNotExist")) + c.Expr[Int](body) + } +} + +object Macros { + def foo = macro Impls.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala b/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala new file mode 100644 index 000000000000..26de1d9de556 --- /dev/null +++ b/tests/pending/run/macro-invalidret-nontypeable/Test_2.scala @@ -0,0 +1,8 @@ + object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-badret.check b/tests/pending/run/macro-invalidusage-badret.check new file mode 100644 index 000000000000..e79550043f78 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-badret.check @@ -0,0 +1,5 @@ +reflective compilation has failed: + +type mismatch; + found : Int + required: String diff --git a/tests/pending/run/macro-invalidusage-badret.flags b/tests/pending/run/macro-invalidusage-badret.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-badret.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala new file mode 100644 index 000000000000..0d4c5755f013 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-badret/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = x +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/pending/run/macro-invalidusage-badret/Test_2.scala b/tests/pending/run/macro-invalidusage-badret/Test_2.scala new file mode 100644 index 000000000000..1d208aeb1d6c --- /dev/null +++ b/tests/pending/run/macro-invalidusage-badret/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Typed(Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))), Ident(TypeName("String"))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check new file mode 100644 index 000000000000..6cbcb9e5af89 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +too few argument lists for macro invocation diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala new file mode 100644 index 000000000000..8b5c59bde86a --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString)))) + c.Expr[Unit](body) + } +} + +object Macros { + def foo[T](x: T) = macro Impls.foo[T] +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala new file mode 100644 index 000000000000..ba763eda52a6 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Select(Ident(TermName("Macros")), TermName("foo")) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/pending/run/macro-invalidusage-partialapplication.check b/tests/pending/run/macro-invalidusage-partialapplication.check new file mode 100644 index 000000000000..6cbcb9e5af89 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +too few argument lists for macro invocation diff --git a/tests/pending/run/macro-invalidusage-partialapplication.flags b/tests/pending/run/macro-invalidusage-partialapplication.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala new file mode 100644 index 000000000000..6970b4dd7eef --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { + import c.universe._ + val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) + c.Expr[Unit](body) + } +} + +object Macros { + def foo(x: Int)(y: Int) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala b/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala new file mode 100644 index 000000000000..a0b90ee6be40 --- /dev/null +++ b/tests/pending/run/macro-invalidusage-partialapplication/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(40)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/pending/run/macro-openmacros.check b/tests/pending/run/macro-openmacros.check new file mode 100644 index 000000000000..ba0ae3ff427d --- /dev/null +++ b/tests/pending/run/macro-openmacros.check @@ -0,0 +1,3 @@ +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) +List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +2), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) diff --git a/tests/pending/run/macro-openmacros.flags b/tests/pending/run/macro-openmacros.flags new file mode 100644 index 000000000000..2433c055a48f --- /dev/null +++ b/tests/pending/run/macro-openmacros.flags @@ -0,0 +1,2 @@ +-Yrangepos:false +-language:experimental.macros diff --git a/tests/pending/run/macro-openmacros/Impls_Macros_1.scala b/tests/pending/run/macro-openmacros/Impls_Macros_1.scala new file mode 100644 index 000000000000..b60ca90d9128 --- /dev/null +++ b/tests/pending/run/macro-openmacros/Impls_Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context): c.Expr[Unit] = { + // we're macros, so we can reflect against our source path + // so we don't need any partests to clean up after us! + val dir = c.enclosingUnit.source.file.file.getCanonicalFile.getParentFile + def normalizePaths(s: String) = { + val base = (dir.getCanonicalPath + java.io.File.separator).replace('\\', '/') + var regex = """\Q%s\E""" format base + val isWin = System.getProperty("os.name", "") startsWith "Windows" + if (isWin) regex = "(?i)" + regex + s.replace('\\', '/').replaceAll(regex, "") + } + + import c.universe._ + val next = if (c.enclosingMacros.length < 3) c.Expr[Unit](Select(Ident(c.mirror.staticModule("Macros")), TermName("foo"))) else c.Expr[Unit](Literal(Constant(()))) + c.universe.reify { + println(c.Expr[String](Literal(Constant(normalizePaths(c.enclosingMacros.toString)))).splice) + next.splice + } + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-openmacros/Test_2.scala b/tests/pending/run/macro-openmacros/Test_2.scala new file mode 100644 index 000000000000..d75fbd0db39e --- /dev/null +++ b/tests/pending/run/macro-openmacros/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} diff --git a/tests/pending/run/macro-parse-position-malformed.check b/tests/pending/run/macro-parse-position-malformed.check new file mode 100644 index 000000000000..00f0bc5b6236 --- /dev/null +++ b/tests/pending/run/macro-parse-position-malformed.check @@ -0,0 +1 @@ +failed with 'source-,line-1,offset=7' position and '')' expected but eof found.' message diff --git a/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala b/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala new file mode 100644 index 000000000000..b623d8820ac6 --- /dev/null +++ b/tests/pending/run/macro-parse-position-malformed/Impls_Macros_1.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.ParseException + +object Macros { + def impl(c: Context)() = { + import c.universe._ + val out = try { + c.parse("foo(bar") + "didn't fail" + } catch { + case e: ParseException => + s"failed with '${e.pos}' position and '${e.msg}' message" + } + c.Expr[String](Literal(Constant(out))) + } + def foo(): String = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-parse-position-malformed/Test_2.scala b/tests/pending/run/macro-parse-position-malformed/Test_2.scala new file mode 100644 index 000000000000..1b04d2af2852 --- /dev/null +++ b/tests/pending/run/macro-parse-position-malformed/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} diff --git a/tests/pending/run/macro-parse-position.check b/tests/pending/run/macro-parse-position.check new file mode 100644 index 000000000000..3da0320696d2 --- /dev/null +++ b/tests/pending/run/macro-parse-position.check @@ -0,0 +1,5 @@ +false +source-,line-1,offset=4 +8 +foo bar + diff --git a/tests/pending/run/macro-parse-position.flags b/tests/pending/run/macro-parse-position.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/macro-parse-position.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/macro-parse-position/Impls_Macros_1.scala b/tests/pending/run/macro-parse-position/Impls_Macros_1.scala new file mode 100644 index 000000000000..dd20fd291b57 --- /dev/null +++ b/tests/pending/run/macro-parse-position/Impls_Macros_1.scala @@ -0,0 +1,12 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)() = { + import c.universe._ + val t = c.parse("foo bar") + val out = s"${t.pos == NoPosition}\n${t.pos}\n${t.pos.source.content.length}\n${new String(t.pos.source.content)}" + c.Expr[String](Literal(Constant(out))) + } + def foo(): String = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-parse-position/Test_2.scala b/tests/pending/run/macro-parse-position/Test_2.scala new file mode 100644 index 000000000000..1b04d2af2852 --- /dev/null +++ b/tests/pending/run/macro-parse-position/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) +} diff --git a/tests/pending/run/macro-quasiinvalidbody-c.check b/tests/pending/run/macro-quasiinvalidbody-c.check new file mode 100644 index 000000000000..f70d7bba4ae1 --- /dev/null +++ b/tests/pending/run/macro-quasiinvalidbody-c.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c.flags b/tests/pending/run/macro-quasiinvalidbody-c.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-quasiinvalidbody-c.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala new file mode 100644 index 000000000000..df189b70d3ec --- /dev/null +++ b/tests/pending/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + object Impls { + def foo(c: Context)(x: c.Expr[Any]) = x + } + + def foo(x: Any) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala b/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala new file mode 100644 index 000000000000..91053843dcb1 --- /dev/null +++ b/tests/pending/run/macro-quasiinvalidbody-c/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiquotes.check b/tests/pending/run/macro-quasiquotes.check new file mode 100644 index 000000000000..94ebaf900161 --- /dev/null +++ b/tests/pending/run/macro-quasiquotes.check @@ -0,0 +1,4 @@ +1 +2 +3 +4 diff --git a/tests/pending/run/macro-quasiquotes/Macros_1.scala b/tests/pending/run/macro-quasiquotes/Macros_1.scala new file mode 100644 index 000000000000..764542a8709e --- /dev/null +++ b/tests/pending/run/macro-quasiquotes/Macros_1.scala @@ -0,0 +1,15 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class Impls(val c: Context) { + import c.universe._ + def impl1 = q"println(1)" + def impl2 = q"{ println(2); println(3) }" + def impl3 = q"4" +} + +object Macros { + def m1: Unit = macro Impls.impl1 + def m2: Unit = macro Impls.impl2 + def m3: Int = macro Impls.impl3 +} \ No newline at end of file diff --git a/tests/pending/run/macro-quasiquotes/Test_2.scala b/tests/pending/run/macro-quasiquotes/Test_2.scala new file mode 100644 index 000000000000..b7d203197f3e --- /dev/null +++ b/tests/pending/run/macro-quasiquotes/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.m1 + Macros.m2 + println(Macros.m3) +} diff --git a/tests/pending/run/macro-range.check b/tests/pending/run/macro-range.check new file mode 100644 index 000000000000..07193989308c --- /dev/null +++ b/tests/pending/run/macro-range.check @@ -0,0 +1,9 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/tests/pending/run/macro-range.flags b/tests/pending/run/macro-range.flags new file mode 100644 index 000000000000..5e5dd6ce794e --- /dev/null +++ b/tests/pending/run/macro-range.flags @@ -0,0 +1 @@ +-language:experimental.macros diff --git a/tests/pending/run/macro-range/Common_1.scala b/tests/pending/run/macro-range/Common_1.scala new file mode 100644 index 000000000000..35d2efd76df0 --- /dev/null +++ b/tests/pending/run/macro-range/Common_1.scala @@ -0,0 +1,48 @@ +import scala.reflect.macros.blackbox.Context + +abstract class RangeDefault { + val from, to: Int + def foreach(f: Int => Unit) = { + var i = from + while (i < to) { f(i); i += 1 } + } +} + +/** This class should go into reflect.macro once it is a bit more stable. */ +abstract class Utils { + val context: Context + import context.universe._ + import internal._ + + class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer { + override def transform(tree: Tree): Tree = tree match { + case Ident(_) => + def subst(from: List[Symbol], to: List[Tree]): Tree = + if (from.isEmpty) tree + else if (tree.symbol == from.head) to.head.duplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`? + else subst(from.tail, to.tail); + subst(from, to) + case _ => + val tree1 = super.transform(tree) + if (tree1 ne tree) setType(tree1, null) + tree1 + } + } + def makeApply(fn: Tree, args: List[Tree]): Tree = fn match { + case Function(vparams, body) => + new TreeSubstituter(vparams map (_.symbol), args) transform body + case Block(stats, expr) => + Block(stats, makeApply(expr, args)) + case _ => + // todo. read the compiler config and print if -Ydebug is set + //println("no beta on "+fn+" "+fn.getClass) + Apply(fn, args) + } + def makeWhile(lname: TermName, cond: Tree, body: Tree): Tree = { + val continu = Apply(Ident(lname), Nil) + val rhs = If(cond, Block(List(body), continu), Literal(Constant())) + LabelDef(lname, Nil, rhs) + } + def makeBinop(left: Tree, op: String, right: Tree): Tree = + Apply(Select(left, TermName(op)), List(right)) +} diff --git a/tests/pending/run/macro-range/Expansion_Impossible_2.scala b/tests/pending/run/macro-range/Expansion_Impossible_2.scala new file mode 100644 index 000000000000..b3c2fa3481f4 --- /dev/null +++ b/tests/pending/run/macro-range/Expansion_Impossible_2.scala @@ -0,0 +1,53 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foreach(c: Context)(f: c.Expr[Int => Unit]): c.Expr[Unit] = { + // todo. read the compiler config and print if -Ydebug is set + //println("macro-expand, _this = "+ _this) + object utils extends Utils { val context: c.type = c } + import utils._ + import c.universe._ + import Flag._ + + val initName = termNames.CONSTRUCTOR + // Either: + // scala"{ var i = $low; val h = $hi; while (i < h) { $f(i); i = i + 1 } } + // or: + // scala"($_this: RangeDefault).foreach($f)" + c.Expr(c.prefix.tree match { + case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" => + val iname = TermName("$i") + val hname = TermName("$h") + def iref = Ident(iname) + def href = Ident(hname) + val labelname = TermName("$while") + val cond = makeBinop(iref, "$less", href) + val body = Block( + List(makeApply(f.tree, List(iref))), + Assign(iref, makeBinop(iref, "$plus", Literal(Constant(1))))) + val generated = + Block( + List( + ValDef(Modifiers(MUTABLE), iname, TypeTree(), lo), + ValDef(Modifiers(), hname, TypeTree(), hi)), + makeWhile(labelname, cond, body)) + // todo. read the compiler config and print if -Ydebug is set + //tools.nsc.util.trace("generated: ")(generated) + generated + case _ => + Apply( + Select( + Typed(c.prefix.tree, Ident(TypeName("RangeDefault"))), + TermName("foreach")), + List(f.tree)) + }) + } +} + +class Range(val from: Int, val to: Int) extends RangeDefault { + override def foreach(f: Int => Unit): Unit = macro Impls.foreach +} + +object Test extends dotty.runtime.LegacyApp { + new Range(1, 10) foreach println +} \ No newline at end of file diff --git a/tests/pending/run/macro-range/Expansion_Possible_3.scala b/tests/pending/run/macro-range/Expansion_Possible_3.scala new file mode 100644 index 000000000000..b1fbba765e4c --- /dev/null +++ b/tests/pending/run/macro-range/Expansion_Possible_3.scala @@ -0,0 +1,7 @@ +class Range(val from: Int, val to: Int) extends RangeDefault { + override def foreach(f: Int => Unit): Unit = macro Impls.foreach +} + +object Test extends dotty.runtime.LegacyApp { + new Range(1, 10) foreach println +} \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-args.check b/tests/pending/run/macro-rangepos-args.check new file mode 100644 index 000000000000..d779505c66c1 --- /dev/null +++ b/tests/pending/run/macro-rangepos-args.check @@ -0,0 +1 @@ +Line: 3. Width: 5. diff --git a/tests/pending/run/macro-rangepos-args.flags b/tests/pending/run/macro-rangepos-args.flags new file mode 100644 index 000000000000..fcf951d90723 --- /dev/null +++ b/tests/pending/run/macro-rangepos-args.flags @@ -0,0 +1 @@ +-Yrangepos \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-args/Macros_1.scala b/tests/pending/run/macro-rangepos-args/Macros_1.scala new file mode 100644 index 000000000000..97b938613c5d --- /dev/null +++ b/tests/pending/run/macro-rangepos-args/Macros_1.scala @@ -0,0 +1,10 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(x: c.Tree): c.Tree = { + import c.universe._ + Literal(Constant(s"Line: ${x.pos.line}. Width: ${x.pos.end - x.pos.start}.")) + } + def pos(x: Any): String = macro impl +} diff --git a/tests/pending/run/macro-rangepos-args/Test_2.scala b/tests/pending/run/macro-rangepos-args/Test_2.scala new file mode 100644 index 000000000000..936b945c766e --- /dev/null +++ b/tests/pending/run/macro-rangepos-args/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x = 2 + println(Macros.pos(x + 2)) +} \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-subpatterns.check b/tests/pending/run/macro-rangepos-subpatterns.check new file mode 100644 index 000000000000..760e15d019ba --- /dev/null +++ b/tests/pending/run/macro-rangepos-subpatterns.check @@ -0,0 +1 @@ +The width of the subpattern is: 2 diff --git a/tests/pending/run/macro-rangepos-subpatterns.flags b/tests/pending/run/macro-rangepos-subpatterns.flags new file mode 100644 index 000000000000..fcf951d90723 --- /dev/null +++ b/tests/pending/run/macro-rangepos-subpatterns.flags @@ -0,0 +1 @@ +-Yrangepos \ No newline at end of file diff --git a/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala b/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala new file mode 100644 index 000000000000..0f30862347b6 --- /dev/null +++ b/tests/pending/run/macro-rangepos-subpatterns/Macros_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Any): Any = macro unapplyImpl + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + import internal._ + val pos = subpatterns(x).get.head.pos + q""" + new { + def isEmpty = false + def get = ${"The width of the subpattern is: " + (pos.end - pos.start + 1)} + def unapply(x: Any) = this + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala b/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala new file mode 100644 index 000000000000..b9b308cea880 --- /dev/null +++ b/tests/pending/run/macro-rangepos-subpatterns/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(a) => println(a) + } +} diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi.check b/tests/pending/run/macro-reflective-ma-normal-mdmi.check new file mode 100644 index 000000000000..ac4213d6e97d --- /dev/null +++ b/tests/pending/run/macro-reflective-ma-normal-mdmi.check @@ -0,0 +1 @@ +43 \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi.flags b/tests/pending/run/macro-reflective-ma-normal-mdmi.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reflective-ma-normal-mdmi.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala new file mode 100644 index 000000000000..e964da21060a --- /dev/null +++ b/tests/pending/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala new file mode 100644 index 000000000000..b8d969b836b1 --- /dev/null +++ b/tests/pending/run/macro-reflective-ma-normal-mdmi/Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + println(cm.mkToolBox().eval(tree)) +} diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi.check b/tests/pending/run/macro-reflective-mamd-normal-mi.check new file mode 100644 index 000000000000..920a13966480 --- /dev/null +++ b/tests/pending/run/macro-reflective-mamd-normal-mi.check @@ -0,0 +1 @@ +43 diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala new file mode 100644 index 000000000000..e62db783b2eb --- /dev/null +++ b/tests/pending/run/macro-reflective-mamd-normal-mi/Impls_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } +} diff --git a/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala new file mode 100644 index 000000000000..0b867e7878f1 --- /dev/null +++ b/tests/pending/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala @@ -0,0 +1,20 @@ +//object Macros { +// def foo(x: Int) = macro Impls.foo +//} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.universe.Flag._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + + val macrobody = Select(Ident(TermName("Impls")), TermName("foo")) + val macroparam = ValDef(NoMods, TermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) + val macrodef = DefDef(Modifiers(MACRO), TermName("foo"), Nil, List(List(macroparam)), Ident(TypeName("Int")), macrobody) + val modulector = DefDef(NoMods, termNames.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) + val module = ModuleDef(NoMods, TermName("Macros"), Template(Nil, noSelfType, List(modulector, macrodef))) + val macroapp = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + val tree = Block(List(macrodef, module), macroapp) + val toolbox = cm.mkToolBox(options = "-language:experimental.macros") + println(toolbox.eval(tree)) +} diff --git a/tests/pending/run/macro-reify-abstypetag-notypeparams.check b/tests/pending/run/macro-reify-abstypetag-notypeparams.check new file mode 100644 index 000000000000..7732c10d7535 --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-notypeparams.check @@ -0,0 +1,2 @@ +TypeTag[Int] +TypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-abstypetag-notypeparams/Test.scala b/tests/pending/run/macro-reify-abstypetag-notypeparams/Test.scala new file mode 100644 index 000000000000..cd208668f625 --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-notypeparams/Test.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[WeakTypeTag[Int]]) + println(implicitly[WeakTypeTag[List[Int]]]) +} diff --git a/tests/pending/run/macro-reify-abstypetag-typeparams-notags.check b/tests/pending/run/macro-reify-abstypetag-typeparams-notags.check new file mode 100644 index 000000000000..a741d11ebd62 --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-typeparams-notags.check @@ -0,0 +1,2 @@ +WeakTypeTag[T] +WeakTypeTag[List[T]] diff --git a/tests/pending/run/macro-reify-abstypetag-typeparams-notags/Test.scala b/tests/pending/run/macro-reify-abstypetag-typeparams-notags/Test.scala new file mode 100644 index 000000000000..99f3689ee0de --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-typeparams-notags/Test.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def fooNoTypeTag[T] = { + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) + } + fooNoTypeTag[Int] +} diff --git a/tests/pending/run/macro-reify-abstypetag-typeparams-tags.check b/tests/pending/run/macro-reify-abstypetag-typeparams-tags.check new file mode 100644 index 000000000000..e225e57757ac --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-typeparams-tags.check @@ -0,0 +1,2 @@ +TypeTag[Int] +WeakTypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-abstypetag-typeparams-tags/Test.scala b/tests/pending/run/macro-reify-abstypetag-typeparams-tags/Test.scala new file mode 100644 index 000000000000..75846ee8c5ce --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-typeparams-tags/Test.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def fooTypeTag[T: WeakTypeTag] = { + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) + } + fooTypeTag[Int] +} diff --git a/tests/pending/run/macro-reify-abstypetag-usetypetag.check b/tests/pending/run/macro-reify-abstypetag-usetypetag.check new file mode 100644 index 000000000000..e225e57757ac --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-usetypetag.check @@ -0,0 +1,2 @@ +TypeTag[Int] +WeakTypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-abstypetag-usetypetag/Test.scala b/tests/pending/run/macro-reify-abstypetag-usetypetag/Test.scala new file mode 100644 index 000000000000..7b21555e80b7 --- /dev/null +++ b/tests/pending/run/macro-reify-abstypetag-usetypetag/Test.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def fooTypeTag[T: TypeTag] = { + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) + } + fooTypeTag[Int] +} diff --git a/tests/pending/run/macro-reify-basic.check b/tests/pending/run/macro-reify-basic.check new file mode 100644 index 000000000000..3b18e512dba7 --- /dev/null +++ b/tests/pending/run/macro-reify-basic.check @@ -0,0 +1 @@ +hello world diff --git a/tests/pending/run/macro-reify-basic.flags b/tests/pending/run/macro-reify-basic.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-basic.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-basic/Macros_1.scala b/tests/pending/run/macro-reify-basic/Macros_1.scala new file mode 100644 index 000000000000..1cf2a8a40661 --- /dev/null +++ b/tests/pending/run/macro-reify-basic/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo(s: String) = macro Impls.foo + + object Impls { + def foo(c: Context)(s: c.Expr[String]) = c.universe.reify { + println("hello " + s.splice) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-basic/Test_2.scala b/tests/pending/run/macro-reify-basic/Test_2.scala new file mode 100644 index 000000000000..26b2c7d9ffa4 --- /dev/null +++ b/tests/pending/run/macro-reify-basic/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("world") +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala new file mode 100644 index 000000000000..7f877b2729d4 --- /dev/null +++ b/tests/pending/run/macro-reify-chained1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained1/Test_2.scala b/tests/pending/run/macro-reify-chained1/Test_2.scala new file mode 100644 index 000000000000..01a021893ce8 --- /dev/null +++ b/tests/pending/run/macro-reify-chained1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala new file mode 100644 index 000000000000..965b1910446f --- /dev/null +++ b/tests/pending/run/macro-reify-chained2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-chained2/Test_2.scala b/tests/pending/run/macro-reify-chained2/Test_2.scala new file mode 100644 index 000000000000..01a021893ce8 --- /dev/null +++ b/tests/pending/run/macro-reify-chained2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(x => x).map(x => x) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars.check b/tests/pending/run/macro-reify-freevars.check new file mode 100644 index 000000000000..f618e307b267 --- /dev/null +++ b/tests/pending/run/macro-reify-freevars.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +Macro expansion contains free term variable code defined by map in Macros_1.scala:9:9. Have you forgotten to use splice when splicing this variable into a reifee? If you have troubles tracking free term variables, consider using -Xlog-free-terms diff --git a/tests/pending/run/macro-reify-freevars.flags b/tests/pending/run/macro-reify-freevars.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-freevars.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars/Macros_1.scala b/tests/pending/run/macro-reify-freevars/Macros_1.scala new file mode 100644 index 000000000000..912f602c6c97 --- /dev/null +++ b/tests/pending/run/macro-reify-freevars/Macros_1.scala @@ -0,0 +1,20 @@ +package scala.collection.slick + +object QueryableMacros{ + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: scala.reflect.macros.blackbox.Context) + (projection: c.Expr[T => S]) + : c.Expr[scala.collection.slick.Queryable[S]] = { + import c.universe._ + val code = EmptyTree + c.universe.reify{ + Queryable.factory[S]( code.asInstanceOf[reflect.runtime.universe.Tree] ) + } + } +} +class Queryable[T]{ + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-freevars/Test_2.scala b/tests/pending/run/macro-reify-freevars/Test_2.scala new file mode 100644 index 000000000000..11c8128cd0a8 --- /dev/null +++ b/tests/pending/run/macro-reify-freevars/Test_2.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val q = New(AppliedTypeTree(Select(Select(Select(Ident(TermName("scala")), TermName("collection")), TermName("slick")), TypeName("Queryable")), List(Ident(TermName("Int"))))) + val x = ValDef(NoMods, TermName("x"), Ident(TermName("Int")), EmptyTree) + val fn = Function(List(x), Apply(Select(Ident(TermName("x")), TermName("$plus")), List(Literal(Constant("5"))))) + val tree = Apply(Select(q, TermName("map")), List(fn)) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala new file mode 100644 index 000000000000..7f877b2729d4 --- /dev/null +++ b/tests/pending/run/macro-reify-nested-a1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a1/Test_2.scala b/tests/pending/run/macro-reify-nested-a1/Test_2.scala new file mode 100644 index 000000000000..37282cad750f --- /dev/null +++ b/tests/pending/run/macro-reify-nested-a1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala new file mode 100644 index 000000000000..965b1910446f --- /dev/null +++ b/tests/pending/run/macro-reify-nested-a2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-a2/Test_2.scala b/tests/pending/run/macro-reify-nested-a2/Test_2.scala new file mode 100644 index 000000000000..37282cad750f --- /dev/null +++ b/tests/pending/run/macro-reify-nested-a2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala new file mode 100644 index 000000000000..7f877b2729d4 --- /dev/null +++ b/tests/pending/run/macro-reify-nested-b1/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b1/Test_2.scala b/tests/pending/run/macro-reify-nested-b1/Test_2.scala new file mode 100644 index 000000000000..b9d6846dcdec --- /dev/null +++ b/tests/pending/run/macro-reify-nested-b1/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala b/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala new file mode 100644 index 000000000000..965b1910446f --- /dev/null +++ b/tests/pending/run/macro-reify-nested-b2/Impls_Macros_1.scala @@ -0,0 +1,47 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +case class Utils[C <: Context]( c:C ) { + import c.universe._ + import c.{Tree=>_} + object removeDoubleReify extends c.universe.Transformer { + def apply( tree:Tree ) = transform(tree) + override def transform(tree: Tree): Tree = { + super.transform { + tree match { + case Apply(TypeApply(Select(_this, termname), _), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case Apply(Select(_this, termname), reification::Nil ) + if termname.toString == "factory" => c.unreifyTree(reification) + case _ => tree + } + } + } + } +} +object QueryableMacros{ + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + import c.universe._ + import internal._ + val element_type = implicitly[c.WeakTypeTag[S]].tpe + val foo = c.Expr[ru.Expr[Queryable[S]]]( + c.reifyTree( gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck( + Utils[c.type](c).removeDoubleReify( + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) + ).asInstanceOf[Tree] + ))) + c.universe.reify{ Queryable.factory[S]( foo.splice )} + } + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] + (c: Context) + (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) +} +class Queryable[T]{ + def _map[S]( projection: T => S ) : Queryable[S] = ??? + def map[S]( projection: T => S ) : Queryable[S] = macro QueryableMacros.map[T,S] +} +object Queryable{ + def factory[S]( projection:ru.Expr[Queryable[S]] ) : Queryable[S] = null +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-nested-b2/Test_2.scala b/tests/pending/run/macro-reify-nested-b2/Test_2.scala new file mode 100644 index 000000000000..b9d6846dcdec --- /dev/null +++ b/tests/pending/run/macro-reify-nested-b2/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp{ + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + + locally { + val q : Queryable[Any] = new Queryable[Any] + q.map(e1 => q.map(e2=>e1).map(e2=>e1)) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-ref-to-packageless.check b/tests/pending/run/macro-reify-ref-to-packageless.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/macro-reify-ref-to-packageless.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/macro-reify-ref-to-packageless.flags b/tests/pending/run/macro-reify-ref-to-packageless.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-ref-to-packageless.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala b/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala new file mode 100644 index 000000000000..38ec6f022e1d --- /dev/null +++ b/tests/pending/run/macro-reify-ref-to-packageless/Impls_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + val `Answer to the Ultimate Question of Life, the Universe, and Everything` = 42 + def foo(c: Context) = c.universe.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` } +} diff --git a/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala b/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala new file mode 100644 index 000000000000..ff5b60a6a137 --- /dev/null +++ b/tests/pending/run/macro-reify-ref-to-packageless/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def foo: Int = macro Impls.foo + println(foo) +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-splice-outside-reify.check b/tests/pending/run/macro-reify-splice-outside-reify.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/macro-reify-splice-outside-reify.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/macro-reify-splice-outside-reify.flags b/tests/pending/run/macro-reify-splice-outside-reify.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-splice-outside-reify.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala new file mode 100644 index 000000000000..f038d8714f1e --- /dev/null +++ b/tests/pending/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val x1 = c.Expr[Int](c.untypecheck(x.tree)) + c.Expr[Int](Literal(Constant(c.eval(x1)))) + } +} + +object Macros { + def foo(x: Int) = macro Impls.foo +} diff --git a/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala b/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala new file mode 100644 index 000000000000..f99d40dad587 --- /dev/null +++ b/tests/pending/run/macro-reify-splice-outside-reify/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) + try println(cm.mkToolBox().eval(tree)) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/pending/run/macro-reify-staticXXX.check b/tests/pending/run/macro-reify-staticXXX.check new file mode 100644 index 000000000000..2894fa5843f8 --- /dev/null +++ b/tests/pending/run/macro-reify-staticXXX.check @@ -0,0 +1,12 @@ +object +class +object > object +object > class +package > object +package > class +object +class +object > object +object > class +package > object +package > class \ No newline at end of file diff --git a/tests/pending/run/macro-reify-staticXXX.flags b/tests/pending/run/macro-reify-staticXXX.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-staticXXX.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-staticXXX/Macros_1.scala b/tests/pending/run/macro-reify-staticXXX/Macros_1.scala new file mode 100644 index 000000000000..2993218bb4b5 --- /dev/null +++ b/tests/pending/run/macro-reify-staticXXX/Macros_1.scala @@ -0,0 +1,48 @@ +import scala.reflect.macros.blackbox.Context + +object B { override def toString = "object" } +class C { override def toString = "class" } + +package foo { + object B { override def toString = "package > object" } + class C { override def toString = "package > class" } +} + +object foo { + object B { override def toString = "object > object" } + class C { override def toString = "object > class" } +} + +object packageless { + def impl(c: Context) = { + import c.universe._ + reify { + println(B) + println(new C) + println(foo.B) + println(new foo.C) + println(_root_.foo.B) + println(new _root_.foo.C) + } + } + + def test = macro impl +} + +package packageful { + object Test { + def impl(c: Context) = { + import c.universe._ + reify { + println(B) + println(new C) + println(foo.B) + println(new foo.C) + println(_root_.foo.B) + println(new _root_.foo.C) + } + } + + def test = macro impl + } +} diff --git a/tests/pending/run/macro-reify-staticXXX/Test_2.scala b/tests/pending/run/macro-reify-staticXXX/Test_2.scala new file mode 100644 index 000000000000..4c02e26f61f9 --- /dev/null +++ b/tests/pending/run/macro-reify-staticXXX/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + packageless.test + packageful.Test.test +} diff --git a/tests/pending/run/macro-reify-tagful-a.check b/tests/pending/run/macro-reify-tagful-a.check new file mode 100644 index 000000000000..3f4c7199905f --- /dev/null +++ b/tests/pending/run/macro-reify-tagful-a.check @@ -0,0 +1 @@ +List(hello world) diff --git a/tests/pending/run/macro-reify-tagful-a.flags b/tests/pending/run/macro-reify-tagful-a.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-tagful-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagful-a/Macros_1.scala b/tests/pending/run/macro-reify-tagful-a/Macros_1.scala new file mode 100644 index 000000000000..6f061fd26a37 --- /dev/null +++ b/tests/pending/run/macro-reify-tagful-a/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + + object Impls { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { + List(s.splice) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagful-a/Test_2.scala b/tests/pending/run/macro-reify-tagful-a/Test_2.scala new file mode 100644 index 000000000000..5095ddcaa05c --- /dev/null +++ b/tests/pending/run/macro-reify-tagful-a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val list: List[String] = Macros.foo("hello world") + println(list) +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a.check b/tests/pending/run/macro-reify-tagless-a.check new file mode 100644 index 000000000000..d160e8043ca1 --- /dev/null +++ b/tests/pending/run/macro-reify-tagless-a.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/macro-reify-tagless-a.flags b/tests/pending/run/macro-reify-tagless-a.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-tagless-a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala b/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala new file mode 100644 index 000000000000..faac3e3a3197 --- /dev/null +++ b/tests/pending/run/macro-reify-tagless-a/Impls_Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + + object Impls { + def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { + List[T](s.splice) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-tagless-a/Test_2.scala b/tests/pending/run/macro-reify-tagless-a/Test_2.scala new file mode 100644 index 000000000000..af882664d5c2 --- /dev/null +++ b/tests/pending/run/macro-reify-tagless-a/Test_2.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + //val list: List[String] = Macros.foo("hello world") + //println(list) + + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } +} diff --git a/tests/pending/run/macro-reify-type.check b/tests/pending/run/macro-reify-type.check new file mode 100644 index 000000000000..ea5e70e10dc8 --- /dev/null +++ b/tests/pending/run/macro-reify-type.check @@ -0,0 +1 @@ +[B, That](f: Int => B)(implicit bf: scala.collection.generic.CanBuildFrom[List[Int],B,That])That \ No newline at end of file diff --git a/tests/pending/run/macro-reify-type.flags b/tests/pending/run/macro-reify-type.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-type.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-type/Macros_1.scala b/tests/pending/run/macro-reify-type/Macros_1.scala new file mode 100644 index 000000000000..c38cf8aa524d --- /dev/null +++ b/tests/pending/run/macro-reify-type/Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.blackbox.Context +import scala.reflect.runtime.{universe => ru} + +object StaticReflect { + def method[A](name: String): ru.Type = macro methodImpl[A] + + def methodImpl[A: c.WeakTypeTag](c: Context)(name: c.Expr[String]): c.Expr[ru.Type] = { + import c.universe._ + import internal._ + + val nameName: TermName = name.tree match { + case Literal(Constant(str: String)) => TermName(str) + case _ => c.error(c.enclosingPosition, s"Method name not constant.") ; return reify(ru.NoType) + } + val clazz = weakTypeOf[A] + + clazz member nameName match { + case NoSymbol => c.error(c.enclosingPosition, s"No member called $nameName in $clazz.") ; reify(ru.NoType) + case member => + val mtpe = member infoIn clazz + val mtag = c.reifyType(gen.mkRuntimeUniverseRef, Select(gen.mkRuntimeUniverseRef, TermName("rootMirror")), mtpe) + val mtree = Select(mtag, TermName("tpe")) + + c.Expr[ru.Type](mtree) + } + } + +} diff --git a/tests/pending/run/macro-reify-type/Test_2.scala b/tests/pending/run/macro-reify-type/Test_2.scala new file mode 100644 index 000000000000..c9e56d71814e --- /dev/null +++ b/tests/pending/run/macro-reify-type/Test_2.scala @@ -0,0 +1,21 @@ +import StaticReflect._ + +object Test extends dotty.runtime.LegacyApp { + //println(method[List[Int]]("distinct")) + println(method[List[Int]]("map")) + //val $u: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe; + //val $m: $u.Mirror = scala.reflect.runtime.universe.rootMirror; + //import $u._, $m._, Flag._, internal._ + //val tpe = { + // val symdef$B2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("B"), NoPosition, DEFERRED | PARAM, false); + // val symdef$That2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("That"), NoPosition, DEFERRED | PARAM, false); + // val symdef$f2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("f"), NoPosition, PARAM, false); + // val symdef$bf2 = reificationSupport.newNestedSymbol(reificationSupport.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("bf"), NoPosition, IMPLICIT | PARAM, false); + // reificationSupport.setInfo(symdef$B2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); + // reificationSupport.setInfo(symdef$That2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); + // reificationSupport.setInfo(symdef$f2, TypeRef(ThisType(staticPackage("scala").asModule.moduleClass), staticClass("scala.Function1"), List(staticClass("scala.Int").asType.toTypeConstructor, TypeRef(NoPrefix, symdef$B2, List())))); + // reificationSupport.setInfo(symdef$bf2, TypeRef(ThisType(staticPackage("scala.collection.generic").asModule.moduleClass), staticClass("scala.collection.generic.CanBuildFrom"), List(TypeRef(ThisType(staticPackage("scala.collection.immutable").asModule.moduleClass), staticClass("scala.collection.immutable.List"), List(staticClass("scala.Int").asType.toTypeConstructor)), TypeRef(NoPrefix, symdef$B2, List()), TypeRef(NoPrefix, symdef$That2, List())))); + // PolyType(List(symdef$B2, symdef$That2), MethodType(List(symdef$f2), MethodType(List(symdef$bf2), TypeRef(NoPrefix, symdef$That2, List())))) + //} + //println(tpe) +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-typetag-notypeparams.check b/tests/pending/run/macro-reify-typetag-notypeparams.check new file mode 100644 index 000000000000..7732c10d7535 --- /dev/null +++ b/tests/pending/run/macro-reify-typetag-notypeparams.check @@ -0,0 +1,2 @@ +TypeTag[Int] +TypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala b/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala new file mode 100644 index 000000000000..1eff6e93fe2f --- /dev/null +++ b/tests/pending/run/macro-reify-typetag-notypeparams/Test.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[TypeTag[Int]]) + println(implicitly[TypeTag[List[Int]]]) +} diff --git a/tests/pending/run/macro-reify-typetag-typeparams-tags.check b/tests/pending/run/macro-reify-typetag-typeparams-tags.check new file mode 100644 index 000000000000..7732c10d7535 --- /dev/null +++ b/tests/pending/run/macro-reify-typetag-typeparams-tags.check @@ -0,0 +1,2 @@ +TypeTag[Int] +TypeTag[List[Int]] diff --git a/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala b/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala new file mode 100644 index 000000000000..4540bb6b376f --- /dev/null +++ b/tests/pending/run/macro-reify-typetag-typeparams-tags/Test.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def fooTypeTag[T: TypeTag] = { + println(implicitly[TypeTag[T]]) + println(implicitly[TypeTag[List[T]]]) + } + fooTypeTag[Int] +} diff --git a/tests/pending/run/macro-reify-unreify.check b/tests/pending/run/macro-reify-unreify.check new file mode 100644 index 000000000000..7a6d53c47e80 --- /dev/null +++ b/tests/pending/run/macro-reify-unreify.check @@ -0,0 +1 @@ +hello world = Expr[java.lang.String("hello world")]("hello world") diff --git a/tests/pending/run/macro-reify-unreify.flags b/tests/pending/run/macro-reify-unreify.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-reify-unreify.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-reify-unreify/Macros_1.scala b/tests/pending/run/macro-reify-unreify/Macros_1.scala new file mode 100644 index 000000000000..d92dfa3e24a7 --- /dev/null +++ b/tests/pending/run/macro-reify-unreify/Macros_1.scala @@ -0,0 +1,20 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo(s: String) = macro Impls.foo + + object Impls { + def foo(c: Context)(s: c.Expr[String]) = { + import c.universe._ + import internal._ + + val world = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, s.tree) + val greeting = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, c.typecheck(Apply(Select(Literal(Constant("hello ")), TermName("$plus")), List(c.unreifyTree(world))))) + val typedGreeting = c.Expr[String](greeting) + + c.universe.reify { + println("hello " + s.splice + " = " + typedGreeting.splice) + } + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-reify-unreify/Test_2.scala b/tests/pending/run/macro-reify-unreify/Test_2.scala new file mode 100644 index 000000000000..26b2c7d9ffa4 --- /dev/null +++ b/tests/pending/run/macro-reify-unreify/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("world") +} \ No newline at end of file diff --git a/tests/pending/run/macro-repl-basic.check b/tests/pending/run/macro-repl-basic.check new file mode 100644 index 000000000000..fab03d155833 --- /dev/null +++ b/tests/pending/run/macro-repl-basic.check @@ -0,0 +1,52 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import language.experimental.macros +import language.experimental.macros + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> + +scala> object Impls { + def foo(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + c.Expr[Int](body) + } + + def bar(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + c.Expr[Int](body) + } + + def quux(c: Context)(x: c.Expr[Int]) = { + import c.universe._ + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + c.Expr[Int](body) + } +} +defined object Impls + +scala> object Macros { + object Shmacros { + def foo(x: Int): Int = macro Impls.foo + } + def bar(x: Int): Int = macro Impls.bar +}; class Macros { + def quux(x: Int): Int = macro Impls.quux +} +defined object Macros +defined class Macros + +scala> + +scala> import Macros.Shmacros._ +import Macros.Shmacros._ + +scala> println(foo(2) + Macros.bar(2) * new Macros().quux(4)) +31 + +scala> :quit diff --git a/tests/pending/run/macro-repl-basic.scala b/tests/pending/run/macro-repl-basic.scala new file mode 100644 index 000000000000..217f3bc0eba2 --- /dev/null +++ b/tests/pending/run/macro-repl-basic.scala @@ -0,0 +1,39 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |import scala.reflect.macros.blackbox.Context + | + |object Impls { + | def foo(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) + | c.Expr[Int](body) + | } + | + | def bar(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) + | c.Expr[Int](body) + | } + | + | def quux(c: Context)(x: c.Expr[Int]) = { + | import c.universe._ + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) + | c.Expr[Int](body) + | } + |} + |object Macros { + | object Shmacros { + | def foo(x: Int): Int = macro Impls.foo + | } + | def bar(x: Int): Int = macro Impls.bar + |}; class Macros { + | def quux(x: Int): Int = macro Impls.quux + |} + | + |import Macros.Shmacros._ + |println(foo(2) + Macros.bar(2) * new Macros().quux(4)) + |""".stripMargin +} diff --git a/tests/pending/run/macro-repl-dontexpand.check b/tests/pending/run/macro-repl-dontexpand.check new file mode 100644 index 000000000000..6ecc9245facd --- /dev/null +++ b/tests/pending/run/macro-repl-dontexpand.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def bar1(c: scala.reflect.macros.blackbox.Context) = ??? +bar1: (c: scala.reflect.macros.blackbox.Context)Nothing + +scala> def foo1 = macro bar1 +defined term macro foo1: Nothing + +scala> def bar2(c: scala.reflect.macros.whitebox.Context) = ??? +bar2: (c: scala.reflect.macros.whitebox.Context)Nothing + +scala> def foo2 = macro bar2 +defined term macro foo2: Nothing + +scala> :quit diff --git a/tests/pending/run/macro-repl-dontexpand.scala b/tests/pending/run/macro-repl-dontexpand.scala new file mode 100644 index 000000000000..920f40084f8e --- /dev/null +++ b/tests/pending/run/macro-repl-dontexpand.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-language:experimental.macros" + def code = """ + |def bar1(c: scala.reflect.macros.blackbox.Context) = ??? + |def foo1 = macro bar1 + |def bar2(c: scala.reflect.macros.whitebox.Context) = ??? + |def foo2 = macro bar2 + |""".stripMargin +} diff --git a/tests/pending/run/macro-settings.check b/tests/pending/run/macro-settings.check new file mode 100644 index 000000000000..050d53cdbbc0 --- /dev/null +++ b/tests/pending/run/macro-settings.check @@ -0,0 +1 @@ +List(hello=1) diff --git a/tests/pending/run/macro-settings.flags b/tests/pending/run/macro-settings.flags new file mode 100644 index 000000000000..15479e30b8bd --- /dev/null +++ b/tests/pending/run/macro-settings.flags @@ -0,0 +1 @@ +-language:experimental.macros -Xmacro-settings:hello=1 \ No newline at end of file diff --git a/tests/pending/run/macro-settings/Impls_Macros_1.scala b/tests/pending/run/macro-settings/Impls_Macros_1.scala new file mode 100644 index 000000000000..851a987206c0 --- /dev/null +++ b/tests/pending/run/macro-settings/Impls_Macros_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl(c: Context) = { + import c.universe._ + reify { + println(c.Expr[String](Literal(Constant(c.settings.toString))).splice) + } + } +} + +object Macros { + def foo = macro Impls.impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-settings/Test_2.scala b/tests/pending/run/macro-settings/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/macro-settings/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised.check b/tests/pending/run/macro-sip19-revised.check new file mode 100644 index 000000000000..86c3d819b038 --- /dev/null +++ b/tests/pending/run/macro-sip19-revised.check @@ -0,0 +1,5 @@ +hey, i've been called from SourceLocation1(null,Test_2.scala,11,251) +hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222),Test_2.scala,6,180) +2 diff --git a/tests/pending/run/macro-sip19-revised.flags b/tests/pending/run/macro-sip19-revised.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-sip19-revised.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala b/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala new file mode 100644 index 000000000000..ded4d85cfc63 --- /dev/null +++ b/tests/pending/run/macro-sip19-revised/Impls_Macros_1.scala @@ -0,0 +1,35 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + + val inscope = c.inferImplicitValue(c.mirror.staticClass("SourceLocation").toType) + val outer = c.Expr[SourceLocation](if (!inscope.isEmpty) inscope else Literal(Constant(null))) + + val Apply(fun, args) = c.enclosingImplicits(0).tree + val fileName = fun.pos.source.file.file.getName + val line = fun.pos.line + val charOffset = fun.pos.point + def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) + c.universe.reify { SourceLocation1(outer.splice, literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } + } + + implicit def sourceLocation: SourceLocation1 = macro impl +} + +trait SourceLocation { + /** Source location of the outermost call */ + val outer: SourceLocation + + /** The name of the source file */ + val fileName: String + + /** The line number */ + val line: Int + + /** The character offset */ + val charOffset: Int +} + +case class SourceLocation1(val outer: SourceLocation, val fileName: String, val line: Int, val charOffset: Int) extends SourceLocation \ No newline at end of file diff --git a/tests/pending/run/macro-sip19-revised/Test_2.scala b/tests/pending/run/macro-sip19-revised/Test_2.scala new file mode 100644 index 000000000000..483665ae4fa2 --- /dev/null +++ b/tests/pending/run/macro-sip19-revised/Test_2.scala @@ -0,0 +1,12 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int, y: Int)(implicit loc: SourceLocation): Int = { + println("hey, i've been called from %s".format(loc)) + if (x < y) foo(y, x) + else if (y == 0) x + else foo(x - y, y) + } + + println(foo(4, 2)) +} diff --git a/tests/pending/run/macro-sip19.check b/tests/pending/run/macro-sip19.check new file mode 100644 index 000000000000..07cfd8c1e1e3 --- /dev/null +++ b/tests/pending/run/macro-sip19.check @@ -0,0 +1,5 @@ +hey, i've been called from SourceLocation(Test_2.scala,15,366) +hey, i've been called from SourceLocation(Test_2.scala,11,331) +hey, i've been called from SourceLocation(Test_2.scala,11,331) +hey, i've been called from SourceLocation(Test_2.scala,9,285) +2 diff --git a/tests/pending/run/macro-sip19.flags b/tests/pending/run/macro-sip19.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-sip19.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-sip19/Impls_Macros_1.scala b/tests/pending/run/macro-sip19/Impls_Macros_1.scala new file mode 100644 index 000000000000..f66ab71479b8 --- /dev/null +++ b/tests/pending/run/macro-sip19/Impls_Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val Apply(fun, args) = c.enclosingImplicits(0).tree + val fileName = fun.pos.source.file.file.getName + val line = fun.pos.line + val charOffset = fun.pos.point + def literal[T](x: T) = c.Expr[T](Literal(Constant(x))) + c.universe.reify { SourceLocation(literal(fileName).splice, literal(line).splice, literal(charOffset).splice) } + } + + implicit def sourceLocation: SourceLocation = macro impl +} + +case class SourceLocation( + /** The name of the source file */ + val fileName: String, + + /** The line number */ + val line: Int, + + /** The character offset */ + val charOffset: Int +) \ No newline at end of file diff --git a/tests/pending/run/macro-sip19/Test_2.scala b/tests/pending/run/macro-sip19/Test_2.scala new file mode 100644 index 000000000000..0255f1381d79 --- /dev/null +++ b/tests/pending/run/macro-sip19/Test_2.scala @@ -0,0 +1,16 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Int, y: Int)(implicit loc0: SourceLocation): Int = { + var loc = loc0; + { + var loc0 = 0 // shadow loc0 to disambiguate with the implicit macro + println("hey, i've been called from %s".format(loc)) + if (x < y) foo(y, x) + else if (y == 0) x + else foo(x - y, y) + } + } + + println(foo(4, 2)) +} diff --git a/tests/pending/run/macro-subpatterns.check b/tests/pending/run/macro-subpatterns.check new file mode 100644 index 000000000000..4997146cf2f6 --- /dev/null +++ b/tests/pending/run/macro-subpatterns.check @@ -0,0 +1,3 @@ +Some(List((a @ Extractor((b @ Extractor((c @ _))))))) +Some(List((b @ Extractor((c @ _))))) +Some(List((c @ _))) diff --git a/tests/pending/run/macro-subpatterns/Macro_1.scala b/tests/pending/run/macro-subpatterns/Macro_1.scala new file mode 100644 index 000000000000..e009e411a2d7 --- /dev/null +++ b/tests/pending/run/macro-subpatterns/Macro_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Any): Any = macro unapplyImpl + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + import internal._ + q""" + new { + def isEmpty = false + def get = ${subpatterns(x).toString} + def unapply(x: Any) = this + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/macro-subpatterns/Test_2.scala b/tests/pending/run/macro-subpatterns/Test_2.scala new file mode 100644 index 000000000000..b19bd9b9ba0c --- /dev/null +++ b/tests/pending/run/macro-subpatterns/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(a @ Extractor(b @ Extractor(c))) => println(a); println(b); println(c) + } +} diff --git a/tests/pending/run/macro-system-properties.check b/tests/pending/run/macro-system-properties.check new file mode 100644 index 000000000000..e2e2bd32b9d3 --- /dev/null +++ b/tests/pending/run/macro-system-properties.check @@ -0,0 +1,22 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental._, scala.reflect.macros.blackbox.Context +import scala.language.experimental._ +import scala.reflect.macros.blackbox.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)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } + def grab(): Unit = 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> :quit diff --git a/tests/pending/run/macro-system-properties.scala b/tests/pending/run/macro-system-properties.scala new file mode 100644 index 000000000000..db88eb7df67f --- /dev/null +++ b/tests/pending/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 scala.language.experimental._, scala.reflect.macros.blackbox.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)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") } + def grab(): Unit = macro impl + } + object Test { class C(implicit a: Any) { GrabContext.grab } } + object Test { class C(implicit a: Any) { GrabContext.grab } } + """ +} diff --git a/tests/pending/run/macro-term-declared-in-annotation.check b/tests/pending/run/macro-term-declared-in-annotation.check new file mode 100644 index 000000000000..7658ad2c24a4 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-annotation.check @@ -0,0 +1 @@ +it works diff --git a/tests/pending/run/macro-term-declared-in-annotation.flags b/tests/pending/run/macro-term-declared-in-annotation.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-annotation.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala b/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala new file mode 100644 index 000000000000..c4bcfbc1ba45 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-annotation/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Literal(Constant("this is deprecated"))) + c.Expr[String](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala b/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala new file mode 100644 index 000000000000..40d71c62fb13 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-annotation/Macros_2.scala @@ -0,0 +1,8 @@ +class foo(val bar: String) extends annotation.StaticAnnotation + +object Api { + // foo in ann must have a different name + // otherwise, we get bitten by https://issues.scala-lang.org/browse/SI-5544 + @foo({def fooInAnn = macro Impls.foo; fooInAnn}) + def foo = println("it works") +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala b/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala new file mode 100644 index 000000000000..322ef9eb1899 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-annotation/Test_3.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Api.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous.check b/tests/pending/run/macro-term-declared-in-anonymous.check new file mode 100644 index 000000000000..09b8d015a6bf --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-anonymous.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.macros) +it works diff --git a/tests/pending/run/macro-term-declared-in-anonymous.flags b/tests/pending/run/macro-term-declared-in-anonymous.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-anonymous.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala b/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-anonymous/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala new file mode 100644 index 000000000000..894947e1ee2b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-anonymous/Macros_Test_2.scala @@ -0,0 +1,6 @@ +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val macros = new { def foo: Unit = macro Impls.foo } + macros.foo +} diff --git a/tests/pending/run/macro-term-declared-in-block.check b/tests/pending/run/macro-term-declared-in-block.check new file mode 100644 index 000000000000..5e687db8bf87 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-block.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing]() +it works diff --git a/tests/pending/run/macro-term-declared-in-block.flags b/tests/pending/run/macro-term-declared-in-block.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-block.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-block/Impls_1.scala b/tests/pending/run/macro-term-declared-in-block/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-block/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala new file mode 100644 index 000000000000..eba5e4961c50 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-block/Macros_Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + { + def foo: Unit = macro Impls.foo + foo + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class.check b/tests/pending/run/macro-term-declared-in-class-class.check new file mode 100644 index 000000000000..47248d7af777 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Test.this.outer.Macros()) +it works diff --git a/tests/pending/run/macro-term-declared-in-class-class.flags b/tests/pending/run/macro-term-declared-in-class-class.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala new file mode 100644 index 000000000000..7f813a30d693 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-class/Macros_Test_2.scala @@ -0,0 +1,10 @@ +class Macros { + class Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = new Macros() + new outer.Macros().foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object.check b/tests/pending/run/macro-term-declared-in-class-object.check new file mode 100644 index 000000000000..35af59e40f10 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.outer.Macros) +it works diff --git a/tests/pending/run/macro-term-declared-in-class-object.flags b/tests/pending/run/macro-term-declared-in-class-object.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala new file mode 100644 index 000000000000..12c6328c9585 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class-object/Macros_Test_2.scala @@ -0,0 +1,10 @@ +class Macros { + object Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = new Macros() + outer.Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class.check b/tests/pending/run/macro-term-declared-in-class.check new file mode 100644 index 000000000000..a1c1d7af8ba1 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Macros()) +it works diff --git a/tests/pending/run/macro-term-declared-in-class.flags b/tests/pending/run/macro-term-declared-in-class.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-class/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala new file mode 100644 index 000000000000..0c9a7ccf00c2 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-class/Macros_Test_2.scala @@ -0,0 +1,7 @@ +class Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + new Macros().foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param.check b/tests/pending/run/macro-term-declared-in-default-param.check new file mode 100644 index 000000000000..6decd7aa4dd5 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-default-param.check @@ -0,0 +1,5 @@ +prefix = Expr[Nothing]() +it works +it works +prefix = Expr[Nothing]() +it works diff --git a/tests/pending/run/macro-term-declared-in-default-param.flags b/tests/pending/run/macro-term-declared-in-default-param.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-default-param.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala b/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala new file mode 100644 index 000000000000..ef0f1361395e --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-default-param/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Literal(Constant("it works"))) + c.Expr[String](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala new file mode 100644 index 000000000000..856a4e44f995 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-default-param/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(bar: String = { def foo: String = macro Impls.foo; foo }) = println(bar) + + foo() + foo("it works") + foo() +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class.check b/tests/pending/run/macro-term-declared-in-implicit-class.check new file mode 100644 index 000000000000..5dc968c08c6a --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-implicit-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros.foo("2")) +Some(2) diff --git a/tests/pending/run/macro-term-declared-in-implicit-class.flags b/tests/pending/run/macro-term-declared-in-implicit-class.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-implicit-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala b/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala new file mode 100644 index 000000000000..ef00f6ff322d --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def toOptionOfInt(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, TermName("x")), TermName("toInt"))))) + c.Expr[Option[Int]](body) + } +} + +object Macros { + implicit def foo(x: String): Foo = new Foo(x) + + class Foo(val x: String) { + def toOptionOfInt = macro Impls.toOptionOfInt + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala b/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala new file mode 100644 index 000000000000..fd67062bec6f --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-implicit-class/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println("2".toOptionOfInt) +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method.check b/tests/pending/run/macro-term-declared-in-method.check new file mode 100644 index 000000000000..5e687db8bf87 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-method.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing]() +it works diff --git a/tests/pending/run/macro-term-declared-in-method.flags b/tests/pending/run/macro-term-declared-in-method.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-method.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method/Impls_1.scala b/tests/pending/run/macro-term-declared-in-method/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-method/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala new file mode 100644 index 000000000000..d40eb4c6048e --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-method/Macros_Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + def bar() = { + def foo: Unit = macro Impls.foo + foo + } + + bar() +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class.check b/tests/pending/run/macro-term-declared-in-object-class.check new file mode 100644 index 000000000000..47248d7af777 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-class.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](new Test.this.outer.Macros()) +it works diff --git a/tests/pending/run/macro-term-declared-in-object-class.flags b/tests/pending/run/macro-term-declared-in-object-class.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-class.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-class/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala new file mode 100644 index 000000000000..89aed84c7067 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-class/Macros_Test_2.scala @@ -0,0 +1,10 @@ +object Macros { + class Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = Macros + new outer.Macros().foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object.check b/tests/pending/run/macro-term-declared-in-object-object.check new file mode 100644 index 000000000000..35af59e40f10 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.outer.Macros) +it works diff --git a/tests/pending/run/macro-term-declared-in-object-object.flags b/tests/pending/run/macro-term-declared-in-object-object.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala new file mode 100644 index 000000000000..c5950fe61a1a --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object-object/Macros_Test_2.scala @@ -0,0 +1,10 @@ +object Macros { + object Macros { + def foo: Unit = macro Impls.foo + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer = Macros + outer.Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object.check b/tests/pending/run/macro-term-declared-in-object.check new file mode 100644 index 000000000000..4d955a96b1c0 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros) +it works diff --git a/tests/pending/run/macro-term-declared-in-object.flags b/tests/pending/run/macro-term-declared-in-object.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-object/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala new file mode 100644 index 000000000000..f89a21d9206f --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-object/Macros_Test_2.scala @@ -0,0 +1,7 @@ +object Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object.check b/tests/pending/run/macro-term-declared-in-package-object.check new file mode 100644 index 000000000000..bc0069178d0f --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-package-object.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Macros.`package`) +it works diff --git a/tests/pending/run/macro-term-declared-in-package-object.flags b/tests/pending/run/macro-term-declared-in-package-object.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-package-object.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala b/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-package-object/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala new file mode 100644 index 000000000000..69f3803badd0 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-package-object/Macros_Test_2.scala @@ -0,0 +1,8 @@ +package object Macros { + def foo: Unit = macro Impls.foo +} + +object Test extends dotty.runtime.LegacyApp { + import Macros._ + foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement.check b/tests/pending/run/macro-term-declared-in-refinement.check new file mode 100644 index 000000000000..09b8d015a6bf --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-refinement.check @@ -0,0 +1,2 @@ +prefix = Expr[Nothing](Test.this.macros) +it works diff --git a/tests/pending/run/macro-term-declared-in-refinement.flags b/tests/pending/run/macro-term-declared-in-refinement.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-refinement.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala b/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-refinement/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala new file mode 100644 index 000000000000..49192291e3c3 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-refinement/Macros_Test_2.scala @@ -0,0 +1,8 @@ +import scala.language.reflectiveCalls + +class Base + +object Test extends dotty.runtime.LegacyApp { + val macros = new Base { def foo: Unit = macro Impls.foo } + macros.foo +} diff --git a/tests/pending/run/macro-term-declared-in-trait.check b/tests/pending/run/macro-term-declared-in-trait.check new file mode 100644 index 000000000000..0f3756ddb661 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-trait.check @@ -0,0 +1,15 @@ +prefix = Expr[Nothing]({ + final class $anon extends AnyRef with Base { + def (): <$anon: Base> = { + $anon.super.(); + () + }; + + }; + new $anon() +}) +it works +prefix = Expr[Nothing](Macros) +it works +prefix = Expr[Nothing](new Macros()) +it works diff --git a/tests/pending/run/macro-term-declared-in-trait.flags b/tests/pending/run/macro-term-declared-in-trait.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-trait.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala b/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala new file mode 100644 index 000000000000..c43f5f3f535b --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-trait/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala b/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala new file mode 100644 index 000000000000..5780aba45b5d --- /dev/null +++ b/tests/pending/run/macro-term-declared-in-trait/Macros_Test_2.scala @@ -0,0 +1,13 @@ +trait Base { + def foo: Unit = macro Impls.foo +} + +object Macros extends Base + +class Macros extends Base + +object Test extends dotty.runtime.LegacyApp { + (new Base {}).foo + Macros.foo + new Macros().foo +} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled.check b/tests/pending/run/macro-typecheck-implicitsdisabled.check new file mode 100644 index 000000000000..91d8fabd72b7 --- /dev/null +++ b/tests/pending/run/macro-typecheck-implicitsdisabled.check @@ -0,0 +1,2 @@ +scala.this.Predef.ArrowAssoc[Int](1).->[Int](2) +scala.reflect.macros.TypecheckException: value -> is not a member of Int diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled.flags b/tests/pending/run/macro-typecheck-implicitsdisabled.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-typecheck-implicitsdisabled.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala new file mode 100644 index 000000000000..956331cfae7e --- /dev/null +++ b/tests/pending/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_implicits_enabled(c: Context) = { + import c.universe._ + + val tree1 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + val ttree1 = c.typecheck(tree1, withImplicitViewsDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_implicits_enabled = macro impl_with_implicits_enabled + + def impl_with_implicits_disabled(c: Context) = { + import c.universe._ + + try { + val tree2 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + val ttree2 = c.typecheck(tree2, withImplicitViewsDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } catch { + case ex: Throwable => + c.Expr[String](Literal(Constant(ex.toString))) + } + } + + def foo_with_implicits_disabled = macro impl_with_implicits_disabled +} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala b/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala new file mode 100644 index 000000000000..87d3148e9b28 --- /dev/null +++ b/tests/pending/run/macro-typecheck-implicitsdisabled/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_implicits_enabled) + println(Macros.foo_with_implicits_disabled) +} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled.check b/tests/pending/run/macro-typecheck-macrosdisabled.check new file mode 100644 index 000000000000..c618d22d8d6a --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled.check @@ -0,0 +1,32 @@ +({ + val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; + val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); + $u.Expr.apply[Int(2)]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Literal.apply($u.Constant.apply(2)) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Int(2)]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) + } + }; + new $typecreator2() + })) +}: reflect.runtime.universe.Expr[Int]) +ru.reify[Int](2) diff --git a/tests/pending/run/macro-typecheck-macrosdisabled.flags b/tests/pending/run/macro-typecheck-macrosdisabled.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala new file mode 100644 index 000000000000..0e549f4ab836 --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala @@ -0,0 +1,31 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_macros_enabled(c: Context) = { + import c.universe._ + + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Literal(Constant(2)))) + val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_macros_enabled = macro impl_with_macros_enabled + + def impl_with_macros_disabled(c: Context) = { + import c.universe._ + import internal._ + + val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } + + def foo_with_macros_disabled = macro impl_with_macros_disabled +} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala b/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala new file mode 100644 index 000000000000..887f28c8c2be --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_macros_enabled) + println(Macros.foo_with_macros_disabled) +} \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2.check b/tests/pending/run/macro-typecheck-macrosdisabled2.check new file mode 100644 index 000000000000..2e862a60899f --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled2.check @@ -0,0 +1,32 @@ +({ + val $u: reflect.runtime.universe.type = scala.reflect.runtime.`package`.universe; + val $m: $u.Mirror = scala.reflect.runtime.`package`.universe.runtimeMirror(this.getClass().getClassLoader()); + $u.Expr.apply[Array[Int]]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Array[Int]]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) + } + }; + new $typecreator2() + })) +}: reflect.runtime.universe.Expr[Array[Int]]) +ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2.flags b/tests/pending/run/macro-typecheck-macrosdisabled2.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled2.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala new file mode 100644 index 000000000000..f99f5d2f8039 --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala @@ -0,0 +1,31 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl_with_macros_enabled(c: Context) = { + import c.universe._ + + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree1 = c.typecheck(tree1, withMacrosDisabled = false) + c.Expr[String](Literal(Constant(ttree1.toString))) + } + + def foo_with_macros_enabled = macro impl_with_macros_enabled + + def impl_with_macros_disabled(c: Context) = { + import c.universe._ + import internal._ + + val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree2 = c.typecheck(tree2, withMacrosDisabled = true) + c.Expr[String](Literal(Constant(ttree2.toString))) + } + + def foo_with_macros_disabled = macro impl_with_macros_disabled +} diff --git a/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala b/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala new file mode 100644 index 000000000000..887f28c8c2be --- /dev/null +++ b/tests/pending/run/macro-typecheck-macrosdisabled2/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo_with_macros_enabled) + println(Macros.foo_with_macros_disabled) +} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls.check b/tests/pending/run/macro-undetparams-consfromsls.check new file mode 100644 index 000000000000..3fee58d9c191 --- /dev/null +++ b/tests/pending/run/macro-undetparams-consfromsls.check @@ -0,0 +1,5 @@ +A = WeakTypeTag[Int] +B = WeakTypeTag[Nothing] +List(1) +A = WeakTypeTag[Any] +List(abc, 1) diff --git a/tests/pending/run/macro-undetparams-consfromsls.flags b/tests/pending/run/macro-undetparams-consfromsls.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-undetparams-consfromsls.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala new file mode 100644 index 000000000000..5df5f96aa8d1 --- /dev/null +++ b/tests/pending/run/macro-undetparams-consfromsls/Impls_Macros_1.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def cons_impl[A: c.WeakTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = { + import c.universe._ + reify { + println("A = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[A]].toString))).splice) + x.splice :: xs.splice + } + } + + def nil_impl[B: c.WeakTypeTag](c: Context): c.Expr[List[B]] = { + import c.universe._ + reify { + println("B = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[B]].toString))).splice) + Nil + } + } + + def cons[A](x: A, xs: List[A]): List[A] = macro cons_impl[A] + + def nil[B]: List[B] = macro nil_impl[B] +} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala b/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala new file mode 100644 index 000000000000..3386844018c6 --- /dev/null +++ b/tests/pending/run/macro-undetparams-consfromsls/Test_2.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + val xs = cons(1, nil) + println(xs) + val ys = cons("abc", xs) + println(ys) +} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-implicitval.check b/tests/pending/run/macro-undetparams-implicitval.check new file mode 100644 index 000000000000..541b922b2186 --- /dev/null +++ b/tests/pending/run/macro-undetparams-implicitval.check @@ -0,0 +1 @@ +TypeTag[Nothing] diff --git a/tests/pending/run/macro-undetparams-implicitval.flags b/tests/pending/run/macro-undetparams-implicitval.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-undetparams-implicitval.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-implicitval/Test.scala b/tests/pending/run/macro-undetparams-implicitval/Test.scala new file mode 100644 index 000000000000..5e38618f6031 --- /dev/null +++ b/tests/pending/run/macro-undetparams-implicitval/Test.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def foo[T: TypeTag] = println(implicitly[TypeTag[T]]) + foo +} diff --git a/tests/pending/run/macro-undetparams-macroitself.check b/tests/pending/run/macro-undetparams-macroitself.check new file mode 100644 index 000000000000..a9bf55423ea6 --- /dev/null +++ b/tests/pending/run/macro-undetparams-macroitself.check @@ -0,0 +1,2 @@ +WeakTypeTag[Int] +WeakTypeTag[String] diff --git a/tests/pending/run/macro-undetparams-macroitself.flags b/tests/pending/run/macro-undetparams-macroitself.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/macro-undetparams-macroitself.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala new file mode 100644 index 000000000000..1eb257e1d9b5 --- /dev/null +++ b/tests/pending/run/macro-undetparams-macroitself/Impls_Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl[T: c.WeakTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = { + import c.universe._ + reify { println(c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[T]].toString))).splice) } + } + + def foo[T](foo: T) = macro impl[T] +} \ No newline at end of file diff --git a/tests/pending/run/macro-undetparams-macroitself/Test_2.scala b/tests/pending/run/macro-undetparams-macroitself/Test_2.scala new file mode 100644 index 000000000000..c315f35087a2 --- /dev/null +++ b/tests/pending/run/macro-undetparams-macroitself/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo(42) + Macros.foo("42") +} \ No newline at end of file diff --git a/tests/pending/run/macro-vampire-false-warning.check b/tests/pending/run/macro-vampire-false-warning.check new file mode 100644 index 000000000000..4792e70f3330 --- /dev/null +++ b/tests/pending/run/macro-vampire-false-warning.check @@ -0,0 +1,2 @@ +2 +3 diff --git a/tests/pending/run/macro-vampire-false-warning.flags b/tests/pending/run/macro-vampire-false-warning.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/macro-vampire-false-warning.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/macro-vampire-false-warning/Macros_1.scala b/tests/pending/run/macro-vampire-false-warning/Macros_1.scala new file mode 100644 index 000000000000..63c34b3ab666 --- /dev/null +++ b/tests/pending/run/macro-vampire-false-warning/Macros_1.scala @@ -0,0 +1,52 @@ +// As per http://meta.plasm.us/posts/2013/08/31/feeding-our-vampires/ + +import scala.annotation.StaticAnnotation +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +class body(tree: Any) extends StaticAnnotation + +object Macros { + def selFieldImpl(c: Context) = { + import c.universe._ + val field = c.macroApplication.symbol + val bodyAnn = field.annotations.filter(_.tree.tpe <:< typeOf[body]).head + c.Expr[Any](bodyAnn.tree.children(1)) + } + + def mkObjectImpl(c: Context)(xs: c.Expr[Any]*) = { + import c.universe._ + import Flag._ + // val kvps = xs.toList map { case q"${_}(${Literal(Constant(name: String))}).->[${_}]($value)" => name -> value } + val kvps = xs.map(_.tree).toList map { case Apply(TypeApply(Select(Apply(_, List(Literal(Constant(name: String)))), _), _), List(value)) => name -> value } + // val fields = kvps map { case (k, v) => q"@body($v) def ${TermName(k)} = macro Macros.selFieldImpl" } + val fields = kvps map { case (k, v) => DefDef( + Modifiers(MACRO, typeNames.EMPTY, List(Apply(Select(New(Ident(TypeName("body"))), termNames.CONSTRUCTOR), List(v)))), + TermName(k), Nil, Nil, Ident(TypeName("Any")), Select(Ident(TermName("Macros")), TermName("selFieldImpl"))) } + // q"import scala.language.experimental.macros; class Workaround { ..$fields }; new Workaround{}" + c.Expr[Any](Block( + List( + Import(Select(Select(Ident(TermName("scala")), TermName("language")), TermName("experimental")), List(ImportSelector(TermName("macros"), 51, TermName("macros"), 51))), + ClassDef( + NoMods, TypeName("Workaround"), Nil, + Template( + List(Select(Ident(TermName("scala")), TypeName("AnyRef"))), noSelfType, + DefDef( + NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))) + +: fields)), + ClassDef( + Modifiers(FINAL), TypeName("$anon"), Nil, + Template( + List(Ident(TypeName("Workaround"))), noSelfType, + List( + DefDef( + NoMods, termNames.CONSTRUCTOR, Nil, List(Nil), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))))))), + Apply(Select(New(Ident(TypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} + +object mkObject { + def apply(xs: Any*): Any = macro Macros.mkObjectImpl +} diff --git a/tests/pending/run/macro-vampire-false-warning/Test_2.scala b/tests/pending/run/macro-vampire-false-warning/Test_2.scala new file mode 100644 index 000000000000..d28849b88df3 --- /dev/null +++ b/tests/pending/run/macro-vampire-false-warning/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + val foo = mkObject("x" -> "2", "y" -> 3) + println(foo.x) + println(foo.y) + // println(foo.z) => will result in a compilation error +} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization.check b/tests/pending/run/macro-whitebox-dynamic-materialization.check new file mode 100644 index 000000000000..ccec8e5b25f5 --- /dev/null +++ b/tests/pending/run/macro-whitebox-dynamic-materialization.check @@ -0,0 +1,2 @@ +null +C2 diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala b/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala new file mode 100644 index 000000000000..aaf27c2896a5 --- /dev/null +++ b/tests/pending/run/macro-whitebox-dynamic-materialization/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +trait Foo[T] + +class C1(val x: Int) +class C2(val x: String) + +trait LowPriority { + implicit def lessSpecific[T]: Foo[T] = null +} + +object Foo extends LowPriority { + implicit def moreSpecific[T]: Foo[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + val tpe = weakTypeOf[T] + if (tpe.members.exists(_.info =:= typeOf[Int])) + c.abort(c.enclosingPosition, "I don't like classes that contain integers") + q"new Foo[$tpe]{ override def toString = ${tpe.toString} }" + } +} diff --git a/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala b/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala new file mode 100644 index 000000000000..10d89dd3cc6d --- /dev/null +++ b/tests/pending/run/macro-whitebox-dynamic-materialization/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[Foo[C1]]) + println(implicitly[Foo[C2]]) +} diff --git a/tests/pending/run/macro-whitebox-extractor.check b/tests/pending/run/macro-whitebox-extractor.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/macro-whitebox-extractor.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/macro-whitebox-extractor/Macros_1.scala b/tests/pending/run/macro-whitebox-extractor/Macros_1.scala new file mode 100644 index 000000000000..d394c0241a00 --- /dev/null +++ b/tests/pending/run/macro-whitebox-extractor/Macros_1.scala @@ -0,0 +1,21 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Extractor { + def unapply(x: Int): Any = macro Macros.unapplyImpl +} + +object Macros { + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/macro-whitebox-extractor/Test_2.scala b/tests/pending/run/macro-whitebox-extractor/Test_2.scala new file mode 100644 index 000000000000..7c354ecd654d --- /dev/null +++ b/tests/pending/run/macro-whitebox-extractor/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + 42 match { + case Extractor(x) => println(x) + } +} diff --git a/tests/pending/run/macro-whitebox-fundep-materialization.check b/tests/pending/run/macro-whitebox-fundep-materialization.check new file mode 100644 index 000000000000..bed7429108cc --- /dev/null +++ b/tests/pending/run/macro-whitebox-fundep-materialization.check @@ -0,0 +1 @@ +(23,foo,true) diff --git a/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala b/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala new file mode 100644 index 000000000000..5e89e6b2f8f5 --- /dev/null +++ b/tests/pending/run/macro-whitebox-fundep-materialization/Macros_1.scala @@ -0,0 +1,39 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +trait Iso[T, U] { + def to(t : T) : U + // def from(u : U) : T +} + +object Iso { + implicit def materializeIso[T, U]: Iso[T, U] = macro impl[T, U] + def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context): c.Expr[Iso[T, U]] = { + import c.universe._ + import definitions._ + import Flag._ + + val sym = c.weakTypeOf[T].typeSymbol + if (!sym.isClass || !sym.asClass.isCaseClass) c.abort(c.enclosingPosition, s"$sym is not a case class") + val fields = sym.info.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + + def mkTpt() = { + val core = Ident(TupleClass(fields.length) orElse UnitClass) + if (fields.length == 0) core + else AppliedTypeTree(core, fields map (f => TypeTree(f.info))) + } + + def mkFrom() = { + if (fields.length == 0) Literal(Constant(Unit)) + else Apply(Ident(newTermName("Tuple" + fields.length)), fields map (f => Select(Ident(newTermName("f")), newTermName(f.name.toString.trim)))) + } + + val evidenceClass = ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template( + List(AppliedTypeTree(Ident(newTypeName("Iso")), List(Ident(sym), mkTpt()))), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("to"), List(), List(List(ValDef(Modifiers(PARAM), newTermName("f"), Ident(sym), EmptyTree))), TypeTree(), mkFrom())))) + c.Expr[Iso[T, U]](Block(List(evidenceClass), Apply(Select(New(Ident(newTypeName("$anon"))), termNames.CONSTRUCTOR), List()))) + } +} diff --git a/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala b/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala new file mode 100644 index 000000000000..72183ba8639b --- /dev/null +++ b/tests/pending/run/macro-whitebox-fundep-materialization/Test_2.scala @@ -0,0 +1,12 @@ +// see the comments for macroExpand.onDelayed for an explanation of what's tested here +object Test extends dotty.runtime.LegacyApp { + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: Iso[C, L]): L = iso.to(c) + + { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } +} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-structural.check b/tests/pending/run/macro-whitebox-structural.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/macro-whitebox-structural.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala b/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala new file mode 100644 index 000000000000..45fdb79c3045 --- /dev/null +++ b/tests/pending/run/macro-whitebox-structural/Impls_Macros_1.scala @@ -0,0 +1,16 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macro-whitebox-structural/Test_2.scala b/tests/pending/run/macro-whitebox-structural/Test_2.scala new file mode 100644 index 000000000000..6fa47e1ddf2d --- /dev/null +++ b/tests/pending/run/macro-whitebox-structural/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo.x) +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala b/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala new file mode 100644 index 000000000000..a90dd702dfe9 --- /dev/null +++ b/tests/pending/run/macroPlugins-isBlackbox/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"42" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala b/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala new file mode 100644 index 000000000000..b78a18ea6a76 --- /dev/null +++ b/tests/pending/run/macroPlugins-isBlackbox/Plugin_1.scala @@ -0,0 +1,21 @@ +package isblackbox + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + import scala.reflect.internal.Mode + + val name = "isBlackbox" + val description = "A sample analyzer plugin that overrides isBlackbox." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsIsBlackbox(macroDef: Symbol): Option[Boolean] = { + Some(false) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags b/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags new file mode 100644 index 000000000000..966df731d030 --- /dev/null +++ b/tests/pending/run/macroPlugins-isBlackbox/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala b/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala new file mode 100644 index 000000000000..f191e5de31f5 --- /dev/null +++ b/tests/pending/run/macroPlugins-isBlackbox/Test_3.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + val x: Int = Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml b/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml new file mode 100644 index 000000000000..09b9c14648b1 --- /dev/null +++ b/tests/pending/run/macroPlugins-isBlackbox/scalac-plugin.xml @@ -0,0 +1,4 @@ + + is-blackbox + isblackbox.Plugin + \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs.check b/tests/pending/run/macroPlugins-macroArgs.check new file mode 100644 index 000000000000..a68f8069b63d --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs.check @@ -0,0 +1,2 @@ +hijacked 1 +hijacked 2 diff --git a/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala b/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala new file mode 100644 index 000000000000..b19b8f18dc2f --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(arg: c.Tree) = { + import c.universe._ + q"""println($arg)""" + } + + def foo(arg: String): Unit = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala b/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala new file mode 100644 index 000000000000..23e80ced3bdd --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs/Plugin_1.scala @@ -0,0 +1,21 @@ +package macroArgs + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "macroArgs" + val description = "A sample analyzer plugin that overrides macroArgs." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroArgs(typer: Typer, expandee: Tree): Option[MacroArgs] = { + val MacroArgs(c, List(Literal(Constant(s: String)))) = standardMacroArgs(typer, expandee) + Some(MacroArgs(c, List(Literal(Constant("hijacked " + s))))) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Test_3.flags b/tests/pending/run/macroPlugins-macroArgs/Test_3.flags new file mode 100644 index 000000000000..966df731d030 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/Test_3.scala b/tests/pending/run/macroPlugins-macroArgs/Test_3.scala new file mode 100644 index 000000000000..8d3be78bbf1a --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("1") + Macros.foo("2") +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml new file mode 100644 index 000000000000..0849f0f4ea9c --- /dev/null +++ b/tests/pending/run/macroPlugins-macroArgs/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-args + macroArgs.Plugin + \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand.check b/tests/pending/run/macroPlugins-macroExpand.check new file mode 100644 index 000000000000..6f685c2af4aa --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand.check @@ -0,0 +1,2 @@ +expanded into println("impl1") +expanded into println("impl2") diff --git a/tests/pending/run/macroPlugins-macroExpand.flags b/tests/pending/run/macroPlugins-macroExpand.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala b/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala new file mode 100644 index 000000000000..c9c88ad2fdfd --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand/Macros_2.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q"""println("impl1")""" + } + + def impl2(c: Context) = { + import c.universe._ + q"""println("impl2")""" + } + + def foo1: Unit = macro impl1 + + def foo2: Unit = macro impl2 +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala b/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala new file mode 100644 index 000000000000..13df85cb23a9 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand/Plugin_1.scala @@ -0,0 +1,27 @@ +package macroExpand + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + import scala.reflect.internal.Mode + + val name = "macroExpand" + val description = "A sample analyzer plugin that overrides macroExpand." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroExpand(typer: Typer, expandee: Tree, mode: Mode, pt: Type): Option[Tree] = { + object expander extends DefMacroExpander(typer, expandee, mode, pt) { + override def onSuccess(expanded: Tree) = { + val message = s"expanded into ${expanded.toString}" + typer.typed(q"println($message)") + } + } + Some(expander(expandee)) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Test_3.flags b/tests/pending/run/macroPlugins-macroExpand/Test_3.flags new file mode 100644 index 000000000000..966df731d030 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/Test_3.scala b/tests/pending/run/macroPlugins-macroExpand/Test_3.scala new file mode 100644 index 000000000000..a730821f22e0 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml new file mode 100644 index 000000000000..860150865c36 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroExpand/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-expand + macroExpand.Plugin + \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime.check b/tests/pending/run/macroPlugins-macroRuntime.check new file mode 100644 index 000000000000..af16d1ac36e2 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime.check @@ -0,0 +1,2 @@ +hijacked +hijacked diff --git a/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala b/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala new file mode 100644 index 000000000000..b19b8f18dc2f --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime/Macros_2.scala @@ -0,0 +1,11 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(arg: c.Tree) = { + import c.universe._ + q"""println($arg)""" + } + + def foo(arg: String): Unit = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala b/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala new file mode 100644 index 000000000000..a55adadb4899 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime/Plugin_1.scala @@ -0,0 +1,20 @@ +package macroRuntime + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "macroRuntime" + val description = "A sample analyzer plugin that overrides macroRuntime." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsMacroRuntime(expandee: Tree): Option[MacroRuntime] = Some({ + case MacroArgs(_, List(msg)) => q"""println("hijacked")""" + }) + } +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags b/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags new file mode 100644 index 000000000000..966df731d030 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime/Test_3.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala b/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala new file mode 100644 index 000000000000..8d3be78bbf1a --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo("1") + Macros.foo("2") +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml b/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml new file mode 100644 index 000000000000..8001af1054f9 --- /dev/null +++ b/tests/pending/run/macroPlugins-macroRuntime/scalac-plugin.xml @@ -0,0 +1,4 @@ + + macro-runtime + macroRuntime.Plugin + \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-namerHooks.check b/tests/pending/run/macroPlugins-namerHooks.check new file mode 100644 index 000000000000..c2db5935d49e --- /dev/null +++ b/tests/pending/run/macroPlugins-namerHooks.check @@ -0,0 +1,45 @@ +enterSym(package { case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } } }) +enterSym(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) +ensureCompanionObject(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }, ...) +enterSym( object C extends runtime.this.AbstractFunction2[Int, Int, C] { def () = { super.(); () }; final override def toString() = "C" }) +enterStat(case class C extends scala.Product with scala.Serializable { val x: Int = _; val y: Int = _; def (x: Int, y: Int) = { super.(); () } }) +enterSym( val x: Int = _) +enterSym( val y: Int = _) +enterSym(def (x: Int, y: Int) = { super.(); () }) +enterSym( def copy(x = x, y = y) = new C(x, y)) +enterStat( private[this] val x: Int = _) +enterStat( private[this] val y: Int = _) +enterStat(def (x: Int, y: Int) = { super.(); () }) +enterSym( private[this] val x: Int = _) +enterSym( private[this] val y: Int = _) +enterSym(def (x: Int, y: Int) = { super.(); () }) +enterSym(super.()) +enterStat(super.()) +enterSym( def copy$default$1 = x) +enterSym( def copy$default$2 = y) +enterSym( var acc: Int = -889275714) +enterSym(acc = Statics.this.mix(acc, x)) +enterSym(acc = Statics.this.mix(acc, y)) +enterStat( var acc: Int = -889275714) +enterStat(acc = Statics.this.mix(acc, x)) +enterStat(acc = Statics.this.mix(acc, y)) +enterSym( val C$1: C = x$1.asInstanceOf[C]) +enterStat( val C$1: C = x$1.asInstanceOf[C]) +enterSym(def () = { super.(); () }) +enterSym(final override def toString() = "C") +enterSym(case def apply(x: Int, y: Int): C = new C(x, y)) +enterSym(case def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y))) +enterStat(def () = { super.(); () }) +enterStat(final override def toString() = "C") +enterSym(def () = { super.(); () }) +enterSym(final override def toString() = "C") +enterSym(super.()) +enterStat(super.()) +enterSym(case val x1: Int = x$1) +enterStat(case val x1: Int = x$1) +enterSym(case val x1: Any = x$1) +enterSym(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) +enterSym(case6(){ matchEnd4(false) }) +enterStat(case val x1: Any = x$1) +enterStat(case5(){ if (x1.isInstanceOf[C]) matchEnd4(true) else case6() }) +enterStat(case6(){ matchEnd4(false) }) diff --git a/tests/pending/run/macroPlugins-namerHooks.scala b/tests/pending/run/macroPlugins-namerHooks.scala new file mode 100644 index 000000000000..302429b19e40 --- /dev/null +++ b/tests/pending/run/macroPlugins-namerHooks.scala @@ -0,0 +1,39 @@ +import scala.tools.partest._ +import scala.tools.nsc._ + +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp" + + def code = """ + case class C(x: Int, y: Int) + """.trim + + def show() { + val global = newCompiler() + import global._ + import analyzer._ + + val output = collection.mutable.ListBuffer[String]() + def log(what: String) = output += what.replace(String.format("%n"), " ") + + object macroPlugin extends MacroPlugin { + override def pluginsEnterSym(namer: Namer, tree: Tree): Boolean = { + log(s"enterSym($tree)") + namer.standardEnterSym(tree) + true + } + override def pluginsEnsureCompanionObject(namer: Namer, cdef: ClassDef, creator: ClassDef => Tree = companionModuleDef(_)): Option[Symbol] = { + log(s"ensureCompanionObject($cdef, ...)") + Some(namer.standardEnsureCompanionObject(cdef, creator)) + } + override def pluginsEnterStats(typer: Typer, stats: List[Tree]): List[Tree] = { + stats.foreach(stat => log(s"enterStat($stat)")) + stats + } + } + + addMacroPlugin(macroPlugin) + compileString(global)(code) + println(output.mkString("\n")) + } +} diff --git a/tests/pending/run/macroPlugins-typedMacroBody.check b/tests/pending/run/macroPlugins-typedMacroBody.check new file mode 100644 index 000000000000..b6f843618909 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody.check @@ -0,0 +1,2 @@ +impl1 +impl2 diff --git a/tests/pending/run/macroPlugins-typedMacroBody.flags b/tests/pending/run/macroPlugins-typedMacroBody.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags new file mode 100644 index 000000000000..966df731d030 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.flags @@ -0,0 +1 @@ +-Xplugin:. \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala new file mode 100644 index 000000000000..80acfec659a1 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody/Macros_2.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q"""println("impl1")""" + } + + def impl2(c: Context) = { + import c.universe._ + q"""println("impl2")""" + } + + def foo1: Unit = macro 1 + + def foo2: Unit = macro 2 +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala b/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala new file mode 100644 index 000000000000..e99cf7f75d71 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody/Plugin_1.scala @@ -0,0 +1,21 @@ +package typedMacroBody + +import scala.tools.nsc.Global +import scala.tools.nsc.plugins.{Plugin => NscPlugin} + +class Plugin(val global: Global) extends NscPlugin { + import global._ + import analyzer._ + + val name = "typedMacroBody" + val description = "A sample analyzer plugin that overrides typedMacroBody." + val components = Nil + addMacroPlugin(MacroPlugin) + + object MacroPlugin extends MacroPlugin { + override def pluginsTypedMacroBody(typer: Typer, ddef: DefDef): Option[Tree] = { + val DefDef(_, _, _, _, _, Literal(Constant(num: Int))) = ddef + Some(standardTypedMacroBody(typer, copyDefDef(ddef)(rhs = Ident(TermName("impl" + num))))) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala b/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala new file mode 100644 index 000000000000..a730821f22e0 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody/Test_3.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo1 + Macros.foo2 +} \ No newline at end of file diff --git a/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml b/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml new file mode 100644 index 000000000000..e223fa5dcaa6 --- /dev/null +++ b/tests/pending/run/macroPlugins-typedMacroBody/scalac-plugin.xml @@ -0,0 +1,4 @@ + + typed-macro-body + typedMacroBody.Plugin + \ No newline at end of file diff --git a/tests/pending/run/manifests-new.scala b/tests/pending/run/manifests-new.scala new file mode 100644 index 000000000000..8b42e3ca7303 --- /dev/null +++ b/tests/pending/run/manifests-new.scala @@ -0,0 +1,152 @@ + + +import scala.language.{ higherKinds, postfixOps } +import scala.reflect.runtime.universe._ + +object Test +{ + object Variances extends Enumeration { + val CO, IN, CONTRA = Value + } + import Variances.{ CO, IN, CONTRA } + + object SubtypeRelationship extends Enumeration { + val NONE, SAME, SUB, SUPER = Value + } + import SubtypeRelationship.{ NONE, SAME, SUB, SUPER } + + class VarianceTester[T, U, CC[_]](expected: Variances.Value)( + implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) { + + def elements = List(ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe) + def containers = List(ev3.tpe <:< ev4.tpe, ev4.tpe <:< ev3.tpe) + + def isUnrelated = typeCompare[T, U] == NONE + def isSame = typeCompare[T, U] == SAME + def isSub = typeCompare[T, U] == SUB + def isSuper = typeCompare[T, U] == SUPER + + def showsCovariance = (elements == containers) + def showsContravariance = (elements == containers.reverse) + def showsInvariance = containers forall (_ == isSame) + + def allContainerVariances = List(showsCovariance, showsInvariance, showsContravariance) + + def showsExpectedVariance = + if (isUnrelated) allContainerVariances forall (_ == false) + else if (isSame) allContainerVariances forall (_ == true) + else expected match { + case CO => showsCovariance && !showsContravariance && !showsInvariance + case IN => showsInvariance && !showsCovariance && !showsContravariance + case CONTRA => showsContravariance && !showsCovariance && !showsInvariance + } + } + + def showsCovariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) = + new VarianceTester[T, U, CC](CO) showsExpectedVariance + + def showsInvariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) = + new VarianceTester[T, U, CC](IN) showsExpectedVariance + + def showsContravariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) = + new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance + + def typeCompare[T, U](implicit ev1: TypeTag[T], ev2: TypeTag[U]) = (ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe) match { + case (true, true) => SAME + case (true, false) => SUB + case (false, true) => SUPER + case (false, false) => NONE + } + + def assertAnyRef[T: TypeTag] = List( + typeOf[T] <:< typeOf[Any], + typeOf[T] <:< typeOf[AnyRef], + !(typeOf[T] <:< typeOf[AnyVal]) + ) foreach (assert(_, "assertAnyRef")) + + def assertAnyVal[T: TypeTag] = List( + typeOf[T] <:< typeOf[Any], + !(typeOf[T] <:< typeOf[AnyRef]), + typeOf[T] <:< typeOf[AnyVal] + ) foreach (assert(_, "assertAnyVal")) + + def assertSameType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SAME, "assertSameType") + def assertSuperType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SUPER, "assertSuperType") + def assertSubType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SUB, "assertSubType") + def assertNoRelationship[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == NONE, "assertNoRelationship") + + def testVariancesVia[T: TypeTag, U: TypeTag] = assert( + typeCompare[T, U] == SUB && + showsCovariance[T, U, List] && + showsInvariance[T, U, Set], + "testVariancesVia" + ) + + def runAllTests = { + assertAnyVal[AnyVal] + assertAnyVal[Unit] + assertAnyVal[Int] + assertAnyVal[Double] + assertAnyVal[Boolean] + assertAnyVal[Char] + + assertAnyRef[AnyRef] + assertAnyRef[java.lang.Object] + assertAnyRef[java.lang.Integer] + assertAnyRef[java.lang.Double] + assertAnyRef[java.lang.Boolean] + assertAnyRef[java.lang.Character] + assertAnyRef[String] + assertAnyRef[scala.List[String]] + assertAnyRef[scala.List[_]] + + // variance doesn't work yet + // testVariancesVia[String, Any] + // testVariancesVia[String, AnyRef] + + assertSubType[List[String], List[Any]] + assertSubType[List[String], List[AnyRef]] + assertNoRelationship[List[String], List[AnyVal]] + + assertSubType[List[Int], List[Any]] + assertSubType[List[Int], List[AnyVal]] + assertNoRelationship[List[Int], List[AnyRef]] + + // Nothing + assertSubType[Nothing, Any] + assertSubType[Nothing, AnyVal] + assertSubType[Nothing, AnyRef] + assertSubType[Nothing, String] + assertSubType[Nothing, List[String]] + assertSubType[Nothing, Null] + assertSameType[Nothing, Nothing] + + // Null + assertSubType[Null, Any] + assertNoRelationship[Null, AnyVal] + assertSubType[Null, AnyRef] + assertSubType[Null, String] + assertSubType[Null, List[String]] + assertSameType[Null, Null] + assertSuperType[Null, Nothing] + + // Any + assertSameType[Any, Any] + assertSuperType[Any, AnyVal] + assertSuperType[Any, AnyRef] + assertSuperType[Any, String] + assertSuperType[Any, List[String]] + assertSuperType[Any, Null] + assertSuperType[Any, Nothing] + + // Misc unrelated types + assertNoRelationship[Unit, AnyRef] + assertNoRelationship[Unit, Int] + assertNoRelationship[Int, Long] + assertNoRelationship[Boolean, String] + assertNoRelationship[List[Boolean], List[String]] + assertNoRelationship[Set[Boolean], Set[String]] + } + + def main(args: Array[String]): Unit = runAllTests +} diff --git a/tests/pending/run/manifests-old.scala b/tests/pending/run/manifests-old.scala new file mode 100644 index 000000000000..d8b1e751d4c1 --- /dev/null +++ b/tests/pending/run/manifests-old.scala @@ -0,0 +1,150 @@ +import scala.language.{ higherKinds, postfixOps } + +@deprecated("Suppress warnings", since="2.11") +object Test +{ + object Variances extends Enumeration { + val CO, IN, CONTRA = Value + } + import Variances.{ CO, IN, CONTRA } + + object SubtypeRelationship extends Enumeration { + val NONE, SAME, SUB, SUPER = Value + } + import SubtypeRelationship.{ NONE, SAME, SUB, SUPER } + + class VarianceTester[T, U, CC[_]](expected: Variances.Value)( + implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) { + + def elements = List(ev1 <:< ev2, ev2 <:< ev1) + def containers = List(ev3 <:< ev4, ev4 <:< ev3) + + def isUnrelated = typeCompare[T, U] == NONE + def isSame = typeCompare[T, U] == SAME + def isSub = typeCompare[T, U] == SUB + def isSuper = typeCompare[T, U] == SUPER + + def showsCovariance = (elements == containers) + def showsContravariance = (elements == containers.reverse) + def showsInvariance = containers forall (_ == isSame) + + def allContainerVariances = List(showsCovariance, showsInvariance, showsContravariance) + + def showsExpectedVariance = + if (isUnrelated) allContainerVariances forall (_ == false) + else if (isSame) allContainerVariances forall (_ == true) + else expected match { + case CO => showsCovariance && !showsContravariance && !showsInvariance + case IN => showsInvariance && !showsCovariance && !showsContravariance + case CONTRA => showsContravariance && !showsCovariance && !showsInvariance + } + } + + def showsCovariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = + new VarianceTester[T, U, CC](CO) showsExpectedVariance + + def showsInvariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = + new VarianceTester[T, U, CC](IN) showsExpectedVariance + + def showsContravariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = + new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance + + def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = (ev1 <:< ev2, ev2 <:< ev1) match { + case (true, true) => SAME + case (true, false) => SUB + case (false, true) => SUPER + case (false, false) => NONE + } + + def assertAnyRef[T: Manifest] = List( + manifest[T] <:< manifest[Any], + manifest[T] <:< manifest[AnyRef], + !(manifest[T] <:< manifest[AnyVal]) + ) foreach (assert(_, "assertAnyRef")) + + def assertAnyVal[T: Manifest] = List( + manifest[T] <:< manifest[Any], + !(manifest[T] <:< manifest[AnyRef]), + manifest[T] <:< manifest[AnyVal] + ) foreach (assert(_, "assertAnyVal")) + + def assertSameType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SAME, "assertSameType") + def assertSuperType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUPER, "assertSuperType") + def assertSubType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUB, "assertSubType") + def assertNoRelationship[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == NONE, "assertNoRelationship") + + def testVariancesVia[T: Manifest, U: Manifest] = assert( + typeCompare[T, U] == SUB && + showsCovariance[T, U, List] && + showsInvariance[T, U, Set], + "testVariancesVia" + ) + + def runAllTests = { + assertAnyVal[AnyVal] + assertAnyVal[Unit] + assertAnyVal[Int] + assertAnyVal[Double] + assertAnyVal[Boolean] + assertAnyVal[Char] + + assertAnyRef[AnyRef] + assertAnyRef[java.lang.Object] + assertAnyRef[java.lang.Integer] + assertAnyRef[java.lang.Double] + assertAnyRef[java.lang.Boolean] + assertAnyRef[java.lang.Character] + assertAnyRef[String] + assertAnyRef[scala.List[String]] + assertAnyRef[scala.List[_]] + + // variance doesn't work yet + // testVariancesVia[String, Any] + // testVariancesVia[String, AnyRef] + + assertSubType[List[String], List[Any]] + assertSubType[List[String], List[AnyRef]] + assertNoRelationship[List[String], List[AnyVal]] + + assertSubType[List[Int], List[Any]] + assertSubType[List[Int], List[AnyVal]] + assertNoRelationship[List[Int], List[AnyRef]] + + // Nothing + assertSubType[Nothing, Any] + assertSubType[Nothing, AnyVal] + assertSubType[Nothing, AnyRef] + assertSubType[Nothing, String] + assertSubType[Nothing, List[String]] + assertSubType[Nothing, Null] + assertSameType[Nothing, Nothing] + + // Null + assertSubType[Null, Any] + assertNoRelationship[Null, AnyVal] + assertSubType[Null, AnyRef] + assertSubType[Null, String] + assertSubType[Null, List[String]] + assertSameType[Null, Null] + assertSuperType[Null, Nothing] + + // Any + assertSameType[Any, Any] + assertSuperType[Any, AnyVal] + assertSuperType[Any, AnyRef] + assertSuperType[Any, String] + assertSuperType[Any, List[String]] + assertSuperType[Any, Null] + assertSuperType[Any, Nothing] + + // Misc unrelated types + assertNoRelationship[Unit, AnyRef] + assertNoRelationship[Unit, Int] + assertNoRelationship[Int, Long] + assertNoRelationship[Boolean, String] + assertNoRelationship[List[Boolean], List[String]] + assertNoRelationship[Set[Boolean], Set[String]] + } + + def main(args: Array[String]): Unit = runAllTests +} diff --git a/tests/pending/run/manifests-undeprecated-in-2.10.0.flags b/tests/pending/run/manifests-undeprecated-in-2.10.0.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/manifests-undeprecated-in-2.10.0.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/manifests-undeprecated-in-2.10.0.scala b/tests/pending/run/manifests-undeprecated-in-2.10.0.scala new file mode 100644 index 000000000000..e7dd61145308 --- /dev/null +++ b/tests/pending/run/manifests-undeprecated-in-2.10.0.scala @@ -0,0 +1,15 @@ +object Test extends dotty.runtime.LegacyApp { + def m1a: scala.reflect.Manifest[Int] = scala.reflect.Manifest.Int + def m2a: scala.reflect.OptManifest[Int] = ??? + def m3a = scala.reflect.NoManifest + + def m1b: Manifest[Int] = Manifest.Int + def m2b: OptManifest[Int] = ??? + def m3b = NoManifest + + val m4a = manifest[Int] + val m5a = optManifest[Int] + + val m4b = implicitly[Manifest[Int]] + val m5b = implicitly[OptManifest[Int]] +} diff --git a/tests/pending/run/mapConserve.scala b/tests/pending/run/mapConserve.scala new file mode 100644 index 000000000000..4c842b0a53e3 --- /dev/null +++ b/tests/pending/run/mapConserve.scala @@ -0,0 +1,56 @@ +/* + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ +import scala.annotation.tailrec +import scala.collection.mutable.ListBuffer + +object Test { + val maxListLength = 7 // up to 16, but larger is slower + var testCount = 0 + + def checkStackOverflow() = { + var xs: List[String] = Nil + for (i <- 0 until 250000) + xs = "X" :: xs + + val lowers = xs.mapConserve(_.toLowerCase) + assert(xs.mapConserve(x => x) eq xs) + } + + def checkBehaviourUnchanged(input: List[_], oldOutput: List[_], newOutput: List[_]): Unit = { + if (oldOutput eq input) + assert(newOutput eq oldOutput) + else { + assert(newOutput.head == oldOutput.head) + checkBehaviourUnchanged(input.tail, oldOutput.tail, newOutput.tail) + } + testCount += 1 + } + + var callCount = 0 + val lastHexDigit: Function1[BigInt, AnyRef] = { x: BigInt => callCount+=1; if (x < 16) x else x % 16 } + + def main(args: Array[String]): Unit = { + for (length <- 0 to maxListLength; + bitmap <- 0 until (1 << length); + data = List.range(0, length) map { x: Int => + if ((bitmap & (1 << x)) != 0) BigInt(x+16) + else BigInt(x) + }) + { + // Behaves like map with respect to == + callCount = 0 + val numUnconserved = data.reverse.dropWhile(_ < 16).length + val result = data mapConserve lastHexDigit + val mapResult = data map lastHexDigit + assert(result == mapResult) + assert((result drop numUnconserved) eq (data drop numUnconserved)) + assert(callCount == 2 * length) // map, mapConserve call transform for each element in the list + + // Behaves like existing mapConserve with respect to eq + checkBehaviourUnchanged(data, data mapConserve lastHexDigit, data mapConserve lastHexDigit) + } + + checkStackOverflow(); + } +} diff --git a/tests/pending/run/mapValues.scala b/tests/pending/run/mapValues.scala new file mode 100644 index 000000000000..d3266bd18fef --- /dev/null +++ b/tests/pending/run/mapValues.scala @@ -0,0 +1,8 @@ +object Test { + val m = Map(1 -> 1, 2 -> 2) + val mv = (m mapValues identity) - 1 + + def main(args: Array[String]): Unit = { + assert(mv.size == 1) + } +} diff --git a/tests/pending/run/map_java_conversions.scala b/tests/pending/run/map_java_conversions.scala new file mode 100644 index 000000000000..b7b39128c8f7 --- /dev/null +++ b/tests/pending/run/map_java_conversions.scala @@ -0,0 +1,60 @@ + + + + + +object Test { + + def main(args: Array[String]): Unit = { + import collection.JavaConversions._ + + test(new java.util.HashMap[String, String]) + test(new java.util.Properties) + testConcMap + } + + def testConcMap: Unit = { + import collection.JavaConversions._ + + val concMap = new java.util.concurrent.ConcurrentHashMap[String, String] + + test(concMap) + val cmap = mapAsScalaConcurrentMap(concMap) + cmap.putIfAbsent("absentKey", "absentValue") + cmap.put("somekey", "somevalue") + assert(cmap.remove("somekey", "somevalue") == true) + assert(cmap.replace("absentKey", "newAbsentValue") == Some("absentValue")) + assert(cmap.replace("absentKey", "newAbsentValue", ".......") == true) + } + + def test(m: collection.mutable.Map[String, String]): Unit = { + m.clear + assert(m.size == 0) + + m.put("key", "value") + assert(m.size == 1) + + assert(m.put("key", "anotherValue") == Some("value")) + assert(m.put("key2", "value2") == None) + assert(m.size == 2) + + m += (("key3", "value3")) + assert(m.size == 3) + + m -= "key2" + assert(m.size == 2) + assert(m.nonEmpty) + assert(m.remove("key") == Some("anotherValue")) + + m.clear + for (i <- 0 until 10) m += (("key" + i, "value" + i)) + for ((k, v) <- m) assert(k.startsWith("key")) + } + +} + + + + + + diff --git a/tests/pending/run/map_test.check b/tests/pending/run/map_test.check new file mode 100644 index 000000000000..a788c0fbca11 --- /dev/null +++ b/tests/pending/run/map_test.check @@ -0,0 +1,3 @@ +0->0 1->1 2->2 3->3 4->4 5->5 6->6 7->7 8->8 9->9 10->10 11->11 12->12 13->13 14->14 15->15 16->16 17->17 18->18 19->19 20->20 21->21 22->22 23->23 24->24 25->25 26->26 27->27 28->28 29->29 30->30 31->31 32->32 33->33 34->34 35->35 36->36 37->37 38->38 39->39 40->40 41->41 42->42 666->A bigger random number 4711->A big random number +0->0 1->1 2->2 3->3 4->4 5->5 6->6 7->7 8->8 9->9 10->10 11->11 12->12 13->13 14->14 15->15 16->16 17->17 18->18 19->19 20->20 21->21 22->22 23->23 24->24 25->25 26->26 27->27 28->28 29->29 30->30 31->31 32->32 33->33 34->34 35->35 36->36 37->37 38->38 39->39 40->40 41->41 42->42 666->A bigger random number 4711->A big random number +OK diff --git a/tests/pending/run/map_test.scala b/tests/pending/run/map_test.scala new file mode 100644 index 000000000000..947c846bdceb --- /dev/null +++ b/tests/pending/run/map_test.scala @@ -0,0 +1,38 @@ +import scala.collection.immutable.{ListMap, Map, TreeMap} + +object Test extends dotty.runtime.LegacyApp { + test1() + test2() + println("OK") + + def test1(): Unit = { + val myMap: TreeMap[Int, String] = new TreeMap + test_map(myMap) + } + + def test2(): Unit = { + val myMap: ListMap[Int, String] = new ListMap + test_map(myMap) + } + + def test_map(myMap: Map[Int, String]): Unit = { + val map1 = myMap.updated(42,"The answer") + val map2 = map1.updated(17,"A small random number") + val map3 = map2.updated(666,"A bigger random number") + val map4 = map3.updated(4711,"A big random number") + map1 == myMap + ((42, "The answer")) + var i = 0 + var map = map4 + while(i < 43) { + map = map.updated(i,i.toString()) + i += 1 + } + i = 0 + while(i < 4712) { + if (map.isDefinedAt(i)) + print(i + "->" + map(i) + " "); + i += 1 + } + println("") + } +} diff --git a/tests/pending/run/matcharraytail.check b/tests/pending/run/matcharraytail.check new file mode 100644 index 000000000000..f2844d41a994 --- /dev/null +++ b/tests/pending/run/matcharraytail.check @@ -0,0 +1,2 @@ +Array(foo, bar, baz) +Vector(bar, baz) diff --git a/tests/pending/run/matcharraytail.scala b/tests/pending/run/matcharraytail.scala new file mode 100644 index 000000000000..3120769f41af --- /dev/null +++ b/tests/pending/run/matcharraytail.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp{ + Array("foo", "bar", "baz") match { + case x@Array("foo", bar :_*) => println(x.deep.toString); println(bar.toString); + case Array(x, y, z) => println("shouldn't have fallen through"); + case _ => println("default case?!"); + } +} diff --git a/tests/pending/run/matchbytes.check b/tests/pending/run/matchbytes.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/matchbytes.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/matchbytes.scala b/tests/pending/run/matchbytes.scala new file mode 100644 index 000000000000..b4455e8f4ddb --- /dev/null +++ b/tests/pending/run/matchbytes.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp{ + val x = (1 : Byte) match { + case 2 => println(2); + case 1 => println(1); + case _ => println("????"); + } +} diff --git a/tests/pending/run/matchemptyarray.check b/tests/pending/run/matchemptyarray.check new file mode 100644 index 000000000000..815225fc64d6 --- /dev/null +++ b/tests/pending/run/matchemptyarray.check @@ -0,0 +1 @@ +Array() diff --git a/tests/pending/run/matchemptyarray.scala b/tests/pending/run/matchemptyarray.scala new file mode 100644 index 000000000000..fa56c0ed3a0c --- /dev/null +++ b/tests/pending/run/matchemptyarray.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp{ + Array[String]() match { + case x@Array() => println(x.deep.toString()); + } +} diff --git a/tests/pending/run/matchintasany.check b/tests/pending/run/matchintasany.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/matchintasany.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/matchintasany.scala b/tests/pending/run/matchintasany.scala new file mode 100644 index 000000000000..ab61e727a2b3 --- /dev/null +++ b/tests/pending/run/matchintasany.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp{ + val x = (1 : Any) match { + case 0xFFFFFFFF00000001L => println("Oops, overflow!"); + case 2L => println(2); + case 1L => println(1); + case _ => println("????"); + } +} diff --git a/tests/pending/run/matchnull.check b/tests/pending/run/matchnull.check new file mode 100644 index 000000000000..64861d87daee --- /dev/null +++ b/tests/pending/run/matchnull.check @@ -0,0 +1,3 @@ +-1 +-1 +-1 diff --git a/tests/pending/run/matchnull.scala b/tests/pending/run/matchnull.scala new file mode 100644 index 000000000000..2cc8550d4743 --- /dev/null +++ b/tests/pending/run/matchnull.scala @@ -0,0 +1,12 @@ +object Test +{ + def f1 = null match { case x: AnyRef => 1 case _ => -1 } + def f2(x: Any) = x match { case 52 => 1 ; case null => -1 ; case _ => 0 } + def f3(x: AnyRef) = x match { case x: String => 1 ; case List(_) => 0 ; case null => -1 ; case _ => -2 } + + def main(args: Array[String]): Unit = { + println(f1) + println(f2(null)) + println(f3(null)) + } +} diff --git a/tests/pending/run/matchonseq.check b/tests/pending/run/matchonseq.check new file mode 100644 index 000000000000..3fe554095adc --- /dev/null +++ b/tests/pending/run/matchonseq.check @@ -0,0 +1,2 @@ +It worked! head=1 +It worked! last=3 diff --git a/tests/pending/run/matchonseq.scala b/tests/pending/run/matchonseq.scala new file mode 100644 index 000000000000..99138706b800 --- /dev/null +++ b/tests/pending/run/matchonseq.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + Vector(1,2,3) match { + case head +: tail => println("It worked! head=" + head) + } + Vector(1,2,3) match { + case init :+ last => println("It worked! last=" + last) + } +} diff --git a/tests/pending/run/matchonstream.check b/tests/pending/run/matchonstream.check new file mode 100644 index 000000000000..3dc3aa5164a7 --- /dev/null +++ b/tests/pending/run/matchonstream.check @@ -0,0 +1 @@ +It worked! diff --git a/tests/pending/run/matchonstream.scala b/tests/pending/run/matchonstream.scala new file mode 100644 index 000000000000..6e5556519d58 --- /dev/null +++ b/tests/pending/run/matchonstream.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp{ + Stream.from(1) match { case Stream(1, 2, x :_*) => println("It worked!") } +} diff --git a/tests/pending/run/memberpos.check b/tests/pending/run/memberpos.check new file mode 100644 index 000000000000..9e3a807f5a1b --- /dev/null +++ b/tests/pending/run/memberpos.check @@ -0,0 +1,11 @@ +newSource1.scala +2,4 class A +6,28 object A + 7,10 def bippy + 8 def hello + 11,27 class Dingo + 12,26 def foooooz + 22 val a +30 class B + 30 def f + diff --git a/tests/pending/run/memberpos.scala b/tests/pending/run/memberpos.scala new file mode 100644 index 000000000000..f2b79c0ec1f2 --- /dev/null +++ b/tests/pending/run/memberpos.scala @@ -0,0 +1,39 @@ +import scala.tools.partest._ + +// Simple sanity test for -Yshow-member-pos. +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp -Ystop-after:parser -Yshow-member-pos \"\" -d " + testOutput.path + override def show() = compile() + override def code = """ +class A(val a: Int = 1) { + +} + +object A { + def bippy = { + def hello = 55 + "" + hello + } + class Dingo { + def foooooz = /**** + + + + + + ****/ { + + + + val a = 1 + + + a + } + } +} + +class B { def f = 1 } + +""" +} diff --git a/tests/pending/run/mirror_symbolof_x.check b/tests/pending/run/mirror_symbolof_x.check new file mode 100644 index 000000000000..cc9cad7a136f --- /dev/null +++ b/tests/pending/run/mirror_symbolof_x.check @@ -0,0 +1,13 @@ +class Int +object C +type T +type Id +class Nothing +class Null +class Int +object C +type T +type Id +class Nothing +class Null +exception: class C not found. diff --git a/tests/pending/run/mirror_symbolof_x.scala b/tests/pending/run/mirror_symbolof_x.scala new file mode 100644 index 000000000000..43e46cf92866 --- /dev/null +++ b/tests/pending/run/mirror_symbolof_x.scala @@ -0,0 +1,43 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.api.Mirror + +class C +object C + +object Test extends dotty.runtime.LegacyApp { + object test1 { + val m = cm + type T = Int + type Id[X] = X + println(m.symbolOf[Int]: ru.TypeSymbol) + println(m.symbolOf[C.type]: ru.TypeSymbol) + println(m.symbolOf[T]: ru.TypeSymbol) + println(m.symbolOf[Id[_]]: ru.TypeSymbol) + println(m.symbolOf[Nothing]: ru.TypeSymbol) + println(m.symbolOf[Null]: ru.TypeSymbol) + } + + object test2 { + val m: Mirror[ru.type] = cm + type T = Int + type Id[X] = X + println(m.symbolOf[Int]: ru.TypeSymbol) + println(m.symbolOf[C.type]: ru.TypeSymbol) + println(m.symbolOf[T]: ru.TypeSymbol) + println(m.symbolOf[Id[_]]: ru.TypeSymbol) + println(m.symbolOf[Nothing]: ru.TypeSymbol) + println(m.symbolOf[Null]: ru.TypeSymbol) + } + + object test3 { + val m = ru.runtimeMirror(classOf[Int].getClass.getClassLoader) + try println(m.symbolOf[C]) + catch { case ex: ScalaReflectionException => println(s"exception: ${ex.getMessage}") } + } + + test1 + test2 + test3 +} diff --git a/tests/pending/run/misc.check b/tests/pending/run/misc.check new file mode 100644 index 000000000000..56116f81048b --- /dev/null +++ b/tests/pending/run/misc.check @@ -0,0 +1,57 @@ +misc.scala:46: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 42; + ^ +misc.scala:47: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 42l; + ^ +misc.scala:48: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 23.5f; + ^ +misc.scala:49: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 23.5; + ^ +misc.scala:50: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + "Hello"; + ^ +misc.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 32 + 45; + ^ +misc.scala:62: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + x; + ^ +misc.scala:74: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 1 < 2; + ^ +### Hello +### 17 +### Bye + +### fib(0) = 1 +### fib(1) = 1 +### fib(2) = 2 +### fib(3) = 3 +### fib(4) = 5 +=== MyClass::toString === +=== MySubclass::toString === +=== MyClass::test === + +identity + +A.a = 1 +B.a = 5 +B.b = 2 + +X.a = 4 +Y.a = 11 +Y.b = 5 +Y.b = 5 + +X::foo + +Y::foo +X::foo + +3 +3 + +true diff --git a/tests/pending/run/misc.scala b/tests/pending/run/misc.scala new file mode 100644 index 000000000000..72af135b9e4b --- /dev/null +++ b/tests/pending/run/misc.scala @@ -0,0 +1,234 @@ +object Test { + + def fac(n: Int): Int = if (n < 2) 1 else fac(n - 1) * n; + + // Fibonacci + def fib(n: Int): Int = if (n < 2) 1 else fib(n - 1) + fib(n - 2); + + def show_fib(n: Int): Int = { + Console.print("### fib("); + Console.print(n); + Console.print(") = "); + Console.flush; + val v = fib(n); + Console.print(v); + Console.println; + Console.flush; + v + } + + def id[X](x: X): X = x; + + def apply[X](f: X => X, x: X): X = f(x); + + def id_obj(x: AnyRef): AnyRef = x; + + def apply_obj(f: AnyRef => AnyRef, x: AnyRef): AnyRef = f(x); + + def id_any(x: scala.Any): scala.Any = x; + + def apply_any(f: scala.Any => scala.Any, x: scala.Any): scala.Any = f(x); + + def id_int(x: Int): Int = x; + + def apply_int(f: Int => Int, x: Int): Int = f(x); + + class MyClass() { + override def toString() = "=== MyClass::toString ==="; + def test() = Console.println("=== MyClass::test ==="); + } + + class MySubclass() extends MyClass() { + override def toString() = "=== MySubclass::toString ==="; + } + + def foobar = { + 42; + 42l; + 23.5f; + 23.5; + "Hello"; + 32 + 45; + // !!! System + // java; // !!! why is this legal ? what does it return ? + // java.lang; + //System.out; + Console.println("### Hello"); + Console.print("### "); + Console.println(17); + Console.println("### Bye"); + Console.println; + val x = 13; + x; + // !!! why are DefDef replaced by Block(Tree[0])? we should use Empty! + def f = 19; + f; + def f0() = 11; + f0(); + def f1(x: Int) = x; + f1(7); + def f2(x: Int, y: Int) = x + y; + f2(3,5); + def f11(x: Int)(y: Int) = x + y; + f11(23)(2); + 1 < 2; + if (1 < 2) 3 else 4; + + + show_fib(0); + show_fib(1); + show_fib(2); + show_fib(3); + show_fib(4); + + // !!! show_fib(id[Int](4)); + +/* + show_fib(5); + show_fib(6); + show_fib(7); + show_fib(8); + show_fib(9); + show_fib(10); + show_fib(11); + show_fib(12); +*/ + + val myObj = new MyClass(); + Console.println(myObj); + val mySub = new MySubclass(); + Console.println(mySub); + myObj.test(); + Console.println; + + Console.println(apply_any(id_any, "identity").toString()); + Console.println; + }; + + foobar; + +//############################################################################ + +class A(a: Int) { + def getA = a; +} + +class B(b: Int, c: Int) extends A(b + c) { + def getB = b; +} + +class X(x: Int) { + def getX = x; +} +case class Y(y: Int, z: Int) extends X(y + z) { + def getY = y; + def getAA = this.y; +} + +{ + val a: A = new A(1); + val b: B = new B(2,3); + + val x: X = new X(4); + val y: Y = new Y(5,6); + + Console.println("A.a = " + a.getA); + Console.println("B.a = " + b.getA); + Console.println("B.b = " + b.getB); + Console.println; + + Console.println("X.a = " + x.getX); + Console.println("Y.a = " + y.getX); + Console.println("Y.b = " + y.getY); + Console.println("Y.b = " + y.y); + Console.println; +} + +//############################################################################ + +{ +class X() { + + def foo = { + Console.println("X::foo"); + } + +} + +class Y() extends X() { + + override def foo = { + Console.println("Y::foo"); + super.foo; + } + +} + +val x: X = new X(); +val y: X = new Y(); + +x.foo; +Console.println; + +y.foo; +Console.println; +} + +//############################################################################ + +{ +class X() {} + +class O(a: Int) { + + + case class Y(b: Int) extends X() { + override def toString() = ""; + def bar = a + b; + } + + def foo = Y(2).bar +} + +Console.println(new O(1).foo) +} + +{ + +class O(a: Int) { + + class X() {} + + case class Y(b: Int) extends X() { + override def toString() = ""; + def bar = a + b; + } + + def foo = Y(2).bar +} + +Console.println(new O(1).foo) +} + +Console.println; + + case class Bar(); + + case class Foo(i: Int, j: Char, c: Bar) ; + + Console.println( + true // Foo(3,'a',Bar()).caseElement( -1 ) == null // throws Exception now + && Foo(3,'a',Bar()).productElement( 0 ) == 3 + && Foo(3,'a',Bar()).productElement( 1 ) == 'a' + && Foo(3,'a',Bar()).productElement( 2 ) == Bar() + && true // Foo(3,'a',Bar()).caseElement( 3 ) == null // throws Exception now + && Bar().productArity == 0 + && Foo(3,'a',Bar()).productArity == 3); + +//############################################################################ + + def main(args: Array[String]): Unit = { + } + +//############################################################################ +} diff --git a/tests/pending/run/missingparams.check b/tests/pending/run/missingparams.check new file mode 100644 index 000000000000..b0047fa49f09 --- /dev/null +++ b/tests/pending/run/missingparams.check @@ -0,0 +1 @@ +None diff --git a/tests/pending/run/missingparams.scala b/tests/pending/run/missingparams.scala new file mode 100644 index 000000000000..21c9ae1701d8 --- /dev/null +++ b/tests/pending/run/missingparams.scala @@ -0,0 +1,21 @@ +/** Tests the optimiser. */ + +final class Foo(val x: Int) { + def filter(p: Int => Boolean) = + if (p(x)) Some(x) else None + + // test that the closure elimination is not wrongly replacing + // 'that' by 'this' + def intersect(that: Foo) = + filter { dummy => +// x // dummy + that.x > 0 + } +} + +object Test extends dotty.runtime.LegacyApp { + val foo1 = new Foo(42) + val foo2 = new Foo(-42) + + println(foo1 intersect foo2) +} diff --git a/tests/pending/run/mixin-bridge-methods.scala b/tests/pending/run/mixin-bridge-methods.scala new file mode 100644 index 000000000000..e0340ebb125a --- /dev/null +++ b/tests/pending/run/mixin-bridge-methods.scala @@ -0,0 +1,14 @@ +trait Foo { + def getFoo() = "foo" +} + +class Sub extends Foo { + def getBar() = "bar" +} + +object Test { + def main(args: Array[String]): Unit = { + val ms = classOf[Sub].getDeclaredMethods + assert(ms forall (x => !x.isBridge), ms mkString " ") + } +} diff --git a/tests/pending/run/mixin-signatures.check b/tests/pending/run/mixin-signatures.check new file mode 100644 index 000000000000..3031fe75afe0 --- /dev/null +++ b/tests/pending/run/mixin-signatures.check @@ -0,0 +1,59 @@ +class Test$bar1$ { + public java.lang.String Test$bar1$.f(java.lang.Object) + public java.lang.Object Test$bar1$.f(java.lang.Object) + public java.lang.String Test$bar1$.g(java.lang.String) + public java.lang.Object Test$bar1$.g(java.lang.Object) + public java.lang.String Test$bar1$.g(java.lang.Object) + public java.lang.Object Test$bar1$.h(java.lang.Object) +} + +class Test$bar2$ { + public java.lang.Object Test$bar2$.f(java.lang.String) + public java.lang.Object Test$bar2$.f(java.lang.Object) + public java.lang.String Test$bar2$.g(java.lang.String) + public java.lang.Object Test$bar2$.g(java.lang.Object) + public java.lang.Object Test$bar2$.g(java.lang.String) + public java.lang.Object Test$bar2$.h(java.lang.Object) +} + +class Test$bar3$ { + public java.lang.String Foo3.f(java.lang.Object) + generic: public java.lang.String Foo3.f(T) + public java.lang.Object Foo3.f(java.lang.Object) + public java.lang.String Test$bar3$.g(java.lang.String) + public java.lang.Object Test$bar3$.g(java.lang.Object) + public java.lang.String Test$bar3$.g(java.lang.Object) + public java.lang.Object Foo3.h(java.lang.Object) +} + +class Test$bar4$ { + public java.lang.Object Foo4.f(java.lang.String) + generic: public R Foo4.f(java.lang.String) + public java.lang.Object Foo4.f(java.lang.Object) + public java.lang.String Test$bar4$.g(java.lang.String) + public java.lang.Object Test$bar4$.g(java.lang.Object) + public java.lang.Object Test$bar4$.g(java.lang.String) + public java.lang.Object Foo4.h(java.lang.Object) +} + +class Test$bar5$ { + public java.lang.String Test$bar5$.f(java.lang.String) + public java.lang.Object Test$bar5$.f(java.lang.Object) + public java.lang.Object Test$bar5$.f(java.lang.String) + public java.lang.String Test$bar5$.f(java.lang.Object) + public java.lang.String Test$bar5$.g(java.lang.String) + public java.lang.Object Test$bar5$.g(java.lang.Object) + public java.lang.Object Test$bar5$.g(java.lang.String) + public java.lang.String Test$bar5$.g(java.lang.Object) + public java.lang.Object Test$bar5$.h(java.lang.Object) +} + +class Foo1$class { + public static java.lang.String Foo1$class.f(Foo1,java.lang.Object) +} + +class Foo2$class { + public static java.lang.Object Foo2$class.f(Foo2,java.lang.String) +} + +000000000000000000000000000000000000 diff --git a/tests/pending/run/mixin-signatures.scala b/tests/pending/run/mixin-signatures.scala new file mode 100644 index 000000000000..d939be62caaf --- /dev/null +++ b/tests/pending/run/mixin-signatures.scala @@ -0,0 +1,105 @@ +trait Base[T, R] { + def f(x: T): R + def g(x: T): R + def h(x: T): R = null.asInstanceOf[R] +} + +trait Foo1[T] extends Base[T, String] { + def f(x: T): String = null + def g(x: T): String +} +trait Foo2[R] extends Base[String, R] { + def f(x: String): R = { print(x.length) ; null.asInstanceOf[R] } + def g(x: String): R +} +abstract class Foo3[T] extends Base[T, String] { + def f(x: T): String = "" + def g(x: T): String +} +abstract class Foo4[R] extends Base[String, R] { + def f(x: String): R = { print(x.length) ; null.asInstanceOf[R] } + def g(x: String): R +} + +object Test { + object bar1 extends Foo1[String] { def g(x: String): String = { print(x.length) ; "" } } + object bar2 extends Foo2[String] { def g(x: String): String = { print(x.length) ; "" } } + object bar3 extends Foo3[String] { def g(x: String): String = { print(x.length) ; "" } } + object bar4 extends Foo4[String] { def g(x: String): String = { print(x.length) ; "" } } + + // Notice that in bar5, f and g require THREE bridges, because the final + // implementation is (String)String, but: + // + // inherited abstract signatures: T(R), (T)String, and (String)R + // which erase to: (Object)Object, (Object)String, and (String)Object + // + // each of which must be bridged to the actual (String)String implementation. + // + // public java.lang.String Test$bar5$.g(java.lang.String) + // public java.lang.Object Test$bar5$.g(java.lang.String) + // public java.lang.Object Test$bar5$.g(java.lang.Object) + // public java.lang.String Test$bar5$.g(java.lang.Object) + object bar5 extends Foo1[String] with Foo2[String] { + override def f(x: String): String = { print(x.length) ; x } + def g(x: String): String = { print(x.length) ; x } + } + + final def m1[T, R](x: Base[T, R], y: T) = { x.f(y) ; x.g(y) ; x.h(y) } + final def m2[T](x: Base[T, String], y: T) = { x.f(y) ; x.g(y) ; x.h(y) } + final def m3[R](x: Base[String, R]) = { x.f("") ; x.g("") ; x.h("") } + final def m4(x: Base[String, String]) = { x.f("") ; x.g("") ; x.h("") } + + final def m11[T](x: Foo1[T], y: T) = { x.f(y) ; x.g(y) ; x.h(y) } + final def m12(x: Foo1[String]) = { x.f("") ; x.g("") ; x.h("") } + final def m21[T](x: Foo2[T], y: T) = { x.f("") ; x.g("") ; x.h("") } + final def m22(x: Foo2[String]) = { x.f("") ; x.g("") ; x.h("") } + final def m31[T](x: Foo3[T], y: T) = { x.f(y) ; x.g(y) ; x.h(y) } + final def m32(x: Foo3[String]) = { x.f("") ; x.g("") ; x.h("") } + final def m41[T](x: Foo4[T], y: T) = { x.f("") ; x.g("") ; x.h("") } + final def m42(x: Foo4[String]) = { x.f("") ; x.g("") ; x.h("") } + + def go = { + m1(bar1, "") ; m2(bar1, "") ; m3(bar1) ; m4(bar1) + m1(bar2, "") ; m2(bar2, "") ; m3(bar2) ; m4(bar2) + m1(bar3, "") ; m2(bar3, "") ; m3(bar3) ; m4(bar3) + m1(bar4, "") ; m2(bar4, "") ; m3(bar4) ; m4(bar4) + + m11(bar1, "") ; m12(bar1) + m21(bar2, "") ; m22(bar2) + m31(bar3, "") ; m32(bar3) + m41(bar4, "") ; m42(bar4) + "" + } + + def flagsString(m: java.lang.reflect.Method) = { + val str = List( + if (m.isBridge) "" else "", + if (m.isSynthetic) "" else "" + ) filterNot (_ == "") mkString " " + + if (str == "") "" else " " + str + // + // val flags = scala.reflect.internal.ClassfileConstants.toScalaMethodFlags(m.getModifiers()) + // scala.tools.nsc.symtab.Flags.flagsToString(flags) + } + + def show(clazz: Class[_]): Unit = { + print(clazz + " {") + clazz.getMethods.sortBy(x => (x.getName, x.isBridge, x.toString)) filter (_.getName.length == 1) foreach { m => + print("\n " + m + flagsString(m)) + if ("" + m != "" + m.toGenericString) { + print("\n generic: " + m.toGenericString) + } + } + println("\n}") + println("") + } + def show(x: AnyRef): Unit = { show(x.getClass) } + def show(x: String): Unit = { show(Class.forName(x)) } + + def main(args: Array[String]): Unit = { + List(bar1, bar2, bar3, bar4, bar5) foreach show + List("Foo1$class", "Foo2$class") foreach show + println(go) + } +} diff --git a/tests/pending/run/mixins.check b/tests/pending/run/mixins.check new file mode 100644 index 000000000000..59a2c1d3f322 --- /dev/null +++ b/tests/pending/run/mixins.check @@ -0,0 +1,7 @@ +M1::B::f +M1::f M2::f M3::f +one +two +A +B +C diff --git a/tests/pending/run/mixins.scala b/tests/pending/run/mixins.scala new file mode 100644 index 000000000000..23aec6b52488 --- /dev/null +++ b/tests/pending/run/mixins.scala @@ -0,0 +1,83 @@ +// Test 1: "super" coming from mixins + +import Console._; + +object Test1 { + class A { + def f = "A::f"; + } + + class B extends A { + override def f = "B::f"; + } + + trait M1 extends A { + override def f = "M1::" + super.f; + } + + class C extends B with M1 { + override def f = super[M1].f; + } + + def test(): Unit = { + val c = new C; + Console.println(c.f); + } +} + +// Test 2: qualified "super" inside of the host class + +object Test2 { + class M1 { + def f = "M1::f"; + } + + trait M2 { + def f = "M2::f"; + } + + trait M3 { + def f = "M3::f"; + } + + class Host extends M1 with M2 with M3 { + override def f = super[M1].f + " " + super[M2].f + " " + super[M3].f + } + + def test(): Unit = { + val h = new Host; + Console.println(h.f) + } +} + +// Test 3: mixin evaluation order (bug 120) + +object Test3 { + + class A(x: Unit, y: Unit) { + Console.println("A"); + } + + trait B { + println("B"); + } + + class C extends A({ println("one"); }, { println("two"); }) + with B { + println("C"); + } + + def test() = { + val c = new C(); + } +} + +// Main testing function + +object Test { + def main(args: Array[String]): Unit = { + Test1.test(); + Test2.test(); + Test3.test(); + } +} diff --git a/tests/pending/run/multi-array.check b/tests/pending/run/multi-array.check new file mode 100644 index 000000000000..f163dae13d9e --- /dev/null +++ b/tests/pending/run/multi-array.check @@ -0,0 +1,4 @@ +Array(1, 2, 3) +null +Array(Array(0, 0, 0), Array(0, 0, 0), Array(0, 0, 0)) +Array(Array(0, 1, 2), Array(1, 2, 3), Array(2, 3, 4)) diff --git a/tests/pending/run/multi-array.scala b/tests/pending/run/multi-array.scala new file mode 100644 index 000000000000..ff8b8ff2e661 --- /dev/null +++ b/tests/pending/run/multi-array.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + val a = Array(1, 2, 3) + println(a.deep.toString) + + val aaiIncomplete = new Array[Array[Array[Int]]](3) + println(aaiIncomplete(0)) + + val aaiComplete: Array[Array[Int]] = Array.ofDim[Int](3, 3) // new Array[Array[Int]](3, 3) + println(aaiComplete.deep) + for (i <- 0 until 3; j <- 0 until 3) + aaiComplete(i)(j) = i + j + println(aaiComplete.deep.toString) + assert(aaiComplete.last.last == 4) +} diff --git a/tests/pending/run/mutable-treeset.scala b/tests/pending/run/mutable-treeset.scala new file mode 100644 index 000000000000..97dda65314e6 --- /dev/null +++ b/tests/pending/run/mutable-treeset.scala @@ -0,0 +1,145 @@ +import scala.collection.mutable.TreeSet + +object Test extends dotty.runtime.LegacyApp { + val list = List(6,5,4,3,2,1,1,2,3,4,5,6,6,5,4,3,2,1) + val distinct = list.distinct + val sorted = distinct.sorted + + // sublist stuff for a single level of slicing + val min = list.min + val max = list.max + val nonlist = ((min - 10) until (max + 20) filterNot list.contains).toList + val sublist = list filter {x => x >=(min + 1) && x < max} + val distinctSublist = sublist.distinct + val subnonlist = min :: max :: nonlist + val subsorted = distinctSublist.sorted + + // subsublist for a 2nd level of slicing + val almostmin = sublist.min + val almostmax = sublist.max + val subsublist = sublist filter {x => x >=(almostmin + 1) && x < almostmax} + val distinctSubsublist = subsublist.distinct + val subsubnonlist = almostmin :: almostmax :: subnonlist + val subsubsorted = distinctSubsublist.sorted + + def testSize: Unit = { + def check(set : TreeSet[Int], list: List[Int]): Unit = { + assert(set.size == list.size, s"$set had size ${set.size} while $list had size ${list.size}") + } + + check(TreeSet[Int](), List[Int]()) + val set = TreeSet(list:_*) + check(set, distinct) + check(set.clone, distinct) + + val subset = set from (min + 1) until max + check(subset, distinctSublist) + check(subset.clone, distinctSublist) + + val subsubset = subset from (almostmin + 1) until almostmax + check(subsubset, distinctSubsublist) + check(subsubset.clone, distinctSubsublist) + } + + def testContains: Unit = { + def check(set : TreeSet[Int], list: List[Int], nonlist: List[Int]): Unit = { + assert(list forall set.apply, s"$set did not contain all elements of $list using apply") + assert(list forall set.contains, s"$set did not contain all elements of $list using contains") + assert(!(nonlist exists set.apply), s"$set had an element from $nonlist using apply") + assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") + } + + val set = TreeSet(list:_*) + check(set, list, nonlist) + check(set.clone, list, nonlist) + + val subset = set from (min + 1) until max + check(subset, sublist, subnonlist) + check(subset.clone, sublist, subnonlist) + + val subsubset = subset from (almostmin + 1) until almostmax + check(subsubset, subsublist, subsubnonlist) + check(subsubset.clone, subsublist, subsubnonlist) + } + + def testAdd: Unit = { + def check(set : TreeSet[Int], list: List[Int], nonlist: List[Int]): Unit = { + var builtList = List[Int]() + for (x <- list) { + set += x + builtList = (builtList :+ x).distinct.sorted filterNot nonlist.contains + assert(builtList forall set.apply, s"$set did not contain all elements of $builtList using apply") + assert(builtList.size == set.size, s"$set had size ${set.size} while $builtList had size ${builtList.size}") + } + assert(!(nonlist exists set.apply), s"$set had an element from $nonlist using apply") + assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") + } + + val set = TreeSet[Int]() + val clone = set.clone + val subset = set.clone from (min + 1) until max + val subclone = subset.clone + val subsubset = subset.clone from (almostmin + 1) until almostmax + val subsubclone = subsubset.clone + + check(set, list, nonlist) + check(clone, list, nonlist) + + check(subset, list, subnonlist) + check(subclone, list, subnonlist) + + check(subsubset, list, subsubnonlist) + check(subsubclone, list, subsubnonlist) + } + + def testRemove: Unit = { + def check(set: TreeSet[Int], sorted: List[Int]): Unit = { + var builtList = sorted + for (x <- list) { + set remove x + builtList = builtList filterNot (_ == x) + assert(builtList forall set.apply, s"$set did not contain all elements of $builtList using apply") + assert(builtList.size == set.size, s"$set had size $set.size while $builtList had size $builtList.size") + } + } + val set = TreeSet(list:_*) + val clone = set.clone + val subset = set.clone from (min + 1) until max + val subclone = subset.clone + val subsubset = subset.clone from (almostmin + 1) until almostmax + val subsubclone = subsubset.clone + + check(set, sorted) + check(clone, sorted) + + check(subset, subsorted) + check(subclone, subsorted) + + check(subsubset, subsubsorted) + check(subsubclone, subsubsorted) + } + + def testIterator: Unit = { + def check(set: TreeSet[Int], list: List[Int]): Unit = { + val it = set.iterator.toList + assert(it == list, s"$it did not equal $list") + } + val set = TreeSet(list: _*) + check(set, sorted) + check(set.clone, sorted) + + val subset = set from (min + 1) until max + check(subset, subsorted) + check(subset.clone, subsorted) + + val subsubset = subset from (almostmin + 1) until almostmax + check(subsubset, subsubsorted) + check(subsubset.clone, subsubsorted) + } + + testSize + testContains + testAdd + testRemove + testIterator +} diff --git a/tests/pending/run/name-based-patmat.check b/tests/pending/run/name-based-patmat.check new file mode 100644 index 000000000000..3d5fc40ed7f4 --- /dev/null +++ b/tests/pending/run/name-based-patmat.check @@ -0,0 +1,12 @@ +`catdog only` has 11 chars +`catdog only, no product` has 23 chars +catdog +2 catdogs! A ha ha! +3 catdogs! A ha ha! +catdog +2 catdogs! A ha ha! +3 catdogs! A ha ha! +1 +1 +2 +3 diff --git a/tests/pending/run/name-based-patmat.scala b/tests/pending/run/name-based-patmat.scala new file mode 100644 index 000000000000..8e2094010032 --- /dev/null +++ b/tests/pending/run/name-based-patmat.scala @@ -0,0 +1,105 @@ +final class MiniSome[T](val get: T) extends AnyVal { def isEmpty = false } + +package p0 { + class Single(val x: Any) extends AnyRef with Product1[String] { + private def s = "" + x + override def canEqual(x: Any) = this eq x.asInstanceOf[AnyRef] + def isEmpty = false + def get = this + def _1 = s + " only" + + override def toString = s"Single(${_1})" + } + + object Single { + def unapply(x: Any): Single = new Single(x) + } + + class SingleNoProduct(val x: Any) extends AnyRef { + private def s = "" + x + def isEmpty = false + def get = s + " only, no product" + + override def toString = s"SingleNoProduct($get)" + } + + object SingleNoProduct { + def unapply(x: Any): SingleNoProduct = new SingleNoProduct(x) + } +} + +package p1 { + class Triple(val x: Any) extends AnyRef with Product3[String, String, String] { + private def s = "" + x + override def canEqual(x: Any) = this eq x.asInstanceOf[AnyRef] + def isEmpty = false + def get = this + def _1 = s + def _2 = "2 " + s + "s! A ha ha!" + def _3 = "3 " + s + "s! A ha ha!" + + override def toString = s"Triple(${_1}, ${_2}, ${_3})" + } + + object Triple { + def unapply(x: Any): Triple = new Triple(x) + } +} + +package p2 { + class Triple(val x: Any) { + private def s = "" + x + def isEmpty = false + def get = this + def _1 = s + def _2 = "2 " + s + "s! A ha ha!" + def _3 = "3 " + s + "s! A ha ha!" + override def toString = s"Triple(${_1}, ${_2}, ${_3})" + } + + object Triple { + def unapply(x: Any): Triple = new Triple(x) + } +} + +package p3 { + case class Foo(x: Int, y: Int, zs: Int*) + + object Bar { + def f(x: Foo) = x match { + case Foo(5, 10, 15, 20, _*) => 1 + case Foo(5, 10, 15, _*) => 2 + case Foo(5, 10, _*) => 3 + case Foo(5, 10) => 4 // should warn unreachable + case _ => 5 + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + "catdog" match { + case p0.Single(x) => println(s"`${x._1}` has ${x._1.length} chars") + case x => println("fail: " + x) + } + "catdog" match { + case p0.SingleNoProduct(x) => println(s"`$x` has ${x.length} chars") + case x => println("fail: " + x) + } + "catdog" match { + case p1.Triple(x, y, z) => List(x, y, z) foreach println + case x => println("fail: " + x) + } + // TODO + "catdog" match { + case p2.Triple(x, y, z) => List(x, y, z) foreach println + case x => println("fail: " + x) + } + + println(p3.Bar.f(p3.Foo(5, 10, 15, 20, 25))) + println(p3.Bar.f(p3.Foo(5, 10, 15, 20))) + println(p3.Bar.f(p3.Foo(5, 10, 15))) + println(p3.Bar.f(p3.Foo(5, 10))) + // println(p3.Bar.f(p3.Foo(5))) + } +} diff --git a/tests/pending/run/names-defaults.check b/tests/pending/run/names-defaults.check new file mode 100644 index 000000000000..c358dc5849de --- /dev/null +++ b/tests/pending/run/names-defaults.check @@ -0,0 +1,127 @@ +names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + spawn(b = { val ttt = 1; ttt }, a = 0) + ^ +warning: there were four deprecation warnings; re-run with -deprecation for details +1: @ +get: $ +get: 2 +2: $ +get: 3 +get: ** +3: ** +get: 110 +get: 11 +get: \ +get: 2.399 +11: \, 110, 2.399 +get: 14 +get: 3920 +get: } +get: [ +14: [, 3920, } +get: 4 +get: @ +4: @ +get: 10 +get: flu +10: flu +get: 8 +get: 9 +get: % +get: 5 +5: %, 17 +12: ', 13, 16 +1: bird, swine, 10 +20 +30 +40 +6: ~ +14: / +100: 100: nix, nix, 982, 982, 0 +100: overridden, bla, 0, 0, 555 +100: overridden, , 93.3, 93.3, -1 +first +first +second +first +second +second +second +first +second +f +second +second +first +third +fourth +fifth +sixth +first +2, List(4, 4, 4) +2, List() +5 +get: 11 +11 +get: 1 +get: 2 +get: 2 +3 +0 +get: 20 +get: 20 +20 +0 +1 +dlkfj0dlkfj102 +lskf2dkflj2 +dlkd5nixda10nixdadklfj1dklfj +C(dlkf,234,struct)struct??? +C(dflkj,234,Some(209))None!! +dflk10 +1-1jupee +12.39 +2 +Factory(1,blabla) +Factory(-1,blabla) +Fact2(ju,1) +Fact2(1,1) +Fact2(10,blabla) +test5 +2 +test5 +3 +test5 +4 +test5 +5 +10: 2 +slkdfj2 +1 +lskfdjlk +11 +2 +20 +10 +jaa +kldfj110101 +klfj1 +blublu1 +my text +List(1, 2) +3 +1 +2 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +(1,0), (1,2) +1 1 0 diff --git a/tests/pending/run/names-defaults.scala b/tests/pending/run/names-defaults.scala new file mode 100644 index 000000000000..12a118ddd758 --- /dev/null +++ b/tests/pending/run/names-defaults.scala @@ -0,0 +1,507 @@ + +import scala.language.{ higherKinds, existentials } + +object Test extends dotty.runtime.LegacyApp { + def get[T](x: T) = { println("get: "+ x); x } + + // TESTS + + // re-order using names, call-site evaluation order + test1(1, "@") + test1(b = get("$"), a = get(2)) + test1(a = get(3), b = get("**")) // should not transform into a block. how to test? + test3(b = get(110), a = get(11))(c = get("\\"), d = get(2.399)) + test3(get(14), get(3920))(d = get("}"), c = get("[")) + + + // mixing named and positional + test1(get(4), b = get("@")) + test1(a = get(10), get("flu")) + test2(get(8), v = get(9))(get("%"), l = get(5)) + test3(12, 13)("'", d = 16) + test3(a = 1, "swine")(c = "bird", d = 10L) + + + // anonymous functions + { + def doMod(f: Int => Unit): Unit = { f(20) } + var var1 = 0 + doMod(var1 = _) + println(var1) + + synchronized(var1 = 30) + println(var1) + + var var2 = 0 + def delay(var2: => Int) = { var2 } + println(delay(var2 = 40)) + } + val f1: (Int, String) => Unit = test1(_, _); f1(6, "~") + + + test4(14) + + + // defaults: subclass overrides, adds and inherits default + val b = new Base + b.test1(b = "nix")(982)(f = 0) + val s = new Sub1 + s.test1(a = new { override def toString = "bla" })(m = 0)() + + // defaults are chosen dynamically + val b2: Base = new Sub1 + b2.test1(b = "")(c = 93.3)(f = -1) + + + + // overloading resolution + object t1 { + def f(a: Int, b: String) = "first" + def f(b: String, a: Int) = "second" + } + println(t1.f(1, "2")) // first + + object t2 { + def f(a: Int, b: Double, c: Object) = "first" + def f(a: Int, b: Double, c: String) = "second" + } + println(t2.f(1, c = new Base(), b = 2.2)) // first + println(t2.f(28, b = 3.89, c = "ldksfj")) // second + + object t3 { + def f(a1: Int) = "first" + def f(a2: Int)(b: Int) = "second" + } + println(t3.f(a1 = 10)) // first + println(t3.f(a2 = 20)(1)) // second + + object t4 { + def f(a: Int, b: String = "foo") = "first" + def f(a: Int) = "second" + } + println(t4.f(109)) // second + println(t4.f(a = 20)) // second + + object t5 { + def f(a: Object) = "first" + val f: String => String = a => "second" + } + println(t5.f(new Sub1())) // firsst + println(t5.f("dfklj")) // second + + object t6 { + def f(a: String = "sdf", b: Int) = "f" + def f(a: Int, b: Int) = "s" + } + println(t6.f(b = 289)) // f + + object t7 { + def f(a: Int, b: String*) = "first" + def f(a: Int) = "second" + def g(a: Sub1, b: Int*) = "third" + def g(a: Base) = "fourth" + def h(a: Base, b: Int*) = "fifth" + def h(a: Sub1) = "sixth" + } + println(t7.f(1)) // second + println(t7.f(a = 19)) // second + println(t7.f(b = "sl19", a = 28)) // first + println(t7.g(new Sub1(), 1, 2)) // third + println(t7.g(new Base())) // fourth + println(t7.h(new Base())) // fifth + println(t7.h(new Sub1())) // sixth + + object t9 { + def f(a: String, b: Int = 11) = "first" + def f(a: Double) = "second" + } + println(t9.f("bla")) // first + + + // vararg + def test5(a: Int, b: Int)(c: Int, d: String*) = a +", "+ d.toList + println(test5(b = 1, a = 2)(3, "4", "4", "4")) + println(test5(b = 1, a = 2)(c = 29)) + + + // tuple conversion + def foo(a: Int, b: Int)(c: (Int, String)) = a + c._1 + println(foo(b = 1, a = 2)(3, "4")) + + + // by-name parameters + def bn1(a: Int, b: => Int) = a + println(bn1(b = get(10), a = get(11))) // should not see get(10) + + def bn2(a: Int, b: => Int)(c: Int = b) = a + b + println(bn2(b = get(2), a = get(1))()) // should get: 1, 2, 2 + + def bn3(a: => Int = get(10)) = 0 + def bn4(a: => Int = get(20)) = {a; a} + println(bn3()) + println(bn4()) + println(bn4(a = 0)) + + class t2929(x: => Int = 1) { + def foo = x + } + println((new t2929()).foo) + + // constructors + val a1 = new A(b = "dlkfj")(d = 102) + println(a1.print) + val a2 = new A[String, Nothing](2, "dkflj")(d = 2, c = "lskf") + println(a2.print) + val b1 = new B("dklfj")(e = "nixda") + println(b1.printB) + val c1 = new C(a = "dlkf", c = new { override def toString() = "struct" })(e = "???") + println(c1.print) + val c2 = C("dflkj", c = Some(209): Option[Int])(None, "!!") + println(c2.print) + + + // "super" qualifier + val b10 = new B1 + println(b10.bar()) + + + // defaults in traits / abstract classes + val mn = new MN + println(mn.foo()()) + println(mn.bar(10)) + // anonymous class + println((new M { def foo[T >: String](x: Int, y: T)(z: String = "2") = z ; def bar(x: Int, y: Double) = x }).foo()()) + + // copy method for case classes + val fact = Factory(y = "blabla")() + println(fact) + println(fact.copy(x = -1)("dldl")) + + println(Fact2()("jyp")) + println(Fact2(x = 1)()) + println(Fact2(10)().copy(y = "blabla")(3)) + + + // assignment to var <-> named argument + var argName = 1 + test5(argName = (argName = 2)) + println(argName) // should be 2 + test5({argName = 3}) + println(argName) // should be 3 + test5((argName = 4)) + println(argName) // should be 4 + test5 { argName = 5 } + println(argName) // should be 5 + val a: Unit = test1(a = 10, b = "2") // local values a and b exist, but not ambiuous since they're val's + + + // dependent types and copy method + val a11 = new A2 + val b11 = a11.B2(new a11.C2)(1) + println(b11.copy()(2)) + + + + // bug #2057 + class O { class I(val x: Int = 1) } + class U extends O { val f = new I() } + val u1 = new U + println(u1.f.x) + + + // names / defaults in self constructor call + new A3("lskfdjlk") + new A4(1.23, ",") + + + // names / defaults in super constructor call + new B4() + new B5() + + // no re-naming of parameters which are free in a closure of the body (lambdalift) + println(test6(10)()) + test7("jaa") + + // implicits + defaults + { + implicit val implInt: Int = 10101 + println(test8()) + } + + println(test9) + + { + implicit val implString: String = "blublu" + println(test9) + } + + + // result type of default getters: parameter type, except if this one mentions any type + // parameter, in which case the result type is inferred. examples: + + // result type of default getter is "String => String". if it were infered, the compiler + // would put "Nothing => Nothing", which is useless + def transform(s: String, f: String => String = identity _) = f(s) + println(transform("my text")) + + + // a bug reported on a mailing list: see comment in Typer.typedModuleDef + object TT + class TT(x: Int = 1) + val v = new TT() + + + // result type of the default getter is inferred (parameter type mentions type parameter T) + def test10[T](x: List[T] = List(1,2)) = x + println(test10()) + + // some complicated type which mentions T + def test11[T[P]](x: T[T[List[T[X forSome { type X }]]]] = List(1,2)) = x + // (cannot call f using the default, List(1,2) doesn't match the param type) + + def multinest = { def bar(x: Int = 1) = { def bar(x: Int = 2) = x; bar() + x }; bar() } + println(multinest) + + + // #2290 + def spawn(a: Int, b: => Unit) = { () } + def t: Unit = { + spawn(b = { val ttt = 1; ttt }, a = 0) + } + + // #2382 + class A2382[+T](x: T => Int) { def foo(a: T => Int = x) = 0 } + + // #2390 + case class A2390[T](x: Int) { def copy(a: Int)(b: Int = 0) = 0 } + + // #2489 + class A2489 { def foo: Unit = { def bar(a: Int = 1) = a; bar(); val u = 0 } } + class A2489x2 { def foo: Unit = { val v = 10; def bar(a: Int = 1, b: Int = 2) = a; bar(); val u = 0 } } + + // a bug reported on the mailing lists, related to #2489 + class Test2489 { + def foo(): Int = { + val i = 10 + case class Foo(j: Int) + i + } + } + + // #2784 + class Test2784 { + object t { def f(x: Int) = x } + val one = t f (x = 1) + } + + // #2820 + class Test2820 { + class A[T](f: String = "ski!") + class C extends A + } + + object t3178 { + def foo(x: String) = x + def foo(x: Int) = x + def bar(foo: Int) = foo + bar(foo = 1) + } + + + // #3207 + trait P3207[T] { + class Inner(val f: T => Unit = (x: T) => println(x)) + } + + object Test3207_1 { + val p = new P3207[Int] {} + val q = new p.Inner() { + def g = 0 + } + } + + object Test3207_2 { + val p = new P3207[Int] { + val inner = new Inner() { + def g = 0 + } + } + } + + // #3344 + def m3344_1 = { case class C(x: Int); C(1).copy(2).x } + m3344_1 + def m3344_2 = { class C(val x: Int = 1); new C().x } + m3344_2 + + // #3338 + object t3338 { + class Container { + class GenericClass[T](arg: String = "") + } + + object Container extends Container + + class Test { + val a = new Container.GenericClass() + } + } + (new t3338.Test).a + + + // subclassing and defaults in both class constructors + class CBLAH(val x: Int = 1) + class DBLAH(val y: String = "2") extends CBLAH() + (new DBLAH()) + + // deprecated names + def deprNam1(@deprecatedName('x) a: Int, @deprecatedName('y) b: Int) = a + b + deprNam1(y = 10, a = 1) + deprNam1(b = 2, x = 10) + + object deprNam2 { + def f(@deprecatedName('s) x: String) = 1 + def f(s: Object) = 2 + + def g(@deprecatedName('x) s: Object) = 3 + def g(s: String) = 4 + } + println(deprNam2.f(s = "dlf")) + println(deprNam2.f(s = new Object)) + println(deprNam2.g(x = "sljkfd")) + + + // #3697 + object t3697 { + def a(x: Int*)(s: Int = 3) = s + def b(a: Int, b: Int, c: Int*) = a + b + } + println(t3697.a(Seq(3): _*)()) + println(t3697.a(3)()) + println(t3697.a()()) + println(t3697.a(2,3,1)()) + println(t3697.b(a = 1, b = 2)) + println(t3697.b(a = 1, b = 2, 3)) + println(t3697.b(b = 1, a = 2, c = 3)) + println(t3697.b(a = 1, b = 2, 3, 4)) + println(t3697.b(a = 1, b = 2, Seq(3, 4): _*)) + println(t3697.b(b = 1, a = 2, c = Seq(3, 4): _*)) + + + // #4041 + object t4041 { + def _1 = (0, 0) copy (_1 = 1) + def _2 = (1, 1) copy (_2 = 2) + } + println(""+ t4041._1 +", "+ t4041._2) + + // #4441 + case class C4441a() + case class C4441b()() + C4441a().copy() + C4441b()().copy()() + + // SI-8117 + def f8177(a: Int = 0, b: Int = 0, c: Int = 0) = s"$a $b $c" + println(f8177(a = 1, 1)) + + // DEFINITIONS + def test1(a: Int, b: String) = println(a +": "+ b) + def test2(u: Int, v: Int)(k: String, l: Int) = println(l +": "+ k +", "+ (u + v)) + + def test3[T1, T2](a: Int, b: T1)(c: String, d: T2) = println(a +": "+ c +", "+ b +", "+ d) + + def test4(a: Int) = { + def inner(b: Int = a, c: String) = println(b +": "+ c) + inner(c = "/") + } + def test5(argName: Unit) = println("test5") + def test6(x: Int) = { () => x } + def test7(s: String) = List(1).foreach(_ => println(s)) + + def test8(x: Int = 1)(implicit y: Int, z: String = "kldfj") = z + x + y + def test9(implicit x: Int = 1, z: String = "klfj") = z + x +} + + +class Base { + def test1[T1, T2](a: Int = 100, b: T1)(c: T2, d: String = a +": "+ b)(e: T2 = c, f: Int) = + println(a +": "+ d +", "+ b +", "+ c +", "+ e +", "+ f) +} + +class Sub1 extends Base { + override def test1[U1, U2](b: Int, a: U1)(m: U2, r: String = "overridden")(o: U2, f: Int = 555) = + println(b +": "+ r +", "+ a +", "+ m +", "+ o +", "+ f) +} + + +class A[T <: String, U](a: Int = 0, b: T)(c: String = b, d: Int) { def print = c + a + b + d } +class B[T](a: T, b: Int = 1)(c: T = a, e: String = "dklsf") extends A(5, e)("dlkd", 10) { def printB = super.print + e + a + b + c } + +case class C[U](a: String, b: Int = 234, c: U)(d: U = c, e: String = "dlkfj") { def print = toString + d + e } + + +class A1 { + def foo(a: Int = 10, b: String) = b + a +} +class B1 extends A1 { + def bar(a: String = "dflk") = super.foo(b = a) +} + +trait N { + def foo[T >: String](x: Int = -1, y: T = "jupee")(z: String): Object +} + +abstract class M extends N { + // also tests #2116, specialize return type when overriding. + def foo[T >: String](x: Int, y: T)(z: String = "1"): String + def bar(n: Int, m: Double = 1.239): Double +} + +class MN extends M { + def foo[T >: String](x: Int, y: T)(z: String) = z + x + y + def bar(n: Int, m: Double) = n*m +} + +case class Factory(x: Int = 1, y: String)(z: String = y) +case class Fact2[T, +U](x: T = "ju", y: U = 1)(z: T = 2) + + +// dependent types and copy method +class A2 { + case class B2(x: C2)(y: Int) extends A2 { + override def toString = "slkdfj" + y + } + class C2 +} + + + +// using names / defaults in self constructor call. +// overloading resolution: calling A3("string") picks the second, method with default is always less specific. +class A3(x: String, y: Int = 10) { + def this(a: Object) = { + this(y = 10, x = a.toString()) + println(x) + } +} +class A4(x: String, y: Int = 11) { + def this(b: Double, sep: String) = { + this(sep + b + sep) + println(y) + } +} + + +// using names / defaults in super constructor call +class A5(x: Int, val y: Int = 2)(z: Int = x + y) +class B4 extends A5(10)() { + println(y) +} +class B5 extends A5(y = 20, x = 2)() { + println(y) +} + +// overriding default can be less specific (but has to conform to argument type!) +class A6 { def foo(a: Object = "dlkf") = 0 } +class B6 extends A6 { override def foo(a: Object = new Object) = 1 } diff --git a/tests/pending/run/newTags.check b/tests/pending/run/newTags.check new file mode 100644 index 000000000000..16be9b124e59 --- /dev/null +++ b/tests/pending/run/newTags.check @@ -0,0 +1,3 @@ +List[Int] +Map[String,String] +TypeTag[Map[String,String]] diff --git a/tests/pending/run/newTags.scala b/tests/pending/run/newTags.scala new file mode 100644 index 000000000000..a54bc3c6bc19 --- /dev/null +++ b/tests/pending/run/newTags.scala @@ -0,0 +1,11 @@ +import scala.reflect.api.{Universe => ApiUniverse} +import scala.reflect.runtime.{universe => ru} + +object Test extends dotty.runtime.LegacyApp { + println(ru.typeOf[List[Int]]) + def foo[T: ru.TypeTag] = { + println(ru.typeOf[T]) + println(implicitly[ApiUniverse#TypeTag[T]]) + } + foo[Map[String, String]] +} diff --git a/tests/pending/run/no-pickle-skolems.check b/tests/pending/run/no-pickle-skolems.check new file mode 100644 index 000000000000..d64066171aae --- /dev/null +++ b/tests/pending/run/no-pickle-skolems.check @@ -0,0 +1 @@ +OK! diff --git a/tests/pending/run/no-pickle-skolems/Source_1.scala b/tests/pending/run/no-pickle-skolems/Source_1.scala new file mode 100644 index 000000000000..1b4cbfa788f3 --- /dev/null +++ b/tests/pending/run/no-pickle-skolems/Source_1.scala @@ -0,0 +1,5 @@ +package s + +trait Foo { def to[CC[X]](implicit cc: CC[Int]): Unit } + +class Bar extends Foo { def to[CC[X]](implicit cc: CC[Int]): Unit = ??? } diff --git a/tests/pending/run/no-pickle-skolems/Test_2.scala b/tests/pending/run/no-pickle-skolems/Test_2.scala new file mode 100644 index 000000000000..c2eefdc0c92d --- /dev/null +++ b/tests/pending/run/no-pickle-skolems/Test_2.scala @@ -0,0 +1,39 @@ + +import scala.language.reflectiveCalls +import scala.reflect.runtime.universe._ + +object Test { + /** Collects symbols by the given name, even if they're not + * named CC. + */ + def collectSymbols[T: TypeTag](inMethod: TermName, name: String): List[String] = { + val m = typeOf[T] member inMethod infoIn typeOf[T] + var buf: List[Symbol] = Nil + var seen: Set[Symbol] = Set() + def id(s: Symbol): Int = s.asInstanceOf[{ def id: Int }].id + + def check(s: Symbol): Unit = { + if (!seen(s)) { + seen += s + if (s.name.toString == name) buf ::= s + } + } + def loop(t: Type): Unit = { + t match { + case TypeRef(pre, sym, args) => loop(pre) ; check(sym) ; args foreach loop + case PolyType(tparams, restpe) => tparams foreach { tp => check(tp) ; check(tp.owner) ; loop(tp.info) } ; loop(restpe) + case MethodType(params, restpe) => params foreach { p => check(p) ; loop(p.info) } ; loop(restpe) + case _ => + } + } + loop(m) + + buf.reverse.distinct map (s => s.name + "#" + id(s)) + } + + def main(args: Array[String]): Unit = { + val syms = collectSymbols[s.Bar](TermName("to"), "CC") + assert(syms.size == 1, syms) + println("OK!") + } +} diff --git a/tests/pending/run/nonlocalreturn.check b/tests/pending/run/nonlocalreturn.check new file mode 100644 index 000000000000..aeb2d5e2398d --- /dev/null +++ b/tests/pending/run/nonlocalreturn.check @@ -0,0 +1 @@ +Some(1) diff --git a/tests/pending/run/nonlocalreturn.scala b/tests/pending/run/nonlocalreturn.scala new file mode 100644 index 000000000000..13b9045da45d --- /dev/null +++ b/tests/pending/run/nonlocalreturn.scala @@ -0,0 +1,15 @@ +object Test { + def wrap[K](body: => K): K = body + + def f(): Option[Int] = { + wrap({ return Some(1) ; None }) + } + + def main(args: Array[String]): Unit = { + println(f()) + } +} +// java.lang.ClassCastException: scala.Some cannot be cast to scala.None$ +// at Test$$anonfun$f$1.apply(nonlocalreturn.scala:5) +// at Test$$anonfun$f$1.apply(nonlocalreturn.scala:5) +// at Test$.wrap(nonlocalreturn.scala:2) diff --git a/tests/pending/run/nothingTypeDce.flags b/tests/pending/run/nothingTypeDce.flags new file mode 100644 index 000000000000..d85321ca0eaa --- /dev/null +++ b/tests/pending/run/nothingTypeDce.flags @@ -0,0 +1 @@ +-target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code diff --git a/tests/pending/run/nothingTypeDce.scala b/tests/pending/run/nothingTypeDce.scala new file mode 100644 index 000000000000..b1acb7d51ac8 --- /dev/null +++ b/tests/pending/run/nothingTypeDce.scala @@ -0,0 +1,63 @@ +// See comment in BCodeBodyBuilder + +// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code +// target enables stack map frames generation + +class C { + // can't just emit a call to ???, that returns value of type Nothing$ (not Int). + def f1: Int = ??? + + def f2: Int = throw new Error("") + + def f3(x: Boolean) = { + var y = 0 + // cannot assign an object of type Nothing$ to Int + if (x) y = ??? + else y = 1 + y + } + + def f4(x: Boolean) = { + var y = 0 + // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames) + if (x) y = throw new Error("") + else y = 1 + y + } + + def f5(x: Boolean) = { + // stack heights need to be the same. ??? looks to the jvm like returning a value of + // type Nothing$, need to drop or throw it. + println( + if (x) { ???; 10 } + else 20 + ) + } + + def f6(x: Boolean) = { + println( + if (x) { throw new Error(""); 10 } + else 20 + ) + } + + def f7(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } + + def f8(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } +} + +object Test extends dotty.runtime.LegacyApp { + // creating an instance is enough to trigger bytecode verification for all methods, + // no need to invoke the methods. + new C() +} diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.check b/tests/pending/run/nothingTypeNoFramesNoDce.check new file mode 100644 index 000000000000..b1d08b45ffef --- /dev/null +++ b/tests/pending/run/nothingTypeNoFramesNoDce.check @@ -0,0 +1 @@ +warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above. diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.flags b/tests/pending/run/nothingTypeNoFramesNoDce.flags new file mode 100644 index 000000000000..a035c861798f --- /dev/null +++ b/tests/pending/run/nothingTypeNoFramesNoDce.flags @@ -0,0 +1 @@ +-target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation diff --git a/tests/pending/run/nothingTypeNoFramesNoDce.scala b/tests/pending/run/nothingTypeNoFramesNoDce.scala new file mode 100644 index 000000000000..13c1617dd843 --- /dev/null +++ b/tests/pending/run/nothingTypeNoFramesNoDce.scala @@ -0,0 +1,61 @@ +// See comment in BCodeBodyBuilder + +// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none +// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is. + +class C { + // can't just emit a call to ???, that returns value of type Nothing$ (not Int). + def f1: Int = ??? + + def f2: Int = throw new Error("") + + def f3(x: Boolean) = { + var y = 0 + // cannot assign an object of type Nothing$ to Int + if (x) y = ??? + else y = 1 + y + } + + def f4(x: Boolean) = { + var y = 0 + // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames) + if (x) y = throw new Error("") + else y = 1 + y + } + + def f5(x: Boolean) = { + // stack heights need to be the smae. ??? looks to the jvm like returning a value of + // type Nothing$, need to drop or throw it. + println( + if (x) { ???; 10 } + else 20 + ) + } + + def f6(x: Boolean) = { + println( + if (x) { throw new Error(""); 10 } + else 20 + ) + } + + def f7(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } + + def f8(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } +} + +object Test extends dotty.runtime.LegacyApp { + new C() +} diff --git a/tests/pending/run/nothingTypeNoOpt.flags b/tests/pending/run/nothingTypeNoOpt.flags new file mode 100644 index 000000000000..b3b518051b6f --- /dev/null +++ b/tests/pending/run/nothingTypeNoOpt.flags @@ -0,0 +1 @@ +-target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none diff --git a/tests/pending/run/nothingTypeNoOpt.scala b/tests/pending/run/nothingTypeNoOpt.scala new file mode 100644 index 000000000000..84085928749e --- /dev/null +++ b/tests/pending/run/nothingTypeNoOpt.scala @@ -0,0 +1,61 @@ +// See comment in BCodeBodyBuilder + +// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none +// target enables stack map frame generation + +class C { + // can't just emit a call to ???, that returns value of type Nothing$ (not Int). + def f1: Int = ??? + + def f2: Int = throw new Error("") + + def f3(x: Boolean) = { + var y = 0 + // cannot assign an object of type Nothing$ to Int + if (x) y = ??? + else y = 1 + y + } + + def f4(x: Boolean) = { + var y = 0 + // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames) + if (x) y = throw new Error("") + else y = 1 + y + } + + def f5(x: Boolean) = { + // stack heights need to be the smae. ??? looks to the jvm like returning a value of + // type Nothing$, need to drop or throw it. + println( + if (x) { ???; 10 } + else 20 + ) + } + + def f6(x: Boolean) = { + println( + if (x) { throw new Error(""); 10 } + else 20 + ) + } + + def f7(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } + + def f8(x: Boolean) = { + println( + if (x) throw new Error("") + else 20 + ) + } +} + +object Test extends dotty.runtime.LegacyApp { + new C() +} diff --git a/tests/pending/run/null-and-intersect.check b/tests/pending/run/null-and-intersect.check new file mode 100644 index 000000000000..81890cfeff4a --- /dev/null +++ b/tests/pending/run/null-and-intersect.check @@ -0,0 +1,9 @@ +1 +2 +3 +4 +1 +2 +1 +2 +2 diff --git a/tests/pending/run/null-and-intersect.scala b/tests/pending/run/null-and-intersect.scala new file mode 100644 index 000000000000..7266dabe6df4 --- /dev/null +++ b/tests/pending/run/null-and-intersect.scala @@ -0,0 +1,34 @@ +object Test { + trait Immortal + class Bippy extends Immutable with Immortal + class Boppy extends Immutable + + def f[T](x: Traversable[T]) = x match { + case _: Map[_, _] => 3 + case _: Seq[_] => 2 + case _: Iterable[_] => 1 + case _ => 4 + } + def g(x: Bippy) = x match { + case _: Immutable with Immortal => 1 + case _ => 2 + } + def h(x: Immutable) = x match { + case _: Immortal => 1 + case _ => 2 + } + + def main(args: Array[String]): Unit = { + println(f(Set(1))) + println(f(Seq(1))) + println(f(Map(1 -> 2))) + println(f(null)) + + println(g(new Bippy)) + println(g(null)) + + println(h(new Bippy)) + println(h(new Boppy)) + println(h(null)) + } +} diff --git a/tests/pending/run/null-hash.scala b/tests/pending/run/null-hash.scala new file mode 100644 index 000000000000..9b1f28b083c1 --- /dev/null +++ b/tests/pending/run/null-hash.scala @@ -0,0 +1,15 @@ +object Test { + def f1 = List(5, 10, null: String).## + def f2(x: Any) = x.## + def f3 = ((55, "abc", null: List[Int])).## + + def main(args: Array[String]): Unit = { + f1 + f2(null) + f2(null: String) + f3 + null.## + (null: Any).## + (null: String).## + } +} diff --git a/tests/pending/run/nullable-lazyvals.check b/tests/pending/run/nullable-lazyvals.check new file mode 100644 index 000000000000..4db57832578a --- /dev/null +++ b/tests/pending/run/nullable-lazyvals.check @@ -0,0 +1,3 @@ + +param1: null +param2: null diff --git a/tests/pending/run/nullable-lazyvals.scala b/tests/pending/run/nullable-lazyvals.scala new file mode 100644 index 000000000000..bb3292b7eff5 --- /dev/null +++ b/tests/pending/run/nullable-lazyvals.scala @@ -0,0 +1,36 @@ + +/** Test that call-by-name parameters are set to null if + * they are used only to initialize a lazy value, after the + * value has been initialized. + */ + +class Foo(param1: => Object, param2: => String) { + lazy val field1 = param1 + lazy val field2 = try param2 finally println("") +} + +object Test extends dotty.runtime.LegacyApp { + val foo = new Foo(new Object, "abc") + + foo.field1 + foo.field2 + + for (f <- foo.getClass.getDeclaredFields) { + f.setAccessible(true) + if (f.getName.startsWith("param")) { + println("%s: %s".format(f.getName, f.get(foo))) + } + } + + // test that try-finally does not generated a liftedTry + // helper. This would already fail the first part of the test, + // but this check will help diganose it (if the single access to a + // private field does not happen directly in the lazy val, it won't + // be nulled). + for (f <- foo.getClass.getDeclaredMethods) { + f.setAccessible(true) + if (f.getName.startsWith("lifted")) { + println("not expected: %s".format(f)) + } + } +} diff --git a/tests/pending/run/number-parsing.scala b/tests/pending/run/number-parsing.scala new file mode 100644 index 000000000000..ad1481063ece --- /dev/null +++ b/tests/pending/run/number-parsing.scala @@ -0,0 +1,31 @@ +object Test { + def numTests() = { + val MinusZero = Float.box(-0.0f) + val PlusZero = Float.box(0.0f) + + assert(PlusZero match { case MinusZero => false ; case _ => true }) + assert(MinusZero match { case PlusZero => false ; case _ => true }) + assert((MinusZero: scala.Float) == (PlusZero: scala.Float)) + assert(!(MinusZero equals PlusZero)) + + List( + -5f.max(2) , + -5f max 2 , + -5.max(2) , + -5 max 2 + ) foreach (num => assert(num == 2)) + } + + case class Foo(val x: Double) { + def unary_- : Foo = Foo(-x) + def +(other: Foo): Foo = Foo(x + other.x) + } + def objTests = { + assert(-Foo(5.0) + Foo(10.0) == Foo(5.0)) + assert(-Foo(5.0).+(Foo(10.0)) == Foo(-15.0)) + } + + def main(args: Array[String]): Unit = { + numTests() + } +} diff --git a/tests/pending/run/numbereq.scala b/tests/pending/run/numbereq.scala new file mode 100644 index 000000000000..7ce4b23cf895 --- /dev/null +++ b/tests/pending/run/numbereq.scala @@ -0,0 +1,91 @@ +object Test { + def mkNumbers(x: Int): List[AnyRef] = { + val base = List( + BigDecimal(x), + BigInt(x), + new java.lang.Double(x.toDouble), + new java.lang.Float(x.toFloat), + new java.lang.Long(x.toLong), + new java.lang.Integer(x) + ) + val extras = List( + if (x >= Short.MinValue && x <= Short.MaxValue) List(new java.lang.Short(x.toShort)) else Nil, + if (x >= Byte.MinValue && x <= Byte.MaxValue) List(new java.lang.Byte(x.toByte)) else Nil, + if (x >= Char.MinValue && x <= Char.MaxValue) List(new java.lang.Character(x.toChar)) else Nil + ).flatten + + base ::: extras + } + + def mkNumbers(x: BigInt): List[AnyRef] = { + List( + List(BigDecimal(x, java.math.MathContext.UNLIMITED)), + List(x), + if (x.isValidDouble) List(new java.lang.Double(x.toDouble)) else Nil, + if (x.isValidFloat) List(new java.lang.Float(x.toFloat)) else Nil, + if (x.isValidLong) List(new java.lang.Long(x.toLong)) else Nil, + if (x.isValidInt) List(new java.lang.Integer(x.toInt)) else Nil, + if (x.isValidShort) List(new java.lang.Short(x.toShort)) else Nil, + if (x.isValidByte) List(new java.lang.Byte(x.toByte)) else Nil, + if (x.isValidChar) List(new java.lang.Character(x.toChar)) else Nil + ).flatten + } + + // Don't necessarily expect BigDecimal created from BigInt to agree with Double here. + def isIffy(x: Any, y: Any, canSwap: Boolean = true): Boolean = x match { + case bd: BigDecimal => y match { + case _: Float | _: Double => bd.toString.length > 15 + case _ => false + } + case _ => canSwap && isIffy(y, x, false) + } + + // Don't necessarily expect BigInt to agree with Float/Double beyond a Long + def isIffyB(x: Any, y: Any, canSwap: Boolean = true): Boolean = x match { + case bi: BigInt => y match { + case _: Float | _: Double => bi < Long.MinValue || bi > Long.MaxValue + case _ => false + } + case _ => canSwap && isIffyB(y, x, false) + } + + def main(args: Array[String]): Unit = { + val ints = (0 to 15).toList map (Short.MinValue >> _) + val ints2 = ints map (x => -x) + val ints3 = ints map (_ + 1) + val ints4 = ints2 map (_ - 1) + + val setneg1 = ints map mkNumbers + val setneg2 = ints3 map mkNumbers + val setpos1 = ints2 map mkNumbers + val setpos2 = ints4 map mkNumbers + val zero = mkNumbers(0) + + val sets = setneg1 ++ setneg2 ++ List(zero) ++ setpos1 ++ setpos2 + + for (set <- sets ; x <- set ; y <- set) { + assert(x == y, "%s/%s != %s/%s".format(x, x.getClass, y, y.getClass)) + assert(x.## == y.##, "%s != %s".format(x.getClass, y.getClass)) + } + + val bigInts = (0 to 1024).toList map (BigInt(-1) << _) + val bigInts2 = bigInts map (x => -x) + val bigInts3 = bigInts map (_ + 1) + val bigInts4 = bigInts2 map (_ - 1) + + val setneg1b = bigInts map mkNumbers + val setneg2b = bigInts3 map mkNumbers + val setpos1b = bigInts2 map mkNumbers + val setpos2b = bigInts4 map mkNumbers + + val sets2 = setneg1 ++ setneg1b ++ setneg2 ++ setneg2b ++ List(zero) ++ setpos1 ++ setpos1b ++ setpos2 ++ setpos2b + + for (set <- sets2 ; x <- set ; y <- set) { + if (!isIffy(x,y)) { + assert(x == y, "%s/%s != %s/%s".format(x, x.getClass, y, y.getClass)) + // The following is blocked by SI-8150 + // if (!isIffyB(x,y)) assert(x.## == y.##, "%x/%s != %x/%s from %s.## and %s.##".format(x.##, x.getClass, y.##, y.getClass, x, y)) + } + } + } +} diff --git a/tests/pending/run/numeric-range.scala b/tests/pending/run/numeric-range.scala new file mode 100644 index 000000000000..9cf8e605e856 --- /dev/null +++ b/tests/pending/run/numeric-range.scala @@ -0,0 +1,13 @@ + + + + +object Test { + def main(args: Array[String]): Unit = { + val r = 'a' to 'z' + for (i <- -2 to (r.length + 2)) { + assert(r.take(i) == r.toList.take(i), (i, r.take(i))) + assert(r.drop(i) == r.toList.drop(i), (i, r.drop(i))) + } + } +} diff --git a/tests/pending/run/optimizer-array-load.check b/tests/pending/run/optimizer-array-load.check new file mode 100644 index 000000000000..e8371f00609f --- /dev/null +++ b/tests/pending/run/optimizer-array-load.check @@ -0,0 +1,6 @@ +0 +1 +2 +3 +4 +5 diff --git a/tests/pending/run/optimizer-array-load.flags b/tests/pending/run/optimizer-array-load.flags new file mode 100644 index 000000000000..eb4d19bcb91a --- /dev/null +++ b/tests/pending/run/optimizer-array-load.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file diff --git a/tests/pending/run/optimizer-array-load.scala b/tests/pending/run/optimizer-array-load.scala new file mode 100644 index 000000000000..a4d76f73853a --- /dev/null +++ b/tests/pending/run/optimizer-array-load.scala @@ -0,0 +1,16 @@ +object Test { + def f() = { + val ar = Array.ofDim[Int](5) + var x = 0 + + while (x<=5) { + println(x) + val a = ar(x) + x+=1 + } + } + def main(args: Array[String]): Unit = { + try { f() ; assert(false, "should have thrown exception") } + catch { case _: ArrayIndexOutOfBoundsException => () } + } +} diff --git a/tests/pending/run/option-fold.check b/tests/pending/run/option-fold.check new file mode 100644 index 000000000000..4e3fe99f9853 --- /dev/null +++ b/tests/pending/run/option-fold.check @@ -0,0 +1,5 @@ +List() +List(5) +-1 +0 +1 diff --git a/tests/pending/run/option-fold.scala b/tests/pending/run/option-fold.scala new file mode 100644 index 000000000000..84e346ec79d1 --- /dev/null +++ b/tests/pending/run/option-fold.scala @@ -0,0 +1,20 @@ +object Test { + sealed class A + case object B extends A + case class C(x: Int) extends A + + def f[T](x: Option[T]) = x.fold(List.empty[T])(List(_)) + def g(x: Option[A]) = x.fold(-1) { + case B => 0 + case C(x) => x + case _ => ??? + } + + def main(args: Array[String]): Unit = { + println(f(None)) //List() + println(f(Some(5))) //List(5) + println(g(None)) //-1 + println(g(Some(B))) //0 + println(g(Some(C(1)))) //1 + } +} diff --git a/tests/pending/run/origins.check b/tests/pending/run/origins.check new file mode 100644 index 000000000000..b12cb6e38fbc --- /dev/null +++ b/tests/pending/run/origins.check @@ -0,0 +1,6 @@ + +>> Origins tag 'boop' logged 65 calls from 3 distinguished sources. + + 50 Test$$anonfun$f3$1.apply(origins.scala:16) + 10 Test$$anonfun$f2$1.apply(origins.scala:15) + 5 Test$$anonfun$f1$1.apply(origins.scala:14) diff --git a/tests/pending/run/origins.flags b/tests/pending/run/origins.flags new file mode 100644 index 000000000000..690753d807c1 --- /dev/null +++ b/tests/pending/run/origins.flags @@ -0,0 +1 @@ +-no-specialization -Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/origins.scala b/tests/pending/run/origins.scala new file mode 100644 index 000000000000..6529351d3c76 --- /dev/null +++ b/tests/pending/run/origins.scala @@ -0,0 +1,21 @@ +import scala.reflect.internal.util.Origins + +package goxbox { + object Socks { + val origins = Origins("boop") + + def boop(x: Int): Int = origins { 5 } + } +} + +object Test { + import goxbox.Socks.boop + + def f1() = 1 to 5 map boop + def f2() = 1 to 10 map boop + def f3() = 1 to 50 map boop + + def main(args: Array[String]): Unit = { + f1() ; f2() ; f3() + } +} diff --git a/tests/pending/run/outertest.scala b/tests/pending/run/outertest.scala new file mode 100644 index 000000000000..edeac9f62645 --- /dev/null +++ b/tests/pending/run/outertest.scala @@ -0,0 +1,62 @@ +// A test for the case where the outer field of class B#J should be eliminated. + +import reflect.ClassTag + +abstract class A { + abstract class I + + val foo = this +} + +class B extends A { + class J extends I { + val bar = foo + } + + type II = I + class K extends II { + val bar = foo + } + + class L extends (I @annotation.tailrec) { + val bar = foo + } +} + + +class C extends A { + val c: C = this + + class M extends c.I { + val bar = foo + } +} + + +object Test extends dotty.runtime.LegacyApp { + val b = new B + val c0 = new C + val c = new C { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +override val c = c0 +// END copied early initializers +} + + assert((new b.J).bar eq b) + assert((new b.K).bar eq b) + assert((new b.L).bar eq b) + assert((new c.M).bar eq c) + + def checkOuterFields[C: ClassTag](expected: Int): Unit = { + val cls = implicitly[ClassTag[C]].runtimeClass + val outerFields = cls.getDeclaredFields().filter(_.getName.contains("$outer")) + assert(outerFields.size == expected, outerFields.map(_.getName)) + } + + checkOuterFields[A#I](1) // the base class must have the $outer pointer + checkOuterFields[B#J](0) // reuse parent class' $outer pointer + checkOuterFields[B#K](0) // ... through an alias + checkOuterFields[B#L](0) // ... through the annotated type + checkOuterFields[C#M](1) // different prefix, can't share. +} diff --git a/tests/pending/run/overloads.check b/tests/pending/run/overloads.check new file mode 100644 index 000000000000..7d294870f6fa --- /dev/null +++ b/tests/pending/run/overloads.check @@ -0,0 +1,15 @@ +ok: -('a') = -97 +ok: -(97) = -97 +ok: Ops.-('a') = a +ok: Ops.-(97) = 97 +ok: -- = 0 +ok: --('a') = a +ok: --(97) = 97 +ok: Ops.-- = 0 +ok: Ops.--('a') = a +ok: Ops.--(97) = 97 +ok: Funcs.foo = 0 +ok: Funcs.foo('a') = 2 +ok: Funcs.foo(97) = 3 +ok: M1.f(3) = 11 +ok: M2.f(3) = 22 diff --git a/tests/pending/run/overloads.scala b/tests/pending/run/overloads.scala new file mode 100644 index 000000000000..e84fef021365 --- /dev/null +++ b/tests/pending/run/overloads.scala @@ -0,0 +1,95 @@ +//############################################################################ +// Overloads +//############################################################################ + +//############################################################################ + +object Ops { + def - = 0; + def -(c: Char) = c; + def -(i: Int) = i; + + def -- = 0; + def --(c: Char) = c; + def --(i: Int) = i; +} + +object Funcs { + def foo = 0; +// def foo() = 1; + def foo(c: Char) = 2; + def foo(i: Int) = 3; +} + +object M1 { + def f[A](x: A) = 11; + def f[A <: Ordered[A]](x: Ordered[A]) = 12; +} + +object M2 { + def f[A <: Ordered[A]](x: Ordered[A]) = 21; + def f[A](x: A) = 22; +} + +object overloads { + + def check(what: String, actual: Any, expected: Any): Unit = { + val success: Boolean = actual == expected; + Console.print(if (success) "ok" else "KO"); + var value: String = if (actual == null) "null" else actual.toString(); + if (value == "\u0000") value = "\\u0000"; + Console.print(": " + what + " = " + value); + if (!success) Console.print(" != " + expected); + Console.println; + Console.flush; + } + + def - = 0; + def -(c: Char) = c; + def -(i: Int) = i; + + def -- = 0; + def --(c: Char) = c; + def --(i: Int) = i; + + def test: Unit = { + check("-('a')", -('a'), -97); + check("-(97)", -(97), -97); + + check("Ops.-('a')", Ops.-('a'), 'a'); + check("Ops.-(97)", Ops.-(97), 97); + + check("--", --, 0); + check("--('a')", --('a'), 'a'); + check("--(97)", --(97), 97); + + check("Ops.--", Ops.--, 0); + check("Ops.--('a')", Ops.--('a'), 'a'); + check("Ops.--(97)", Ops.--(97), 97); + + check("Funcs.foo", Funcs.foo, 0); +// check("Funcs.foo()", Funcs.foo(), 1); + check("Funcs.foo('a')", Funcs.foo('a'), 2); + check("Funcs.foo(97)", Funcs.foo(97), 3); + + val x = 3; + check("M1.f(" + x +")", M1.f(x), 11); + check("M2.f(" + x +")", M2.f(x), 22); +// val y = new scala.collection.mutable.Stack[Int]; +// check("M1.f(" + y +")", M1.f(y), 12); +// check("M2.f(" + y +")", M2.f(y), 21); + } + +} + +//############################################################################ + +object Test { + + def main(args: Array[String]): Unit = { + overloads.test; + } + +} + +//############################################################################ diff --git a/tests/pending/run/parmap-ops.scala b/tests/pending/run/parmap-ops.scala new file mode 100644 index 000000000000..3c0d8ee4b667 --- /dev/null +++ b/tests/pending/run/parmap-ops.scala @@ -0,0 +1,48 @@ +import collection._ + +object Test { + + def main(args: Array[String]): Unit = { + val gm: GenMap[Int, Int] = GenMap(0 -> 0, 1 -> 1).par + + // ops + assert(gm.isDefinedAt(1)) + assert(gm.contains(1)) + assert(gm.getOrElse(1, 2) == 1) + assert(gm.getOrElse(2, 3) == 3) + assert(gm.keysIterator.toSet == Set(0, 1)) + assert(gm.valuesIterator.toSet == Set(0, 1)) + assert(gm.keySet == Set(0, 1)) + assert(gm.keys.toSet == Set(0, 1)) + assert(gm.values.toSet == Set(0, 1)) + try { + gm.default(-1) + assert(false) + } catch { + case e: NoSuchElementException => // ok + } + + assert(gm.filterKeys(_ % 2 == 0)(0) == 0) + assert(gm.filterKeys(_ % 2 == 0).get(1) == None) + assert(gm.mapValues(_ + 1)(0) == 1) + + // with defaults + val pm = parallel.mutable.ParMap(0 -> 0, 1 -> 1) + val dm = pm.withDefault(x => -x) + assert(dm(0) == 0) + assert(dm(1) == 1) + assert(dm(2) == -2) + assert(dm.updated(2, 2) == parallel.ParMap(0 -> 0, 1 -> 1, 2 -> 2)) + dm.put(3, 3) + assert(dm(3) == 3) + assert(pm(3) == 3) + assert(dm(4) == -4) + + val imdm = parallel.immutable.ParMap(0 -> 0, 1 -> 1).withDefault(x => -x) + assert(imdm(0) == 0) + assert(imdm(1) == 1) + assert(imdm(2) == -2) + assert(imdm.updated(2, 2) == parallel.ParMap(0 -> 0, 1 -> 1, 2 -> 2)) + } + +} diff --git a/tests/pending/run/partialfun.check b/tests/pending/run/partialfun.check new file mode 100644 index 000000000000..d4e9f494cd6f --- /dev/null +++ b/tests/pending/run/partialfun.check @@ -0,0 +1,6 @@ +47 +147 +100 +0:isDefinedAt +1:isDefinedAt +2:apply diff --git a/tests/pending/run/partialfun.scala b/tests/pending/run/partialfun.scala new file mode 100644 index 000000000000..68f8c8c92682 --- /dev/null +++ b/tests/pending/run/partialfun.scala @@ -0,0 +1,86 @@ +import collection._ +import collection.generic._ + +object Test { + def collectIDA[A, B, Repr, That](_this: TraversableLike[A, Repr])(pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { + val repr: Repr = _this.asInstanceOf[Repr] + val b = bf(repr) + _this foreach { x => if (pf isDefinedAt x) b += pf(x) } + b.result + } + + def collectRW[A, B, Repr, That](_this: TraversableLike[A, Repr])(pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { + val repr: Repr = _this.asInstanceOf[Repr] + val b = bf(repr) + val f = pf runWith { b += _ } + _this foreach f + b.result + } + + var cnt = 0 + + object Ex1 { + def unapply(x: Int) : Option[Int] = { + cnt += 1 + if ((x % 3) == 0) Some(-x) else None + } + } + + object Ex2 { + def unapply(x: Int) : Option[Int] = { + //cnt += 1 + if ((x % 5) == 0) Some(x) else None + } + } + + def resetCnt() = { val r = cnt; cnt = 0; r } + + val pf: PartialFunction[Int,Int] = { + case Ex1(result) => result + case Ex2(result) => result + } + + def collectTest(): Unit = { + val xs = 1 to 100 + resetCnt() + + val ysIDA = collectIDA(xs)(pf) + val cntIDA = resetCnt() + + val ysRW = collectRW(xs)(pf) + val cntRW = resetCnt() + + val ys = xs collect pf + + assert(ys == ysIDA) + assert(ys == ysRW) + assert(cntIDA == xs.length + ys.length) + assert(cntRW == xs.length) + println(ys.length) + println(cntIDA) + println(cntRW) + } + + def orElseTest(): Unit = { + val pf0 = new PartialFunction[Unit, Unit] { + def apply(u: Unit): Unit = { println("0:apply") } + def isDefinedAt(u: Unit) = { println("0:isDefinedAt"); false } + } + val pf1 = new PartialFunction[Unit, Unit] { + def apply(u: Unit): Unit = { println("1:apply") } + def isDefinedAt(u: Unit) = { println("1:isDefinedAt"); false } + } + val pf2 = new PartialFunction[Unit, Unit] { + def apply(u: Unit): Unit = { println("2:apply") } + def isDefinedAt(u: Unit) = { println("2:isDefinedAt"); true } + } + + val chained = pf0 orElse pf1 orElse pf2 + chained(()) + } + + def main(args: Array[String]): Unit = { + collectTest() + orElseTest() + } +} diff --git a/tests/pending/run/patch-boundary.scala b/tests/pending/run/patch-boundary.scala new file mode 100644 index 000000000000..ed1a0e9fc1a6 --- /dev/null +++ b/tests/pending/run/patch-boundary.scala @@ -0,0 +1,8 @@ +object Test { + def f = collection.mutable.ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8) + def g = f.patch(4, List(1, 2), 10) + + def main(args: Array[String]): Unit = { + assert(g.size == 6) + } +} diff --git a/tests/pending/run/patmat-behavior-2.check b/tests/pending/run/patmat-behavior-2.check new file mode 100644 index 000000000000..a928fe7918b9 --- /dev/null +++ b/tests/pending/run/patmat-behavior-2.check @@ -0,0 +1,24 @@ +f1(Foo(1)) == true +f1(Foo(1, 2)) == false +f1(Foo(1, 2, 3)) == false + +f2(Foo(1)) == false +f2(Foo(1, 2)) == true +f2(Foo(1, 2, 3)) == false + +f3(Foo(1)) == false +f3(Foo(1, 2)) == false +f3(Foo(1, 2, 3)) == true + +f1seq(Foo(1)) == true +f1seq(Foo(1, 2)) == true +f1seq(Foo(1, 2, 3)) == true + +f2seq(Foo(1)) == false +f2seq(Foo(1, 2)) == true +f2seq(Foo(1, 2, 3)) == true + +f3seq(Foo(1)) == false +f3seq(Foo(1, 2)) == false +f3seq(Foo(1, 2, 3)) == true + diff --git a/tests/pending/run/patmat-behavior-2.scala b/tests/pending/run/patmat-behavior-2.scala new file mode 100644 index 000000000000..448dcf45037e --- /dev/null +++ b/tests/pending/run/patmat-behavior-2.scala @@ -0,0 +1,50 @@ +case class Foo(x: Int, ys: Int*) { + // We write our own toString because of SI-7735 + override def toString = (x +: ys).mkString("Foo(", ", ", ")") +} + +object Test { + def f1(x: Any) = x match { + case Foo(x) => true + case _ => false + } + def f2(x: Any) = x match { + case Foo(x, y) => true + case _ => false + } + def f3(x: Any) = x match { + case Foo(x, y, z) => true + case _ => false + } + def f1seq(x: Any) = x match { + case Foo(x, ys : _*) => true + case _ => false + } + def f2seq(x: Any) = x match { + case Foo(x, y, zs : _*) => true + case _ => false + } + def f3seq(x: Any) = x match { + case Foo(x, y, z, qs : _*) => true + case _ => false + } + + val x1 = Foo(1) + val x2 = Foo(1, 2) + val x3 = Foo(1, 2, 3) + + val fs = List[Any => Boolean](f1, f2, f3) + val fseqs = List[Any => Boolean](f1seq, f2seq, f3seq) + val xs = List[Foo](x1, x2, x3) + + def main(args: Array[String]): Unit = { + for ((f, i) <- fs.zipWithIndex) { + xs foreach (x => println(s"f${i+1}($x) == ${f(x)}")) + println("") + } + for ((f, i) <- fseqs.zipWithIndex) { + xs foreach (x => println(s"f${i+1}seq($x) == ${f(x)}")) + println("") + } + } +} diff --git a/tests/pending/run/patmat-behavior.check b/tests/pending/run/patmat-behavior.check new file mode 100644 index 000000000000..273a1434fbd3 --- /dev/null +++ b/tests/pending/run/patmat-behavior.check @@ -0,0 +1,90 @@ +patmat-behavior.scala:82: warning: fruitless type test: a value of type s.C00[A] cannot also be a s.C10[A] + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:82: warning: fruitless type test: a value of type s.C00[A] cannot also be a s.C20[A] + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:82: warning: fruitless type test: a value of type s.C00[A] cannot also be a s.C01[A] + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:82: warning: fruitless type test: a value of type s.C00[A] cannot also be a s.C11[A] + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:82: warning: fruitless type test: a value of type s.C00[A] cannot also be a s.C21[A] + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:83: warning: fruitless type test: a value of type s.C10[A] cannot also be a s.C00[A] + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:83: warning: fruitless type test: a value of type s.C10[A] cannot also be a s.C20[A] + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:83: warning: fruitless type test: a value of type s.C10[A] cannot also be a s.C01[A] + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:83: warning: fruitless type test: a value of type s.C10[A] cannot also be a s.C11[A] + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:83: warning: fruitless type test: a value of type s.C10[A] cannot also be a s.C21[A] + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:84: warning: fruitless type test: a value of type s.C20[A] cannot also be a s.C00[A] + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:84: warning: fruitless type test: a value of type s.C20[A] cannot also be a s.C10[A] + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:84: warning: fruitless type test: a value of type s.C20[A] cannot also be a s.C01[A] + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:84: warning: fruitless type test: a value of type s.C20[A] cannot also be a s.C11[A] + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:84: warning: fruitless type test: a value of type s.C20[A] cannot also be a s.C21[A] + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:85: warning: fruitless type test: a value of type s.C01[A] cannot also be a s.C00[A] + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:85: warning: fruitless type test: a value of type s.C01[A] cannot also be a s.C10[A] + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:85: warning: fruitless type test: a value of type s.C01[A] cannot also be a s.C20[A] + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:85: warning: fruitless type test: a value of type s.C01[A] cannot also be a s.C11[A] + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:85: warning: fruitless type test: a value of type s.C01[A] cannot also be a s.C21[A] + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:86: warning: fruitless type test: a value of type s.C11[A] cannot also be a s.C00[A] + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:86: warning: fruitless type test: a value of type s.C11[A] cannot also be a s.C10[A] + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:86: warning: fruitless type test: a value of type s.C11[A] cannot also be a s.C20[A] + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:86: warning: fruitless type test: a value of type s.C11[A] cannot also be a s.C01[A] + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:86: warning: fruitless type test: a value of type s.C11[A] cannot also be a s.C21[A] + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:87: warning: fruitless type test: a value of type s.C21[A] cannot also be a s.C00[A] + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:87: warning: fruitless type test: a value of type s.C21[A] cannot also be a s.C10[A] + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:87: warning: fruitless type test: a value of type s.C21[A] cannot also be a s.C20[A] + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:87: warning: fruitless type test: a value of type s.C21[A] cannot also be a s.C01[A] + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ +patmat-behavior.scala:87: warning: fruitless type test: a value of type s.C21[A] cannot also be a s.C11[A] + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs @ _*) => xs.head ; case G11(x, ys @ _*) => x ; case G21(x, y, zs @ _*) => x } + ^ diff --git a/tests/pending/run/patmat-behavior.scala b/tests/pending/run/patmat-behavior.scala new file mode 100644 index 000000000000..3ce9fb3a70bd --- /dev/null +++ b/tests/pending/run/patmat-behavior.scala @@ -0,0 +1,95 @@ +package s { + sealed trait C[+A] + + case class C00[+A]() extends C[A] + case class C10[+A](x: A) extends C[A] + case class C20[+A](x: A, y: A) extends C[A] + case class C01[+A](xs: A*) extends C[A] + case class C11[+A](x: A, ys: A*) extends C[A] + case class C21[+A](x: A, y: A, zs: A*) extends C[A] + + object E00 { def unapply[A](x: Any): Boolean = ??? } + object E10 { def unapply[A](x: Any): Option[A] = ??? } + object E20 { def unapply[A](x: Any): Option[(A, A)] = ??? } + object E01 { def unapplySeq[A](x: Any): Option[Seq[A]] = ??? } + object E11 { def unapplySeq[A](x: Any): Option[(A, Seq[A])] = ??? } + object E21 { def unapplySeq[A](x: Any): Option[(A, A, Seq[A])] = ??? } + + object F00 { def unapply[A](x: C[A]): Boolean = ??? } + object F10 { def unapply[A](x: C[A]): Option[A] = ??? } + object F20 { def unapply[A](x: C[A]): Option[(A, A)] = ??? } + object F01 { def unapplySeq[A](x: C[A]): Option[Seq[A]] = ??? } + object F11 { def unapplySeq[A](x: C[A]): Option[(A, Seq[A])] = ??? } + object F21 { def unapplySeq[A](x: C[A]): Option[(A, A, Seq[A])] = ??? } + + object G00 { def unapply[A](x: C00[A]): Boolean = ??? } + object G10 { def unapply[A](x: C10[A]): Option[A] = ??? } + object G20 { def unapply[A](x: C20[A]): Option[(A, A)] = ??? } + object G01 { def unapplySeq[A](x: C01[A]): Option[Seq[A]] = ??? } + object G11 { def unapplySeq[A](x: C11[A]): Option[(A, Seq[A])] = ??? } + object G21 { def unapplySeq[A](x: C21[A]): Option[(A, A, Seq[A])] = ??? } +} +import s._ + +package pos { + object Test { + def ga1(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + def ga2(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + def ga3(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + def ga4(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + def ga5(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + def ga6(x: Any) = x match { case C00() => 1 ; case C10(x) => 2 ; case C20(x, y) => 3 ; case C01(xs) => 4 ; case C11(x, ys) => 5 ; case C21(x, y, zs) => 6 } + + def gb1[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb2[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb3[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb4[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb5[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb6[A](x: C[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + + def gc1[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc2[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc3[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc4[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc5[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc6[A](x: C[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + + def gd1[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gd2[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gd3[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gd4[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gd5[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gd6[A, B <: C[A]](x: B) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + } +} + +package neg { + object Fail { + def gb1[A](x: C00[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb2[A](x: C10[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb3[A](x: C20[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb4[A](x: C01[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb5[A](x: C11[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + def gb6[A](x: C21[A]) = x match { case E00() => ??? ; case E10(x) => x ; case E20(x, y) => x ; case E01(xs : _*) => xs.head ; case E11(x, ys : _*) => x ; case E21(x, y, zs : _*) => x } + + def gc1[A](x: C00[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc2[A](x: C10[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc3[A](x: C20[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc4[A](x: C01[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc5[A](x: C11[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + def gc6[A](x: C21[A]) = x match { case F00() => ??? ; case F10(x) => x ; case F20(x, y) => x ; case F01(xs : _*) => xs.head ; case F11(x, ys : _*) => x ; case F21(x, y, zs : _*) => x } + + def gd1[A](x: C00[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + def gd2[A](x: C10[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + def gd3[A](x: C20[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + def gd4[A](x: C01[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + def gd5[A](x: C11[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + def gd6[A](x: C21[A]) = x match { case G00() => ??? ; case G10(x) => x ; case G20(x, y) => x ; case G01(xs : _*) => xs.head ; case G11(x, ys : _*) => x ; case G21(x, y, zs : _*) => x } + } +} + +object Test { + def main(args: Array[String]): Unit = { + + } +} diff --git a/tests/pending/run/patmat-bind-typed.check b/tests/pending/run/patmat-bind-typed.check new file mode 100644 index 000000000000..8baef1b4abc4 --- /dev/null +++ b/tests/pending/run/patmat-bind-typed.check @@ -0,0 +1 @@ +abc diff --git a/tests/pending/run/patmat-bind-typed.scala b/tests/pending/run/patmat-bind-typed.scala new file mode 100644 index 000000000000..10de921c5190 --- /dev/null +++ b/tests/pending/run/patmat-bind-typed.scala @@ -0,0 +1,8 @@ +object Test { + def f(xs: List[Any]) = for (key @ (dummy: String) <- xs) yield key + + def main(args: Array[String]): Unit = { + f("abc" :: Nil) foreach println + f(5 :: Nil) foreach println + } +} diff --git a/tests/pending/run/patmat-exprs.check b/tests/pending/run/patmat-exprs.check new file mode 100644 index 000000000000..b6df9385faa0 --- /dev/null +++ b/tests/pending/run/patmat-exprs.check @@ -0,0 +1 @@ +((5 + 10) + 300) diff --git a/tests/pending/run/patmat-exprs.scala b/tests/pending/run/patmat-exprs.scala new file mode 100644 index 000000000000..7ca5fd30633f --- /dev/null +++ b/tests/pending/run/patmat-exprs.scala @@ -0,0 +1,581 @@ + +import scala.language.{ implicitConversions } +import runtime.ScalaRunTime + +object Test { + val p = new Pattern { } + import p._ + implicit object IntOps extends NumericOps[Int] { + def zero = 0 + def one = 1 + + def add(a: Int, b: Int): Int = a + b + def sub(a: Int, b: Int): Int = a - b + def mul(a: Int, b: Int): Int = a * b + def mul(a: Int, b: Double): Int = (a * b).toInt + def div(a: Int, b: Int): Int = a / b + def div(a: Int, b: Double): Int = (a / b).toInt + def similar(a: Int, b: Int): Boolean = a == b + def abs(a: Int): Double = math.abs(a).toDouble + def sqr(a: Int): Int = a * a + def sqrt(a: Int): Int = math.sqrt(a).toInt + def log(a: Int): Int = math.log(a).toInt + def exp(a: Int): Int = math.exp(a).toInt + def sin(a: Int): Int = math.sin(a).toInt + def cos(a: Int): Int = math.cos(a).toInt + + def fromDouble(a: Double): Int = a.toInt + def fromInt(a: Int): Int = a + } + + def main(args: Array[String]): Unit = { + println((5: Expr[Int]) + 10 + 15 * 20) + } +} + + +trait Pattern { + // For trying out 2.7.7 + // + // type Numeric[T] + // import java.io.Serializable + // + // implicit def compat27a[T](x: Iterable[T]) = new { + // def iterator: Iterator[T] = x.elements + // def sum: Int = 5 + // def collect[U](pf: PartialFunction[T, U]): Iterable[U] = x map pf + // } + + /** Function that returns object of the same type it was passed */ + trait EndoFunction[-A] { + def apply[B <: A](x: B): B + } + + /** Allows for smart construction of EndoFunction from an ordinary function */ + object EndoFunction { + def apply[A](f: A => A): EndoFunction[A] = new EndoFunction[A] { + def apply[B <: A](x: B): B = f(x).asInstanceOf[B] + } + } + + trait NumericOps[T] extends Serializable { + def zero: T + def one: T + def two = add(one, one) + def three = add(two, one) + + def add(a: T, b: T): T + def add(a: T, b: T, c: T): T = add(a, add(b, c)) + def sub(a: T, b: T): T + def mul(a: T, b: T): T + def mul(a: T, b: Double): T + def div(a: T, b: T): T + def div(a: T, b: Double): T + def similar(a: T, b: T): Boolean + def neg(a: T) = sub(zero, a) + def abs(a: T): Double + def sqr(a: T): T + def sqrt(a: T): T + def log(a: T): T + def exp(a: T): T + def sin(a: T): T + def cos(a: T): T + def tan(a: T): T = div(sin(a), cos(a)) + + def fromDouble(a: Double): T + def fromInt(a: Int): T + + def sum(terms: Iterable[T]) = terms.foldLeft(zero)(add) + def sum(terms: Iterator[T]) = terms.foldLeft(zero)(add) + def product(terms: Iterable[T]) = terms.foldLeft(one)(mul) + def product(terms: Iterator[T]) = terms.foldLeft(one)(mul) + + + def similar(a: Iterable[T], b: Iterable[T]): Boolean = { + val i1 = a.iterator + val i2 = b.iterator + while (i1.hasNext && i2.hasNext) + if (!similar(i1.next, i2.next)) + return false; + true; + } + } + + /** + * Simple expression interpreter with some basic symbolic manipulation. + * Able to evaluate derivatives. + */ + + trait Expr[T] { + + import Expr._ + + /** Evaluates value of the expression. */ + def eval(context: Any => Any): T + + /** Symbolically calculates derivative of this expression. Does not simplify it. */ + def derivative(variable: Var[T]): Expr[T] + + /** Returns arguments of this operator */ + def args: Iterable[Expr[_]] + + /** Transforms arguments of this operator by applying given function. */ + def mapArgs(f: EndoFunction[Expr[_]]): Expr[T] + + /** Transforms this operator and its arguments by applying given function */ + def map(f: EndoFunction[Expr[_]]): Expr[T] = + f(mapArgs(EndoFunction[Expr[_]](x => x.map(f)))) + + /** Folds all subexpressions in this expression in depth-first order */ + def fold[A](v: A)(f: (A, Expr[_]) => A): A = + f(args.foldLeft(v) { (a, b) => b.fold(a)(f) }, this) + + /** Replaces all occurrences of one subexpression with another one */ + def replace(from: Expr[_], to: Expr[_]): Expr[T] = + map(EndoFunction[Expr[_]](x => if (x == from) to else x)) + + /** Returns true if this expression contains given subexpression */ + def contains(s: Expr[_]): Boolean = + this == s || args.exists(_ contains s) + + /** Counts number of occurrences of the given subexpression. */ + def count(condition: Expr[_] => Boolean): Int = + (if (condition(this)) 1 else 0) + args.map(_.count(condition)).sum + + /** Executes some code for every subexpression in the depth-first order */ + def foreach[U](block: Expr[_] => U): Unit = { + args.foreach(_.foreach(block)) + block(this) + } + + /** Collects subexpressions successfully transformed by the given partial function, in depth-first order. */ + def collect[U](f: PartialFunction[Expr[_], U]): List[U] = { + val a = args.flatMap(_.collect(f)).toList + if (f.isDefinedAt(this)) (f(this) :: a) else a + } + + def leaves: List[Leaf[T]] = collect { case l: Leaf[T] => l } + + def + (other: Expr[T])(implicit n: NumericOps[T]) = Add(List(this, other)) + def - (other: Expr[T])(implicit n: NumericOps[T]) = Sub(this, other) + def * (other: Expr[T])(implicit n: NumericOps[T]) = Mul(this, other) + def / (other: Expr[T])(implicit n: NumericOps[T]) = Div(this, other) + + def unary_- (implicit n: NumericOps[T]) = Neg(this) + def sqr(implicit n: NumericOps[T]) = Sqr(this) + + def < (other: Expr[T])(implicit n: NumericOps[T], o: Ordering[T]) = LT(this, other) + def <= (other: Expr[T])(implicit n: NumericOps[T], o: Ordering[T]) = LE(this, other) + def > (other: Expr[T])(implicit n: NumericOps[T], o: Ordering[T]) = GT(this, other) + def >= (other: Expr[T])(implicit n: NumericOps[T], o: Ordering[T]) = GE(this, other) + + private def generalize(implicit num: NumericOps[T]): Expr[T] = { + this match { + case Add2(a, b) => Add(a :: b :: Nil) + case Add3(a, b, c) => Add(a :: b :: c :: Nil) + case Sub(a, b) => Add(a :: Neg(b) :: Nil) + case Add(x) => Add(x flatMap { + case Neg(Add(y)) => y.map(Neg(_)) + case Add(y) => y + case y => y :: Nil + }) + case x => x + } + } + + private def specialize(implicit num: NumericOps[T]): Expr[T] = { + this match { + case Add(Seq(a, b)) => Add2(a, b) + case Add(Seq(a, b, c)) => Add3(a, b, c) + case x => x + } + } + + /** Eliminates common negated components of a sum */ + private def reduceComponents(components: List[Expr[T]])(implicit num: NumericOps[T]): List[Expr[T]] = { + val pairs = + for (a <- components; b <- components if Neg(a) == b || a == Neg(b)) + yield (a, b) + pairs.foldLeft(components) { (c, pair) => + if (c.contains(pair._1) && c.contains(pair._2)) + c.diff(pair._1 :: pair._2 :: Nil) + else + c + } + } + + + /** Simplifies this expression to make evaluation faster and more accurate. + * Performs only one pass. */ + private def reduce(implicit num: NumericOps[T]): Expr[T] = { + this match { + case Add(Seq(Neg(x), Neg(y), Neg(z))) => Neg(Add(List(x, y, z))) + case Add(Seq(Mul(x, y), z)) if (x == z) => Mul(x, Add(List(y, One[T]))) + case Add(Seq(Mul(x, y), z)) if (y == z) => Mul(y, Add(List(z, One[T]))) + case Add(Seq(Mul(x, y), Mul(u, w))) if (x == u) => Mul(x, Add(List(y, w))) + case Add(Seq(Mul(x, y), Mul(u, w))) if (y == w) => Mul(y, Add(List(x, u))) + case Add(Seq(Add(x), Add(y))) => Add(x.toList ::: y.toList).simplify + case Add(Seq(Add(x), y)) => Add(y :: x.toList).simplify + case Add(Seq(x, Add(y))) => Add(x :: y.toList).simplify + case Add(x) => { + val noZeros = x.filter(_ != Zero[T]) + val noOnes = noZeros.map { case y: One[_] => Const(num.one); case y => y } + val constant = num.sum(noOnes.collect { case c: Const[T] => c.value }) + val rest = noOnes.filter(x => !x.isInstanceOf[Const[_]]).toList + val reduced = reduceComponents(rest) + val args = if (num.similar(constant, num.zero)) reduced else reduced ::: Const(constant) :: Nil + args.size match { + case 0 => Zero[T] + case 1 => args.head + case 2 => Add2(args(0), args(1)) + case 3 => Add3(args(0), args(1), args(2)) + case _ => Add(args) + } + } + case Sub(x: Zero[_], y) => Neg(y) + case Sub(x, y: Zero[_]) => x + case Sub(x, y) if x == y => Zero[T] + case Sub(Mul(x, y), z) if (x == z) => Mul(x, Sub(y, One[T])) + case Sub(Mul(x, y), z) if (y == z) => Mul(y, Sub(z, One[T])) + case Sub(Mul(x, y), Mul(u, w)) if (x == u) => Mul(x, Sub(y, w)) + case Sub(Mul(x, y), Mul(u, w)) if (y == w) => Mul(y, Sub(x, u)) + case Mul(x: Zero[_], y) => Zero[T] + case Mul(x, y: Zero[_]) => Zero[T] + case Mul(x: One[_], y) => y + case Mul(x, y: One[_]) => x + case Mul(Neg(x: One[_]), y) => Neg(y) + case Mul(x, Neg(y: One[_])) => Neg(x) + + case Mul(x, y) if (x == y) => Sqr(x) + case Div(x: Zero[_], y) => Zero[T] // warning: possibly extends domain + case Div(x, y: One[_]) => x + case Div(Sqr(x), y) if x == y => x + case Div(Mul(x, y), z) if (x == z) => y + case Div(Mul(x, y), z) if (y == z) => y + case Div(Mul(Mul(x, y), z), w) if (x == w) => Mul(y, z) + case Div(Mul(Mul(x, y), z), w) if (y == w) => Mul(x, z) + case Div(Mul(z, Mul(x, y)), w) if (x == w) => Mul(y, z) + case Div(Mul(z, Mul(x, y)), w) if (y == w) => Mul(x, z) + case Div(Mul(x, y), Mul(u, w)) if (x == u) => Div(y, w) + case Div(Mul(x, y), Mul(u, w)) if (y == w) => Div(x, u) + case Div(x: One[_], y) => Inv(y) + case Div(x, Sqr(y)) if x == y => Inv(y) + case Div(Mul(x, y), Sqr(Mul(u, w))) if x == u && y == w => Inv(Mul(x, y)) + case Div(x, y) if x == y => One[T] + + case Mul(Neg(a), Neg(b)) => Mul(a, b) + case Div(Neg(a), Neg(b)) => Div(a, b) + + case Neg(x: Zero[_]) => Zero[T] + case Neg(x: One[_]) => Const(num.neg(num.one)) + case Sub(Const(x), Const(y)) => const(num.sub(x, y)) + case Mul(Const(x), Const(y)) => const(num.mul(x, y)) + case Div(Const(x), Const(y)) => const(num.div(x, y)) + case Neg(Const(x)) => const(num.neg(x)) + case Sqr(Const(x)) => const(num.sqr(x)) + + case Mul(Const(x), Mul(Const(y), z)) => Mul(const(num.mul(x, y)), z) + case Mul(Const(x), Mul(y, Const(z))) => Mul(const(num.mul(x, z)), y) + case Mul(Mul(Const(y), z), Const(x)) => Mul(const(num.mul(x, y)), z) + case Mul(Mul(y, Const(z)), Const(x)) => Mul(const(num.mul(x, z)), y) + + case Const(x) if x == num.one => One[T] + case Const(x) if x == num.zero => Zero[T] + + case Sub(x, Neg(y)) => Add(List(x, y)) + case Sub(Neg(x), y) => Neg(Add(List(x, y))) + case Neg(Neg(x)) => x + case Neg(Mul(a: Const[T], x)) => Mul(const(num.neg(a.value)), x) + case Neg(Mul(x, a: Const[T])) => Mul(const(num.neg(a.value)), x) + case Neg(Div(Neg(a), b)) => Div(a, b) + case Neg(Div(a, Neg(b))) => Div(a, b) + case Neg(Mul(Neg(a), b)) => Mul(a, b) + case Neg(Mul(a, Neg(b))) => Mul(a, b) + + case Log(Exp(x)) => x + case x => x + } + } + + private def optimizeWith(f: Expr[T] => Expr[T]): Expr[T] = { + f(mapArgs(EndoFunction[Expr[_]]( + a => a match { case x: Expr[T] => x.optimizeWith(f) } + ))) + } + + /** Simplifies this expression to make evaluation faster and more accurate.*/ + def simplify(implicit num: NumericOps[T]): Expr[T] = { + val a1 = optimizeWith(_.generalize) + val a2 = a1.optimizeWith(_.generalize) + val b = a2.optimizeWith(_.reduce) + val c = b.optimizeWith(_.reduce) + val d = c.optimizeWith(_.specialize) + d + } + } + + + trait Leaf[T] extends Expr[T] { + val args = List[Expr[T]]() + def mapArgs(f: EndoFunction[Expr[_]]) = this + } + + trait OneArg[T] extends Expr[T] { + val expr: Expr[T] + val args = List(expr) + } + + + trait TwoArg[T] extends Expr[T] { + val left: Expr[T] + val right: Expr[T] + val args = List(left, right) + } + + trait ManyArg[T] extends Expr[T] + + /** Marker trait for specifying that you can safely divide by this */ + trait NonZero[T] extends Expr[T] + + case class Const[T](value: T)(implicit num: NumericOps[T]) extends Leaf[T] with NonZero[T] { + def derivative(variable: Var[T]) = Zero[T] + def eval(f: Any => Any) = value + override def toString = value.toString + } + + + case class Zero[T] (implicit num: NumericOps[T]) extends Leaf[T] { + def derivative(variable: Var[T]) = Zero[T] + def eval(f: Any => Any) = num.zero + override def toString = "0" + } + + case class One[T] (implicit num: NumericOps[T]) extends Leaf[T] { + def derivative(variable: Var[T]) = Zero[T] + def eval(f: Any => Any) = num.one + override def toString = "1" + } + + abstract class Var[T](implicit num: NumericOps[T]) extends Leaf[T] { + def derivative(variable: Var[T]) = if (variable == this) One[T] else Zero[T] + def eval(f: Any => Any) = f(this).asInstanceOf[T] + } + + case class NamedVar[T](name: String)(implicit num: NumericOps[T]) extends Var[T] { + override lazy val hashCode = ScalaRunTime._hashCode(this) + override def toString = name + } + + case class Add[T](args: Iterable[Expr[T]])(implicit num: NumericOps[T]) extends ManyArg[T] { + def eval(f: Any => Any) = num.sum(for (i <- args.iterator) yield i.eval(f)) + def derivative(v: Var[T]) = Add(args.map(_.derivative(v))) + def mapArgs(f: EndoFunction[Expr[_]]) = Add(args map (x => f(x))) + override def toString = "(" + args.mkString(" + ") + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Add2[T](left: Expr[T], right: Expr[T]) + (implicit num: NumericOps[T]) extends TwoArg[T] { + def eval(f: Any => Any) = num.add(left.eval(f), right.eval(f)) + def derivative(v: Var[T]) = Add2(left.derivative(v), right.derivative(v)) + def mapArgs(f: EndoFunction[Expr[_]]) = Add2(f(left), f(right)) + override def toString = "(" + left + " + " + right + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Add3[T](a1: Expr[T], a2: Expr[T], a3: Expr[T]) + (implicit num: NumericOps[T]) extends ManyArg[T] { + val args = List(a1, a2, a3) + def eval(f: Any => Any) = num.add(a1.eval(f), a2.eval(f), a3.eval(f)) + def derivative(v: Var[T]) = Add3(a1.derivative(v), a2.derivative(v), a3.derivative(v)) + def mapArgs(f: EndoFunction[Expr[_]]) = Add3(f(a1), f(a2), f(a3)) + override def toString = "(" + a1 + " + " + a2 + " + " + a3 + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Sub[T](left: Expr[T], right: Expr[T]) + (implicit num: NumericOps[T]) extends TwoArg[T] { + def derivative(v: Var[T]) = Sub(left.derivative(v), right.derivative(v)) + def eval(f: Any => Any) = num.sub(left.eval(f), right.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Sub(f(left), f(right)) + override def toString = "(" + left + " - " + right + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Neg[T](expr: Expr[T]) + (implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Neg(expr.derivative(v)) + def eval(f: Any => Any) = num.neg(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Neg(f(expr)) + override def toString = "(-" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + + } + + case class Mul[T](left: Expr[T], right: Expr[T]) + (implicit num: NumericOps[T]) extends TwoArg[T] { + def derivative(v: Var[T]) = + Add(List( + Mul(left, right.derivative(v)), + Mul(right, left.derivative(v)))) + + def eval(f: Any => Any) = num.mul(left.eval(f), right.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Mul(f(left), f(right)) + override def toString = "(" + left + " * " + right + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Div[T](left: Expr[T], right: Expr[T]) + (implicit num: NumericOps[T]) extends TwoArg[T] { + + // [f(x) / g(x)]' = [f(x) * 1 / g(x)]' = f'(x) * 1 / g(x) + f(x) * [1 / g(x)]' = + // f'(x) / g(x) + f(x) * [-1 / g(x) ^ 2] * g'(x) = (f'(x) * g(x) - f(x) * g'(x)) / g(x)^2 + def derivative(v: Var[T]) = + Div( + Sub( + Mul(left.derivative(v), right), + Mul(left, right.derivative(v))), + Sqr(right) + ) + + def eval(f: Any => Any) = num.div(left.eval(f), right.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = + Div(f(left), f(right)) + override def toString = "(" + left + " / " + right + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Inv[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + + // [1 / f(x)]' = - f'(x) / f(x) ^ 2 + def derivative(v: Var[T]) = Neg(Div(expr.derivative(v), Sqr(expr))) + def eval(f: Any => Any) = num.div(num.one, expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Inv(f(expr)) + override def toString = "(1 / " + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Sqr[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + // [f(x) ^ 2]' = 2 * f(x) * f'(x) + def derivative(v: Var[T]) = Mul(Mul(Const(num.two), expr), expr.derivative(v)) + def eval(f: Any => Any) = num.sqr(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Sqr(f(expr)) + override def toString = expr + " ^ 2" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Log[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Div(expr.derivative(v), expr) + def eval(f: Any => Any) = num.log(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Log(f(expr)) + override def toString = "log(" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Exp[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Mul(expr.derivative(v), Exp(expr)) + def eval(f: Any => Any) = num.exp(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Exp(f(expr)) + override def toString = "exp(" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + case class Sqrt[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Neg(Div(expr.derivative(v), Sqrt(expr))) + def eval(f: Any => Any) = num.sqrt(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Sqrt(f(expr)) + override def toString = "sqrt(" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Sin[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Mul(expr.derivative(v), Cos(expr)) + def eval(f: Any => Any) = num.sin(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Sin(f(expr)) + override def toString = "sin(" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + case class Cos[T](expr: Expr[T])(implicit num: NumericOps[T]) extends OneArg[T] { + def derivative(v: Var[T]) = Neg(Mul(expr.derivative(v), Sin(expr))) + def eval(f: Any => Any) = num.cos(expr.eval(f)) + def mapArgs(f: EndoFunction[Expr[_]]) = Cos(f(expr)) + override def toString = "cos(" + expr + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + + abstract class Compare[T](left: Expr[T], right: Expr[T], cmp: (T, T) => Boolean)(implicit num: NumericOps[T]) + extends Expr[Boolean] { + def derivative(v: Var[Boolean]) = throw new IllegalStateException("Derivative of Boolean not allowed") + def eval(f: Any => Any) = cmp(left.eval(f), right.eval(f)) + val args = List(left, right) + } + + case class LE[T](left: Expr[T], right: Expr[T])(implicit num: NumericOps[T], ord: Ordering[T]) + extends Compare[T](left, right, ord.compare(_, _) <= 0) { + def mapArgs(f: EndoFunction[Expr[_]]) = LE( + f(left), f(right)) + override def toString = left.toString + " <= " + right.toString + } + + case class LT[T](left: Expr[T], right: Expr[T])(implicit num: NumericOps[T], ord: Ordering[T]) + extends Compare[T](left, right, ord.compare(_, _) < 0) { + def mapArgs(f: EndoFunction[Expr[_]]) = LT( + f(left), f(right)) + override def toString = left.toString + " < " + right.toString + } + + case class GE[T](left: Expr[T], right: Expr[T])(implicit num: NumericOps[T], ord: Ordering[T]) + extends Compare[T](left, right, ord.compare(_, _) >= 0) { + def mapArgs(f: EndoFunction[Expr[_]]) = GE( + f(left), f(right)) + override def toString = left.toString + " >= " + right.toString + } + + case class GT[T](left: Expr[T], right: Expr[T])(implicit num: NumericOps[T], ord: Ordering[T]) + extends Compare[T](left, right, ord.compare(_, _) > 0) { + def mapArgs(f: EndoFunction[Expr[_]]) = GT( + f(left), f(right)) + override def toString = left.toString + " > " + right.toString + } + + case class IfElse[T <: Numeric[T]] + (condition: Expr[Boolean], left: Expr[T], right: Expr[T])(implicit num: NumericOps[T]) extends Expr[T] { + + val args = List(condition, left, right) + def derivative(v: Var[T]) = IfElse(condition, left.derivative(v), right.derivative(v)) + def eval(f: Any => Any) = if (condition.eval(f)) left.eval(f) else right.eval(f) + def mapArgs(f: EndoFunction[Expr[_]]) = IfElse( + f(condition).asInstanceOf[Expr[Boolean]], + f(left), + f(right)) + override def toString = "if (" + condition + ")(" + left + ") else (" + right + ")" + override lazy val hashCode = ScalaRunTime._hashCode(this); + } + + object Expr { + /** Creates a constant expression */ + def const[T](value: T)(implicit num: NumericOps[T]): Leaf[T] = + if (num.zero == value) Zero[T] + else Const(value) + + implicit def double2Constant[T](d: Double)(implicit num: NumericOps[T]): Leaf[T] = + const(num.fromDouble(d)) + + implicit def float2Constant[T](f: Float)(implicit num: NumericOps[T]): Leaf[T] = + const(num.fromDouble(f.toDouble)) + + implicit def int2Constant[T](i: Int)(implicit num: NumericOps[T]): Leaf[T] = + const(num.fromDouble(i.toDouble)) + + implicit def long2Constant[T](l: Long)(implicit num: NumericOps[T]): Leaf[T] = + const(num.fromDouble(l.toDouble)) + } +} diff --git a/tests/pending/run/patmat-finally.scala b/tests/pending/run/patmat-finally.scala new file mode 100644 index 000000000000..895fb79f79de --- /dev/null +++ b/tests/pending/run/patmat-finally.scala @@ -0,0 +1,25 @@ +/** Test pattern matching and finally, see SI-5929. */ +object Test extends dotty.runtime.LegacyApp { + def bar(s1: Object, s2: Object): Unit = { + s1 match { + case _ => + } + + try { + () + } finally { + s2 match { + case _ => + } + } + } + + def x = { + null match { case _ => } + + try { 1 } finally { while(false) { } } + } + + bar(null, null) + x +} diff --git a/tests/pending/run/patmat-mix-case-extractor.check b/tests/pending/run/patmat-mix-case-extractor.check new file mode 100644 index 000000000000..a6e1bd23dfee --- /dev/null +++ b/tests/pending/run/patmat-mix-case-extractor.check @@ -0,0 +1,8 @@ +-1 +6 +4 +18 +-1 +1006 +1004 +1018 diff --git a/tests/pending/run/patmat-mix-case-extractor.scala b/tests/pending/run/patmat-mix-case-extractor.scala new file mode 100644 index 000000000000..8c1a2c906d93 --- /dev/null +++ b/tests/pending/run/patmat-mix-case-extractor.scala @@ -0,0 +1,110 @@ +trait CaseClass +trait ProdCaseClass extends CaseClass { def x: Int } +trait SeqCaseClass extends CaseClass { def xs: Seq[Int] } + +case class CaseClass1() extends CaseClass +case class CaseClass2(xs: Int*) extends SeqCaseClass +case class CaseClass3(x: Int) extends ProdCaseClass +case class CaseClass4(x: Int, xs: Int*) extends ProdCaseClass with SeqCaseClass + +object Extractor1 { def unapply(x: CaseClass): Boolean = false } +object Extractor2 { def unapplySeq(x: SeqCaseClass): Option[Seq[Int]] = Some(x.xs) } +object Extractor3 { def unapply(x: ProdCaseClass): Option[Int] = Some(x.x) } +object Extractor4 { def unapplySeq(x: ProdCaseClass with SeqCaseClass): Option[(Int, Seq[Int])] = Some(x.x, x.xs) } + +class A { + def f1(x: Any) = x match { + case CaseClass1() => -1 + case CaseClass2(xs : _*) => xs.sum + case CaseClass3(x) => x + case CaseClass4(x, xs : _*) => x + xs.sum + case Extractor4(x, xs : _*) => 1000 + x + xs.sum + case Extractor3(x) => 1000 + x + case Extractor2(xs : _*) => 1000 + xs.sum + case Extractor1() => -3 + case _ => -2 + } + def f2(x: Any) = x match { + case Extractor4(x, xs : _*) => 1000 + x + xs.sum + case Extractor3(x) => 1000 + x + case Extractor2(xs : _*) => 1000 + xs.sum + case Extractor1() => -3 + case CaseClass1() => -1 + case CaseClass2(xs : _*) => xs.sum + case CaseClass3(x) => x + case CaseClass4(x, xs : _*) => x + xs.sum + case _ => -2 + } + def run(): Unit = { + List( + f1(CaseClass1()), + f1(CaseClass2(1, 2, 3)), + f1(CaseClass3(4)), + f1(CaseClass4(5, 6, 7)), + f2(CaseClass1()), + f2(CaseClass2(1, 2, 3)), + f2(CaseClass3(4)), + f2(CaseClass4(5, 6, 7)) + ) foreach println + } +} + +object Test { + def main(args: Array[String]): Unit = { + (new A).run + } +} + + +class B { + case class CaseClass0() + case class CaseClass0v(xs: Int*) + + case class CaseClass(x: Int, y: Int) + object Extractor { def unapply(x: Any): Option[(Int, Int)] = Some((1, 1)) } + + case class CaseSeq(x: Char, y: Double, zs: Int*) + object ExtractorSeq { def unapplySeq(x: Any): Option[(Int, Int, Seq[Int])] = Some((1, 1, List(1))) } + + def f1(x: CaseClass) = x match { case CaseClass(y, z) => y } + def f2(x: Any) = x match { case Extractor(y, z) => y } + + def f3(x: CaseSeq) = x match { + case CaseSeq(x, y) => y + case CaseSeq(x, y, z) => z + } + def f4(x: CaseSeq) = x match { + case CaseSeq(x, y, z) => z :: Nil + case CaseSeq(x, y, z : _*) => z + } + + def f5(x: Any) = x match { case ExtractorSeq(x, y, z) => z } + def f6(x: Any) = x match { case ExtractorSeq(x, y, z : _*) => z } + + def g1(x: CaseClass0) = x match { + case CaseClass0() => true + } + def g2(x: CaseClass0v) = x match { + case CaseClass0v() => true + case CaseClass0v(5) => true + case CaseClass0v(x) => true + case CaseClass0v(xs : _*) => false + } +} + +package p1 { + trait _X { + case class _Foo(); + object _Bar { + def unapply(foo: _Foo): Boolean = true; + } + } + + object Y extends _X { + val foo = _Foo() + foo match { + case _Bar() => + case _ => assert(false) + } + } +} diff --git a/tests/pending/run/patmat-seqs.check b/tests/pending/run/patmat-seqs.check new file mode 100644 index 000000000000..bb2a5ee44af9 --- /dev/null +++ b/tests/pending/run/patmat-seqs.check @@ -0,0 +1,13 @@ +s3 +s2 +s1 +s0 +ss6 +d +s3 +s3 +d +s1 +s3 +d +d diff --git a/tests/pending/run/patmat-seqs.scala b/tests/pending/run/patmat-seqs.scala new file mode 100644 index 000000000000..b5c47b4b4b4d --- /dev/null +++ b/tests/pending/run/patmat-seqs.scala @@ -0,0 +1,42 @@ +object Test { + def f1(x: Any) = x match { + case Seq(1, 2, 3) => "s3" + case Seq(4, 5) => "s2" + case Seq(7) => "s1" + case Nil => "s0" + case Seq(_, _, _, _, _, x: String) => "ss6" + case _ => "d" + } + + def f2(x: Any) = x match { + case Seq("a", "b", _*) => "s2" + case Seq(1, _*) => "s1" + case Seq(5, 6, 7, _*) => "s3" + case _ => "d" + } + + def main(args: Array[String]): Unit = { + val xs1 = List( + List(1,2,3), + List(4,5), + Vector(7), + Seq(), + Seq(1, 2, 3, 4, 5, "abcd"), + "abc" + ) map f1 + + xs1 foreach println + + val xs2 = List( + Seq(5, 6, 7), + Seq(5, 6, 7, 8, 9), + Seq("a"), + Seq(1, 6, 7), + List(5, 6, 7), + Nil, + 5 + ) map f2 + + xs2 foreach println + } +} diff --git a/tests/pending/run/patmat_unapp_abstype-new.check b/tests/pending/run/patmat_unapp_abstype-new.check new file mode 100644 index 000000000000..35447dbbfa45 --- /dev/null +++ b/tests/pending/run/patmat_unapp_abstype-new.check @@ -0,0 +1,10 @@ +patmat_unapp_abstype-new.scala:21: warning: abstract type pattern TypesUser.this.TypeRef is unchecked since it is eliminated by erasure + case TypeRef(x) => println("TypeRef") + ^ +patmat_unapp_abstype-new.scala:53: warning: abstract type pattern Intermed.this.Foo is unchecked since it is eliminated by erasure + case Foo(x) => println("Foo") + ^ +TypeRef +MethodType +Bar +Foo diff --git a/tests/pending/run/patmat_unapp_abstype-new.scala b/tests/pending/run/patmat_unapp_abstype-new.scala new file mode 100644 index 000000000000..fa8b2151cedd --- /dev/null +++ b/tests/pending/run/patmat_unapp_abstype-new.scala @@ -0,0 +1,76 @@ +import reflect.{ClassTag, classTag} + +// abstract types and extractors, oh my! +trait TypesAPI { + trait Type + + type TypeRef <: Type + val TypeRef: TypeRefExtractor; trait TypeRefExtractor { + def apply(x: Int): TypeRef + def unapply(x: TypeRef): Option[(Int)] + } + + // just for illustration, should follow the same pattern as TypeRef + case class MethodType(n: Int) extends Type +} + +// user should not be exposed to the implementation +trait TypesUser extends TypesAPI { + def shouldNotCrash(tp: Type): Unit = { + tp match { + case TypeRef(x) => println("TypeRef") + case MethodType(x) => println("MethodType") + case _ => println("none of the above") + } + } +} + +trait TypesImpl extends TypesAPI { + object TypeRef extends TypeRefExtractor // this will have a bridged unapply(x: Type) = unapply(x.asInstanceOf[TypeRef]) + case class TypeRef(n: Int) extends Type // this has a bridge from TypesAPI#Type to TypesImpl#TypeRef + // --> the cast in the bridge will fail because the pattern matcher can't type test against the abstract types in TypesUser +} + +trait Foos { + trait Bar + type Foo <: Bar + trait FooExtractor { + def unapply(foo: Foo): Option[Int] + } + val Foo: FooExtractor +} + +trait RealFoos extends Foos { + class Foo(val x: Int) extends Bar + object Foo extends FooExtractor { + def unapply(foo: Foo): Option[Int] = Some(foo.x) + } +} + +trait Intermed extends Foos { + def crash(bar: Bar): Unit = + bar match { + case Foo(x) => println("Foo") + case _ => println("Bar") + } +} + +object TestUnappStaticallyKnownSynthetic extends TypesImpl with TypesUser { + def test() = { + shouldNotCrash(TypeRef(10)) // prints "TypeRef" + shouldNotCrash(MethodType(10)) // prints "MethodType" + } +} + +object TestUnappDynamicSynth extends RealFoos with Intermed { + case class NotAFoo(n: Int) extends Bar + def test() = { + crash(NotAFoo(10)) + crash(new Foo(5)) + } +} + +object Test extends dotty.runtime.LegacyApp { + TestUnappStaticallyKnownSynthetic.test() + TestUnappDynamicSynth.test() +} diff --git a/tests/pending/run/patmatnew.check b/tests/pending/run/patmatnew.check new file mode 100644 index 000000000000..56b8ac2f4f0e --- /dev/null +++ b/tests/pending/run/patmatnew.check @@ -0,0 +1,15 @@ +patmatnew.scala:351: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + case 1 => "OK" + ^ +patmatnew.scala:352: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + case 2 => assert(false); "KO" + ^ +patmatnew.scala:353: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + case 3 => assert(false); "KO" + ^ +patmatnew.scala:670: warning: This catches all Throwables. If this is really intended, use `case e : Throwable` to clear this warning. + case e => { + ^ +patmatnew.scala:489: warning: unreachable code + case _ if false => + ^ diff --git a/tests/pending/run/patmatnew.scala b/tests/pending/run/patmatnew.scala new file mode 100644 index 000000000000..d55773e25d59 --- /dev/null +++ b/tests/pending/run/patmatnew.scala @@ -0,0 +1,765 @@ + +import scala.language.{ postfixOps } + +object Test { + + def main(args: Array[String]): Unit = { + ApplyFromJcl.run() + Bug1093.run() + Bug1094.run() + Bug1270.run() + Bug1281.run() + Bug457.run() + Bug508.run() + Bug789.run() + Bug881.run() + Bug995.run() + ClassDefInGuard.run() + SeqUnapply.run() + SimpleUnapply.run() + Test1163_Order.run() + Test717.run() + Test903.run() + TestEqualsPatternOpt.run() + TestGuards.run() + TestSequence01.run() + TestSequence02.run() + TestSequence03.run() + TestSequence04.run() + TestSequence05.run() + TestSequence06.run() + TestSequence07.run() + TestSequence08.run() + TestSimpleIntSwitch.run() + TestStream.run() + TestUnbox.run() + Ticket11.run() + Ticket2.run() + Ticket346.run() + Ticket37.run() + Ticket44.run() + } + + def assertEquals(a: Any, b: Any): Unit = { assert(a == b) } + def assertEquals(msg: String, a: Any, b: Any): Unit = { assert(a == b, msg) } + + object SimpleUnapply { + def run(): Unit = { // from sortedmap, old version + List((1, 2)).head match { + case kv@(key, _) => kv.toString + " " + key.toString + } + + } + } + + object SeqUnapply { + case class SFB(i: Int, xs: List[Int]) + def run(): Unit = { + List(1, 2) match { + case List(1) => assert(false, "wrong case") + case List(1, 2, xs:_*) => assert(xs.isEmpty, "not empty") + case Nil => assert(false, "wrong case") + } + SFB(1, List(1)) match { + case SFB(_, List(x)) => assert(x == 1) + case SFB(_, _) => assert(false) + } + } + } + + object ApplyFromJcl { + def run(): Unit = { + val p = (1, 2) + Some(2) match { + case Some(p._2) => + case _ => assert(false) + } + } + } + + object TestSimpleIntSwitch { + def run(): Unit = { + assertEquals("s1", 1, 1 match { + case 3 => 3 + case 2 => 2 + case 1 => 1 + case 0 => 0 + }) + assertEquals("s2", 1, 1 match { + case 1 => 1 + case _ => 0 + }) + assertEquals("s2boxed", 1, (1: Any) match { + case 1 => 1 + case _ => 0 + }) + assertEquals("s3", 1, ("hello") match { + case s: String => 1 + //case _ => 0 // unreachable! + }) + val xyz: (Int, String, Boolean) = (1, "abc", true); + assertEquals("s4", 1, xyz._1 match { + case 1 => 1 + case _ => 0 + }) + } + } + + // #717 test path of case classes + object Test717 { + class Foo(j: Int) { + case class Bar(i: Int) + } + val foo1 = new Foo(1) + val foo2 = new Foo(2) + def run(): Unit = { + val res = (foo1.Bar(2): Any) match { + + case foo1.Bar(2) => true + } + assert(res) + } + } + + /// + + trait Treez { self: Shmeez => + abstract class Tree + case class Beez(i: Int) extends Tree + case object HagbardCeline extends Tree + } + + trait Shmeez extends AnyRef with Treez { + val tree: Tree + + def foo = tree match { + case Beez(2) => 1 + case HagbardCeline => 0 + } + } + + // multiple guards for same pattern + object TestGuards extends Shmeez { + val tree: Tree = Beez(2) + def run(): Unit = { + val res = tree match { + case Beez(x) if x == 3 => false + case Beez(x) if x == 2 => true + } + assert(res) + val ret = (Beez(3): Tree) match { + case Beez(x) if x == 3 => true + case Beez(x) if x == 2 => false + } + assert(ret) + } + } + + // test EqualsPatternClass in combination with MixTypes opt, bug #1276 + object TestEqualsPatternOpt { + val NoContext = new Object + def run(): Unit = { + assertEquals(1, ((NoContext: Any) match { + case that: AnyRef if this eq that => 0 + case NoContext => 1 + case _ => 2 + })) + } + } + + // all ignoring patterns on List + object TestSequence01 { + def doMatch(xs: List[String]): String = xs match { + case List(_*) => "ok" + } + def doMatch2(xs: List[String]): List[String] = xs match { + case List(_, rest:_*) => rest.toList + } + def run(): Unit = { + val list1 = List() + assertEquals(doMatch(list1), "ok") + val list2 = List("1", "2", "3") + assertEquals(doMatch(list2), "ok") + val list3 = List("1", "2", "3") + assertEquals(doMatch2(list3), List("2", "3")) + } + } + + // all ignoring patterns on Seq + object TestSequence02 { + def doMatch(l: Seq[String]): String = l match { + case Seq(_*) => "ok" + } + def run(): Unit = { + val list1 = List() + assertEquals(doMatch(list1), "ok") + val list2 = List("1", "2", "3") + assertEquals(doMatch(list2), "ok") + val array3 = Array[String]() + assertEquals(doMatch(array3), "ok") + val array4 = Array[String]("ga", "gu") + assertEquals(doMatch(array4), "ok") + } + } + + // right-ignoring patterns on List, defaults + object TestSequence03 { + def doMatch(xs: List[String]): String = xs match { + case List(_, _, _, _*) => "ok" + case _ => "not ok" + } + def run(): Unit = { + val list1 = List() + assertEquals(doMatch(list1), "not ok") + val list2 = List("1", "2", "3") + assertEquals(doMatch(list2), "ok") + val list3 = List("1", "2", "3", "4") + assertEquals(doMatch(list3), "ok") + } + } + + // all- and right-ignoring pattern on case class w/ seq param + object TestSequence04 { + case class Foo(i: Int, chars: Char*) + + def run(): Unit = { + val a = Foo(0, 'a') match { + case Foo(i, c, chars:_*) => c + case _ => null + } + assertEquals(a, 'a') + + val b = Foo(0, 'a') match { + case Foo(i, chars:_*) => 'b' + case _ => null + } + assertEquals(b, 'b') + } + } + + // sealed case class with ignoring seq patterns + object TestSequence05 { + sealed abstract class Con; + + case class Foo() extends Con + case class Bar(xs: Con*) extends Con + + def run(): Unit = { + val res = (Bar(Foo()): Con) match { + case Bar(xs:_*) => xs // this should be optimized away to a pattern Bar(xs) + case _ => Nil + } + assertEquals("res instance" + res.isInstanceOf[Seq[_]] + " res(0)=" + res(0), true, res.isInstanceOf[Seq[_]] && res(0) == Foo()) + } + } + + // (not regular) fancy guards / bug#644 + object TestSequence06 { + + case class A(i: Any) + + def doMatch(x: Any, bla: Int) = x match { + case x: A if (bla == 1) => 0 + case A(1) => 1 + case A(A(1)) => 2 + } + + def run(): Unit = { + assertEquals(doMatch(A(null), 1), 0) + assertEquals(doMatch(A(1), 2), 1) + assertEquals(doMatch(A(A(1)), 2), 2) + } + + } + + // List of chars + object TestSequence07 { + def doMatch1(xs: List[Char]) = xs match { + case List(x, y, _*) => x :: y :: Nil + } + def doMatch2(xs: List[Char]) = xs match { + case List(x, y, z, w) => List(z, w) + } + def doMatch3(xs: Seq[Char]) = xs match { + case Seq(x, y, 'c', w:_*) => x :: y :: Nil + case Seq(x, y, z:_*) => z + } + def doMatch4(xs: Seq[Char]) = xs match { + case Seq(x, 'b') => x :: 'b' :: Nil + case Seq(x, y, z:_*) => z.toList + } + + def run(): Unit = { + assertEquals(List('a', 'b'), doMatch1(List('a', 'b', 'c', 'd'))) + assertEquals(List('c', 'd'), doMatch2(List('a', 'b', 'c', 'd'))) + assertEquals(List('a', 'b'), doMatch3(List('a', 'b', 'c', 'd'))) + assertEquals(List('c', 'd'), doMatch4(List('a', 'b', 'c', 'd'))) + } + } + + // backquoted identifiers in pattern + object TestSequence08 { + def run(): Unit = { + val xs = List(2, 3) + val ys = List(1, 2, 3) match { + case x :: `xs` => xs + case _ => Nil + } + assertEquals(xs, ys) + } + } + + // unapply for Streams + object TestStream { + def sum(stream: Stream[Int]): Int = + stream match { + case Stream.Empty => 0 + case Stream.cons(hd, tl) => hd + sum(tl) + } + + val str: Stream[Int] = List(1, 2, 3).iterator.toStream + + def run(): Unit = { assertEquals(sum(str), 6) } + } + + // bug#1163 order of temps must be preserved + object Test1163_Order { + abstract class Function + case class Var(n: String) extends Function + case class Const(v: Double) extends Function + + def f(): (Function, Function) = { + (Var("x"): Function, Var("y"): Function) match { + case (Const(v), Const(w)) => throw new Error + case (leftOne, Var("z")) => throw new Error + case (leftTwo, rightTwo) => (leftTwo, rightTwo) // was giving "y","x" + } + } + + def flips(l: List[Int]): Int = (l: @unchecked) match { + case 1 :: ls => 0 + case n :: ls => flips((l take n reverse) ::: (l drop n)) + 1 + } + + def run(): Unit = { assertEquals("both", (Var("x"), Var("y")), f) } + } + + object TestUnbox { + def run(): Unit = { + val xyz: (Int, String, Boolean) = (1, "abc", true) + xyz._1 match { + case 1 => "OK" + case 2 => assert(false); "KO" + case 3 => assert(false); "KO" + } + } + } + + object Test903 { + class Person(_name: String, _father: Person) { + def name = _name + def father = _father + } + + object PersonFather { + def unapply(p: Person): Option[Person] = + if (p.father == null) + None + else + Some(p.father) + } + def run(): Unit = { + val p1 = new Person("p1", null) + val p2 = new Person("p2", p1) + assertEquals((p2.name, p1.name), p2 match { + case aPerson@PersonFather(f) => (aPerson.name, f.name) + case _ => "No father" + }) + } + } + + object Bug881 { + object Foo1 { + class Bar1(val x: String) + def p(b: Bar1) = b.x + + def unapply(s: String): Option[Bar1] = + Some(new Bar1(s)) + } + class Foo(j: Int) { + case class Bar(i: Int) + } + def run(): Unit = { + "baz" match { + case Foo1(x) => + Foo1.p(x) + } + } + } + + // these are exhaustive matches + // should not generate any warnings + def f[A](z: (Option[A], Option[A])) = z match { + case (None, Some(x)) => 1 + case (Some(x), None) => 2 + case (Some(x), Some(y)) => 3 + case _ => 4 + } + + def g1[A](z: Option[List[A]]) = z match { + case Some(Nil) => true + case Some(x :: Nil) => true + case _ => true + } + + def g2[A](z: Option[List[A]]) = z match { + case Some(x :: Nil) => true + case Some(_) => false + case _ => true + } + + def h[A](x: (Option[A], Option[A])) = x match { + case (None, _: Some[_]) => 1 + case (_: Some[_], None) => 2 + case (_: Some[_], _: Some[_]) => 3 + case _ => 4 + } + + def j = (List[Int](), List[Int](1)) match { + case (Nil, _) => 'a' + case (_, Nil) => 'b' + case (h1 :: t1, h2 :: t2) => 'c' + } + + def k(x: AnyRef) = x match { + case null => 1 + case _ => 2 + } + + val FooBar = 42 + def lala() = 42 match { + case FooBar => true + } + + object Bug1270 { // unapply13 + class Sync { + def apply(x: Int): Int = 42 + def unapply(scrut: Any): Option[Int] = None + } + class Buffer { + object Get extends Sync + + var ps: PartialFunction[Any, Any] = { + case Get(y) if y > 4 => // y gets a wildcard type for some reason?! hack + } + } + def run(): Unit = { + assert(!(new Buffer).ps.isDefinedAt(42)) + } + } + + object Bug1281 { + class Sync { + def unapplySeq(scrut: Int): Option[Seq[Int]] = { + if (scrut == 42) Some(List(1, 2)) + else None + } + } + class Buffer { + val Get = new Sync + val jp: PartialFunction[Any, Any] = { + case Get(xs) => // the argDummy should have proper arg.tpe (Int in this case) + } + } + def run(): Unit = { + assert(!(new Buffer).jp.isDefinedAt(40)) + assert(!(new Buffer).jp.isDefinedAt(42)) + } + } + + object ClassDefInGuard { + val z: PartialFunction[Any, Any] = { + case x :: xs if xs.forall { y => y.hashCode() > 0 } => 1 + } + + def run(): Unit = { + val s: PartialFunction[Any, Any] = { + case List(4 :: xs) => 1 + case List(5 :: xs) => 1 + case _ if false => + case List(3 :: xs) if List(3: Any).forall { g => g.hashCode() > 0 } => 1 + } + z.isDefinedAt(42) + s.isDefinedAt(42) + // just load the thing, to see if the classes are found + + (None: Option[Boolean] @unchecked) match { + case x if x.map(x => x).isEmpty => + } + } + } + + // bug#457 + + object Bug457 { + def method1() = { + val x = "Hello, world"; val y = 100; + y match { + case _: Int if (x match { case t => t.trim().length() > 0 }) => false; + case _ => true; + } + } + + def method2(): scala.Boolean = { + val x: String = "Hello, world"; val y: scala.Int = 100; { + var temp1: scala.Int = y + var result: scala.Boolean = false + if ({ + var result1: scala.Boolean = true; + if (y == 100) + result1 + else + throw new MatchError("crazybox.scala, line 11") + } && (y > 90)) + result + else + throw new MatchError("crazybox.scala, line 9") + } + } + + def run(): Unit = { + method1(); + method2(); + } + } + + // bug#508 + + object Bug508 { + case class Operator(x: Int); + val EQ = new Operator(2); + + def analyze(x: Tuple2[Operator, Int]) = x match { + case (EQ, 0) => "0" + case (EQ, 1) => "1" + case (EQ, 2) => "2" + } + def run(): Unit = { + val x = (EQ, 0); + assertEquals("0", analyze(x)); // should print "0" + val y = (EQ, 1); + assertEquals("1", analyze(y)); // should print "1" + val z = (EQ, 2); + assertEquals("2", analyze(z)); // should print "2" + } + } + + // bug#789 + + object Bug789 { // don't do this at home + + trait Impl + + trait SizeImpl extends Impl { def size = 42 } + + trait ColorImpl extends Impl { def color = "red" } + + type Both = SizeImpl with ColorImpl + + def info(x: Impl) = x match { + case x: Both => "size " + x.size + " color " + x.color // you wish + case x: SizeImpl => "!size " + x.size + case x: ColorImpl => "color " + x.color + case _ => "n.a." + } + + def info2(x: Impl) = x match { + case x: SizeImpl with ColorImpl => "size " + x.size + " color " + x.color // you wish + case x: SizeImpl => "!size " + x.size + case x: ColorImpl => "color " + x.color + case _ => "n.a." + } + + def run(): Unit = { + // make up some class that has a size + class MyNode extends SizeImpl + assertEquals("!size 42", info(new MyNode)) + assertEquals("!size 42", info2(new MyNode)) + } + } + + // bug#995 + + object Bug995 { + def foo(v: Any): String = v match { + case s: Seq[_] => "Seq" // see hack in object Seq.unapplySeq + case a: AnyRef if runtime.ScalaRunTime.isArray(a) => "Array" + case _ => v.toString + } + def run(): Unit = { assertEquals("Array", foo(Array(0))) } + } + + // bug#1093 (contribution #460) + + object Bug1093 { + def run(): Unit = { + assert(Some(3) match { + case Some(1 | 2) => false + case Some(3) => true + }) + } + } + + // bug#1094 (contribution #461) + + object Bug1094 { + def foo(ps: String*) = "Foo" + case class X(p: String, ps: String*) + def bar = + X("a", "b") match { + case X(p, ps:_*) => foo(ps: _*) + } + def run(): Unit = { assertEquals("Foo", bar) } + } + + // #2 + + class Outer_2 { + case class Foo(x: Int, y: Int) { + override def equals(other: Any) = other match { + case Outer_2.this.Foo(`x`, `y`) => true + case _ => false + } + } + } + + object Ticket2 { + def run(): Unit = { + val o1 = new Outer_2; val o2 = new Outer_2; val x: Any = o1.Foo(1, 2); val y: Any = o2.Foo(1, 2) + assert(x != y, "equals test returns true (but should not)") + assert(x match { + case o2.Foo(x, y) => false + case o1.Foo(x, y) => true + case _ => false + }, "match enters wrong case") + } + } + + // #11 + + class MyException1 extends Exception + + // Commenting out the following line and uncommenting the second line + // will cause the test to succeed. + trait SpecialException extends MyException1 + // trait SpecialException + + class MyException2 extends MyException1 with SpecialException + + object Ticket11 { + def run(): Unit = { + Array[Throwable](new Exception("abc"), + new MyException1, + new MyException2).foreach { e => + try { + throw e + } catch { + case e: SpecialException => { + assume(e.isInstanceOf[SpecialException]) + } + case e => { + assume(e.isInstanceOf[Throwable]) + } + } + } + } + } + + // #37 + + object Ticket37 { + def foo(): Unit = {} + val (a, b) = { foo(); (2, 3) } + def run(): Unit = { assertEquals(this.a, 2) } + } + + // #44 + + trait _X { + case class _Foo(); + object _Bar { + def unapply(foo: _Foo): Boolean = true; + } + } + object Y extends _X { + val foo = _Foo() + foo match { + case _Bar() => + case _ => assert(false) + } + } + object Ticket44 { + def run(): Unit = { assert(Y.toString ne null) /*instantiate Y*/ } + } + + object Ticket211 { + def run(): Unit = { + (Some(123): Option[Int]) match { + case (x: Option[a]) if false => {}; + case (y: Option[b]) => {}; + } + } + } + + // this test case checks nothing more than whether + // case N for object N is translated to a check scrutinee.equals(N) + // (or the other way round)... for a long time, we got away with + // scrutinee eq N, but those golden days are, apparently, over. + object Ticket346 { + + class L(val content: List[Int]) { + + def isEmpty = content.isEmpty + def head = content.head + def tail = content.tail + + override def equals(that: Any): Boolean = { + val result = that.isInstanceOf[N.type] + println("L(" + content + ").equals(" + that + ") returning " + result) + result + } + } + + object N extends L(Nil) { + override def equals(that: Any): Boolean = + (that.isInstanceOf[L] && that.asInstanceOf[L].isEmpty) + } + + object C { + + def unapply(xs: L): Option[(Int, L)] = { + if (xs.isEmpty) { println("xs is empty"); None } + else + Some((xs.head, new L(xs.tail))) + } + + } + + def empty(xs: L): Boolean = xs match { + case N => true + case _ => false + } + + def singleton(xs: L): Boolean = xs match { + case C(_, N) => true + case _ => false + } + + def run(): Unit = { + assert(empty(new L(Nil))) + assert(singleton(new L(List(1)))) + } + + } // end Ticket346 + +} diff --git a/tests/pending/run/pc-conversions.scala b/tests/pending/run/pc-conversions.scala new file mode 100644 index 000000000000..effac118bc81 --- /dev/null +++ b/tests/pending/run/pc-conversions.scala @@ -0,0 +1,94 @@ +/* + * filter: inliner warning; re-run with -Yinline-warnings for details + */ + +import collection._ + + +// test conversions between collections +object Test { + + def main(args: Array[String]): Unit = { + testConversions + } + + def testConversions: Unit = { + // seq conversions + assertSeq(parallel.mutable.ParArray(1, 2, 3)) + assertSeq(parallel.mutable.ParHashMap(1 -> 2, 2 -> 3)) + assertSeq(parallel.mutable.ParHashSet(1, 2, 3)) + assertSeq(parallel.immutable.ParRange(1, 50, 1, false)) + assertSeq(parallel.immutable.ParHashMap(1 -> 2, 2 -> 4)) + assertSeq(parallel.immutable.ParHashSet(1, 2, 3)) + + // par conversions + assertPar(Array(1, 2, 3)) + assertPar(mutable.ArrayBuffer(1, 2, 3)) + assertPar(mutable.ArraySeq(1, 2, 3)) + assertPar(mutable.WrappedArray.make[Int](Array(1, 2, 3))) + assertPar(mutable.HashMap(1 -> 1, 2 -> 2)) + assertPar(mutable.HashSet(1, 2, 3)) + assertPar(immutable.Range(1, 50, 1)) + assertPar(immutable.HashMap(1 -> 1, 2 -> 2)) + assertPar(immutable.HashSet(1, 2, 3)) + + // par.to* and to*.par tests + assertToPar(List(1 -> 1, 2 -> 2, 3 -> 3)) + assertToPar(Stream(1 -> 1, 2 -> 2)) + assertToPar(Array(1 -> 1, 2 -> 2)) + assertToPar(mutable.PriorityQueue(1 -> 1, 2 -> 2, 3 -> 3)) + assertToPar(mutable.ArrayBuffer(1 -> 1, 2 -> 2)) + assertToPar(mutable.ArraySeq(1 -> 3)) + assertToPar(mutable.WrappedArray.make[(Int, Int)](Array(1 -> 3))) + assertToPar(mutable.HashMap(1 -> 3)) + assertToPar(mutable.HashSet(1 -> 3)) + assertToPar(immutable.HashMap(1 -> 3)) + assertToPar(immutable.HashSet(1 -> 3)) + assertToPar(parallel.mutable.ParArray(1 -> 1, 2 -> 2, 3 -> 3)) + assertToPar(parallel.mutable.ParHashMap(1 -> 2)) + assertToPar(parallel.mutable.ParHashSet(1 -> 2)) + assertToPar(parallel.immutable.ParHashMap(1 -> 2)) + assertToPar(parallel.immutable.ParHashSet(1 -> 3)) + + assertToParWoMap(immutable.Range(1, 10, 2)) + + // seq and par again conversions) + assertSeqPar(parallel.mutable.ParArray(1, 2, 3)) + } + + def assertSeqPar[T](pc: parallel.ParIterable[T]) = pc.seq.par == pc + + def assertSeq[T](pc: parallel.ParIterable[T]) = assert(pc.seq == pc) + + def assertPar[T, P <: Parallel](xs: GenIterable[T]) = assert(xs == xs.par) + + def assertToPar[K, V](xs: GenTraversable[(K, V)]): Unit = { + xs match { + case _: Seq[_] => + assert(xs.toIterable.par == xs) + assert(xs.par.toIterable == xs) + case _ => + } + + assert(xs.toSeq.par == xs.toSeq) + assert(xs.par.toSeq == xs.toSeq) + + assert(xs.toSet.par == xs.toSet) + assert(xs.par.toSet == xs.toSet) + + assert(xs.toMap.par == xs.toMap) + assert(xs.par.toMap == xs.toMap) + } + + def assertToParWoMap[T](xs: GenSeq[T]): Unit = { + assert(xs.toIterable.par == xs.toIterable) + assert(xs.par.toIterable == xs.toIterable) + + assert(xs.toSeq.par == xs.toSeq) + assert(xs.par.toSeq == xs.toSeq) + + assert(xs.toSet.par == xs.toSet) + assert(xs.par.toSet == xs.toSet) + } + +} diff --git a/tests/pending/run/pf-catch.check b/tests/pending/run/pf-catch.check new file mode 100644 index 000000000000..faee9566af1c --- /dev/null +++ b/tests/pending/run/pf-catch.check @@ -0,0 +1,4 @@ +NoSuchElementException +NullPointerException slipped by. +NoSuchElementException +DEBUG: NullPointerException diff --git a/tests/pending/run/pf-catch.scala b/tests/pending/run/pf-catch.scala new file mode 100644 index 000000000000..4f515357242c --- /dev/null +++ b/tests/pending/run/pf-catch.scala @@ -0,0 +1,36 @@ + +import scala.language.{ postfixOps } +object Test { + def shortName(x: AnyRef) = x.getClass.getName split '.' last + type Handler[+T] = PartialFunction[Throwable, T] + + val standardHandler: Handler[String] = { + case x: java.util.NoSuchElementException => shortName(x) + case x: java.lang.IllegalArgumentException => shortName(x) + } + + def fn[T: Handler](body: => T): T = { + try body + catch implicitly[Handler[T]] + } + + def f1 = { + implicit val myHandler: Test.Handler[String] = standardHandler + println(fn(Nil.head)) + println(fn(null.toString)) + } + def f2 = { + implicit val myHandler: Handler[String] = standardHandler orElse { + case x => "DEBUG: " + shortName(x) + } + println(fn(Nil.head)) + println(fn(null.toString)) + } + + def main(args: Array[String]): Unit = { + try f1 + catch { case x: Throwable => println(shortName(x) + " slipped by.") } + + f2 + } +} diff --git a/tests/pending/run/phantomValueClass.check b/tests/pending/run/phantomValueClass.check new file mode 100644 index 000000000000..323fae03f460 --- /dev/null +++ b/tests/pending/run/phantomValueClass.check @@ -0,0 +1 @@ +foobar diff --git a/tests/pending/run/phantomValueClass.scala b/tests/pending/run/phantomValueClass.scala new file mode 100644 index 000000000000..fb4b8e2d0b49 --- /dev/null +++ b/tests/pending/run/phantomValueClass.scala @@ -0,0 +1,10 @@ +final class Phantom[A](val s: String) extends AnyVal { + def compose(p: Phantom[A]): Phantom[A] = new Phantom[A](s+p.s) +} + +object Test extends dotty.runtime.LegacyApp { + val x = new Phantom[Int]("foo") + val y = new Phantom[Int]("bar") + val z = x compose y + println(z.s) +} diff --git a/tests/pending/run/position-val-def.check b/tests/pending/run/position-val-def.check new file mode 100644 index 000000000000..a92c77c68cff --- /dev/null +++ b/tests/pending/run/position-val-def.check @@ -0,0 +1,30 @@ +val x = 0 +[0:9]val x = [8:9]0 + +var x = 0 +[0:9]var x = [8:9]0 + +val x, y = 0 +[NoPosition]{ + [0:5]val x = [11]0; + [7:12]val y = [11:12]0; + [NoPosition]() +} + +var x, y = 0 +[NoPosition]{ + [0:5]var x = [11]0; + [7:12]var y = [11:12]0; + [NoPosition]() +} + +val (x, y) = 0 +[NoPosition]{ + <0:14> private[this] val x$1 = <4:14>[13:14][13:14]0: @[13]scala.unchecked match { + <4:10>case <4:10>[4]scala.Tuple2(<5:6>(x @ [5]_), <8:9>(y @ [8]_)) => <4:10><4:10>scala.Tuple2(<4:10>x, <4:10>y) + }; + [5:6]val x = [5]x$1._1; + [8:9]val y = [8]x$1._2; + [NoPosition]() +} + diff --git a/tests/pending/run/position-val-def.scala b/tests/pending/run/position-val-def.scala new file mode 100644 index 000000000000..b79e120f746a --- /dev/null +++ b/tests/pending/run/position-val-def.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test { + val toolbox = cm.mkToolBox(options = "-Yrangepos") + + def main(args: Array[String]): Unit = { + def test(expr: String): Unit = { + val t = toolbox.parse(expr) + println(expr) + println(show(t, printPositions = true)) + println() + } + val tests = """ + val x = 0 + var x = 0 + val x, y = 0 + var x, y = 0 + val (x, y) = 0 + """ + val exprs = tests.split("\\n").map(_.trim).filterNot(_.isEmpty) + exprs foreach test + } +} diff --git a/tests/pending/run/predef-cycle.scala b/tests/pending/run/predef-cycle.scala new file mode 100644 index 000000000000..64b352bc4300 --- /dev/null +++ b/tests/pending/run/predef-cycle.scala @@ -0,0 +1,71 @@ +class Force { + val t1 = new Thread { + override def run(): Unit = { + scala.`package` + } + } + val t2 = new Thread { + override def run(): Unit = { + scala.Predef + } + } + t1.start() + t2.start() + t1.join() + t2.join() +} + +object Test { + def main(args: Array[String]): Unit = { + new Force() + } +} + +/* Was deadlocking: +"Thread-2" prio=5 tid=7f9637268000 nid=0x119601000 in Object.wait() [119600000] + java.lang.Thread.State: RUNNABLE + at scala.Predef$.(Predef.scala:90) + at scala.Predef$.(Predef.scala) + at Force$$anon$2.run(predef-cycle.scala:10) + +"Thread-1" prio=5 tid=7f9637267800 nid=0x1194fe000 in Object.wait() [1194fb000] + java.lang.Thread.State: RUNNABLE + at scala.collection.immutable.Set$Set4.$plus(Set.scala:127) + at scala.collection.immutable.Set$Set4.$plus(Set.scala:121) + at scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:24) + at scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:22) + at scala.collection.generic.Growable$$anonfun$$plus$plus$eq$1.apply(Growable.scala:48) + at scala.collection.generic.Growable$$anonfun$$plus$plus$eq$1.apply(Growable.scala:48) + at scala.collection.immutable.List.foreach(List.scala:318) + at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48) + at scala.collection.mutable.SetBuilder.$plus$plus$eq(SetBuilder.scala:22) + at scala.collection.TraversableLike$class.to(TraversableLike.scala:629) + at scala.collection.AbstractTraversable.to(Traversable.scala:105) + at scala.collection.TraversableOnce$class.toSet(TraversableOnce.scala:267) + at scala.collection.AbstractTraversable.toSet(Traversable.scala:105) + at scala.runtime.ScalaRunTime$.(ScalaRunTime.scala:50) + at scala.runtime.ScalaRunTime$.(ScalaRunTime.scala) + at scala.collection.mutable.HashTable$HashUtils$class.elemHashCode(HashTable.scala) + at scala.collection.mutable.HashMap.elemHashCode(HashMap.scala:39) + at scala.collection.mutable.HashTable$class.findOrAddEntry(HashTable.scala:161) + at scala.collection.mutable.HashMap.findOrAddEntry(HashMap.scala:39) + at scala.collection.mutable.HashMap.put(HashMap.scala:75) + at scala.collection.mutable.HashMap.update(HashMap.scala:80) + at scala.sys.SystemProperties$.addHelp(SystemProperties.scala:64) + at scala.sys.SystemProperties$.bool(SystemProperties.scala:68) + at scala.sys.SystemProperties$.noTraceSupression$lzycompute(SystemProperties.scala:80) + - locked <7b8b0e228> (a scala.sys.SystemProperties$) + at scala.sys.SystemProperties$.noTraceSupression(SystemProperties.scala:80) + at scala.util.control.NoStackTrace$.(NoStackTrace.scala:31) + at scala.util.control.NoStackTrace$.(NoStackTrace.scala) + at scala.util.control.NoStackTrace$class.fillInStackTrace(NoStackTrace.scala:22) + at scala.util.control.BreakControl.fillInStackTrace(Breaks.scala:93) + at java.lang.Throwable.(Throwable.java:181) + at scala.util.control.BreakControl.(Breaks.scala:93) + at scala.util.control.Breaks.(Breaks.scala:28) + at scala.collection.Traversable$.(Traversable.scala:96) + at scala.collection.Traversable$.(Traversable.scala) + at scala.package$.(package.scala:46) + at scala.package$.(package.scala) + at Force$$anon$1.run(predef-cycle.scala:4) + */ diff --git a/tests/pending/run/preinits.check b/tests/pending/run/preinits.check new file mode 100644 index 000000000000..e97a14b77f5c --- /dev/null +++ b/tests/pending/run/preinits.check @@ -0,0 +1,9 @@ +preinits.scala:2: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized. +trait B extends { override val x = 1 } with A { println("B") } + ^ +preinits.scala:3: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized. +trait C extends { override val x = 2 } with A + ^ +A +B +2 diff --git a/tests/pending/run/preinits.scala b/tests/pending/run/preinits.scala new file mode 100644 index 000000000000..6566c4086b55 --- /dev/null +++ b/tests/pending/run/preinits.scala @@ -0,0 +1,6 @@ +trait A { val x: Int; println("A") } +trait B extends { override val x = 1 } with A { println("B") } +trait C extends { override val x = 2 } with A +object Test extends B with C with App { + println(x) +} diff --git a/tests/pending/run/primitive-sigs-2-new.check b/tests/pending/run/primitive-sigs-2-new.check new file mode 100644 index 000000000000..59d864947c00 --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-new.check @@ -0,0 +1,7 @@ +T +List(A, char, class java.lang.Object) +a +public java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.ClassTag) +public float[] Arr.arr3(float[][]) +public scala.collection.immutable.List Arr.arr2(java.lang.Character[]) +public scala.collection.immutable.List Arr.arr1(int[]) diff --git a/tests/pending/run/primitive-sigs-2-new.flags b/tests/pending/run/primitive-sigs-2-new.flags new file mode 100644 index 000000000000..2349d8294d80 --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-new.flags @@ -0,0 +1 @@ +-Ydelambdafy:inline diff --git a/tests/pending/run/primitive-sigs-2-new.scala b/tests/pending/run/primitive-sigs-2-new.scala new file mode 100644 index 000000000000..1f39667b18f1 --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-new.scala @@ -0,0 +1,34 @@ + +import scala.language.{ postfixOps } +import scala.reflect.{ClassTag, classTag} +import java.{ lang => jl } + +trait T[A] { + def f(): A +} +class C extends T[Char] { + def f(): Char = 'a' +} +class Arr { + def arr1(xs: Array[Int]): List[Int] = xs.toList + def arr2(xs: Array[jl.Character]): List[jl.Character] = xs.toList + def arr3(xss: Array[Array[Float]]): Array[Float] = xss map (_.sum) + def arr4[T: ClassTag](xss: Array[Array[T]]): Array[T] = xss map (_.head) +} + +object Test { + val c1: Class[_] = classOf[T[_]] + val c2: Class[_] = classOf[C] + val c3: Class[_] = classOf[Arr] + + val c1m = c1.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) + val c2m = c2.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) + val c3m = c3.getDeclaredMethods.toList map (_.toGenericString) + + def main(args: Array[String]): Unit = { + println(c2.getGenericInterfaces.map(_.toString).sorted mkString " ") + println(c1m ++ c2m sorted) + println(new C f) + c3m.sorted foreach println + } +} diff --git a/tests/pending/run/primitive-sigs-2-old.check b/tests/pending/run/primitive-sigs-2-old.check new file mode 100644 index 000000000000..feb06195256f --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-old.check @@ -0,0 +1,7 @@ +T +List(A, char, class java.lang.Object) +a +public java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.Manifest) +public float[] Arr.arr3(float[][]) +public scala.collection.immutable.List Arr.arr2(java.lang.Character[]) +public scala.collection.immutable.List Arr.arr1(int[]) diff --git a/tests/pending/run/primitive-sigs-2-old.flags b/tests/pending/run/primitive-sigs-2-old.flags new file mode 100644 index 000000000000..ac96850b69b5 --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-old.flags @@ -0,0 +1 @@ +-Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/primitive-sigs-2-old.scala b/tests/pending/run/primitive-sigs-2-old.scala new file mode 100644 index 000000000000..16fe5ae55563 --- /dev/null +++ b/tests/pending/run/primitive-sigs-2-old.scala @@ -0,0 +1,41 @@ + +import scala.language.{ postfixOps } +import java.{ lang => jl } + +trait T[A] { + def f(): A +} +class C extends T[Char] { + def f(): Char = 'a' +} +class Arr { + def arr1(xs: Array[Int]): List[Int] = xs.toList + def arr2(xs: Array[jl.Character]): List[jl.Character] = xs.toList + def arr3(xss: Array[Array[Float]]): Array[Float] = xss map (_.sum) + // This gets a signature like + // public java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.Manifest) + // + // instead of the more appealing version from the past + // public T[] Arr.arr4(T[][],scala.reflect.Manifest) + // + // because java inflict's its reference-only generic-arrays on us. + // + def arr4[T: Manifest](xss: Array[Array[T]]): Array[T] = xss map (_.head) +} + +object Test { + val c1: Class[_] = classOf[T[_]] + val c2: Class[_] = classOf[C] + val c3: Class[_] = classOf[Arr] + + val c1m = c1.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) + val c2m = c2.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) + val c3m = c3.getDeclaredMethods.toList map (_.toGenericString) + + def main(args: Array[String]): Unit = { + println(c2.getGenericInterfaces.map(_.toString).sorted mkString " ") + println(c1m ++ c2m sorted) + println(new C f) + c3m.sorted foreach println + } +} diff --git a/tests/pending/run/priorityQueue.scala b/tests/pending/run/priorityQueue.scala new file mode 100644 index 000000000000..56f7ac3c8ee6 --- /dev/null +++ b/tests/pending/run/priorityQueue.scala @@ -0,0 +1,373 @@ + + + +import scala.collection.mutable.PriorityQueue + + + + + + +// populate a priority queue a few different ways and make sure they all seem equal +object Test { + + def main(args: Array[String]): Unit = { + // testInsertionsAndEqualities + // testIntensiveEnqueueDequeue + // testTails + // testInits + // testFilters + // testDrops + // testEquality + // testMisc + // testReverse + // testToList + // testForeach + } + + // def testInsertionsAndEqualities { + // import scala.util.Random.nextInt + // val pq1 = new PriorityQueue[String] + // val pq2 = new PriorityQueue[String] + // val pq3 = new PriorityQueue[String] + // val pq4 = new PriorityQueue[String] + + // val strings = (1 to 20).toList map (i => List.fill((Math.abs(nextInt % 20)) + 1)("x").mkString) + + // pq1 ++= strings + // pq2 ++= strings.reverse + // for (s <- strings) pq3 += s + // for (s <- strings.reverse) pq4 += s + + // val pqs = List(pq1, pq2, pq3, pq4, pq1.clone, pq2.clone) + + // for (queue1 <- pqs ; queue2 <- pqs) { + // val l1: List[String] = queue1.dequeueAll[String, List[String]] + // val l2: List[String] = queue2.dequeueAll[String, List[String]] + // assert(l1 == l2) + // assert(queue1.max == queue2.max) + // } + + // assertPriorityDestructive(pq1) + // } + + // not a sequence anymore, Mildred + // def testIndexing { + // val pq = new PriorityQueue[Char] + // "The quick brown fox jumps over the lazy dog".foreach(pq += _) + + // // val iter = pq.iterator + // // while (iter.hasNext) println("`" + iter.next + "`") + // assert(pq(0) == 'z') + // assert(pq(1) == 'y') + // assert(pq(2) == 'x') + // assert(pq(3) == 'w') + // assert(pq(4) == 'v') + // assert(pq(5) == 'u') + // assert(pq(7) == 't') + // assert(pq(8) == 's') + // assert(pq(9) == 'r') + // assert(pq(10) == 'r') + + // pq.clear + // "abcdefghijklmnopqrstuvwxyz".foreach(pq += _) + // for (i <- 0 until 26) assert(pq(i) == ('z' - i)) + + // val intpq = new PriorityQueue[Int] + // val intlst = new collection.mutable.ArrayBuffer ++ (0 until 100) + // val random = new util.Random(101) + // while (intlst.nonEmpty) { + // val idx = random.nextInt(intlst.size) + // intpq += intlst(idx) + // intlst.remove(idx) + // } + // for (i <- 0 until 100) assert(intpq(i) == (99 - i)) + // } + + // def testTails { + // val pq = new PriorityQueue[Int] + // for (i <- 0 until 10) pq += i * 4321 % 200 + + // assert(pq.size == 10) + // assert(pq.nonEmpty) + + // val tailpq = pq.tail + // // pq.printstate + // // tailpq.printstate + // assert(tailpq.size == 9) + // assert(tailpq.nonEmpty) + // assertPriorityDestructive(tailpq) + // } + + // def assertPriorityDestructive[A](pq: PriorityQueue[A])(implicit ord: Ordering[A]) { + // import ord._ + // var prev: A = null.asInstanceOf[A] + // while (pq.nonEmpty) { + // val curr = pq.dequeue + // if (prev != null) assert(curr <= prev) + // prev = curr + // } + // } + + // def testInits { + // val pq = new PriorityQueue[Long] + // for (i <- 0 until 20) pq += (i + 313) * 111 % 300 + + // assert(pq.size == 20) + + // val initpq = pq.init + // assert(initpq.size == 19) + // assertPriorityDestructive(initpq) + // } + + // def testFilters { + // val pq = new PriorityQueue[String] + // for (i <- 0 until 100) pq += "Some " + (i * 312 % 200) + + // val filpq = pq.filter(_.indexOf('0') != -1) + // assertPriorityDestructive(filpq) + // } + + // def testIntensiveEnqueueDequeue { + // val pq = new PriorityQueue[Int] + + // testIntensive(1000, pq) + // pq.clear + // testIntensive(200, pq) + // } + + // def testIntensive(sz: Int, pq: PriorityQueue[Int]) { + // val lst = new collection.mutable.ArrayBuffer[Int] ++ (0 until sz) + // val rand = new util.Random(7) + // while (lst.nonEmpty) { + // val idx = rand.nextInt(lst.size) + // pq.enqueue(lst(idx)) + // lst.remove(idx) + // if (rand.nextDouble < 0.25 && pq.nonEmpty) pq.dequeue + // assertPriority(pq) + // } + // } + + // def testDrops { + // val pq = new PriorityQueue[Int] + // pq ++= (0 until 100) + // val droppq = pq.drop(50) + // assertPriority(droppq) + + // pq.clear + // pq ++= droppq + // assertPriorityDestructive(droppq) + // assertPriority(pq) + // assertPriorityDestructive(pq) + // } + + // // your sequence days have ended, foul priority queue + // // def testUpdates { + // // val pq = new PriorityQueue[Int] + // // pq ++= (0 until 36) + // // assertPriority(pq) + + // // pq(0) = 100 + // // assert(pq(0) == 100) + // // assert(pq.dequeue == 100) + // // assertPriority(pq) + + // // pq.clear + + // // pq ++= (1 to 100) + // // pq(5) = 200 + // // assert(pq(0) == 200) + // // assert(pq(1) == 100) + // // assert(pq(2) == 99) + // // assert(pq(3) == 98) + // // assert(pq(4) == 97) + // // assert(pq(5) == 96) + // // assert(pq(6) == 94) + // // assert(pq(7) == 93) + // // assert(pq(98) == 2) + // // assert(pq(99) == 1) + // // assertPriority(pq) + + // // pq(99) = 450 + // // assert(pq(0) == 450) + // // assert(pq(1) == 200) + // // assert(pq(99) == 2) + // // assertPriority(pq) + + // // pq(1) = 0 + // // assert(pq(1) == 100) + // // assert(pq(99) == 0) + // // assertPriority(pq) + // // assertPriorityDestructive(pq) + // // } + + // def testEquality { + // val pq1 = new PriorityQueue[Int] + // val pq2 = new PriorityQueue[Int] + + // pq1 ++= (0 until 50) + // var i = 49 + // while (i >= 0) { + // pq2 += i + // i -= 1 + // } + // assert(pq1 == pq2) + // assertPriority(pq2) + + // pq1 += 100 + // assert(pq1 != pq2) + // pq2 += 100 + // assert(pq1 == pq2) + // pq2 += 200 + // assert(pq1 != pq2) + // pq1 += 200 + // assert(pq1 == pq2) + // assertPriorityDestructive(pq1) + // assertPriorityDestructive(pq2) + // } + + // def testMisc { + // val pq = new PriorityQueue[Int] + // pq ++= (0 until 100) + // assert(pq.size == 100) + + // val (p1, p2) = pq.partition(_ < 50) + // assertPriorityDestructive(p1) + // assertPriorityDestructive(p2) + + // val spq = pq.slice(25, 75) + // assertPriorityDestructive(spq) + + // pq.clear + // pq ++= (0 until 10) + // pq += 5 + // assert(pq.size == 11) + + // val ind = pq.lastIndexWhere(_ == 5) + // assert(ind == 5) + // assertPriorityDestructive(pq) + + // pq.clear + // pq ++= (0 until 10) + // assert(pq.lastIndexWhere(_ == 9) == 0) + // assert(pq.lastIndexOf(8) == 1) + // assert(pq.lastIndexOf(7) == 2) + + // pq += 5 + // pq += 9 + // assert(pq.lastIndexOf(9) == 1) + // assert(pq.lastIndexWhere(_ % 2 == 1) == 10) + // assert(pq.lastIndexOf(5) == 6) + + // val lst = pq.reverseIterator.toList + // for (i <- 0 until 5) assert(lst(i) == i) + // assert(lst(5) == 5) + // assert(lst(6) == 5) + // assert(lst(7) == 6) + // assert(lst(8) == 7) + // assert(lst(9) == 8) + // assert(lst(10) == 9) + // assert(lst(11) == 9) + + // pq.clear + // assert(pq.reverseIterator.toList.isEmpty) + + // pq ++= (50 to 75) + // assert(pq.lastIndexOf(70) == 5) + + // pq += 55 + // pq += 70 + // assert(pq.lastIndexOf(70) == 6) + // assert(pq.lastIndexOf(55) == 22) + // assert(pq.lastIndexOf(55, 21) == 21) + // assert(pq.lastIndexWhere(_ > 54) == 22) + // assert(pq.lastIndexWhere(_ > 54, 21) == 21) + // assert(pq.lastIndexWhere(_ > 69, 5) == 5) + // } + + // def testReverse { + // val pq = new PriorityQueue[(Int, Int)] + // pq ++= (for (i <- 0 until 10) yield (i, i * i % 10)) + + // assert(pq.reverse.size == pq.reverseIterator.toList.size) + // assert((pq.reverse zip pq.reverseIterator.toList).forall(p => p._1 == p._2)) + // assert(pq.reverse.sameElements(pq.reverseIterator.toSeq)) + // assert(pq.reverse(0)._1 == pq(9)._1) + // assert(pq.reverse(1)._1 == pq(8)._1) + // assert(pq.reverse(4)._1 == pq(5)._1) + // assert(pq.reverse(9)._1 == pq(0)._1) + + // pq += ((7, 7)) + // pq += ((7, 9)) + // pq += ((7, 8)) + // assert(pq.reverse.reverse == pq) + // assert(pq.reverse.lastIndexWhere(_._2 == 6) == 6) + // assertPriorityDestructive(pq.reverse.reverse) + + // val iq = new PriorityQueue[Int] + // iq ++= (0 until 50) + // assert(iq.reverse == iq.reverseIterator.toSeq) + // assert(iq.reverse.reverse == iq) + + // iq += 25 + // iq += 40 + // iq += 10 + // assert(iq.reverse == iq.reverseIterator.toList) + // assert(iq.reverse.reverse == iq) + // assert(iq.reverse.lastIndexWhere(_ == 10) == 11) + // assertPriorityDestructive(iq.reverse.reverse) + // } + + // def testToList { + // val pq = new PriorityQueue[Int] + + // pq += 1 + // pq += 4 + // pq += 0 + // pq += 5 + // pq += 3 + // pq += 2 + // assert(pq.toList == pq) + // assert(pq == List(5, 4, 3, 2, 1, 0)) + // assert(pq.reverse == List(0, 1, 2, 3, 4, 5)) + + // pq.clear + // for (i <- -50 until 50) pq += i + // assert(pq.toList == pq) + // assert(pq.toList == (-50 until 50).reverse) + // } + + // def testForeach { + // val pq = new PriorityQueue[Char] + + // pq += 't' + // pq += 'o' + // pq += 'b' + // pq += 'y' + // val sbf = new StringBuilder + // val sbi = new StringBuilder + // pq.foreach(sbf += _) + // pq.iterator.foreach(sbi += _) + // assert(sbf.toString == sbi.toString) + // assert(sbf.toString == "ytob") + // } + +} + + + + + + + + + + + + + + + + + + diff --git a/tests/pending/run/private-inline.check b/tests/pending/run/private-inline.check new file mode 100644 index 000000000000..e71aec2fcfd8 --- /dev/null +++ b/tests/pending/run/private-inline.check @@ -0,0 +1,13 @@ +private-inline.scala:24: warning: Could not inline required method wrapper1 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. + def f1b() = identity(wrapper1(5)) + ^ +private-inline.scala:24: warning: At the end of the day, could not inline @inline-marked method wrapper1 + def f1b() = identity(wrapper1(5)) + ^ +private-inline.scala:29: warning: Could not inline required method wrapper2 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. + def f2b() = identity(wrapper2(5)) + ^ +private-inline.scala:29: warning: At the end of the day, could not inline @inline-marked method wrapper2 + def f2b() = identity(wrapper2(5)) + ^ +20 diff --git a/tests/pending/run/private-inline.flags b/tests/pending/run/private-inline.flags new file mode 100644 index 000000000000..00d3643fd4a1 --- /dev/null +++ b/tests/pending/run/private-inline.flags @@ -0,0 +1 @@ +-optimise -Yinline-warnings diff --git a/tests/pending/run/private-inline.scala b/tests/pending/run/private-inline.scala new file mode 100644 index 000000000000..60fef9efca30 --- /dev/null +++ b/tests/pending/run/private-inline.scala @@ -0,0 +1,52 @@ + +final class A { + private var x1 = false + var x2 = false + + // manipulates private var + @inline private def wrapper1[T](body: => T): T = { + val saved = x1 + x1 = true + try body + finally x1 = saved + } + // manipulates public var + @inline private def wrapper2[T](body: => T): T = { + val saved = x2 + x2 = true + try body + finally x2 = saved + } + + // not inlined + def f1a() = wrapper1(5) + // inlined! + def f1b() = identity(wrapper1(5)) + + // not inlined + def f2a() = wrapper2(5) + // inlined! + def f2b() = identity(wrapper2(5)) +} + +object Test { + def methodClasses = List("f1a", "f2a") map ("A$$anonfun$" + _ + "$1") + + def main(args: Array[String]): Unit = { + val a = new A + import a._ + println(f1a() + f1b() + f2a() + f2b()) + + // Don't know how else to test this: all these should have been + // inlined, so all should fail. + methodClasses foreach { clazz => + + val foundClass = ( + try Class.forName(clazz) + catch { case _: Throwable => null } + ) + + assert(foundClass == null, foundClass) + } + } +} diff --git a/tests/pending/run/programmatic-main.check b/tests/pending/run/programmatic-main.check new file mode 100644 index 000000000000..1cd94ccb453f --- /dev/null +++ b/tests/pending/run/programmatic-main.check @@ -0,0 +1,27 @@ + phase name id description + ---------- -- ----------- + parser 1 parse source into ASTs, perform simple desugaring + namer 2 resolve names, attach symbols to named trees +packageobjects 3 load package objects + typer 4 the meat and potatoes: type the trees + patmat 5 translate match expressions +superaccessors 6 add super accessors in traits and nested classes + extmethods 7 add extension methods for inline classes + pickler 8 serialize symbol tables + refchecks 9 reference/override checking, translate nested objects + uncurry 10 uncurry, translate function values to anonymous classes + tailcalls 11 replace tail calls by jumps + specialize 12 @specialized-driven class and method specialization + explicitouter 13 this refs to outer pointers + erasure 14 erase types, add interfaces for traits + posterasure 15 clean up erased inline classes + lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs + lambdalift 17 move nested functions to top level + constructors 18 move field definitions into constructors + flatten 19 eliminate inner classes + mixin 20 mixin composition + cleanup 21 platform-specific cleanups, generate reflective calls + delambdafy 22 remove lambdas + icode 23 generate portable intermediate code + jvm 24 generate JVM bytecode + terminal 25 the last phase during a compilation run diff --git a/tests/pending/run/programmatic-main.scala b/tests/pending/run/programmatic-main.scala new file mode 100644 index 000000000000..542ac2781e47 --- /dev/null +++ b/tests/pending/run/programmatic-main.scala @@ -0,0 +1,16 @@ + +import scala.language.postfixOps +import scala.tools.nsc._ +import io.Path + +object Test { + val cwd = Option(System.getProperty("partest.cwd")) getOrElse "." + val basedir = Path(cwd).parent / "lib" path + val baseargs = Array("-usejavacp", "-bootclasspath", basedir + "/scala-library.jar", "-cp", basedir + "/scala-compiler.jar") + + def main(args: Array[String]): Unit = { + Console.withErr(Console.out) { + Main process (baseargs ++ "-Xpluginsdir /does/not/exist/foo/quux -Xshow-phases".split(' ')) + } + } +} diff --git a/tests/pending/run/promotion.check b/tests/pending/run/promotion.check new file mode 100644 index 000000000000..e769775ce7ed --- /dev/null +++ b/tests/pending/run/promotion.check @@ -0,0 +1,4 @@ +2.0 +6.0 +20.0 +30.0 diff --git a/tests/pending/run/promotion.scala b/tests/pending/run/promotion.scala new file mode 100644 index 000000000000..9f3be9661cd9 --- /dev/null +++ b/tests/pending/run/promotion.scala @@ -0,0 +1,14 @@ + +/** Test that unboxing and promotion (from int to double) work together. + * Was bug 819. + */ +object Test { + + def id[A](x: A): A = x; + def main(args: Array[String]): Unit = { + Console.println(id(1) * 2.0) + Console.println(3.0 * id(2)) + Console.println(id(4.0) * 5) + Console.println(6 * id(5.0)) + } +} diff --git a/tests/pending/run/proxy.check b/tests/pending/run/proxy.check new file mode 100644 index 000000000000..c40b3db7c21a --- /dev/null +++ b/tests/pending/run/proxy.check @@ -0,0 +1,6 @@ +false +true +false +false +true +true diff --git a/tests/pending/run/proxy.scala b/tests/pending/run/proxy.scala new file mode 100644 index 000000000000..8449b73298a9 --- /dev/null +++ b/tests/pending/run/proxy.scala @@ -0,0 +1,17 @@ +object Test extends dotty.runtime.LegacyApp { + val p = new Proxy { + def self = 2 + } + println(p equals 1) + println(p equals 2) + println(p equals 3) + println(p equals null) + + case class Bippy(a: String) extends Proxy { + def self = a + } + + val label = Bippy("bippy!") + println(label == label) + println(label == "bippy!") +} diff --git a/tests/pending/run/pure-args-byname-noinline.check b/tests/pending/run/pure-args-byname-noinline.check new file mode 100644 index 000000000000..a39c61eb64a5 --- /dev/null +++ b/tests/pending/run/pure-args-byname-noinline.check @@ -0,0 +1,12 @@ +2 +2 +2 +2 +List(1) +List() + +1 +1 +1 +1 +1 diff --git a/tests/pending/run/pure-args-byname-noinline.scala b/tests/pending/run/pure-args-byname-noinline.scala new file mode 100644 index 000000000000..3ed4c480b3f5 --- /dev/null +++ b/tests/pending/run/pure-args-byname-noinline.scala @@ -0,0 +1,33 @@ +object Test { + //Were affected by SI-6306 + def f[A](a: =>A) = println(a.toString) + def f1[A <: AnyVal](a: =>A) = println(a.toString) + def f1a[A <: AnyVal](a: =>A) = println(a.##) + def f2[A <: AnyRef](a: =>A) = println(a.toString) + def f2a[A <: String](a: =>A) = println(a.toString) + //Works + def f3[A](a: =>Seq[A]) = println(a.toString) + + def foo() = println(2) + def client(f: () => Unit) = {f(); f()} + def attempt2(): Unit = { + val bar: () => Unit = foo _ + //The code causing SI-6306 was supposed to optimize code like this: + client(() => bar ()) + //to: + client(bar) + } + def main(args: Array[String]): Unit = { + attempt2() + f3(Seq(1)) + f3(Seq()) + f("") + f((1).toString) + f((1).##) + f1((1).##) + f2((1).toString) + f2a((1).toString) + } +} + +// vim: set ts=8 sw=2 et: diff --git a/tests/pending/run/range-unit.check b/tests/pending/run/range-unit.check new file mode 100644 index 000000000000..3daf91cd6419 --- /dev/null +++ b/tests/pending/run/range-unit.check @@ -0,0 +1,4178 @@ +>>> Range.inclusive <<< + +start end step length/first/last +----------------------------------------- +0 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 0 -1 1/0/0 +0 0 1 1/0/0 +0 0 -2 1/0/0 +0 0 2 1/0/0 +0 0 -3 1/0/0 +0 0 3 1/0/0 +0 0 17 1/0/0 +0 0 127 1/0/0 +0 0 MIN+1 1/0/0 +0 0 MAX 1/0/0 +0 0 MIN 1/0/0 +0 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 -1 -1 2/0/-1 +0 -1 1 0 +0 -1 -2 1/0/0 +0 -1 2 0 +0 -1 -3 1/0/0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 1/0/0 +0 -1 MAX 0 +0 -1 MIN 1/0/0 +0 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 1 -1 0 +0 1 1 2/0/1 +0 1 -2 0 +0 1 2 1/0/0 +0 1 -3 0 +0 1 3 1/0/0 +0 1 17 1/0/0 +0 1 127 1/0/0 +0 1 MIN+1 0 +0 1 MAX 1/0/0 +0 1 MIN 0 +0 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 3 -1 0 +0 3 1 4/0/3 +0 3 -2 0 +0 3 2 2/0/2 +0 3 -3 0 +0 3 3 2/0/3 +0 3 17 1/0/0 +0 3 127 1/0/0 +0 3 MIN+1 0 +0 3 MAX 1/0/0 +0 3 MIN 0 +0 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN+1 -1 --- + java.lang.IllegalArgumentException: 0 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN+1 1 0 +0 MIN+1 -2 1073741824/0/MIN+2 +0 MIN+1 2 0 +0 MIN+1 -3 715827883/0/MIN+2 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 2/0/MIN+1 +0 MIN+1 MAX 0 +0 MIN+1 MIN 1/0/0 +0 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MAX -1 0 +0 MAX 1 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX -2 0 +0 MAX 2 1073741824/0/MAX-1 +0 MAX -3 0 +0 MAX 3 715827883/0/MAX-1 +0 MAX 17 126322568/0/MAX-8 +0 MAX 127 16909321/0/MAX-7 +0 MAX MIN+1 0 +0 MAX MAX 2/0/MAX +0 MAX MIN 0 +0 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN -1 --- + java.lang.IllegalArgumentException: 0 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN 1 0 +0 MIN -2 1073741825/0/MIN +0 MIN 2 0 +0 MIN -3 715827883/0/MIN+2 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 2/0/MIN+1 +0 MIN MAX 0 +0 MIN MIN 2/0/MIN + +start end step length/first/last +----------------------------------------- +-1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 0 -1 0 +-1 0 1 2/-1/0 +-1 0 -2 0 +-1 0 2 1/-1/-1 +-1 0 -3 0 +-1 0 3 1/-1/-1 +-1 0 17 1/-1/-1 +-1 0 127 1/-1/-1 +-1 0 MIN+1 0 +-1 0 MAX 1/-1/-1 +-1 0 MIN 0 +-1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 -1 -1 1/-1/-1 +-1 -1 1 1/-1/-1 +-1 -1 -2 1/-1/-1 +-1 -1 2 1/-1/-1 +-1 -1 -3 1/-1/-1 +-1 -1 3 1/-1/-1 +-1 -1 17 1/-1/-1 +-1 -1 127 1/-1/-1 +-1 -1 MIN+1 1/-1/-1 +-1 -1 MAX 1/-1/-1 +-1 -1 MIN 1/-1/-1 +-1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 1 -1 0 +-1 1 1 3/-1/1 +-1 1 -2 0 +-1 1 2 2/-1/1 +-1 1 -3 0 +-1 1 3 1/-1/-1 +-1 1 17 1/-1/-1 +-1 1 127 1/-1/-1 +-1 1 MIN+1 0 +-1 1 MAX 1/-1/-1 +-1 1 MIN 0 +-1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 3 -1 0 +-1 3 1 5/-1/3 +-1 3 -2 0 +-1 3 2 3/-1/3 +-1 3 -3 0 +-1 3 3 2/-1/2 +-1 3 17 1/-1/-1 +-1 3 127 1/-1/-1 +-1 3 MIN+1 0 +-1 3 MAX 1/-1/-1 +-1 3 MIN 0 +-1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN+1 -1 MAX/-1/MIN+1 +-1 MIN+1 1 0 +-1 MIN+1 -2 1073741824/-1/MIN+1 +-1 MIN+1 2 0 +-1 MIN+1 -3 715827883/-1/MIN+1 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 1/-1/-1 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 1/-1/-1 +-1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MAX -1 0 +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 0 +-1 MAX 2 1073741825/-1/MAX +-1 MAX -3 0 +-1 MAX 3 715827883/-1/MAX-2 +-1 MAX 17 126322568/-1/MAX-9 +-1 MAX 127 16909321/-1/MAX-8 +-1 MAX MIN+1 0 +-1 MAX MAX 2/-1/MAX-1 +-1 MAX MIN 0 +-1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN -1 --- + java.lang.IllegalArgumentException: -1 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +-1 MIN 1 0 +-1 MIN -2 1073741824/-1/MIN+1 +-1 MIN 2 0 +-1 MIN -3 715827883/-1/MIN+1 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 2/-1/MIN +-1 MIN MAX 0 +-1 MIN MIN 1/-1/-1 + +start end step length/first/last +----------------------------------------- +1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 0 -1 2/1/0 +1 0 1 0 +1 0 -2 1/1/1 +1 0 2 0 +1 0 -3 1/1/1 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 1/1/1 +1 0 MAX 0 +1 0 MIN 1/1/1 +1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 -1 -1 3/1/-1 +1 -1 1 0 +1 -1 -2 2/1/-1 +1 -1 2 0 +1 -1 -3 1/1/1 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 1/1/1 +1 -1 MAX 0 +1 -1 MIN 1/1/1 +1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 1 -1 1/1/1 +1 1 1 1/1/1 +1 1 -2 1/1/1 +1 1 2 1/1/1 +1 1 -3 1/1/1 +1 1 3 1/1/1 +1 1 17 1/1/1 +1 1 127 1/1/1 +1 1 MIN+1 1/1/1 +1 1 MAX 1/1/1 +1 1 MIN 1/1/1 +1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 3 -1 0 +1 3 1 3/1/3 +1 3 -2 0 +1 3 2 2/1/3 +1 3 -3 0 +1 3 3 1/1/1 +1 3 17 1/1/1 +1 3 127 1/1/1 +1 3 MIN+1 0 +1 3 MAX 1/1/1 +1 3 MIN 0 +1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN+1 -1 --- + java.lang.IllegalArgumentException: 1 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN+1 1 0 +1 MIN+1 -2 1073741825/1/MIN+1 +1 MIN+1 2 0 +1 MIN+1 -3 715827883/1/MIN+3 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 2/1/MIN+2 +1 MIN+1 MAX 0 +1 MIN+1 MIN 2/1/MIN+1 +1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MAX -1 0 +1 MAX 1 MAX/1/MAX +1 MAX -2 0 +1 MAX 2 1073741824/1/MAX +1 MAX -3 0 +1 MAX 3 715827883/1/MAX +1 MAX 17 126322568/1/MAX-7 +1 MAX 127 16909321/1/MAX-6 +1 MAX MIN+1 0 +1 MAX MAX 1/1/1 +1 MAX MIN 0 +1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN -1 --- + java.lang.IllegalArgumentException: 1 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN 1 0 +1 MIN -2 1073741825/1/MIN+1 +1 MIN 2 0 +1 MIN -3 715827884/1/MIN +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 2/1/MIN+2 +1 MIN MAX 0 +1 MIN MIN 2/1/MIN+1 + +start end step length/first/last +----------------------------------------- +3 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 0 -1 4/3/0 +3 0 1 0 +3 0 -2 2/3/1 +3 0 2 0 +3 0 -3 2/3/0 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 1/3/3 +3 0 MAX 0 +3 0 MIN 1/3/3 +3 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 -1 -1 5/3/-1 +3 -1 1 0 +3 -1 -2 3/3/-1 +3 -1 2 0 +3 -1 -3 2/3/0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 1/3/3 +3 -1 MAX 0 +3 -1 MIN 1/3/3 +3 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 1 -1 3/3/1 +3 1 1 0 +3 1 -2 2/3/1 +3 1 2 0 +3 1 -3 1/3/3 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 1/3/3 +3 1 MAX 0 +3 1 MIN 1/3/3 +3 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 3 -1 1/3/3 +3 3 1 1/3/3 +3 3 -2 1/3/3 +3 3 2 1/3/3 +3 3 -3 1/3/3 +3 3 3 1/3/3 +3 3 17 1/3/3 +3 3 127 1/3/3 +3 3 MIN+1 1/3/3 +3 3 MAX 1/3/3 +3 3 MIN 1/3/3 +3 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN+1 -1 --- + java.lang.IllegalArgumentException: 3 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN+1 1 0 +3 MIN+1 -2 1073741826/3/MIN+1 +3 MIN+1 2 0 +3 MIN+1 -3 715827884/3/MIN+2 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 2/3/MIN+4 +3 MIN+1 MAX 0 +3 MIN+1 MIN 2/3/MIN+3 +3 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MAX -1 0 +3 MAX 1 MAX-2/3/MAX +3 MAX -2 0 +3 MAX 2 1073741823/3/MAX +3 MAX -3 0 +3 MAX 3 715827882/3/MAX-1 +3 MAX 17 126322568/3/MAX-5 +3 MAX 127 16909321/3/MAX-4 +3 MAX MIN+1 0 +3 MAX MAX 1/3/3 +3 MAX MIN 0 +3 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN -1 --- + java.lang.IllegalArgumentException: 3 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN 1 0 +3 MIN -2 1073741826/3/MIN+1 +3 MIN 2 0 +3 MIN -3 715827884/3/MIN+2 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 2/3/MIN+4 +3 MIN MAX 0 +3 MIN MIN 2/3/MIN+3 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 0 -1 0 +MIN+1 0 1 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 -2 0 +MIN+1 0 2 1073741824/MIN+1/-1 +MIN+1 0 -3 0 +MIN+1 0 3 715827883/MIN+1/-1 +MIN+1 0 17 126322568/MIN+1/-8 +MIN+1 0 127 16909321/MIN+1/-7 +MIN+1 0 MIN+1 0 +MIN+1 0 MAX 2/MIN+1/0 +MIN+1 0 MIN 0 +MIN+1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 -1 -1 0 +MIN+1 -1 1 MAX/MIN+1/-1 +MIN+1 -1 -2 0 +MIN+1 -1 2 1073741824/MIN+1/-1 +MIN+1 -1 -3 0 +MIN+1 -1 3 715827883/MIN+1/-1 +MIN+1 -1 17 126322568/MIN+1/-8 +MIN+1 -1 127 16909321/MIN+1/-7 +MIN+1 -1 MIN+1 0 +MIN+1 -1 MAX 1/MIN+1/MIN+1 +MIN+1 -1 MIN 0 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 1 -1 0 +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 0 +MIN+1 1 2 1073741825/MIN+1/1 +MIN+1 1 -3 0 +MIN+1 1 3 715827883/MIN+1/-1 +MIN+1 1 17 126322568/MIN+1/-8 +MIN+1 1 127 16909321/MIN+1/-7 +MIN+1 1 MIN+1 0 +MIN+1 1 MAX 2/MIN+1/0 +MIN+1 1 MIN 0 +MIN+1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 3 -1 0 +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 0 +MIN+1 3 2 1073741826/MIN+1/3 +MIN+1 3 -3 0 +MIN+1 3 3 715827884/MIN+1/2 +MIN+1 3 17 126322568/MIN+1/-8 +MIN+1 3 127 16909321/MIN+1/-7 +MIN+1 3 MIN+1 0 +MIN+1 3 MAX 2/MIN+1/0 +MIN+1 3 MIN 0 +MIN+1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN+1 -1 1/MIN+1/MIN+1 +MIN+1 MIN+1 1 1/MIN+1/MIN+1 +MIN+1 MIN+1 -2 1/MIN+1/MIN+1 +MIN+1 MIN+1 2 1/MIN+1/MIN+1 +MIN+1 MIN+1 -3 1/MIN+1/MIN+1 +MIN+1 MIN+1 3 1/MIN+1/MIN+1 +MIN+1 MIN+1 17 1/MIN+1/MIN+1 +MIN+1 MIN+1 127 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN+1 MAX 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN 1/MIN+1/MIN+1 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MAX -1 0 +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 0 +MIN+1 MAX 2 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -3 0 +MIN+1 MAX 3 1431655765/MIN+1/MAX-2 +MIN+1 MAX 17 252645135/MIN+1/MAX-16 +MIN+1 MAX 127 33818641/MIN+1/MAX-14 +MIN+1 MAX MIN+1 0 +MIN+1 MAX MAX 3/MIN+1/MAX +MIN+1 MAX MIN 0 +MIN+1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN -1 2/MIN+1/MIN +MIN+1 MIN 1 0 +MIN+1 MIN -2 1/MIN+1/MIN+1 +MIN+1 MIN 2 0 +MIN+1 MIN -3 1/MIN+1/MIN+1 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 1/MIN+1/MIN+1 + +start end step length/first/last +----------------------------------------- +MAX 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 0 -1 --- + java.lang.IllegalArgumentException: 2147483647 to 0 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX 0 1 0 +MAX 0 -2 1073741824/MAX/1 +MAX 0 2 0 +MAX 0 -3 715827883/MAX/1 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 2/MAX/0 +MAX 0 MAX 0 +MAX 0 MIN 1/MAX/MAX +MAX -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX -1 -1 --- + java.lang.IllegalArgumentException: 2147483647 to -1 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX -1 1 0 +MAX -1 -2 1073741825/MAX/-1 +MAX -1 2 0 +MAX -1 -3 715827883/MAX/1 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 2/MAX/0 +MAX -1 MAX 0 +MAX -1 MIN 2/MAX/-1 +MAX 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 1 -1 MAX/MAX/1 +MAX 1 1 0 +MAX 1 -2 1073741824/MAX/1 +MAX 1 2 0 +MAX 1 -3 715827883/MAX/1 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 1/MAX/MAX +MAX 1 MAX 0 +MAX 1 MIN 1/MAX/MAX +MAX 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 3 -1 MAX-2/MAX/3 +MAX 3 1 0 +MAX 3 -2 1073741823/MAX/3 +MAX 3 2 0 +MAX 3 -3 715827882/MAX/4 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 1/MAX/MAX +MAX 3 MAX 0 +MAX 3 MIN 1/MAX/MAX +MAX MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN+1 -1 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 1 0 +MAX MIN+1 -2 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483647 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 2 0 +MAX MIN+1 -3 1431655765/MAX/MIN+3 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 3/MAX/MIN+1 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 2/MAX/-1 +MAX MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MAX -1 1/MAX/MAX +MAX MAX 1 1/MAX/MAX +MAX MAX -2 1/MAX/MAX +MAX MAX 2 1/MAX/MAX +MAX MAX -3 1/MAX/MAX +MAX MAX 3 1/MAX/MAX +MAX MAX 17 1/MAX/MAX +MAX MAX 127 1/MAX/MAX +MAX MAX MIN+1 1/MAX/MAX +MAX MAX MAX 1/MAX/MAX +MAX MAX MIN 1/MAX/MAX +MAX MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN -1 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 1 0 +MAX MIN -2 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483648 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 2 0 +MAX MIN -3 1431655766/MAX/MIN +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 3/MAX/MIN+1 +MAX MIN MAX 0 +MAX MIN MIN 2/MAX/-1 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 0 -1 0 +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 0 +MIN 0 2 1073741825/MIN/0 +MIN 0 -3 0 +MIN 0 3 715827883/MIN/-2 +MIN 0 17 126322568/MIN/-9 +MIN 0 127 16909321/MIN/-8 +MIN 0 MIN+1 0 +MIN 0 MAX 2/MIN/-1 +MIN 0 MIN 0 +MIN -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN -1 -1 0 +MIN -1 1 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 -2 0 +MIN -1 2 1073741824/MIN/-2 +MIN -1 -3 0 +MIN -1 3 715827883/MIN/-2 +MIN -1 17 126322568/MIN/-9 +MIN -1 127 16909321/MIN/-8 +MIN -1 MIN+1 0 +MIN -1 MAX 2/MIN/-1 +MIN -1 MIN 0 +MIN 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 1 -1 0 +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 0 +MIN 1 2 1073741825/MIN/0 +MIN 1 -3 0 +MIN 1 3 715827884/MIN/1 +MIN 1 17 126322568/MIN/-9 +MIN 1 127 16909321/MIN/-8 +MIN 1 MIN+1 0 +MIN 1 MAX 2/MIN/-1 +MIN 1 MIN 0 +MIN 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 3 -1 0 +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 0 +MIN 3 2 1073741826/MIN/2 +MIN 3 -3 0 +MIN 3 3 715827884/MIN/1 +MIN 3 17 126322568/MIN/-9 +MIN 3 127 16909321/MIN/-8 +MIN 3 MIN+1 0 +MIN 3 MAX 2/MIN/-1 +MIN 3 MIN 0 +MIN MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN+1 -1 0 +MIN MIN+1 1 2/MIN/MIN+1 +MIN MIN+1 -2 0 +MIN MIN+1 2 1/MIN/MIN +MIN MIN+1 -3 0 +MIN MIN+1 3 1/MIN/MIN +MIN MIN+1 17 1/MIN/MIN +MIN MIN+1 127 1/MIN/MIN +MIN MIN+1 MIN+1 0 +MIN MIN+1 MAX 1/MIN/MIN +MIN MIN+1 MIN 0 +MIN MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MAX -1 0 +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 0 +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 0 +MIN MAX 3 1431655766/MIN/MAX +MIN MAX 17 252645136/MIN/MAX +MIN MAX 127 33818641/MIN/MAX-15 +MIN MAX MIN+1 0 +MIN MAX MAX 3/MIN/MAX-1 +MIN MAX MIN 0 +MIN MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN -1 1/MIN/MIN +MIN MIN 1 1/MIN/MIN +MIN MIN -2 1/MIN/MIN +MIN MIN 2 1/MIN/MIN +MIN MIN -3 1/MIN/MIN +MIN MIN 3 1/MIN/MIN +MIN MIN 17 1/MIN/MIN +MIN MIN 127 1/MIN/MIN +MIN MIN MIN+1 1/MIN/MIN +MIN MIN MAX 1/MIN/MIN +MIN MIN MIN 1/MIN/MIN + +>>> Range.apply <<< + +start end step length/first/last +----------------------------------------- +0 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 0 -1 0 +0 0 1 0 +0 0 -2 0 +0 0 2 0 +0 0 -3 0 +0 0 3 0 +0 0 17 0 +0 0 127 0 +0 0 MIN+1 0 +0 0 MAX 0 +0 0 MIN 0 +0 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 -1 -1 1/0/0 +0 -1 1 0 +0 -1 -2 1/0/0 +0 -1 2 0 +0 -1 -3 1/0/0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 1/0/0 +0 -1 MAX 0 +0 -1 MIN 1/0/0 +0 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 1 -1 0 +0 1 1 1/0/0 +0 1 -2 0 +0 1 2 1/0/0 +0 1 -3 0 +0 1 3 1/0/0 +0 1 17 1/0/0 +0 1 127 1/0/0 +0 1 MIN+1 0 +0 1 MAX 1/0/0 +0 1 MIN 0 +0 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 3 -1 0 +0 3 1 3/0/2 +0 3 -2 0 +0 3 2 2/0/2 +0 3 -3 0 +0 3 3 1/0/0 +0 3 17 1/0/0 +0 3 127 1/0/0 +0 3 MIN+1 0 +0 3 MAX 1/0/0 +0 3 MIN 0 +0 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN+1 -1 MAX/0/MIN+2 +0 MIN+1 1 0 +0 MIN+1 -2 1073741824/0/MIN+2 +0 MIN+1 2 0 +0 MIN+1 -3 715827883/0/MIN+2 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 1/0/0 +0 MIN+1 MAX 0 +0 MIN+1 MIN 1/0/0 +0 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MAX -1 0 +0 MAX 1 MAX/0/MAX-1 +0 MAX -2 0 +0 MAX 2 1073741824/0/MAX-1 +0 MAX -3 0 +0 MAX 3 715827883/0/MAX-1 +0 MAX 17 126322568/0/MAX-8 +0 MAX 127 16909321/0/MAX-7 +0 MAX MIN+1 0 +0 MAX MAX 1/0/0 +0 MAX MIN 0 +0 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN -1 --- + java.lang.IllegalArgumentException: 0 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN 1 0 +0 MIN -2 1073741824/0/MIN+2 +0 MIN 2 0 +0 MIN -3 715827883/0/MIN+2 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 2/0/MIN+1 +0 MIN MAX 0 +0 MIN MIN 1/0/0 + +start end step length/first/last +----------------------------------------- +-1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 0 -1 0 +-1 0 1 1/-1/-1 +-1 0 -2 0 +-1 0 2 1/-1/-1 +-1 0 -3 0 +-1 0 3 1/-1/-1 +-1 0 17 1/-1/-1 +-1 0 127 1/-1/-1 +-1 0 MIN+1 0 +-1 0 MAX 1/-1/-1 +-1 0 MIN 0 +-1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 -1 -1 0 +-1 -1 1 0 +-1 -1 -2 0 +-1 -1 2 0 +-1 -1 -3 0 +-1 -1 3 0 +-1 -1 17 0 +-1 -1 127 0 +-1 -1 MIN+1 0 +-1 -1 MAX 0 +-1 -1 MIN 0 +-1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 1 -1 0 +-1 1 1 2/-1/0 +-1 1 -2 0 +-1 1 2 1/-1/-1 +-1 1 -3 0 +-1 1 3 1/-1/-1 +-1 1 17 1/-1/-1 +-1 1 127 1/-1/-1 +-1 1 MIN+1 0 +-1 1 MAX 1/-1/-1 +-1 1 MIN 0 +-1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 3 -1 0 +-1 3 1 4/-1/2 +-1 3 -2 0 +-1 3 2 2/-1/1 +-1 3 -3 0 +-1 3 3 2/-1/2 +-1 3 17 1/-1/-1 +-1 3 127 1/-1/-1 +-1 3 MIN+1 0 +-1 3 MAX 1/-1/-1 +-1 3 MIN 0 +-1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN+1 -1 MAX-1/-1/MIN+2 +-1 MIN+1 1 0 +-1 MIN+1 -2 1073741823/-1/MIN+3 +-1 MIN+1 2 0 +-1 MIN+1 -3 715827882/-1/MIN+4 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 1/-1/-1 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 1/-1/-1 +-1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MAX -1 0 +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 0 +-1 MAX 2 1073741824/-1/MAX-2 +-1 MAX -3 0 +-1 MAX 3 715827883/-1/MAX-2 +-1 MAX 17 126322568/-1/MAX-9 +-1 MAX 127 16909321/-1/MAX-8 +-1 MAX MIN+1 0 +-1 MAX MAX 2/-1/MAX-1 +-1 MAX MIN 0 +-1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN -1 MAX/-1/MIN+1 +-1 MIN 1 0 +-1 MIN -2 1073741824/-1/MIN+1 +-1 MIN 2 0 +-1 MIN -3 715827883/-1/MIN+1 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 1/-1/-1 +-1 MIN MAX 0 +-1 MIN MIN 1/-1/-1 + +start end step length/first/last +----------------------------------------- +1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 0 -1 1/1/1 +1 0 1 0 +1 0 -2 1/1/1 +1 0 2 0 +1 0 -3 1/1/1 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 1/1/1 +1 0 MAX 0 +1 0 MIN 1/1/1 +1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 -1 -1 2/1/0 +1 -1 1 0 +1 -1 -2 1/1/1 +1 -1 2 0 +1 -1 -3 1/1/1 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 1/1/1 +1 -1 MAX 0 +1 -1 MIN 1/1/1 +1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 1 -1 0 +1 1 1 0 +1 1 -2 0 +1 1 2 0 +1 1 -3 0 +1 1 3 0 +1 1 17 0 +1 1 127 0 +1 1 MIN+1 0 +1 1 MAX 0 +1 1 MIN 0 +1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 3 -1 0 +1 3 1 2/1/2 +1 3 -2 0 +1 3 2 1/1/1 +1 3 -3 0 +1 3 3 1/1/1 +1 3 17 1/1/1 +1 3 127 1/1/1 +1 3 MIN+1 0 +1 3 MAX 1/1/1 +1 3 MIN 0 +1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN+1 -1 --- + java.lang.IllegalArgumentException: 1 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN+1 1 0 +1 MIN+1 -2 1073741824/1/MIN+3 +1 MIN+1 2 0 +1 MIN+1 -3 715827883/1/MIN+3 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 2/1/MIN+2 +1 MIN+1 MAX 0 +1 MIN+1 MIN 1/1/1 +1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MAX -1 0 +1 MAX 1 MAX-1/1/MAX-1 +1 MAX -2 0 +1 MAX 2 1073741823/1/MAX-2 +1 MAX -3 0 +1 MAX 3 715827882/1/MAX-3 +1 MAX 17 126322568/1/MAX-7 +1 MAX 127 16909321/1/MAX-6 +1 MAX MIN+1 0 +1 MAX MAX 1/1/1 +1 MAX MIN 0 +1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN -1 --- + java.lang.IllegalArgumentException: 1 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN 1 0 +1 MIN -2 1073741825/1/MIN+1 +1 MIN 2 0 +1 MIN -3 715827883/1/MIN+3 +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 2/1/MIN+2 +1 MIN MAX 0 +1 MIN MIN 2/1/MIN+1 + +start end step length/first/last +----------------------------------------- +3 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 0 -1 3/3/1 +3 0 1 0 +3 0 -2 2/3/1 +3 0 2 0 +3 0 -3 1/3/3 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 1/3/3 +3 0 MAX 0 +3 0 MIN 1/3/3 +3 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 -1 -1 4/3/0 +3 -1 1 0 +3 -1 -2 2/3/1 +3 -1 2 0 +3 -1 -3 2/3/0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 1/3/3 +3 -1 MAX 0 +3 -1 MIN 1/3/3 +3 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 1 -1 2/3/2 +3 1 1 0 +3 1 -2 1/3/3 +3 1 2 0 +3 1 -3 1/3/3 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 1/3/3 +3 1 MAX 0 +3 1 MIN 1/3/3 +3 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 3 -1 0 +3 3 1 0 +3 3 -2 0 +3 3 2 0 +3 3 -3 0 +3 3 3 0 +3 3 17 0 +3 3 127 0 +3 3 MIN+1 0 +3 3 MAX 0 +3 3 MIN 0 +3 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN+1 -1 --- + java.lang.IllegalArgumentException: 3 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN+1 1 0 +3 MIN+1 -2 1073741825/3/MIN+3 +3 MIN+1 2 0 +3 MIN+1 -3 715827884/3/MIN+2 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 2/3/MIN+4 +3 MIN+1 MAX 0 +3 MIN+1 MIN 2/3/MIN+3 +3 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MAX -1 0 +3 MAX 1 MAX-3/3/MAX-1 +3 MAX -2 0 +3 MAX 2 1073741822/3/MAX-2 +3 MAX -3 0 +3 MAX 3 715827882/3/MAX-1 +3 MAX 17 126322568/3/MAX-5 +3 MAX 127 16909321/3/MAX-4 +3 MAX MIN+1 0 +3 MAX MAX 1/3/3 +3 MAX MIN 0 +3 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN -1 --- + java.lang.IllegalArgumentException: 3 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN 1 0 +3 MIN -2 1073741826/3/MIN+1 +3 MIN 2 0 +3 MIN -3 715827884/3/MIN+2 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 2/3/MIN+4 +3 MIN MAX 0 +3 MIN MIN 2/3/MIN+3 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 0 -1 0 +MIN+1 0 1 MAX/MIN+1/-1 +MIN+1 0 -2 0 +MIN+1 0 2 1073741824/MIN+1/-1 +MIN+1 0 -3 0 +MIN+1 0 3 715827883/MIN+1/-1 +MIN+1 0 17 126322568/MIN+1/-8 +MIN+1 0 127 16909321/MIN+1/-7 +MIN+1 0 MIN+1 0 +MIN+1 0 MAX 1/MIN+1/MIN+1 +MIN+1 0 MIN 0 +MIN+1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 -1 -1 0 +MIN+1 -1 1 MAX-1/MIN+1/-2 +MIN+1 -1 -2 0 +MIN+1 -1 2 1073741823/MIN+1/-3 +MIN+1 -1 -3 0 +MIN+1 -1 3 715827882/MIN+1/-4 +MIN+1 -1 17 126322568/MIN+1/-8 +MIN+1 -1 127 16909321/MIN+1/-7 +MIN+1 -1 MIN+1 0 +MIN+1 -1 MAX 1/MIN+1/MIN+1 +MIN+1 -1 MIN 0 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 1 -1 0 +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 0 +MIN+1 1 2 1073741824/MIN+1/-1 +MIN+1 1 -3 0 +MIN+1 1 3 715827883/MIN+1/-1 +MIN+1 1 17 126322568/MIN+1/-8 +MIN+1 1 127 16909321/MIN+1/-7 +MIN+1 1 MIN+1 0 +MIN+1 1 MAX 2/MIN+1/0 +MIN+1 1 MIN 0 +MIN+1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 3 -1 0 +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 0 +MIN+1 3 2 1073741825/MIN+1/1 +MIN+1 3 -3 0 +MIN+1 3 3 715827884/MIN+1/2 +MIN+1 3 17 126322568/MIN+1/-8 +MIN+1 3 127 16909321/MIN+1/-7 +MIN+1 3 MIN+1 0 +MIN+1 3 MAX 2/MIN+1/0 +MIN+1 3 MIN 0 +MIN+1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN+1 -1 0 +MIN+1 MIN+1 1 0 +MIN+1 MIN+1 -2 0 +MIN+1 MIN+1 2 0 +MIN+1 MIN+1 -3 0 +MIN+1 MIN+1 3 0 +MIN+1 MIN+1 17 0 +MIN+1 MIN+1 127 0 +MIN+1 MIN+1 MIN+1 0 +MIN+1 MIN+1 MAX 0 +MIN+1 MIN+1 MIN 0 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MAX -1 0 +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 0 +MIN+1 MAX 2 MAX/MIN+1/MAX-2 +MIN+1 MAX -3 0 +MIN+1 MAX 3 1431655765/MIN+1/MAX-2 +MIN+1 MAX 17 252645135/MIN+1/MAX-16 +MIN+1 MAX 127 33818641/MIN+1/MAX-14 +MIN+1 MAX MIN+1 0 +MIN+1 MAX MAX 2/MIN+1/0 +MIN+1 MAX MIN 0 +MIN+1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN -1 1/MIN+1/MIN+1 +MIN+1 MIN 1 0 +MIN+1 MIN -2 1/MIN+1/MIN+1 +MIN+1 MIN 2 0 +MIN+1 MIN -3 1/MIN+1/MIN+1 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 1/MIN+1/MIN+1 + +start end step length/first/last +----------------------------------------- +MAX 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 0 -1 MAX/MAX/1 +MAX 0 1 0 +MAX 0 -2 1073741824/MAX/1 +MAX 0 2 0 +MAX 0 -3 715827883/MAX/1 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 1/MAX/MAX +MAX 0 MAX 0 +MAX 0 MIN 1/MAX/MAX +MAX -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX -1 -1 --- + java.lang.IllegalArgumentException: 2147483647 until -1 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX -1 1 0 +MAX -1 -2 1073741824/MAX/1 +MAX -1 2 0 +MAX -1 -3 715827883/MAX/1 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 2/MAX/0 +MAX -1 MAX 0 +MAX -1 MIN 1/MAX/MAX +MAX 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 1 -1 MAX-1/MAX/2 +MAX 1 1 0 +MAX 1 -2 1073741823/MAX/3 +MAX 1 2 0 +MAX 1 -3 715827882/MAX/4 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 1/MAX/MAX +MAX 1 MAX 0 +MAX 1 MIN 1/MAX/MAX +MAX 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 3 -1 MAX-3/MAX/4 +MAX 3 1 0 +MAX 3 -2 1073741822/MAX/5 +MAX 3 2 0 +MAX 3 -3 715827882/MAX/4 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 1/MAX/MAX +MAX 3 MAX 0 +MAX 3 MIN 1/MAX/MAX +MAX MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN+1 -1 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 1 0 +MAX MIN+1 -2 MAX/MAX/MIN+3 +MAX MIN+1 2 0 +MAX MIN+1 -3 1431655765/MAX/MIN+3 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 2/MAX/0 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 2/MAX/-1 +MAX MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MAX -1 0 +MAX MAX 1 0 +MAX MAX -2 0 +MAX MAX 2 0 +MAX MAX -3 0 +MAX MAX 3 0 +MAX MAX 17 0 +MAX MAX 127 0 +MAX MAX MIN+1 0 +MAX MAX MAX 0 +MAX MAX MIN 0 +MAX MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN -1 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 1 0 +MAX MIN -2 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483648 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 2 0 +MAX MIN -3 1431655765/MAX/MIN+3 +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 3/MAX/MIN+1 +MAX MIN MAX 0 +MAX MIN MIN 2/MAX/-1 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 0 -1 0 +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 0 +MIN 0 2 1073741824/MIN/-2 +MIN 0 -3 0 +MIN 0 3 715827883/MIN/-2 +MIN 0 17 126322568/MIN/-9 +MIN 0 127 16909321/MIN/-8 +MIN 0 MIN+1 0 +MIN 0 MAX 2/MIN/-1 +MIN 0 MIN 0 +MIN -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN -1 -1 0 +MIN -1 1 MAX/MIN/-2 +MIN -1 -2 0 +MIN -1 2 1073741824/MIN/-2 +MIN -1 -3 0 +MIN -1 3 715827883/MIN/-2 +MIN -1 17 126322568/MIN/-9 +MIN -1 127 16909321/MIN/-8 +MIN -1 MIN+1 0 +MIN -1 MAX 1/MIN/MIN +MIN -1 MIN 0 +MIN 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 1 -1 0 +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 0 +MIN 1 2 1073741825/MIN/0 +MIN 1 -3 0 +MIN 1 3 715827883/MIN/-2 +MIN 1 17 126322568/MIN/-9 +MIN 1 127 16909321/MIN/-8 +MIN 1 MIN+1 0 +MIN 1 MAX 2/MIN/-1 +MIN 1 MIN 0 +MIN 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 3 -1 0 +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 0 +MIN 3 2 1073741826/MIN/2 +MIN 3 -3 0 +MIN 3 3 715827884/MIN/1 +MIN 3 17 126322568/MIN/-9 +MIN 3 127 16909321/MIN/-8 +MIN 3 MIN+1 0 +MIN 3 MAX 2/MIN/-1 +MIN 3 MIN 0 +MIN MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN+1 -1 0 +MIN MIN+1 1 1/MIN/MIN +MIN MIN+1 -2 0 +MIN MIN+1 2 1/MIN/MIN +MIN MIN+1 -3 0 +MIN MIN+1 3 1/MIN/MIN +MIN MIN+1 17 1/MIN/MIN +MIN MIN+1 127 1/MIN/MIN +MIN MIN+1 MIN+1 0 +MIN MIN+1 MAX 1/MIN/MIN +MIN MIN+1 MIN 0 +MIN MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MAX -1 0 +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 0 +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 0 +MIN MAX 3 1431655765/MIN/MAX-3 +MIN MAX 17 252645135/MIN/MAX-17 +MIN MAX 127 33818641/MIN/MAX-15 +MIN MAX MIN+1 0 +MIN MAX MAX 3/MIN/MAX-1 +MIN MAX MIN 0 +MIN MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN -1 0 +MIN MIN 1 0 +MIN MIN -2 0 +MIN MIN 2 0 +MIN MIN -3 0 +MIN MIN 3 0 +MIN MIN 17 0 +MIN MIN 127 0 +MIN MIN MIN+1 0 +MIN MIN MAX 0 +MIN MIN MIN 0 + +>>> start to end <<< + +start end step length/first/last +----------------------------------------- +0 0 0 1/0/0 +0 0 -1 1/0/0 +0 0 1 1/0/0 +0 0 -2 1/0/0 +0 0 2 1/0/0 +0 0 -3 1/0/0 +0 0 3 1/0/0 +0 0 17 1/0/0 +0 0 127 1/0/0 +0 0 MIN+1 1/0/0 +0 0 MAX 1/0/0 +0 0 MIN 1/0/0 +0 -1 0 0 +0 -1 -1 0 +0 -1 1 0 +0 -1 -2 0 +0 -1 2 0 +0 -1 -3 0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 0 +0 -1 MAX 0 +0 -1 MIN 0 +0 1 0 2/0/1 +0 1 -1 2/0/1 +0 1 1 2/0/1 +0 1 -2 2/0/1 +0 1 2 2/0/1 +0 1 -3 2/0/1 +0 1 3 2/0/1 +0 1 17 2/0/1 +0 1 127 2/0/1 +0 1 MIN+1 2/0/1 +0 1 MAX 2/0/1 +0 1 MIN 2/0/1 +0 3 0 4/0/3 +0 3 -1 4/0/3 +0 3 1 4/0/3 +0 3 -2 4/0/3 +0 3 2 4/0/3 +0 3 -3 4/0/3 +0 3 3 4/0/3 +0 3 17 4/0/3 +0 3 127 4/0/3 +0 3 MIN+1 4/0/3 +0 3 MAX 4/0/3 +0 3 MIN 4/0/3 +0 MIN+1 0 0 +0 MIN+1 -1 0 +0 MIN+1 1 0 +0 MIN+1 -2 0 +0 MIN+1 2 0 +0 MIN+1 -3 0 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 0 +0 MIN+1 MAX 0 +0 MIN+1 MIN 0 +0 MAX 0 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX -1 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX 1 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX -2 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX 2 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX -3 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX 3 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX 17 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX 127 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX MIN+1 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX MAX --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX MIN --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MIN 0 0 +0 MIN -1 0 +0 MIN 1 0 +0 MIN -2 0 +0 MIN 2 0 +0 MIN -3 0 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 0 +0 MIN MAX 0 +0 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +-1 0 0 2/-1/0 +-1 0 -1 2/-1/0 +-1 0 1 2/-1/0 +-1 0 -2 2/-1/0 +-1 0 2 2/-1/0 +-1 0 -3 2/-1/0 +-1 0 3 2/-1/0 +-1 0 17 2/-1/0 +-1 0 127 2/-1/0 +-1 0 MIN+1 2/-1/0 +-1 0 MAX 2/-1/0 +-1 0 MIN 2/-1/0 +-1 -1 0 1/-1/-1 +-1 -1 -1 1/-1/-1 +-1 -1 1 1/-1/-1 +-1 -1 -2 1/-1/-1 +-1 -1 2 1/-1/-1 +-1 -1 -3 1/-1/-1 +-1 -1 3 1/-1/-1 +-1 -1 17 1/-1/-1 +-1 -1 127 1/-1/-1 +-1 -1 MIN+1 1/-1/-1 +-1 -1 MAX 1/-1/-1 +-1 -1 MIN 1/-1/-1 +-1 1 0 3/-1/1 +-1 1 -1 3/-1/1 +-1 1 1 3/-1/1 +-1 1 -2 3/-1/1 +-1 1 2 3/-1/1 +-1 1 -3 3/-1/1 +-1 1 3 3/-1/1 +-1 1 17 3/-1/1 +-1 1 127 3/-1/1 +-1 1 MIN+1 3/-1/1 +-1 1 MAX 3/-1/1 +-1 1 MIN 3/-1/1 +-1 3 0 5/-1/3 +-1 3 -1 5/-1/3 +-1 3 1 5/-1/3 +-1 3 -2 5/-1/3 +-1 3 2 5/-1/3 +-1 3 -3 5/-1/3 +-1 3 3 5/-1/3 +-1 3 17 5/-1/3 +-1 3 127 5/-1/3 +-1 3 MIN+1 5/-1/3 +-1 3 MAX 5/-1/3 +-1 3 MIN 5/-1/3 +-1 MIN+1 0 0 +-1 MIN+1 -1 0 +-1 MIN+1 1 0 +-1 MIN+1 -2 0 +-1 MIN+1 2 0 +-1 MIN+1 -3 0 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 0 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 0 +-1 MAX 0 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -1 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 2 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -3 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 3 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 17 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 127 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MIN+1 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MAX --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MIN --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MIN 0 0 +-1 MIN -1 0 +-1 MIN 1 0 +-1 MIN -2 0 +-1 MIN 2 0 +-1 MIN -3 0 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 0 +-1 MIN MAX 0 +-1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +1 0 0 0 +1 0 -1 0 +1 0 1 0 +1 0 -2 0 +1 0 2 0 +1 0 -3 0 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 0 +1 0 MAX 0 +1 0 MIN 0 +1 -1 0 0 +1 -1 -1 0 +1 -1 1 0 +1 -1 -2 0 +1 -1 2 0 +1 -1 -3 0 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 0 +1 -1 MAX 0 +1 -1 MIN 0 +1 1 0 1/1/1 +1 1 -1 1/1/1 +1 1 1 1/1/1 +1 1 -2 1/1/1 +1 1 2 1/1/1 +1 1 -3 1/1/1 +1 1 3 1/1/1 +1 1 17 1/1/1 +1 1 127 1/1/1 +1 1 MIN+1 1/1/1 +1 1 MAX 1/1/1 +1 1 MIN 1/1/1 +1 3 0 3/1/3 +1 3 -1 3/1/3 +1 3 1 3/1/3 +1 3 -2 3/1/3 +1 3 2 3/1/3 +1 3 -3 3/1/3 +1 3 3 3/1/3 +1 3 17 3/1/3 +1 3 127 3/1/3 +1 3 MIN+1 3/1/3 +1 3 MAX 3/1/3 +1 3 MIN 3/1/3 +1 MIN+1 0 0 +1 MIN+1 -1 0 +1 MIN+1 1 0 +1 MIN+1 -2 0 +1 MIN+1 2 0 +1 MIN+1 -3 0 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 0 +1 MIN+1 MAX 0 +1 MIN+1 MIN 0 +1 MAX 0 MAX/1/MAX +1 MAX -1 MAX/1/MAX +1 MAX 1 MAX/1/MAX +1 MAX -2 MAX/1/MAX +1 MAX 2 MAX/1/MAX +1 MAX -3 MAX/1/MAX +1 MAX 3 MAX/1/MAX +1 MAX 17 MAX/1/MAX +1 MAX 127 MAX/1/MAX +1 MAX MIN+1 MAX/1/MAX +1 MAX MAX MAX/1/MAX +1 MAX MIN MAX/1/MAX +1 MIN 0 0 +1 MIN -1 0 +1 MIN 1 0 +1 MIN -2 0 +1 MIN 2 0 +1 MIN -3 0 +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 0 +1 MIN MAX 0 +1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +3 0 0 0 +3 0 -1 0 +3 0 1 0 +3 0 -2 0 +3 0 2 0 +3 0 -3 0 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 0 +3 0 MAX 0 +3 0 MIN 0 +3 -1 0 0 +3 -1 -1 0 +3 -1 1 0 +3 -1 -2 0 +3 -1 2 0 +3 -1 -3 0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 0 +3 -1 MAX 0 +3 -1 MIN 0 +3 1 0 0 +3 1 -1 0 +3 1 1 0 +3 1 -2 0 +3 1 2 0 +3 1 -3 0 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 0 +3 1 MAX 0 +3 1 MIN 0 +3 3 0 1/3/3 +3 3 -1 1/3/3 +3 3 1 1/3/3 +3 3 -2 1/3/3 +3 3 2 1/3/3 +3 3 -3 1/3/3 +3 3 3 1/3/3 +3 3 17 1/3/3 +3 3 127 1/3/3 +3 3 MIN+1 1/3/3 +3 3 MAX 1/3/3 +3 3 MIN 1/3/3 +3 MIN+1 0 0 +3 MIN+1 -1 0 +3 MIN+1 1 0 +3 MIN+1 -2 0 +3 MIN+1 2 0 +3 MIN+1 -3 0 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 0 +3 MIN+1 MAX 0 +3 MIN+1 MIN 0 +3 MAX 0 MAX-2/3/MAX +3 MAX -1 MAX-2/3/MAX +3 MAX 1 MAX-2/3/MAX +3 MAX -2 MAX-2/3/MAX +3 MAX 2 MAX-2/3/MAX +3 MAX -3 MAX-2/3/MAX +3 MAX 3 MAX-2/3/MAX +3 MAX 17 MAX-2/3/MAX +3 MAX 127 MAX-2/3/MAX +3 MAX MIN+1 MAX-2/3/MAX +3 MAX MAX MAX-2/3/MAX +3 MAX MIN MAX-2/3/MAX +3 MIN 0 0 +3 MIN -1 0 +3 MIN 1 0 +3 MIN -2 0 +3 MIN 2 0 +3 MIN -3 0 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 0 +3 MIN MAX 0 +3 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 -1 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 1 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 -2 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 2 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 -3 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 3 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 17 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 127 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 MAX --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 MIN --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 -1 0 MAX/MIN+1/-1 +MIN+1 -1 -1 MAX/MIN+1/-1 +MIN+1 -1 1 MAX/MIN+1/-1 +MIN+1 -1 -2 MAX/MIN+1/-1 +MIN+1 -1 2 MAX/MIN+1/-1 +MIN+1 -1 -3 MAX/MIN+1/-1 +MIN+1 -1 3 MAX/MIN+1/-1 +MIN+1 -1 17 MAX/MIN+1/-1 +MIN+1 -1 127 MAX/MIN+1/-1 +MIN+1 -1 MIN+1 MAX/MIN+1/-1 +MIN+1 -1 MAX MAX/MIN+1/-1 +MIN+1 -1 MIN MAX/MIN+1/-1 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -1 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 2 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -3 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 3 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 17 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 127 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MAX --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MIN --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 0 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -1 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 2 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -3 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 3 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 17 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 127 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MAX --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MIN --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MIN+1 0 1/MIN+1/MIN+1 +MIN+1 MIN+1 -1 1/MIN+1/MIN+1 +MIN+1 MIN+1 1 1/MIN+1/MIN+1 +MIN+1 MIN+1 -2 1/MIN+1/MIN+1 +MIN+1 MIN+1 2 1/MIN+1/MIN+1 +MIN+1 MIN+1 -3 1/MIN+1/MIN+1 +MIN+1 MIN+1 3 1/MIN+1/MIN+1 +MIN+1 MIN+1 17 1/MIN+1/MIN+1 +MIN+1 MIN+1 127 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN+1 MAX 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN 1/MIN+1/MIN+1 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -1 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 2 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -3 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 3 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 17 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 127 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MAX --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MIN --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MIN 0 0 +MIN+1 MIN -1 0 +MIN+1 MIN 1 0 +MIN+1 MIN -2 0 +MIN+1 MIN 2 0 +MIN+1 MIN -3 0 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 0 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MAX 0 0 0 +MAX 0 -1 0 +MAX 0 1 0 +MAX 0 -2 0 +MAX 0 2 0 +MAX 0 -3 0 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 0 +MAX 0 MAX 0 +MAX 0 MIN 0 +MAX -1 0 0 +MAX -1 -1 0 +MAX -1 1 0 +MAX -1 -2 0 +MAX -1 2 0 +MAX -1 -3 0 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 0 +MAX -1 MAX 0 +MAX -1 MIN 0 +MAX 1 0 0 +MAX 1 -1 0 +MAX 1 1 0 +MAX 1 -2 0 +MAX 1 2 0 +MAX 1 -3 0 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 0 +MAX 1 MAX 0 +MAX 1 MIN 0 +MAX 3 0 0 +MAX 3 -1 0 +MAX 3 1 0 +MAX 3 -2 0 +MAX 3 2 0 +MAX 3 -3 0 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 0 +MAX 3 MAX 0 +MAX 3 MIN 0 +MAX MIN+1 0 0 +MAX MIN+1 -1 0 +MAX MIN+1 1 0 +MAX MIN+1 -2 0 +MAX MIN+1 2 0 +MAX MIN+1 -3 0 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 0 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 0 +MAX MAX 0 1/MAX/MAX +MAX MAX -1 1/MAX/MAX +MAX MAX 1 1/MAX/MAX +MAX MAX -2 1/MAX/MAX +MAX MAX 2 1/MAX/MAX +MAX MAX -3 1/MAX/MAX +MAX MAX 3 1/MAX/MAX +MAX MAX 17 1/MAX/MAX +MAX MAX 127 1/MAX/MAX +MAX MAX MIN+1 1/MAX/MAX +MAX MAX MAX 1/MAX/MAX +MAX MAX MIN 1/MAX/MAX +MAX MIN 0 0 +MAX MIN -1 0 +MAX MIN 1 0 +MAX MIN -2 0 +MAX MIN 2 0 +MAX MIN -3 0 +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 0 +MAX MIN MAX 0 +MAX MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -1 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 2 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -3 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 3 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 17 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 127 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MAX --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MIN --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 0 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 -1 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 1 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 -2 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 2 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 -3 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 3 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 17 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 127 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 MAX --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 MIN --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 0 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -1 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 2 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -3 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 3 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 17 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 127 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MAX --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MIN --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 0 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -1 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 2 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -3 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 3 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 17 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 127 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MAX --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MIN --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MIN+1 0 2/MIN/MIN+1 +MIN MIN+1 -1 2/MIN/MIN+1 +MIN MIN+1 1 2/MIN/MIN+1 +MIN MIN+1 -2 2/MIN/MIN+1 +MIN MIN+1 2 2/MIN/MIN+1 +MIN MIN+1 -3 2/MIN/MIN+1 +MIN MIN+1 3 2/MIN/MIN+1 +MIN MIN+1 17 2/MIN/MIN+1 +MIN MIN+1 127 2/MIN/MIN+1 +MIN MIN+1 MIN+1 2/MIN/MIN+1 +MIN MIN+1 MAX 2/MIN/MIN+1 +MIN MIN+1 MIN 2/MIN/MIN+1 +MIN MAX 0 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -1 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 3 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 17 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 127 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MAX --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MIN --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MIN 0 1/MIN/MIN +MIN MIN -1 1/MIN/MIN +MIN MIN 1 1/MIN/MIN +MIN MIN -2 1/MIN/MIN +MIN MIN 2 1/MIN/MIN +MIN MIN -3 1/MIN/MIN +MIN MIN 3 1/MIN/MIN +MIN MIN 17 1/MIN/MIN +MIN MIN 127 1/MIN/MIN +MIN MIN MIN+1 1/MIN/MIN +MIN MIN MAX 1/MIN/MIN +MIN MIN MIN 1/MIN/MIN + +>>> start to end by step <<< + +start end step length/first/last +----------------------------------------- +0 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 0 -1 1/0/0 +0 0 1 1/0/0 +0 0 -2 1/0/0 +0 0 2 1/0/0 +0 0 -3 1/0/0 +0 0 3 1/0/0 +0 0 17 1/0/0 +0 0 127 1/0/0 +0 0 MIN+1 1/0/0 +0 0 MAX 1/0/0 +0 0 MIN 1/0/0 +0 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 -1 -1 2/0/-1 +0 -1 1 0 +0 -1 -2 1/0/0 +0 -1 2 0 +0 -1 -3 1/0/0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 1/0/0 +0 -1 MAX 0 +0 -1 MIN 1/0/0 +0 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 1 -1 0 +0 1 1 2/0/1 +0 1 -2 0 +0 1 2 1/0/0 +0 1 -3 0 +0 1 3 1/0/0 +0 1 17 1/0/0 +0 1 127 1/0/0 +0 1 MIN+1 0 +0 1 MAX 1/0/0 +0 1 MIN 0 +0 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 3 -1 0 +0 3 1 4/0/3 +0 3 -2 0 +0 3 2 2/0/2 +0 3 -3 0 +0 3 3 2/0/3 +0 3 17 1/0/0 +0 3 127 1/0/0 +0 3 MIN+1 0 +0 3 MAX 1/0/0 +0 3 MIN 0 +0 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN+1 -1 --- + java.lang.IllegalArgumentException: 0 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN+1 1 0 +0 MIN+1 -2 1073741824/0/MIN+2 +0 MIN+1 2 0 +0 MIN+1 -3 715827883/0/MIN+2 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 2/0/MIN+1 +0 MIN+1 MAX 0 +0 MIN+1 MIN 1/0/0 +0 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MAX -1 0 +0 MAX 1 --- + java.lang.IllegalArgumentException: 0 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +0 MAX -2 0 +0 MAX 2 1073741824/0/MAX-1 +0 MAX -3 0 +0 MAX 3 715827883/0/MAX-1 +0 MAX 17 126322568/0/MAX-8 +0 MAX 127 16909321/0/MAX-7 +0 MAX MIN+1 0 +0 MAX MAX 2/0/MAX +0 MAX MIN 0 +0 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN -1 --- + java.lang.IllegalArgumentException: 0 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN 1 0 +0 MIN -2 1073741825/0/MIN +0 MIN 2 0 +0 MIN -3 715827883/0/MIN+2 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 2/0/MIN+1 +0 MIN MAX 0 +0 MIN MIN 2/0/MIN + +start end step length/first/last +----------------------------------------- +-1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 0 -1 0 +-1 0 1 2/-1/0 +-1 0 -2 0 +-1 0 2 1/-1/-1 +-1 0 -3 0 +-1 0 3 1/-1/-1 +-1 0 17 1/-1/-1 +-1 0 127 1/-1/-1 +-1 0 MIN+1 0 +-1 0 MAX 1/-1/-1 +-1 0 MIN 0 +-1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 -1 -1 1/-1/-1 +-1 -1 1 1/-1/-1 +-1 -1 -2 1/-1/-1 +-1 -1 2 1/-1/-1 +-1 -1 -3 1/-1/-1 +-1 -1 3 1/-1/-1 +-1 -1 17 1/-1/-1 +-1 -1 127 1/-1/-1 +-1 -1 MIN+1 1/-1/-1 +-1 -1 MAX 1/-1/-1 +-1 -1 MIN 1/-1/-1 +-1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 1 -1 0 +-1 1 1 3/-1/1 +-1 1 -2 0 +-1 1 2 2/-1/1 +-1 1 -3 0 +-1 1 3 1/-1/-1 +-1 1 17 1/-1/-1 +-1 1 127 1/-1/-1 +-1 1 MIN+1 0 +-1 1 MAX 1/-1/-1 +-1 1 MIN 0 +-1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 3 -1 0 +-1 3 1 5/-1/3 +-1 3 -2 0 +-1 3 2 3/-1/3 +-1 3 -3 0 +-1 3 3 2/-1/2 +-1 3 17 1/-1/-1 +-1 3 127 1/-1/-1 +-1 3 MIN+1 0 +-1 3 MAX 1/-1/-1 +-1 3 MIN 0 +-1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN+1 -1 MAX/-1/MIN+1 +-1 MIN+1 1 0 +-1 MIN+1 -2 1073741824/-1/MIN+1 +-1 MIN+1 2 0 +-1 MIN+1 -3 715827883/-1/MIN+1 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 1/-1/-1 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 1/-1/-1 +-1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MAX -1 0 +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 0 +-1 MAX 2 1073741825/-1/MAX +-1 MAX -3 0 +-1 MAX 3 715827883/-1/MAX-2 +-1 MAX 17 126322568/-1/MAX-9 +-1 MAX 127 16909321/-1/MAX-8 +-1 MAX MIN+1 0 +-1 MAX MAX 2/-1/MAX-1 +-1 MAX MIN 0 +-1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN -1 --- + java.lang.IllegalArgumentException: -1 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +-1 MIN 1 0 +-1 MIN -2 1073741824/-1/MIN+1 +-1 MIN 2 0 +-1 MIN -3 715827883/-1/MIN+1 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 2/-1/MIN +-1 MIN MAX 0 +-1 MIN MIN 1/-1/-1 + +start end step length/first/last +----------------------------------------- +1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 0 -1 2/1/0 +1 0 1 0 +1 0 -2 1/1/1 +1 0 2 0 +1 0 -3 1/1/1 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 1/1/1 +1 0 MAX 0 +1 0 MIN 1/1/1 +1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 -1 -1 3/1/-1 +1 -1 1 0 +1 -1 -2 2/1/-1 +1 -1 2 0 +1 -1 -3 1/1/1 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 1/1/1 +1 -1 MAX 0 +1 -1 MIN 1/1/1 +1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 1 -1 1/1/1 +1 1 1 1/1/1 +1 1 -2 1/1/1 +1 1 2 1/1/1 +1 1 -3 1/1/1 +1 1 3 1/1/1 +1 1 17 1/1/1 +1 1 127 1/1/1 +1 1 MIN+1 1/1/1 +1 1 MAX 1/1/1 +1 1 MIN 1/1/1 +1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 3 -1 0 +1 3 1 3/1/3 +1 3 -2 0 +1 3 2 2/1/3 +1 3 -3 0 +1 3 3 1/1/1 +1 3 17 1/1/1 +1 3 127 1/1/1 +1 3 MIN+1 0 +1 3 MAX 1/1/1 +1 3 MIN 0 +1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN+1 -1 --- + java.lang.IllegalArgumentException: 1 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN+1 1 0 +1 MIN+1 -2 1073741825/1/MIN+1 +1 MIN+1 2 0 +1 MIN+1 -3 715827883/1/MIN+3 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 2/1/MIN+2 +1 MIN+1 MAX 0 +1 MIN+1 MIN 2/1/MIN+1 +1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MAX -1 0 +1 MAX 1 MAX/1/MAX +1 MAX -2 0 +1 MAX 2 1073741824/1/MAX +1 MAX -3 0 +1 MAX 3 715827883/1/MAX +1 MAX 17 126322568/1/MAX-7 +1 MAX 127 16909321/1/MAX-6 +1 MAX MIN+1 0 +1 MAX MAX 1/1/1 +1 MAX MIN 0 +1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN -1 --- + java.lang.IllegalArgumentException: 1 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN 1 0 +1 MIN -2 1073741825/1/MIN+1 +1 MIN 2 0 +1 MIN -3 715827884/1/MIN +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 2/1/MIN+2 +1 MIN MAX 0 +1 MIN MIN 2/1/MIN+1 + +start end step length/first/last +----------------------------------------- +3 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 0 -1 4/3/0 +3 0 1 0 +3 0 -2 2/3/1 +3 0 2 0 +3 0 -3 2/3/0 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 1/3/3 +3 0 MAX 0 +3 0 MIN 1/3/3 +3 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 -1 -1 5/3/-1 +3 -1 1 0 +3 -1 -2 3/3/-1 +3 -1 2 0 +3 -1 -3 2/3/0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 1/3/3 +3 -1 MAX 0 +3 -1 MIN 1/3/3 +3 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 1 -1 3/3/1 +3 1 1 0 +3 1 -2 2/3/1 +3 1 2 0 +3 1 -3 1/3/3 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 1/3/3 +3 1 MAX 0 +3 1 MIN 1/3/3 +3 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 3 -1 1/3/3 +3 3 1 1/3/3 +3 3 -2 1/3/3 +3 3 2 1/3/3 +3 3 -3 1/3/3 +3 3 3 1/3/3 +3 3 17 1/3/3 +3 3 127 1/3/3 +3 3 MIN+1 1/3/3 +3 3 MAX 1/3/3 +3 3 MIN 1/3/3 +3 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN+1 -1 --- + java.lang.IllegalArgumentException: 3 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN+1 1 0 +3 MIN+1 -2 1073741826/3/MIN+1 +3 MIN+1 2 0 +3 MIN+1 -3 715827884/3/MIN+2 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 2/3/MIN+4 +3 MIN+1 MAX 0 +3 MIN+1 MIN 2/3/MIN+3 +3 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MAX -1 0 +3 MAX 1 MAX-2/3/MAX +3 MAX -2 0 +3 MAX 2 1073741823/3/MAX +3 MAX -3 0 +3 MAX 3 715827882/3/MAX-1 +3 MAX 17 126322568/3/MAX-5 +3 MAX 127 16909321/3/MAX-4 +3 MAX MIN+1 0 +3 MAX MAX 1/3/3 +3 MAX MIN 0 +3 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN -1 --- + java.lang.IllegalArgumentException: 3 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN 1 0 +3 MIN -2 1073741826/3/MIN+1 +3 MIN 2 0 +3 MIN -3 715827884/3/MIN+2 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 2/3/MIN+4 +3 MIN MAX 0 +3 MIN MIN 2/3/MIN+3 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 0 -1 0 +MIN+1 0 1 --- + java.lang.IllegalArgumentException: -2147483647 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 0 -2 0 +MIN+1 0 2 1073741824/MIN+1/-1 +MIN+1 0 -3 0 +MIN+1 0 3 715827883/MIN+1/-1 +MIN+1 0 17 126322568/MIN+1/-8 +MIN+1 0 127 16909321/MIN+1/-7 +MIN+1 0 MIN+1 0 +MIN+1 0 MAX 2/MIN+1/0 +MIN+1 0 MIN 0 +MIN+1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 -1 -1 0 +MIN+1 -1 1 MAX/MIN+1/-1 +MIN+1 -1 -2 0 +MIN+1 -1 2 1073741824/MIN+1/-1 +MIN+1 -1 -3 0 +MIN+1 -1 3 715827883/MIN+1/-1 +MIN+1 -1 17 126322568/MIN+1/-8 +MIN+1 -1 127 16909321/MIN+1/-7 +MIN+1 -1 MIN+1 0 +MIN+1 -1 MAX 1/MIN+1/MIN+1 +MIN+1 -1 MIN 0 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 1 -1 0 +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 0 +MIN+1 1 2 1073741825/MIN+1/1 +MIN+1 1 -3 0 +MIN+1 1 3 715827883/MIN+1/-1 +MIN+1 1 17 126322568/MIN+1/-8 +MIN+1 1 127 16909321/MIN+1/-7 +MIN+1 1 MIN+1 0 +MIN+1 1 MAX 2/MIN+1/0 +MIN+1 1 MIN 0 +MIN+1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 3 -1 0 +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 0 +MIN+1 3 2 1073741826/MIN+1/3 +MIN+1 3 -3 0 +MIN+1 3 3 715827884/MIN+1/2 +MIN+1 3 17 126322568/MIN+1/-8 +MIN+1 3 127 16909321/MIN+1/-7 +MIN+1 3 MIN+1 0 +MIN+1 3 MAX 2/MIN+1/0 +MIN+1 3 MIN 0 +MIN+1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN+1 -1 1/MIN+1/MIN+1 +MIN+1 MIN+1 1 1/MIN+1/MIN+1 +MIN+1 MIN+1 -2 1/MIN+1/MIN+1 +MIN+1 MIN+1 2 1/MIN+1/MIN+1 +MIN+1 MIN+1 -3 1/MIN+1/MIN+1 +MIN+1 MIN+1 3 1/MIN+1/MIN+1 +MIN+1 MIN+1 17 1/MIN+1/MIN+1 +MIN+1 MIN+1 127 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN+1 MAX 1/MIN+1/MIN+1 +MIN+1 MIN+1 MIN 1/MIN+1/MIN+1 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MAX -1 0 +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 0 +MIN+1 MAX 2 --- + java.lang.IllegalArgumentException: -2147483647 to 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -3 0 +MIN+1 MAX 3 1431655765/MIN+1/MAX-2 +MIN+1 MAX 17 252645135/MIN+1/MAX-16 +MIN+1 MAX 127 33818641/MIN+1/MAX-14 +MIN+1 MAX MIN+1 0 +MIN+1 MAX MAX 3/MIN+1/MAX +MIN+1 MAX MIN 0 +MIN+1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN -1 2/MIN+1/MIN +MIN+1 MIN 1 0 +MIN+1 MIN -2 1/MIN+1/MIN+1 +MIN+1 MIN 2 0 +MIN+1 MIN -3 1/MIN+1/MIN+1 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 1/MIN+1/MIN+1 + +start end step length/first/last +----------------------------------------- +MAX 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 0 -1 --- + java.lang.IllegalArgumentException: 2147483647 to 0 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX 0 1 0 +MAX 0 -2 1073741824/MAX/1 +MAX 0 2 0 +MAX 0 -3 715827883/MAX/1 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 2/MAX/0 +MAX 0 MAX 0 +MAX 0 MIN 1/MAX/MAX +MAX -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX -1 -1 --- + java.lang.IllegalArgumentException: 2147483647 to -1 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX -1 1 0 +MAX -1 -2 1073741825/MAX/-1 +MAX -1 2 0 +MAX -1 -3 715827883/MAX/1 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 2/MAX/0 +MAX -1 MAX 0 +MAX -1 MIN 2/MAX/-1 +MAX 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 1 -1 MAX/MAX/1 +MAX 1 1 0 +MAX 1 -2 1073741824/MAX/1 +MAX 1 2 0 +MAX 1 -3 715827883/MAX/1 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 1/MAX/MAX +MAX 1 MAX 0 +MAX 1 MIN 1/MAX/MAX +MAX 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 3 -1 MAX-2/MAX/3 +MAX 3 1 0 +MAX 3 -2 1073741823/MAX/3 +MAX 3 2 0 +MAX 3 -3 715827882/MAX/4 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 1/MAX/MAX +MAX 3 MAX 0 +MAX 3 MIN 1/MAX/MAX +MAX MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN+1 -1 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 1 0 +MAX MIN+1 -2 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483647 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 2 0 +MAX MIN+1 -3 1431655765/MAX/MIN+3 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 3/MAX/MIN+1 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 2/MAX/-1 +MAX MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MAX -1 1/MAX/MAX +MAX MAX 1 1/MAX/MAX +MAX MAX -2 1/MAX/MAX +MAX MAX 2 1/MAX/MAX +MAX MAX -3 1/MAX/MAX +MAX MAX 3 1/MAX/MAX +MAX MAX 17 1/MAX/MAX +MAX MAX 127 1/MAX/MAX +MAX MAX MIN+1 1/MAX/MAX +MAX MAX MAX 1/MAX/MAX +MAX MAX MIN 1/MAX/MAX +MAX MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN -1 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 1 0 +MAX MIN -2 --- + java.lang.IllegalArgumentException: 2147483647 to -2147483648 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 2 0 +MAX MIN -3 1431655766/MAX/MIN +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 3/MAX/MIN+1 +MAX MIN MAX 0 +MAX MIN MIN 2/MAX/-1 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 0 -1 0 +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 to 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 0 +MIN 0 2 1073741825/MIN/0 +MIN 0 -3 0 +MIN 0 3 715827883/MIN/-2 +MIN 0 17 126322568/MIN/-9 +MIN 0 127 16909321/MIN/-8 +MIN 0 MIN+1 0 +MIN 0 MAX 2/MIN/-1 +MIN 0 MIN 0 +MIN -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN -1 -1 0 +MIN -1 1 --- + java.lang.IllegalArgumentException: -2147483648 to -1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 -2 0 +MIN -1 2 1073741824/MIN/-2 +MIN -1 -3 0 +MIN -1 3 715827883/MIN/-2 +MIN -1 17 126322568/MIN/-9 +MIN -1 127 16909321/MIN/-8 +MIN -1 MIN+1 0 +MIN -1 MAX 2/MIN/-1 +MIN -1 MIN 0 +MIN 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 1 -1 0 +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 to 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 0 +MIN 1 2 1073741825/MIN/0 +MIN 1 -3 0 +MIN 1 3 715827884/MIN/1 +MIN 1 17 126322568/MIN/-9 +MIN 1 127 16909321/MIN/-8 +MIN 1 MIN+1 0 +MIN 1 MAX 2/MIN/-1 +MIN 1 MIN 0 +MIN 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 3 -1 0 +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 to 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 0 +MIN 3 2 1073741826/MIN/2 +MIN 3 -3 0 +MIN 3 3 715827884/MIN/1 +MIN 3 17 126322568/MIN/-9 +MIN 3 127 16909321/MIN/-8 +MIN 3 MIN+1 0 +MIN 3 MAX 2/MIN/-1 +MIN 3 MIN 0 +MIN MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN+1 -1 0 +MIN MIN+1 1 2/MIN/MIN+1 +MIN MIN+1 -2 0 +MIN MIN+1 2 1/MIN/MIN +MIN MIN+1 -3 0 +MIN MIN+1 3 1/MIN/MIN +MIN MIN+1 17 1/MIN/MIN +MIN MIN+1 127 1/MIN/MIN +MIN MIN+1 MIN+1 0 +MIN MIN+1 MAX 1/MIN/MIN +MIN MIN+1 MIN 0 +MIN MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MAX -1 0 +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 0 +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 to 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 0 +MIN MAX 3 1431655766/MIN/MAX +MIN MAX 17 252645136/MIN/MAX +MIN MAX 127 33818641/MIN/MAX-15 +MIN MAX MIN+1 0 +MIN MAX MAX 3/MIN/MAX-1 +MIN MAX MIN 0 +MIN MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN -1 1/MIN/MIN +MIN MIN 1 1/MIN/MIN +MIN MIN -2 1/MIN/MIN +MIN MIN 2 1/MIN/MIN +MIN MIN -3 1/MIN/MIN +MIN MIN 3 1/MIN/MIN +MIN MIN 17 1/MIN/MIN +MIN MIN 127 1/MIN/MIN +MIN MIN MIN+1 1/MIN/MIN +MIN MIN MAX 1/MIN/MIN +MIN MIN MIN 1/MIN/MIN + +>>> start until end <<< + +start end step length/first/last +----------------------------------------- +0 0 0 0 +0 0 -1 0 +0 0 1 0 +0 0 -2 0 +0 0 2 0 +0 0 -3 0 +0 0 3 0 +0 0 17 0 +0 0 127 0 +0 0 MIN+1 0 +0 0 MAX 0 +0 0 MIN 0 +0 -1 0 0 +0 -1 -1 0 +0 -1 1 0 +0 -1 -2 0 +0 -1 2 0 +0 -1 -3 0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 0 +0 -1 MAX 0 +0 -1 MIN 0 +0 1 0 1/0/0 +0 1 -1 1/0/0 +0 1 1 1/0/0 +0 1 -2 1/0/0 +0 1 2 1/0/0 +0 1 -3 1/0/0 +0 1 3 1/0/0 +0 1 17 1/0/0 +0 1 127 1/0/0 +0 1 MIN+1 1/0/0 +0 1 MAX 1/0/0 +0 1 MIN 1/0/0 +0 3 0 3/0/2 +0 3 -1 3/0/2 +0 3 1 3/0/2 +0 3 -2 3/0/2 +0 3 2 3/0/2 +0 3 -3 3/0/2 +0 3 3 3/0/2 +0 3 17 3/0/2 +0 3 127 3/0/2 +0 3 MIN+1 3/0/2 +0 3 MAX 3/0/2 +0 3 MIN 3/0/2 +0 MIN+1 0 0 +0 MIN+1 -1 0 +0 MIN+1 1 0 +0 MIN+1 -2 0 +0 MIN+1 2 0 +0 MIN+1 -3 0 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 0 +0 MIN+1 MAX 0 +0 MIN+1 MIN 0 +0 MAX 0 MAX/0/MAX-1 +0 MAX -1 MAX/0/MAX-1 +0 MAX 1 MAX/0/MAX-1 +0 MAX -2 MAX/0/MAX-1 +0 MAX 2 MAX/0/MAX-1 +0 MAX -3 MAX/0/MAX-1 +0 MAX 3 MAX/0/MAX-1 +0 MAX 17 MAX/0/MAX-1 +0 MAX 127 MAX/0/MAX-1 +0 MAX MIN+1 MAX/0/MAX-1 +0 MAX MAX MAX/0/MAX-1 +0 MAX MIN MAX/0/MAX-1 +0 MIN 0 0 +0 MIN -1 0 +0 MIN 1 0 +0 MIN -2 0 +0 MIN 2 0 +0 MIN -3 0 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 0 +0 MIN MAX 0 +0 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +-1 0 0 1/-1/-1 +-1 0 -1 1/-1/-1 +-1 0 1 1/-1/-1 +-1 0 -2 1/-1/-1 +-1 0 2 1/-1/-1 +-1 0 -3 1/-1/-1 +-1 0 3 1/-1/-1 +-1 0 17 1/-1/-1 +-1 0 127 1/-1/-1 +-1 0 MIN+1 1/-1/-1 +-1 0 MAX 1/-1/-1 +-1 0 MIN 1/-1/-1 +-1 -1 0 0 +-1 -1 -1 0 +-1 -1 1 0 +-1 -1 -2 0 +-1 -1 2 0 +-1 -1 -3 0 +-1 -1 3 0 +-1 -1 17 0 +-1 -1 127 0 +-1 -1 MIN+1 0 +-1 -1 MAX 0 +-1 -1 MIN 0 +-1 1 0 2/-1/0 +-1 1 -1 2/-1/0 +-1 1 1 2/-1/0 +-1 1 -2 2/-1/0 +-1 1 2 2/-1/0 +-1 1 -3 2/-1/0 +-1 1 3 2/-1/0 +-1 1 17 2/-1/0 +-1 1 127 2/-1/0 +-1 1 MIN+1 2/-1/0 +-1 1 MAX 2/-1/0 +-1 1 MIN 2/-1/0 +-1 3 0 4/-1/2 +-1 3 -1 4/-1/2 +-1 3 1 4/-1/2 +-1 3 -2 4/-1/2 +-1 3 2 4/-1/2 +-1 3 -3 4/-1/2 +-1 3 3 4/-1/2 +-1 3 17 4/-1/2 +-1 3 127 4/-1/2 +-1 3 MIN+1 4/-1/2 +-1 3 MAX 4/-1/2 +-1 3 MIN 4/-1/2 +-1 MIN+1 0 0 +-1 MIN+1 -1 0 +-1 MIN+1 1 0 +-1 MIN+1 -2 0 +-1 MIN+1 2 0 +-1 MIN+1 -3 0 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 0 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 0 +-1 MAX 0 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -1 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 2 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -3 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 3 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 17 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX 127 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MIN+1 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MAX --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX MIN --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MIN 0 0 +-1 MIN -1 0 +-1 MIN 1 0 +-1 MIN -2 0 +-1 MIN 2 0 +-1 MIN -3 0 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 0 +-1 MIN MAX 0 +-1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +1 0 0 0 +1 0 -1 0 +1 0 1 0 +1 0 -2 0 +1 0 2 0 +1 0 -3 0 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 0 +1 0 MAX 0 +1 0 MIN 0 +1 -1 0 0 +1 -1 -1 0 +1 -1 1 0 +1 -1 -2 0 +1 -1 2 0 +1 -1 -3 0 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 0 +1 -1 MAX 0 +1 -1 MIN 0 +1 1 0 0 +1 1 -1 0 +1 1 1 0 +1 1 -2 0 +1 1 2 0 +1 1 -3 0 +1 1 3 0 +1 1 17 0 +1 1 127 0 +1 1 MIN+1 0 +1 1 MAX 0 +1 1 MIN 0 +1 3 0 2/1/2 +1 3 -1 2/1/2 +1 3 1 2/1/2 +1 3 -2 2/1/2 +1 3 2 2/1/2 +1 3 -3 2/1/2 +1 3 3 2/1/2 +1 3 17 2/1/2 +1 3 127 2/1/2 +1 3 MIN+1 2/1/2 +1 3 MAX 2/1/2 +1 3 MIN 2/1/2 +1 MIN+1 0 0 +1 MIN+1 -1 0 +1 MIN+1 1 0 +1 MIN+1 -2 0 +1 MIN+1 2 0 +1 MIN+1 -3 0 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 0 +1 MIN+1 MAX 0 +1 MIN+1 MIN 0 +1 MAX 0 MAX-1/1/MAX-1 +1 MAX -1 MAX-1/1/MAX-1 +1 MAX 1 MAX-1/1/MAX-1 +1 MAX -2 MAX-1/1/MAX-1 +1 MAX 2 MAX-1/1/MAX-1 +1 MAX -3 MAX-1/1/MAX-1 +1 MAX 3 MAX-1/1/MAX-1 +1 MAX 17 MAX-1/1/MAX-1 +1 MAX 127 MAX-1/1/MAX-1 +1 MAX MIN+1 MAX-1/1/MAX-1 +1 MAX MAX MAX-1/1/MAX-1 +1 MAX MIN MAX-1/1/MAX-1 +1 MIN 0 0 +1 MIN -1 0 +1 MIN 1 0 +1 MIN -2 0 +1 MIN 2 0 +1 MIN -3 0 +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 0 +1 MIN MAX 0 +1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +3 0 0 0 +3 0 -1 0 +3 0 1 0 +3 0 -2 0 +3 0 2 0 +3 0 -3 0 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 0 +3 0 MAX 0 +3 0 MIN 0 +3 -1 0 0 +3 -1 -1 0 +3 -1 1 0 +3 -1 -2 0 +3 -1 2 0 +3 -1 -3 0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 0 +3 -1 MAX 0 +3 -1 MIN 0 +3 1 0 0 +3 1 -1 0 +3 1 1 0 +3 1 -2 0 +3 1 2 0 +3 1 -3 0 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 0 +3 1 MAX 0 +3 1 MIN 0 +3 3 0 0 +3 3 -1 0 +3 3 1 0 +3 3 -2 0 +3 3 2 0 +3 3 -3 0 +3 3 3 0 +3 3 17 0 +3 3 127 0 +3 3 MIN+1 0 +3 3 MAX 0 +3 3 MIN 0 +3 MIN+1 0 0 +3 MIN+1 -1 0 +3 MIN+1 1 0 +3 MIN+1 -2 0 +3 MIN+1 2 0 +3 MIN+1 -3 0 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 0 +3 MIN+1 MAX 0 +3 MIN+1 MIN 0 +3 MAX 0 MAX-3/3/MAX-1 +3 MAX -1 MAX-3/3/MAX-1 +3 MAX 1 MAX-3/3/MAX-1 +3 MAX -2 MAX-3/3/MAX-1 +3 MAX 2 MAX-3/3/MAX-1 +3 MAX -3 MAX-3/3/MAX-1 +3 MAX 3 MAX-3/3/MAX-1 +3 MAX 17 MAX-3/3/MAX-1 +3 MAX 127 MAX-3/3/MAX-1 +3 MAX MIN+1 MAX-3/3/MAX-1 +3 MAX MAX MAX-3/3/MAX-1 +3 MAX MIN MAX-3/3/MAX-1 +3 MIN 0 0 +3 MIN -1 0 +3 MIN 1 0 +3 MIN -2 0 +3 MIN 2 0 +3 MIN -3 0 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 0 +3 MIN MAX 0 +3 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 MAX/MIN+1/-1 +MIN+1 0 -1 MAX/MIN+1/-1 +MIN+1 0 1 MAX/MIN+1/-1 +MIN+1 0 -2 MAX/MIN+1/-1 +MIN+1 0 2 MAX/MIN+1/-1 +MIN+1 0 -3 MAX/MIN+1/-1 +MIN+1 0 3 MAX/MIN+1/-1 +MIN+1 0 17 MAX/MIN+1/-1 +MIN+1 0 127 MAX/MIN+1/-1 +MIN+1 0 MIN+1 MAX/MIN+1/-1 +MIN+1 0 MAX MAX/MIN+1/-1 +MIN+1 0 MIN MAX/MIN+1/-1 +MIN+1 -1 0 MAX-1/MIN+1/-2 +MIN+1 -1 -1 MAX-1/MIN+1/-2 +MIN+1 -1 1 MAX-1/MIN+1/-2 +MIN+1 -1 -2 MAX-1/MIN+1/-2 +MIN+1 -1 2 MAX-1/MIN+1/-2 +MIN+1 -1 -3 MAX-1/MIN+1/-2 +MIN+1 -1 3 MAX-1/MIN+1/-2 +MIN+1 -1 17 MAX-1/MIN+1/-2 +MIN+1 -1 127 MAX-1/MIN+1/-2 +MIN+1 -1 MIN+1 MAX-1/MIN+1/-2 +MIN+1 -1 MAX MAX-1/MIN+1/-2 +MIN+1 -1 MIN MAX-1/MIN+1/-2 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -1 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 2 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -3 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 3 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 17 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 127 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MAX --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 MIN --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 0 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -1 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 2 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -3 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 3 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 17 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 127 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MAX --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 MIN --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MIN+1 0 0 +MIN+1 MIN+1 -1 0 +MIN+1 MIN+1 1 0 +MIN+1 MIN+1 -2 0 +MIN+1 MIN+1 2 0 +MIN+1 MIN+1 -3 0 +MIN+1 MIN+1 3 0 +MIN+1 MIN+1 17 0 +MIN+1 MIN+1 127 0 +MIN+1 MIN+1 MIN+1 0 +MIN+1 MIN+1 MAX 0 +MIN+1 MIN+1 MIN 0 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -1 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 2 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -3 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 3 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 17 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX 127 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MIN+1 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MAX --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX MIN --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MIN 0 0 +MIN+1 MIN -1 0 +MIN+1 MIN 1 0 +MIN+1 MIN -2 0 +MIN+1 MIN 2 0 +MIN+1 MIN -3 0 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 0 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MAX 0 0 0 +MAX 0 -1 0 +MAX 0 1 0 +MAX 0 -2 0 +MAX 0 2 0 +MAX 0 -3 0 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 0 +MAX 0 MAX 0 +MAX 0 MIN 0 +MAX -1 0 0 +MAX -1 -1 0 +MAX -1 1 0 +MAX -1 -2 0 +MAX -1 2 0 +MAX -1 -3 0 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 0 +MAX -1 MAX 0 +MAX -1 MIN 0 +MAX 1 0 0 +MAX 1 -1 0 +MAX 1 1 0 +MAX 1 -2 0 +MAX 1 2 0 +MAX 1 -3 0 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 0 +MAX 1 MAX 0 +MAX 1 MIN 0 +MAX 3 0 0 +MAX 3 -1 0 +MAX 3 1 0 +MAX 3 -2 0 +MAX 3 2 0 +MAX 3 -3 0 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 0 +MAX 3 MAX 0 +MAX 3 MIN 0 +MAX MIN+1 0 0 +MAX MIN+1 -1 0 +MAX MIN+1 1 0 +MAX MIN+1 -2 0 +MAX MIN+1 2 0 +MAX MIN+1 -3 0 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 0 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 0 +MAX MAX 0 0 +MAX MAX -1 0 +MAX MAX 1 0 +MAX MAX -2 0 +MAX MAX 2 0 +MAX MAX -3 0 +MAX MAX 3 0 +MAX MAX 17 0 +MAX MAX 127 0 +MAX MAX MIN+1 0 +MAX MAX MAX 0 +MAX MAX MIN 0 +MAX MIN 0 0 +MAX MIN -1 0 +MAX MIN 1 0 +MAX MIN -2 0 +MAX MIN 2 0 +MAX MIN -3 0 +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 0 +MAX MIN MAX 0 +MAX MIN MIN 0 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -1 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 2 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -3 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 3 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 17 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 127 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MAX --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 MIN --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN -1 0 MAX/MIN/-2 +MIN -1 -1 MAX/MIN/-2 +MIN -1 1 MAX/MIN/-2 +MIN -1 -2 MAX/MIN/-2 +MIN -1 2 MAX/MIN/-2 +MIN -1 -3 MAX/MIN/-2 +MIN -1 3 MAX/MIN/-2 +MIN -1 17 MAX/MIN/-2 +MIN -1 127 MAX/MIN/-2 +MIN -1 MIN+1 MAX/MIN/-2 +MIN -1 MAX MAX/MIN/-2 +MIN -1 MIN MAX/MIN/-2 +MIN 1 0 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -1 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 2 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -3 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 3 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 17 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 127 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MAX --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 MIN --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 0 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -1 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 2 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -3 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 3 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 17 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 127 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MAX --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 MIN --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MIN+1 0 1/MIN/MIN +MIN MIN+1 -1 1/MIN/MIN +MIN MIN+1 1 1/MIN/MIN +MIN MIN+1 -2 1/MIN/MIN +MIN MIN+1 2 1/MIN/MIN +MIN MIN+1 -3 1/MIN/MIN +MIN MIN+1 3 1/MIN/MIN +MIN MIN+1 17 1/MIN/MIN +MIN MIN+1 127 1/MIN/MIN +MIN MIN+1 MIN+1 1/MIN/MIN +MIN MIN+1 MAX 1/MIN/MIN +MIN MIN+1 MIN 1/MIN/MIN +MIN MAX 0 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -1 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 3 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 17 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX 127 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MIN+1 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MAX --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX MIN --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MIN 0 0 +MIN MIN -1 0 +MIN MIN 1 0 +MIN MIN -2 0 +MIN MIN 2 0 +MIN MIN -3 0 +MIN MIN 3 0 +MIN MIN 17 0 +MIN MIN 127 0 +MIN MIN MIN+1 0 +MIN MIN MAX 0 +MIN MIN MIN 0 + +>>> start until end by step <<< + +start end step length/first/last +----------------------------------------- +0 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 0 -1 0 +0 0 1 0 +0 0 -2 0 +0 0 2 0 +0 0 -3 0 +0 0 3 0 +0 0 17 0 +0 0 127 0 +0 0 MIN+1 0 +0 0 MAX 0 +0 0 MIN 0 +0 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 -1 -1 1/0/0 +0 -1 1 0 +0 -1 -2 1/0/0 +0 -1 2 0 +0 -1 -3 1/0/0 +0 -1 3 0 +0 -1 17 0 +0 -1 127 0 +0 -1 MIN+1 1/0/0 +0 -1 MAX 0 +0 -1 MIN 1/0/0 +0 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 1 -1 0 +0 1 1 1/0/0 +0 1 -2 0 +0 1 2 1/0/0 +0 1 -3 0 +0 1 3 1/0/0 +0 1 17 1/0/0 +0 1 127 1/0/0 +0 1 MIN+1 0 +0 1 MAX 1/0/0 +0 1 MIN 0 +0 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 3 -1 0 +0 3 1 3/0/2 +0 3 -2 0 +0 3 2 2/0/2 +0 3 -3 0 +0 3 3 1/0/0 +0 3 17 1/0/0 +0 3 127 1/0/0 +0 3 MIN+1 0 +0 3 MAX 1/0/0 +0 3 MIN 0 +0 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN+1 -1 MAX/0/MIN+2 +0 MIN+1 1 0 +0 MIN+1 -2 1073741824/0/MIN+2 +0 MIN+1 2 0 +0 MIN+1 -3 715827883/0/MIN+2 +0 MIN+1 3 0 +0 MIN+1 17 0 +0 MIN+1 127 0 +0 MIN+1 MIN+1 1/0/0 +0 MIN+1 MAX 0 +0 MIN+1 MIN 1/0/0 +0 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MAX -1 0 +0 MAX 1 MAX/0/MAX-1 +0 MAX -2 0 +0 MAX 2 1073741824/0/MAX-1 +0 MAX -3 0 +0 MAX 3 715827883/0/MAX-1 +0 MAX 17 126322568/0/MAX-8 +0 MAX 127 16909321/0/MAX-7 +0 MAX MIN+1 0 +0 MAX MAX 1/0/0 +0 MAX MIN 0 +0 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +0 MIN -1 --- + java.lang.IllegalArgumentException: 0 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +0 MIN 1 0 +0 MIN -2 1073741824/0/MIN+2 +0 MIN 2 0 +0 MIN -3 715827883/0/MIN+2 +0 MIN 3 0 +0 MIN 17 0 +0 MIN 127 0 +0 MIN MIN+1 2/0/MIN+1 +0 MIN MAX 0 +0 MIN MIN 1/0/0 + +start end step length/first/last +----------------------------------------- +-1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 0 -1 0 +-1 0 1 1/-1/-1 +-1 0 -2 0 +-1 0 2 1/-1/-1 +-1 0 -3 0 +-1 0 3 1/-1/-1 +-1 0 17 1/-1/-1 +-1 0 127 1/-1/-1 +-1 0 MIN+1 0 +-1 0 MAX 1/-1/-1 +-1 0 MIN 0 +-1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 -1 -1 0 +-1 -1 1 0 +-1 -1 -2 0 +-1 -1 2 0 +-1 -1 -3 0 +-1 -1 3 0 +-1 -1 17 0 +-1 -1 127 0 +-1 -1 MIN+1 0 +-1 -1 MAX 0 +-1 -1 MIN 0 +-1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 1 -1 0 +-1 1 1 2/-1/0 +-1 1 -2 0 +-1 1 2 1/-1/-1 +-1 1 -3 0 +-1 1 3 1/-1/-1 +-1 1 17 1/-1/-1 +-1 1 127 1/-1/-1 +-1 1 MIN+1 0 +-1 1 MAX 1/-1/-1 +-1 1 MIN 0 +-1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 3 -1 0 +-1 3 1 4/-1/2 +-1 3 -2 0 +-1 3 2 2/-1/1 +-1 3 -3 0 +-1 3 3 2/-1/2 +-1 3 17 1/-1/-1 +-1 3 127 1/-1/-1 +-1 3 MIN+1 0 +-1 3 MAX 1/-1/-1 +-1 3 MIN 0 +-1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN+1 -1 MAX-1/-1/MIN+2 +-1 MIN+1 1 0 +-1 MIN+1 -2 1073741823/-1/MIN+3 +-1 MIN+1 2 0 +-1 MIN+1 -3 715827882/-1/MIN+4 +-1 MIN+1 3 0 +-1 MIN+1 17 0 +-1 MIN+1 127 0 +-1 MIN+1 MIN+1 1/-1/-1 +-1 MIN+1 MAX 0 +-1 MIN+1 MIN 1/-1/-1 +-1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MAX -1 0 +-1 MAX 1 --- + java.lang.IllegalArgumentException: -1 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +-1 MAX -2 0 +-1 MAX 2 1073741824/-1/MAX-2 +-1 MAX -3 0 +-1 MAX 3 715827883/-1/MAX-2 +-1 MAX 17 126322568/-1/MAX-9 +-1 MAX 127 16909321/-1/MAX-8 +-1 MAX MIN+1 0 +-1 MAX MAX 2/-1/MAX-1 +-1 MAX MIN 0 +-1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +-1 MIN -1 MAX/-1/MIN+1 +-1 MIN 1 0 +-1 MIN -2 1073741824/-1/MIN+1 +-1 MIN 2 0 +-1 MIN -3 715827883/-1/MIN+1 +-1 MIN 3 0 +-1 MIN 17 0 +-1 MIN 127 0 +-1 MIN MIN+1 1/-1/-1 +-1 MIN MAX 0 +-1 MIN MIN 1/-1/-1 + +start end step length/first/last +----------------------------------------- +1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 0 -1 1/1/1 +1 0 1 0 +1 0 -2 1/1/1 +1 0 2 0 +1 0 -3 1/1/1 +1 0 3 0 +1 0 17 0 +1 0 127 0 +1 0 MIN+1 1/1/1 +1 0 MAX 0 +1 0 MIN 1/1/1 +1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 -1 -1 2/1/0 +1 -1 1 0 +1 -1 -2 1/1/1 +1 -1 2 0 +1 -1 -3 1/1/1 +1 -1 3 0 +1 -1 17 0 +1 -1 127 0 +1 -1 MIN+1 1/1/1 +1 -1 MAX 0 +1 -1 MIN 1/1/1 +1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 1 -1 0 +1 1 1 0 +1 1 -2 0 +1 1 2 0 +1 1 -3 0 +1 1 3 0 +1 1 17 0 +1 1 127 0 +1 1 MIN+1 0 +1 1 MAX 0 +1 1 MIN 0 +1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 3 -1 0 +1 3 1 2/1/2 +1 3 -2 0 +1 3 2 1/1/1 +1 3 -3 0 +1 3 3 1/1/1 +1 3 17 1/1/1 +1 3 127 1/1/1 +1 3 MIN+1 0 +1 3 MAX 1/1/1 +1 3 MIN 0 +1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN+1 -1 --- + java.lang.IllegalArgumentException: 1 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN+1 1 0 +1 MIN+1 -2 1073741824/1/MIN+3 +1 MIN+1 2 0 +1 MIN+1 -3 715827883/1/MIN+3 +1 MIN+1 3 0 +1 MIN+1 17 0 +1 MIN+1 127 0 +1 MIN+1 MIN+1 2/1/MIN+2 +1 MIN+1 MAX 0 +1 MIN+1 MIN 1/1/1 +1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MAX -1 0 +1 MAX 1 MAX-1/1/MAX-1 +1 MAX -2 0 +1 MAX 2 1073741823/1/MAX-2 +1 MAX -3 0 +1 MAX 3 715827882/1/MAX-3 +1 MAX 17 126322568/1/MAX-7 +1 MAX 127 16909321/1/MAX-6 +1 MAX MIN+1 0 +1 MAX MAX 1/1/1 +1 MAX MIN 0 +1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +1 MIN -1 --- + java.lang.IllegalArgumentException: 1 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +1 MIN 1 0 +1 MIN -2 1073741825/1/MIN+1 +1 MIN 2 0 +1 MIN -3 715827883/1/MIN+3 +1 MIN 3 0 +1 MIN 17 0 +1 MIN 127 0 +1 MIN MIN+1 2/1/MIN+2 +1 MIN MAX 0 +1 MIN MIN 2/1/MIN+1 + +start end step length/first/last +----------------------------------------- +3 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 0 -1 3/3/1 +3 0 1 0 +3 0 -2 2/3/1 +3 0 2 0 +3 0 -3 1/3/3 +3 0 3 0 +3 0 17 0 +3 0 127 0 +3 0 MIN+1 1/3/3 +3 0 MAX 0 +3 0 MIN 1/3/3 +3 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 -1 -1 4/3/0 +3 -1 1 0 +3 -1 -2 2/3/1 +3 -1 2 0 +3 -1 -3 2/3/0 +3 -1 3 0 +3 -1 17 0 +3 -1 127 0 +3 -1 MIN+1 1/3/3 +3 -1 MAX 0 +3 -1 MIN 1/3/3 +3 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 1 -1 2/3/2 +3 1 1 0 +3 1 -2 1/3/3 +3 1 2 0 +3 1 -3 1/3/3 +3 1 3 0 +3 1 17 0 +3 1 127 0 +3 1 MIN+1 1/3/3 +3 1 MAX 0 +3 1 MIN 1/3/3 +3 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 3 -1 0 +3 3 1 0 +3 3 -2 0 +3 3 2 0 +3 3 -3 0 +3 3 3 0 +3 3 17 0 +3 3 127 0 +3 3 MIN+1 0 +3 3 MAX 0 +3 3 MIN 0 +3 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN+1 -1 --- + java.lang.IllegalArgumentException: 3 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN+1 1 0 +3 MIN+1 -2 1073741825/3/MIN+3 +3 MIN+1 2 0 +3 MIN+1 -3 715827884/3/MIN+2 +3 MIN+1 3 0 +3 MIN+1 17 0 +3 MIN+1 127 0 +3 MIN+1 MIN+1 2/3/MIN+4 +3 MIN+1 MAX 0 +3 MIN+1 MIN 2/3/MIN+3 +3 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MAX -1 0 +3 MAX 1 MAX-3/3/MAX-1 +3 MAX -2 0 +3 MAX 2 1073741822/3/MAX-2 +3 MAX -3 0 +3 MAX 3 715827882/3/MAX-1 +3 MAX 17 126322568/3/MAX-5 +3 MAX 127 16909321/3/MAX-4 +3 MAX MIN+1 0 +3 MAX MAX 1/3/3 +3 MAX MIN 0 +3 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +3 MIN -1 --- + java.lang.IllegalArgumentException: 3 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +3 MIN 1 0 +3 MIN -2 1073741826/3/MIN+1 +3 MIN 2 0 +3 MIN -3 715827884/3/MIN+2 +3 MIN 3 0 +3 MIN 17 0 +3 MIN 127 0 +3 MIN MIN+1 2/3/MIN+4 +3 MIN MAX 0 +3 MIN MIN 2/3/MIN+3 + +start end step length/first/last +----------------------------------------- +MIN+1 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 0 -1 0 +MIN+1 0 1 MAX/MIN+1/-1 +MIN+1 0 -2 0 +MIN+1 0 2 1073741824/MIN+1/-1 +MIN+1 0 -3 0 +MIN+1 0 3 715827883/MIN+1/-1 +MIN+1 0 17 126322568/MIN+1/-8 +MIN+1 0 127 16909321/MIN+1/-7 +MIN+1 0 MIN+1 0 +MIN+1 0 MAX 1/MIN+1/MIN+1 +MIN+1 0 MIN 0 +MIN+1 -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 -1 -1 0 +MIN+1 -1 1 MAX-1/MIN+1/-2 +MIN+1 -1 -2 0 +MIN+1 -1 2 1073741823/MIN+1/-3 +MIN+1 -1 -3 0 +MIN+1 -1 3 715827882/MIN+1/-4 +MIN+1 -1 17 126322568/MIN+1/-8 +MIN+1 -1 127 16909321/MIN+1/-7 +MIN+1 -1 MIN+1 0 +MIN+1 -1 MAX 1/MIN+1/MIN+1 +MIN+1 -1 MIN 0 +MIN+1 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 1 -1 0 +MIN+1 1 1 --- + java.lang.IllegalArgumentException: -2147483647 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 1 -2 0 +MIN+1 1 2 1073741824/MIN+1/-1 +MIN+1 1 -3 0 +MIN+1 1 3 715827883/MIN+1/-1 +MIN+1 1 17 126322568/MIN+1/-8 +MIN+1 1 127 16909321/MIN+1/-7 +MIN+1 1 MIN+1 0 +MIN+1 1 MAX 2/MIN+1/0 +MIN+1 1 MIN 0 +MIN+1 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 3 -1 0 +MIN+1 3 1 --- + java.lang.IllegalArgumentException: -2147483647 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 3 -2 0 +MIN+1 3 2 1073741825/MIN+1/1 +MIN+1 3 -3 0 +MIN+1 3 3 715827884/MIN+1/2 +MIN+1 3 17 126322568/MIN+1/-8 +MIN+1 3 127 16909321/MIN+1/-7 +MIN+1 3 MIN+1 0 +MIN+1 3 MAX 2/MIN+1/0 +MIN+1 3 MIN 0 +MIN+1 MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN+1 -1 0 +MIN+1 MIN+1 1 0 +MIN+1 MIN+1 -2 0 +MIN+1 MIN+1 2 0 +MIN+1 MIN+1 -3 0 +MIN+1 MIN+1 3 0 +MIN+1 MIN+1 17 0 +MIN+1 MIN+1 127 0 +MIN+1 MIN+1 MIN+1 0 +MIN+1 MIN+1 MAX 0 +MIN+1 MIN+1 MIN 0 +MIN+1 MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MAX -1 0 +MIN+1 MAX 1 --- + java.lang.IllegalArgumentException: -2147483647 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN+1 MAX -2 0 +MIN+1 MAX 2 MAX/MIN+1/MAX-2 +MIN+1 MAX -3 0 +MIN+1 MAX 3 1431655765/MIN+1/MAX-2 +MIN+1 MAX 17 252645135/MIN+1/MAX-16 +MIN+1 MAX 127 33818641/MIN+1/MAX-14 +MIN+1 MAX MIN+1 0 +MIN+1 MAX MAX 2/MIN+1/0 +MIN+1 MAX MIN 0 +MIN+1 MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN+1 MIN -1 1/MIN+1/MIN+1 +MIN+1 MIN 1 0 +MIN+1 MIN -2 1/MIN+1/MIN+1 +MIN+1 MIN 2 0 +MIN+1 MIN -3 1/MIN+1/MIN+1 +MIN+1 MIN 3 0 +MIN+1 MIN 17 0 +MIN+1 MIN 127 0 +MIN+1 MIN MIN+1 1/MIN+1/MIN+1 +MIN+1 MIN MAX 0 +MIN+1 MIN MIN 1/MIN+1/MIN+1 + +start end step length/first/last +----------------------------------------- +MAX 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 0 -1 MAX/MAX/1 +MAX 0 1 0 +MAX 0 -2 1073741824/MAX/1 +MAX 0 2 0 +MAX 0 -3 715827883/MAX/1 +MAX 0 3 0 +MAX 0 17 0 +MAX 0 127 0 +MAX 0 MIN+1 1/MAX/MAX +MAX 0 MAX 0 +MAX 0 MIN 1/MAX/MAX +MAX -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX -1 -1 --- + java.lang.IllegalArgumentException: 2147483647 until -1 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX -1 1 0 +MAX -1 -2 1073741824/MAX/1 +MAX -1 2 0 +MAX -1 -3 715827883/MAX/1 +MAX -1 3 0 +MAX -1 17 0 +MAX -1 127 0 +MAX -1 MIN+1 2/MAX/0 +MAX -1 MAX 0 +MAX -1 MIN 1/MAX/MAX +MAX 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 1 -1 MAX-1/MAX/2 +MAX 1 1 0 +MAX 1 -2 1073741823/MAX/3 +MAX 1 2 0 +MAX 1 -3 715827882/MAX/4 +MAX 1 3 0 +MAX 1 17 0 +MAX 1 127 0 +MAX 1 MIN+1 1/MAX/MAX +MAX 1 MAX 0 +MAX 1 MIN 1/MAX/MAX +MAX 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX 3 -1 MAX-3/MAX/4 +MAX 3 1 0 +MAX 3 -2 1073741822/MAX/5 +MAX 3 2 0 +MAX 3 -3 715827882/MAX/4 +MAX 3 3 0 +MAX 3 17 0 +MAX 3 127 0 +MAX 3 MIN+1 1/MAX/MAX +MAX 3 MAX 0 +MAX 3 MIN 1/MAX/MAX +MAX MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN+1 -1 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483647 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN+1 1 0 +MAX MIN+1 -2 MAX/MAX/MIN+3 +MAX MIN+1 2 0 +MAX MIN+1 -3 1431655765/MAX/MIN+3 +MAX MIN+1 3 0 +MAX MIN+1 17 0 +MAX MIN+1 127 0 +MAX MIN+1 MIN+1 2/MAX/0 +MAX MIN+1 MAX 0 +MAX MIN+1 MIN 2/MAX/-1 +MAX MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MAX -1 0 +MAX MAX 1 0 +MAX MAX -2 0 +MAX MAX 2 0 +MAX MAX -3 0 +MAX MAX 3 0 +MAX MAX 17 0 +MAX MAX 127 0 +MAX MAX MIN+1 0 +MAX MAX MAX 0 +MAX MAX MIN 0 +MAX MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MAX MIN -1 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483648 by -1: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 1 0 +MAX MIN -2 --- + java.lang.IllegalArgumentException: 2147483647 until -2147483648 by -2: seqs cannot contain more than Int.MaxValue elements. +MAX MIN 2 0 +MAX MIN -3 1431655765/MAX/MIN+3 +MAX MIN 3 0 +MAX MIN 17 0 +MAX MIN 127 0 +MAX MIN MIN+1 3/MAX/MIN+1 +MAX MIN MAX 0 +MAX MIN MIN 2/MAX/-1 + +start end step length/first/last +----------------------------------------- +MIN 0 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 0 -1 0 +MIN 0 1 --- + java.lang.IllegalArgumentException: -2147483648 until 0 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 0 -2 0 +MIN 0 2 1073741824/MIN/-2 +MIN 0 -3 0 +MIN 0 3 715827883/MIN/-2 +MIN 0 17 126322568/MIN/-9 +MIN 0 127 16909321/MIN/-8 +MIN 0 MIN+1 0 +MIN 0 MAX 2/MIN/-1 +MIN 0 MIN 0 +MIN -1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN -1 -1 0 +MIN -1 1 MAX/MIN/-2 +MIN -1 -2 0 +MIN -1 2 1073741824/MIN/-2 +MIN -1 -3 0 +MIN -1 3 715827883/MIN/-2 +MIN -1 17 126322568/MIN/-9 +MIN -1 127 16909321/MIN/-8 +MIN -1 MIN+1 0 +MIN -1 MAX 1/MIN/MIN +MIN -1 MIN 0 +MIN 1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 1 -1 0 +MIN 1 1 --- + java.lang.IllegalArgumentException: -2147483648 until 1 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 1 -2 0 +MIN 1 2 1073741825/MIN/0 +MIN 1 -3 0 +MIN 1 3 715827883/MIN/-2 +MIN 1 17 126322568/MIN/-9 +MIN 1 127 16909321/MIN/-8 +MIN 1 MIN+1 0 +MIN 1 MAX 2/MIN/-1 +MIN 1 MIN 0 +MIN 3 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN 3 -1 0 +MIN 3 1 --- + java.lang.IllegalArgumentException: -2147483648 until 3 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN 3 -2 0 +MIN 3 2 1073741826/MIN/2 +MIN 3 -3 0 +MIN 3 3 715827884/MIN/1 +MIN 3 17 126322568/MIN/-9 +MIN 3 127 16909321/MIN/-8 +MIN 3 MIN+1 0 +MIN 3 MAX 2/MIN/-1 +MIN 3 MIN 0 +MIN MIN+1 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN+1 -1 0 +MIN MIN+1 1 1/MIN/MIN +MIN MIN+1 -2 0 +MIN MIN+1 2 1/MIN/MIN +MIN MIN+1 -3 0 +MIN MIN+1 3 1/MIN/MIN +MIN MIN+1 17 1/MIN/MIN +MIN MIN+1 127 1/MIN/MIN +MIN MIN+1 MIN+1 0 +MIN MIN+1 MAX 1/MIN/MIN +MIN MIN+1 MIN 0 +MIN MAX 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MAX -1 0 +MIN MAX 1 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -2 0 +MIN MAX 2 --- + java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 2: seqs cannot contain more than Int.MaxValue elements. +MIN MAX -3 0 +MIN MAX 3 1431655765/MIN/MAX-3 +MIN MAX 17 252645135/MIN/MAX-17 +MIN MAX 127 33818641/MIN/MAX-15 +MIN MAX MIN+1 0 +MIN MAX MAX 3/MIN/MAX-1 +MIN MAX MIN 0 +MIN MIN 0 --- + java.lang.IllegalArgumentException: step cannot be 0. +MIN MIN -1 0 +MIN MIN 1 0 +MIN MIN -2 0 +MIN MIN 2 0 +MIN MIN -3 0 +MIN MIN 3 0 +MIN MIN 17 0 +MIN MIN 127 0 +MIN MIN MIN+1 0 +MIN MIN MAX 0 +MIN MIN MIN 0 + diff --git a/tests/pending/run/range-unit.scala b/tests/pending/run/range-unit.scala new file mode 100644 index 000000000000..730a1d7c1767 --- /dev/null +++ b/tests/pending/run/range-unit.scala @@ -0,0 +1,55 @@ +import scala.collection.immutable.Range + +object Test { + // ha ha, I always forget math.abs(Int.MinValue) == Int.MinValue + val numbers = ( + ( (-3 to 3) ++ List(17, 127, Int.MaxValue, Int.MinValue + 1) + ).distinct.sortBy(n => (math.abs(n), n)) + ) :+ Int.MinValue + + // reducing output a little + val endpoints = numbers filterNot Set(-3, -2, 2, 17, 127) + + def num(n: Int) = { + val frommax = Int.MaxValue - n + val frommin = Int.MinValue - n + + if (n > 0) { + if (frommax == 0) "MAX" + else if (frommax < 1000) "MAX-" + frommax + else "" + n + } + else { + if (frommin == 0) "MIN" + else if (frommin > -1000) "MIN+" + (-frommin) + else "" + n + } + } + + def run[T](body: => Range): List[Any] = { + try { val r = body ; if (r.isEmpty) List(r.length) else List(num(r.length), num(r.head), num(r.last)) } + catch { case e: IllegalArgumentException => List("---\n " + e) } + } + + def runGroup(label: String, f: (Int, Int, Int) => Range): Unit = { + println(">>> " + label + " <<<\n") + for (start <- endpoints) { + val s = "%-7s %-7s %-7s %s".format("start", "end", "step", "length/first/last") + println(s + "\n" + ("-" * s.length)) + for (end <- endpoints ; step <- numbers) { + print("%-7s %-7s %-7s ".format(num(start), num(end), num(step))) + println(run(f(start, end, step)).mkString("/")) + } + println("") + } + } + + def main(args: Array[String]): Unit = { + runGroup("Range.inclusive", Range.inclusive(_, _, _)) + runGroup("Range.apply", Range.apply(_, _, _)) + runGroup("start to end", (x, y, _) => x to y) + runGroup("start to end by step", _ to _ by _) + runGroup("start until end", (x, y, _) => x until y) + runGroup("start until end by step", _ until _ by _) + } +} diff --git a/tests/pending/run/range.scala b/tests/pending/run/range.scala new file mode 100644 index 000000000000..ee934f6279a6 --- /dev/null +++ b/tests/pending/run/range.scala @@ -0,0 +1,83 @@ +import scala.collection.immutable.{ Range, NumericRange } + +object Test { + def rangeForeach(range : Range) = { + val buffer = new scala.collection.mutable.ListBuffer[Int]; + range.foreach(buffer += _); + assert(buffer.toList == range.iterator.toList, buffer.toList+"/"+range.iterator.toList) + } + + def boundaryTests() = { + // #4321 + assert((Int.MinValue to Int.MaxValue by Int.MaxValue).size == 3) + // #4308 + val caught = ( + try { (Long.MinValue to Long.MaxValue).sum ; false } + catch { case _: IllegalArgumentException => true } + ) + assert(caught) + // #7432 + val noElemAtMin = ( + try { (10 until 10).min ; false } + catch { case _: NoSuchElementException => true } + ) + assert(noElemAtMin) + val noElemAtMax = ( + try { (10 until 10).max ; false } + catch { case _: NoSuchElementException => true } + ) + assert(noElemAtMax) + } + + case class GR[T](val x: T)(implicit val num: Integral[T]) { + import num._ + + def negated = GR[T](-x) + + def gr1 = NumericRange(x, x, x) + def gr2 = NumericRange.inclusive(x, x, x) + def gr3 = NumericRange(x, x * fromInt(10), x) + def gr4 = NumericRange.inclusive(x, x * fromInt(10), x) + def gr5 = gr3.toList ::: negated.gr3.toList + + def check = { + assert(gr1.isEmpty && !gr2.isEmpty) + assert(gr3.size == 9 && gr4.size == 10) + assert(gr5.sum == num.zero, gr5.toString) + assert(!(gr3 contains (x * fromInt(10)))) + assert((gr4 contains (x * fromInt(10)))) + } + } + + def main(args: Array[String]): Unit = { + implicit val imp1: Numeric.BigDecimalAsIfIntegral.type = Numeric.BigDecimalAsIfIntegral + implicit val imp2: Numeric.DoubleAsIfIntegral.type = Numeric.DoubleAsIfIntegral + + val _grs = List[GR[_]]( + GR(BigDecimal(5.0)), + GR(BigInt(5)), + GR(5L), + GR(5.0d), + GR(2.toByte) + ) + val grs = _grs ::: (_grs map (_.negated)) + grs foreach (_.check) + + assert(NumericRange(1, 10, 1) sameElements (1 until 10)) + assert(NumericRange.inclusive(1, 10, 1) sameElements (1 to 10)) + assert(NumericRange.inclusive(1, 100, 3) sameElements (1 to 100 by 3)) + + // #2518 + assert((3L to 7 by 2) sameElements List(3L, 5L, 7L)) + + rangeForeach(1 to 10); + rangeForeach(1 until 10); + rangeForeach(10 to 1 by -1); + rangeForeach(10 until 1 by -1); + rangeForeach(10 to 1 by -3); + rangeForeach(10 until 1 by -3); + + // living on the edges + boundaryTests() + } +} diff --git a/tests/pending/run/rawstrings.check b/tests/pending/run/rawstrings.check new file mode 100644 index 000000000000..2b6c40725a57 --- /dev/null +++ b/tests/pending/run/rawstrings.check @@ -0,0 +1 @@ +[\n\t'"$\n] diff --git a/tests/pending/run/rawstrings.scala b/tests/pending/run/rawstrings.scala new file mode 100644 index 000000000000..bf4c684f3bc5 --- /dev/null +++ b/tests/pending/run/rawstrings.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(raw"[\n\t'${'"'}$$\n]") +} diff --git a/tests/pending/run/records.scala b/tests/pending/run/records.scala new file mode 100644 index 000000000000..f2b582b9509e --- /dev/null +++ b/tests/pending/run/records.scala @@ -0,0 +1,30 @@ + +import scala.language.{ reflectiveCalls } + +trait C { + def f: Int +} + +object Test { + type T = C { + def f: Int + def g: String + } + + val x: T = new C { + def f = 1 + def g = "hello" + } + + val y = new C { + def f = 2 + def g = " world" + } + + val z: T = y + + def main(args: Array[String]): Unit = { + assert(x.f+z.f == 3) + assert(x.g+z.g == "hello world") + } +} diff --git a/tests/pending/run/reflect-priv-ctor.check b/tests/pending/run/reflect-priv-ctor.check new file mode 100644 index 000000000000..a0fb1943b75a --- /dev/null +++ b/tests/pending/run/reflect-priv-ctor.check @@ -0,0 +1 @@ +privately constructed diff --git a/tests/pending/run/reflect-priv-ctor.scala b/tests/pending/run/reflect-priv-ctor.scala new file mode 100644 index 000000000000..9cb3e658cd3d --- /dev/null +++ b/tests/pending/run/reflect-priv-ctor.scala @@ -0,0 +1,22 @@ + +import language.postfixOps +import reflect.runtime._ +import universe._ + +object Test { + + class Foo private () { + override def toString = "privately constructed" + } + + def main(args: Array[String]): Unit = { + + //val foo = new Foo // no access + val klass = currentMirror reflectClass typeOf[Foo].typeSymbol.asClass + val init = typeOf[Foo].members find { case m: MethodSymbol => m.isConstructor case _ => false } get + val ctor = klass reflectConstructor init.asMethod + val foo = ctor() // no access? + Console println foo + } +} + diff --git a/tests/pending/run/reflection-allmirrors-tostring.check b/tests/pending/run/reflection-allmirrors-tostring.check new file mode 100644 index 000000000000..3003cce6c04c --- /dev/null +++ b/tests/pending/run/reflection-allmirrors-tostring.check @@ -0,0 +1,14 @@ +class mirror for C (bound to null) +module mirror for M (bound to null) +instance mirror for an instance of C +field mirror for private[this] val f1: Int (bound to an instance of C) +field mirror for private[this] var f2: Int (bound to an instance of C) +method mirror for def m1: Int (bound to an instance of C) +method mirror for def m2(): Int (bound to an instance of C) +method mirror for def m3[T >: String <: Int]: T (bound to an instance of C) +method mirror for def m4[A[_], B <: A[Int]](x: A[B])(implicit y: Int): Nothing (bound to an instance of C) +method mirror for def m5(x: => Int,y: Int*): String (bound to an instance of C) +class mirror for C.C (bound to an instance of C) +module mirror for C.M (bound to an instance of C) +constructor mirror for def (): C (bound to null) +constructor mirror for def (): C.this.C (bound to an instance of C) diff --git a/tests/pending/run/reflection-allmirrors-tostring.scala b/tests/pending/run/reflection-allmirrors-tostring.scala new file mode 100644 index 000000000000..bc2c080abafe --- /dev/null +++ b/tests/pending/run/reflection-allmirrors-tostring.scala @@ -0,0 +1,44 @@ +import scala.language.higherKinds +import scala.reflect.runtime.universe._ + +class C { + val f1 = 2 + var f2 = 3 + + def m1 = 4 + def m2() = 5 + def m3[T >: String <: Int]: T = ??? + def m4[A[_], B <: A[Int]](x: A[B])(implicit y: Int) = ??? + def m5(x: => Int, y: Int*): String = ??? + + class C + object M + + override def toString = "an instance of C" +} +object M + +object Test extends dotty.runtime.LegacyApp { + val cm = scala.reflect.runtime.currentMirror +// println(cm) + + println(cm.reflectClass(cm.staticClass("C"))) + println(cm.reflectModule(cm.staticModule("M"))) + println(cm.reflect(new C)) + + val im = cm.reflect(new C) + println(im.reflectField(typeOf[C].member(TermName("f1")).asTerm)) + println(im.reflectField(typeOf[C].member(TermName("f2")).asTerm)) + println(im.reflectMethod(typeOf[C].member(TermName("m1")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m2")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m3")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m4")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m5")).asMethod)) + println(im.reflectClass(typeOf[C].member(TypeName("C")).asClass)) + println(im.reflectModule(typeOf[C].member(TermName("M")).asModule)) + + val c = cm.staticClass("C") + val cc = typeOf[C].member(TypeName("C")).asClass + println(cm.reflectClass(c).reflectConstructor(c.info.member(termNames.CONSTRUCTOR).asMethod)) + println(im.reflectClass(cc).reflectConstructor(cc.info.member(termNames.CONSTRUCTOR).asMethod)) +} diff --git a/tests/pending/run/reflection-attachments.check b/tests/pending/run/reflection-attachments.check new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/pending/run/reflection-companion.check b/tests/pending/run/reflection-companion.check new file mode 100644 index 000000000000..5dbff9960e5b --- /dev/null +++ b/tests/pending/run/reflection-companion.check @@ -0,0 +1,6 @@ +C#MOD +C#CLS +C#CLS +NoSymbol#??? +NoSymbol#??? +NoSymbol#??? diff --git a/tests/pending/run/reflection-companion.scala b/tests/pending/run/reflection-companion.scala new file mode 100644 index 000000000000..f5c6702c1b76 --- /dev/null +++ b/tests/pending/run/reflection-companion.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C +object C + +object Test extends dotty.runtime.LegacyApp { + type T = C + + println(showRaw(symbolOf[C].companion, printKinds = true)) + println(showRaw(symbolOf[C].companion.companion, printKinds = true)) + println(showRaw(symbolOf[C.type].companion, printKinds = true)) + println(showRaw(symbolOf[T].companion, printKinds = true)) + println(showRaw(cm.staticPackage("scala").moduleClass.companion, printKinds = true)) + println(showRaw(cm.staticPackage("scala").companion, printKinds = true)) +} diff --git a/tests/pending/run/reflection-companiontype.check b/tests/pending/run/reflection-companiontype.check new file mode 100644 index 000000000000..f87bc044809c --- /dev/null +++ b/tests/pending/run/reflection-companiontype.check @@ -0,0 +1,12 @@ +TypeRefs +TypeRef(ThisType(#PKC), C#MODC, List()) +TypeRef(ThisType(#PKC), C#CLS, List()) +TypeRef(ThisType(#PKC), C#CLS, List()) +ClassInfoTypes +TypeRef(ThisType(#PKC), C#MODC, List()) +TypeRef(ThisType(#PKC), C#CLS, List()) +TypeRef(ThisType(#PKC), C#CLS, List()) +Unrelated +NoType +NoType +NoType diff --git a/tests/pending/run/reflection-companiontype.scala b/tests/pending/run/reflection-companiontype.scala new file mode 100644 index 000000000000..099f1013a54b --- /dev/null +++ b/tests/pending/run/reflection-companiontype.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C +object C + +object Test extends dotty.runtime.LegacyApp { + type T = C + + println("TypeRefs") + println(showRaw(typeOf[C].companion, printKinds = true)) + println(showRaw(typeOf[C].companion.companion, printKinds = true)) + println(showRaw(typeOf[C.type].companion, printKinds = true)) + println("ClassInfoTypes") + println(showRaw(typeOf[C].typeSymbol.info.companion, printKinds = true)) + println(showRaw(typeOf[C].typeSymbol.info.companion.typeSymbol.info.companion, printKinds = true)) + println(showRaw(typeOf[C.type].typeSymbol.info.companion, printKinds = true)) + println("Unrelated") + println(showRaw(typeOf[T].companion, printKinds = true)) + println(showRaw(cm.staticPackage("scala").moduleClass.asType.toType.companion, printKinds = true)) + println(showRaw(cm.staticPackage("scala").info.companion, printKinds = true)) +} diff --git a/tests/pending/run/reflection-constructormirror-inner-badpath.check b/tests/pending/run/reflection-constructormirror-inner-badpath.check new file mode 100644 index 000000000000..83852aa80b96 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-inner-badpath.check @@ -0,0 +1,2 @@ +class R is an inner class, use reflectClass on an InstanceMirror to obtain its ClassMirror +() diff --git a/tests/pending/run/reflection-constructormirror-inner-badpath.scala b/tests/pending/run/reflection-constructormirror-inner-badpath.scala new file mode 100644 index 000000000000..44743d137ca9 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-inner-badpath.scala @@ -0,0 +1,32 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +class Foo{ + case class R( + sales : Int, + name : String + ) + + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + try { + val cls = cm.reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } + +} +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-constructormirror-inner-good.check b/tests/pending/run/reflection-constructormirror-inner-good.check new file mode 100644 index 000000000000..d38fb33f9761 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-inner-good.check @@ -0,0 +1 @@ +R(5,test) diff --git a/tests/pending/run/reflection-constructormirror-inner-good.scala b/tests/pending/run/reflection-constructormirror-inner-good.scala new file mode 100644 index 000000000000..0d00f24e16d6 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-inner-good.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +class Foo{ + case class R( + sales : Int, + name : String + ) + + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + val cls = cm.reflect( this ).reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + } + +} +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-constructormirror-nested-badpath.check b/tests/pending/run/reflection-constructormirror-nested-badpath.check new file mode 100644 index 000000000000..4c65b8a58b38 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-nested-badpath.check @@ -0,0 +1,2 @@ +class R is a static class, use reflectClass on a RuntimeMirror to obtain its ClassMirror +() diff --git a/tests/pending/run/reflection-constructormirror-nested-badpath.scala b/tests/pending/run/reflection-constructormirror-nested-badpath.scala new file mode 100644 index 000000000000..fa8ff04d3d5c --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-nested-badpath.scala @@ -0,0 +1,32 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +class Foo{ + import Test._ + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + try { + val cls = cm.reflect( this ).reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } + +} +object Test extends dotty.runtime.LegacyApp{ + case class R( + sales : Int, + name : String + ) + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-constructormirror-nested-good.check b/tests/pending/run/reflection-constructormirror-nested-good.check new file mode 100644 index 000000000000..d38fb33f9761 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-nested-good.check @@ -0,0 +1 @@ +R(5,test) diff --git a/tests/pending/run/reflection-constructormirror-nested-good.scala b/tests/pending/run/reflection-constructormirror-nested-good.scala new file mode 100644 index 000000000000..94ddfac33464 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-nested-good.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +class Foo{ + import Test._ + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + val cls = cm.reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + } +} + +object Test extends dotty.runtime.LegacyApp{ + case class R( + sales : Int, + name : String + ) + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-constructormirror-toplevel-badpath.check b/tests/pending/run/reflection-constructormirror-toplevel-badpath.check new file mode 100644 index 000000000000..4c65b8a58b38 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-toplevel-badpath.check @@ -0,0 +1,2 @@ +class R is a static class, use reflectClass on a RuntimeMirror to obtain its ClassMirror +() diff --git a/tests/pending/run/reflection-constructormirror-toplevel-badpath.scala b/tests/pending/run/reflection-constructormirror-toplevel-badpath.scala new file mode 100644 index 000000000000..e5d3756a0bb7 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-toplevel-badpath.scala @@ -0,0 +1,33 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +case class R( + sales : Int, + name : String +) + +class Foo{ + import Test._ + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + try { + val cls = cm.reflect( this ).reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-constructormirror-toplevel-good.check b/tests/pending/run/reflection-constructormirror-toplevel-good.check new file mode 100644 index 000000000000..d38fb33f9761 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-toplevel-good.check @@ -0,0 +1 @@ +R(5,test) diff --git a/tests/pending/run/reflection-constructormirror-toplevel-good.scala b/tests/pending/run/reflection-constructormirror-toplevel-good.scala new file mode 100644 index 000000000000..f16f8c734af4 --- /dev/null +++ b/tests/pending/run/reflection-constructormirror-toplevel-good.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +case class R( + sales : Int, + name : String +) + +class Foo{ + import Test._ + def foo = { + val expectedType = implicitly[TypeTag[R]] + val classTag = implicitly[ClassTag[R]] + val cl = classTag.runtimeClass.getClassLoader + val cm = runtimeMirror(cl) + val constructor = expectedType.tpe.member( termNames.CONSTRUCTOR ).asMethod + val sig = constructor.info + val sym = cm.classSymbol( classTag.runtimeClass ) + val cls = cm.reflectClass( sym ) + cls.reflectConstructor( constructor )( 5,"test" ).asInstanceOf[R] + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println( foo.foo ) +} diff --git a/tests/pending/run/reflection-enclosed-basic.check b/tests/pending/run/reflection-enclosed-basic.check new file mode 100644 index 000000000000..6210b42ea5b5 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-basic.check @@ -0,0 +1,18 @@ +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-basic.scala b/tests/pending/run/reflection-enclosed-basic.scala new file mode 100644 index 000000000000..4bb3f62d982f --- /dev/null +++ b/tests/pending/run/reflection-enclosed-basic.scala @@ -0,0 +1,46 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +class B1 { override def toString = "B1"; def foo = 1 } +private class B2 { override def toString = "B2"; def foo = 2 } +object B3 { override def toString = "B3"; def foo = 3 } +private object B4 { override def toString = "B4"; def foo = 4 } +object B5 extends B1 { override def toString = "B5"; override def foo = 5 } +private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } + +object Test extends dotty.runtime.LegacyApp { + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testNestedClass(name: String) = { + val sym = cm.staticClass(name) + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testNestedClass("B1") + testNestedClass("B2") + + def testNestedModule(name: String) = { + val sym = cm.staticModule(name) + println(sym) + val moduleMirror = cm.reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testNestedModule("B3") + testNestedModule("B4") + testNestedModule("B5") + testNestedModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-inner-basic.check b/tests/pending/run/reflection-enclosed-inner-basic.check new file mode 100644 index 000000000000..2496ee407b31 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-basic.check @@ -0,0 +1,20 @@ +class B +List(constructor B, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-inner-basic.scala b/tests/pending/run/reflection-enclosed-inner-basic.scala new file mode 100644 index 000000000000..920b78ae4772 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-basic.scala @@ -0,0 +1,52 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +class B { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } +} + +object Test extends dotty.runtime.LegacyApp { + val b = cm.classSymbol(classTag[B].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testInnerClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflect(new B).reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testInnerClass("B1") + testInnerClass("B2") + + def testInnerModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val moduleMirror = cm.reflect(new B).reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testInnerModule("B3") + testInnerModule("B4") + testInnerModule("B5") + testInnerModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-inner-inner-basic.check b/tests/pending/run/reflection-enclosed-inner-inner-basic.check new file mode 100644 index 000000000000..add7a81c0a90 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-inner-basic.check @@ -0,0 +1,20 @@ +class BB +List(constructor BB, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-inner-inner-basic.scala b/tests/pending/run/reflection-enclosed-inner-inner-basic.scala new file mode 100644 index 000000000000..771f0cebb3bd --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-inner-basic.scala @@ -0,0 +1,58 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +class B { + class BB { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } + } +} + +object Test extends dotty.runtime.LegacyApp { + val b = cm.classSymbol(classTag[B#BB].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testInnerClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val outer1 = new B + val outer2 = new outer1.BB + val ctorMirror = cm.reflect(outer2).reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testInnerClass("B1") + testInnerClass("B2") + + def testInnerModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val outer1 = new B + val outer2 = new outer1.BB + val moduleMirror = cm.reflect(outer2).reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testInnerModule("B3") + testInnerModule("B4") + testInnerModule("B5") + testInnerModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-inner-nested-basic.check b/tests/pending/run/reflection-enclosed-inner-nested-basic.check new file mode 100644 index 000000000000..0f5176a6e707 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-nested-basic.check @@ -0,0 +1,20 @@ +object BB +List(constructor BB, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-inner-nested-basic.scala b/tests/pending/run/reflection-enclosed-inner-nested-basic.scala new file mode 100644 index 000000000000..edaf10f5e770 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-inner-nested-basic.scala @@ -0,0 +1,55 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +class B { + object BB { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } + } +} + +object Test extends dotty.runtime.LegacyApp { + val outer1 = new B() + val b = cm.moduleSymbol(classTag[outer1.BB.type].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testNestedClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflect(outer1.BB).reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testNestedClass("B1") + testNestedClass("B2") + + def testNestedModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val moduleMirror = cm.reflect(outer1.BB).reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testNestedModule("B3") + testNestedModule("B4") + testNestedModule("B5") + testNestedModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-nested-basic.check b/tests/pending/run/reflection-enclosed-nested-basic.check new file mode 100644 index 000000000000..b0e61149f865 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-basic.check @@ -0,0 +1,20 @@ +object B +List(constructor B, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-nested-basic.scala b/tests/pending/run/reflection-enclosed-nested-basic.scala new file mode 100644 index 000000000000..f81fa84101d7 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-basic.scala @@ -0,0 +1,52 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +object B { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } +} + +object Test extends dotty.runtime.LegacyApp { + val b = cm.moduleSymbol(classTag[B.type].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testNestedClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testNestedClass("B1") + testNestedClass("B2") + + def testNestedModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val moduleMirror = cm.reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testNestedModule("B3") + testNestedModule("B4") + testNestedModule("B5") + testNestedModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-nested-inner-basic.check b/tests/pending/run/reflection-enclosed-nested-inner-basic.check new file mode 100644 index 000000000000..add7a81c0a90 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-inner-basic.check @@ -0,0 +1,20 @@ +class BB +List(constructor BB, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-nested-inner-basic.scala b/tests/pending/run/reflection-enclosed-nested-inner-basic.scala new file mode 100644 index 000000000000..09290bdcfb0f --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-inner-basic.scala @@ -0,0 +1,54 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +object B { + class BB { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } + } +} + +object Test extends dotty.runtime.LegacyApp { + val b = cm.classSymbol(classTag[B.BB].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testInnerClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflect(new B.BB).reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testInnerClass("B1") + testInnerClass("B2") + + def testInnerModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val moduleMirror = cm.reflect(new B.BB).reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testInnerModule("B3") + testInnerModule("B4") + testInnerModule("B5") + testInnerModule("B6") +} diff --git a/tests/pending/run/reflection-enclosed-nested-nested-basic.check b/tests/pending/run/reflection-enclosed-nested-nested-basic.check new file mode 100644 index 000000000000..0f5176a6e707 --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-nested-basic.check @@ -0,0 +1,20 @@ +object BB +List(constructor BB, class B1, class B2, object B3, object B4, object B5, object B6) +class B1 +B1 +1 +class B2 +B2 +2 +object B3 +B3 +3 +object B4 +B4 +4 +object B5 +B5 +5 +object B6 +B6 +6 diff --git a/tests/pending/run/reflection-enclosed-nested-nested-basic.scala b/tests/pending/run/reflection-enclosed-nested-nested-basic.scala new file mode 100644 index 000000000000..a601f207c55f --- /dev/null +++ b/tests/pending/run/reflection-enclosed-nested-nested-basic.scala @@ -0,0 +1,54 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{classTag, ClassTag} + +object B { + object BB { + class B1 { override def toString = "B1"; def foo = 1 } + private class B2 { override def toString = "B2"; def foo = 2 } + object B3 { override def toString = "B3"; def foo = 3 } + private object B4 { override def toString = "B4"; def foo = 4 } + object B5 extends B1 { override def toString = "B5"; override def foo = 5 } + private object B6 extends B2 { override def toString = "B6"; override def foo = 6 } + } +} + +object Test extends dotty.runtime.LegacyApp { + val b = cm.moduleSymbol(classTag[B.BB.type].runtimeClass) + println(b) + println(b.info.decls.toList) + + def testMethodInvocation(instance: Any) = { + val instanceMirror = cm.reflect(instance) + val method = instanceMirror.symbol.info.decl(TermName("foo")).asMethod + val methodMirror = instanceMirror.reflectMethod(method) + println(methodMirror()) + } + + def testNestedClass(name: String) = { + val sym = b.info.decl(TypeName(name)).asClass + println(sym) + val ctor = sym.info.decl(termNames.CONSTRUCTOR).asMethod + val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) + val instance = ctorMirror() + println(instance) + testMethodInvocation(instance) + } + + testNestedClass("B1") + testNestedClass("B2") + + def testNestedModule(name: String) = { + val sym = b.info.decl(TermName(name)).asModule + println(sym) + val moduleMirror = cm.reflectModule(sym) + val instance = moduleMirror.instance + println(instance) + testMethodInvocation(instance) + } + + testNestedModule("B3") + testNestedModule("B4") + testNestedModule("B5") + testNestedModule("B6") +} diff --git a/tests/pending/run/reflection-equality.check b/tests/pending/run/reflection-equality.check new file mode 100644 index 000000000000..d60d861a90ec --- /dev/null +++ b/tests/pending/run/reflection-equality.check @@ -0,0 +1,51 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class X { + def methodIntIntInt(x: Int, y: Int) = x+y +} +defined class X + +scala> + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.reflect.runtime.{ currentMirror => cm } +import scala.reflect.runtime.{currentMirror=>cm} + +scala> def im: InstanceMirror = cm.reflect(new X) +im: reflect.runtime.universe.InstanceMirror + +scala> val cs: ClassSymbol = im.symbol +cs: reflect.runtime.universe.ClassSymbol = class X + +scala> val ts: Type = cs.info +ts: reflect.runtime.universe.Type = +scala.AnyRef { + def (): X + def methodIntIntInt(x: scala.Int,y: scala.Int): scala.Int +} + +scala> val ms: MethodSymbol = ts.decl(TermName("methodIntIntInt")).asMethod +ms: reflect.runtime.universe.MethodSymbol = method methodIntIntInt + +scala> val MethodType( _, t1 ) = ms.info +t1: reflect.runtime.universe.Type = scala.Int + +scala> val t2 = typeOf[scala.Int] +t2: reflect.runtime.universe.Type = Int + +scala> t1 == t2 +res0: Boolean = false + +scala> t1 =:= t2 +res1: Boolean = true + +scala> t1 <:< t2 +res2: Boolean = true + +scala> t2 <:< t1 +res3: Boolean = true + +scala> :quit diff --git a/tests/pending/run/reflection-equality.scala b/tests/pending/run/reflection-equality.scala new file mode 100644 index 000000000000..0416bc77268e --- /dev/null +++ b/tests/pending/run/reflection-equality.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |class X { + | def methodIntIntInt(x: Int, y: Int) = x+y + |} + | + |import scala.reflect.runtime.universe._ + |import scala.reflect.runtime.{ currentMirror => cm } + |def im: InstanceMirror = cm.reflect(new X) + |val cs: ClassSymbol = im.symbol + |val ts: Type = cs.info + |val ms: MethodSymbol = ts.decl(TermName("methodIntIntInt")).asMethod + |val MethodType( _, t1 ) = ms.info + |val t2 = typeOf[scala.Int] + |t1 == t2 + |t1 =:= t2 + |t1 <:< t2 + |t2 <:< t1 + |""".stripMargin +} diff --git a/tests/pending/run/reflection-fancy-java-classes.check b/tests/pending/run/reflection-fancy-java-classes.check new file mode 100644 index 000000000000..258208dd9959 --- /dev/null +++ b/tests/pending/run/reflection-fancy-java-classes.check @@ -0,0 +1,12 @@ +===== JAVA POV ===== +class Foo_1$1 +getEnclosingClass = class Foo_1 +getEnclosingMethod = null +getEnclosingConstructor = null +isMemberClass = false +isLocalClass = false +isAnonymousClass = true + +===== SCALA POV ===== +class 1 +object Foo_1 diff --git a/tests/pending/run/reflection-fancy-java-classes/Foo_1.java b/tests/pending/run/reflection-fancy-java-classes/Foo_1.java new file mode 100644 index 000000000000..f6fd76124bc6 --- /dev/null +++ b/tests/pending/run/reflection-fancy-java-classes/Foo_1.java @@ -0,0 +1,5 @@ +public class Foo_1 { + public static Bar bar = new Bar(); + private static class Bar { + } +} \ No newline at end of file diff --git a/tests/pending/run/reflection-fancy-java-classes/Test_2.scala b/tests/pending/run/reflection-fancy-java-classes/Test_2.scala new file mode 100644 index 000000000000..2a98b1d37e3d --- /dev/null +++ b/tests/pending/run/reflection-fancy-java-classes/Test_2.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + println("===== JAVA POV =====") + val jfancy = Class.forName("Foo_1$1") + println(jfancy) + println("getEnclosingClass = " + jfancy.getEnclosingClass) + println("getEnclosingMethod = " + jfancy.getEnclosingMethod) + println("getEnclosingConstructor = " + jfancy.getEnclosingConstructor) + println("isMemberClass = " + jfancy.isMemberClass) + println("isLocalClass = " + jfancy.isLocalClass) + println("isAnonymousClass = " + jfancy.isAnonymousClass) + + println("") + println("===== SCALA POV =====") + val sfancy = cm.classSymbol(jfancy) + println(sfancy) + println(sfancy.owner) +} diff --git a/tests/pending/run/reflection-fieldmirror-accessorsareokay.check b/tests/pending/run/reflection-fieldmirror-accessorsareokay.check new file mode 100644 index 000000000000..e6936c8accf9 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-accessorsareokay.check @@ -0,0 +1,6 @@ +true +42 +2 +true +2 +2 diff --git a/tests/pending/run/reflection-fieldmirror-accessorsareokay.scala b/tests/pending/run/reflection-fieldmirror-accessorsareokay.scala new file mode 100644 index 000000000000..9e68104e0cc8 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-accessorsareokay.scala @@ -0,0 +1,29 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { + var x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + + def test(f: Symbol) = { + try { + val fm: FieldMirror = im.reflectField(f.asTerm) + println(fm.symbol.isVar) + println(fm.get) + fm.set(2) + println(fm.get) + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } + + test(cs.info.decl(TermName("x")).asTerm) + test(cs.info.decl(TermName("x_$eq")).asTerm) +} diff --git a/tests/pending/run/reflection-fieldmirror-ctorparam.check b/tests/pending/run/reflection-fieldmirror-ctorparam.check new file mode 100644 index 000000000000..e391e7ccfec3 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-ctorparam.check @@ -0,0 +1,3 @@ +class scala.ScalaReflectionException: Scala field x isn't represented as a Java field, neither it has a Java accessor method +note that private parameters of class constructors don't get mapped onto fields and/or accessors, +unless they are used outside of their declaring constructors. diff --git a/tests/pending/run/reflection-fieldmirror-ctorparam.scala b/tests/pending/run/reflection-fieldmirror-ctorparam.scala new file mode 100644 index 000000000000..20a13ba193fa --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-ctorparam.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A(x: Int) { + private[this] var xx = x + } + + val a = new A(42) + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + val f = cs.info.decl(TermName("x")).asTerm + try { + val fm: FieldMirror = im.reflectField(f) + println(fm.get) + } catch { + case ex: Throwable => + println(s"${ex.getClass}: ${ex.getMessage}") + } +} diff --git a/tests/pending/run/reflection-fieldmirror-getsetval.check b/tests/pending/run/reflection-fieldmirror-getsetval.check new file mode 100644 index 000000000000..1e959a9900f5 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-getsetval.check @@ -0,0 +1,2 @@ +42 +2 diff --git a/tests/pending/run/reflection-fieldmirror-getsetval.scala b/tests/pending/run/reflection-fieldmirror-getsetval.scala new file mode 100644 index 000000000000..94a83ddb19d8 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-getsetval.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { + val x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + val f = cs.info.decl(TermName("x" + termNames.LOCAL_SUFFIX_STRING)).asTerm + val fm: FieldMirror = im.reflectField(f) + println(fm.get) + fm.set(2) + println(fm.get) +} diff --git a/tests/pending/run/reflection-fieldmirror-getsetvar.check b/tests/pending/run/reflection-fieldmirror-getsetvar.check new file mode 100644 index 000000000000..1e959a9900f5 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-getsetvar.check @@ -0,0 +1,2 @@ +42 +2 diff --git a/tests/pending/run/reflection-fieldmirror-getsetvar.scala b/tests/pending/run/reflection-fieldmirror-getsetvar.scala new file mode 100644 index 000000000000..486ac26e734f --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-getsetvar.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { + var x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + val f = cs.info.decl(TermName("x" + termNames.LOCAL_SUFFIX_STRING)).asTerm + val fm: FieldMirror = im.reflectField(f) + println(fm.get) + fm.set(2) + println(fm.get) +} diff --git a/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.check b/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.scala b/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.scala new file mode 100644 index 000000000000..bc45ba0dd3e8 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-nmelocalsuffixstring.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { + var x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + val f = cs.info.decl(TermName("x" + termNames.LOCAL_SUFFIX_STRING)).asTerm + val fm: FieldMirror = im.reflectField(f) + println(fm.symbol.isVar) +} diff --git a/tests/pending/run/reflection-fieldmirror-privatethis.check b/tests/pending/run/reflection-fieldmirror-privatethis.check new file mode 100644 index 000000000000..16010115e16c --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-privatethis.check @@ -0,0 +1,3 @@ +true +42 +2 diff --git a/tests/pending/run/reflection-fieldmirror-privatethis.scala b/tests/pending/run/reflection-fieldmirror-privatethis.scala new file mode 100644 index 000000000000..f6b65fe9bcf5 --- /dev/null +++ b/tests/pending/run/reflection-fieldmirror-privatethis.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { + private[this] var x: Int = 42 + } + + val a = new A + + val im: InstanceMirror = cm.reflect(a) + val cs = im.symbol + val f = cs.info.decl(TermName("x")).asTerm + val fm: FieldMirror = im.reflectField(f) + println(fm.symbol.isVar) + println(fm.get) + fm.set(2) + println(fm.get) +} diff --git a/tests/pending/run/reflection-fieldsymbol-navigation.check b/tests/pending/run/reflection-fieldsymbol-navigation.check new file mode 100644 index 000000000000..ae0597a04516 --- /dev/null +++ b/tests/pending/run/reflection-fieldsymbol-navigation.check @@ -0,0 +1,6 @@ +method x +false +variable x +true +method x +method x_= diff --git a/tests/pending/run/reflection-fieldsymbol-navigation.scala b/tests/pending/run/reflection-fieldsymbol-navigation.scala new file mode 100644 index 000000000000..d3a5a0dc6b8f --- /dev/null +++ b/tests/pending/run/reflection-fieldsymbol-navigation.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ + +class C { + var x = 2 +} + +object Test extends dotty.runtime.LegacyApp { + val x = typeOf[C].member(TermName("x")).asTerm + println(x) + println(x.isVar) + println(x.accessed) + println(x.accessed.asTerm.isVar) + println(x.getter) + println(x.setter) +} diff --git a/tests/pending/run/reflection-idtc.check b/tests/pending/run/reflection-idtc.check new file mode 100644 index 000000000000..9cdeb02f8c9e --- /dev/null +++ b/tests/pending/run/reflection-idtc.check @@ -0,0 +1,6 @@ +[X]X +Int +=== +[X]Id[X] +Id[Int] +Int diff --git a/tests/pending/run/reflection-idtc.scala b/tests/pending/run/reflection-idtc.scala new file mode 100644 index 000000000000..c61b57b56d38 --- /dev/null +++ b/tests/pending/run/reflection-idtc.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val idsym = tb.typecheck(q"type Id[X] = X").symbol.asType + val idTC1 = idsym.info + println(idTC1) + println(appliedType(idTC1, List(typeOf[Int]))) + println("===") + val idTC2 = idsym.toType.etaExpand + println(idTC2) + println(appliedType(idTC2, List(typeOf[Int]))) + println(appliedType(idTC2, List(typeOf[Int])).dealias) +} diff --git a/tests/pending/run/reflection-implClass.scala b/tests/pending/run/reflection-implClass.scala new file mode 100644 index 000000000000..8e91db9a7774 --- /dev/null +++ b/tests/pending/run/reflection-implClass.scala @@ -0,0 +1,40 @@ +/** + * Tries to load a symbol for the `Foo$class` using Scala reflection. + * Since trait implementation classes do not get pickling information + * symbol for them should be created using fallback mechanism + * that exposes Java reflection information dressed up in + * a Scala symbol. + */ +object Test extends dotty.runtime.LegacyApp with Outer { + import scala.reflect.{ClassTag, classTag} + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + + assert(cm.classSymbol(classTag[Foo].runtimeClass).info.decl(TermName("bar")).info == + cm.classSymbol(classTag[Bar].runtimeClass).info.decl(TermName("foo")).info) + + val s1 = implClass(classTag[Foo].runtimeClass) + assert(s1 != NoSymbol) + assert(s1.info != NoType) + assert(s1.companion.info != NoType) + assert(s1.companion.info.decl(TermName("bar")) != NoSymbol) + val s2 = implClass(classTag[Bar].runtimeClass) + assert(s2 != NoSymbol) + assert(s2.info != NoType) + assert(s2.companion.info != NoType) + assert(s2.companion.info.decl(TermName("foo")) != NoSymbol) + def implClass(clazz: Class[_]) = { + val implClass = Class.forName(clazz.getName + "$class") + cm.classSymbol(implClass) + } +} + +trait Foo { + def bar = 1 +} + +trait Outer { + trait Bar { + def foo = 1 + } +} diff --git a/tests/pending/run/reflection-implicit.check b/tests/pending/run/reflection-implicit.check new file mode 100644 index 000000000000..5a88a46f0b96 --- /dev/null +++ b/tests/pending/run/reflection-implicit.check @@ -0,0 +1,2 @@ +List(true, true, true, true) +true diff --git a/tests/pending/run/reflection-implicit.scala b/tests/pending/run/reflection-implicit.scala new file mode 100644 index 000000000000..5523545bf026 --- /dev/null +++ b/tests/pending/run/reflection-implicit.scala @@ -0,0 +1,17 @@ + +import scala.language.implicitConversions +import scala.reflect.runtime.universe._ + +class C { + implicit val v: C = new C + implicit def d(x: C)(implicit c: C): Int = ??? + implicit class X(val x: Int) +} + +object Test extends dotty.runtime.LegacyApp { + val decls = typeOf[C].typeSymbol.info.decls.sorted.toList.filter(sym => !sym.isTerm || (sym.isMethod && !sym.asMethod.isConstructor)) + println(decls map (_.isImplicit)) + val param = decls.find(_.name.toString == "d").get.asMethod.paramLists.last.head + param.info + println(param.isImplicit) +} diff --git a/tests/pending/run/reflection-java-annotations.check b/tests/pending/run/reflection-java-annotations.check new file mode 100644 index 000000000000..842037254ef8 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations.check @@ -0,0 +1,4 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +List(JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[JavaAnnottee_1], v110 = ["hello", "world"], v111 = [classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]], v112 = [FOO, BAR], v113 = [JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v12 = FOO, v13 = JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false)) +======= +new JavaComplexAnnotation_1(v1 = 1, v10 = "hello", v101 = Array(101, 101), v102 = Array(102, 102), v103 = Array('g', 'g'), v104 = Array(104, 104), v105 = Array(105L, 105L), v106 = Array(106.0, 106.0), v107 = Array(107.0, 107.0), v108 = Array(false, true), v11 = classOf[JavaAnnottee_1], v110 = Array("hello", "world"), v111 = Array(classOf[JavaSimpleAnnotation_1], classOf[JavaComplexAnnotation_1]), v112 = Array(FOO, BAR), v113 = Array(new JavaSimpleAnnotation_1(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation_1], v12 = BAR, v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)), v12 = FOO, v13 = new JavaSimpleAnnotation_1(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation_1], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false) diff --git a/tests/pending/run/reflection-java-annotations/JavaAnnottee_1.java b/tests/pending/run/reflection-java-annotations/JavaAnnottee_1.java new file mode 100644 index 000000000000..b241f5d25ea0 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations/JavaAnnottee_1.java @@ -0,0 +1,47 @@ +@JavaComplexAnnotation_1( + v1 = (byte)1, + v2 = (short)2, + v3 = (char)3, + v4 = (int)4, + v5 = (long)5, + v6 = (float)6, + v7 = (double)7, + v10 = "hello", + v11 = JavaAnnottee_1.class, + v12 = JavaSimpleEnumeration_1.FOO, + v13 = @JavaSimpleAnnotation_1( + v1 = (byte)11, + v2 = (short)12, + v3 = (char)13, + v4 = (int)14, + v5 = (long)15, + v6 = (float)16, + v7 = (double)17, + v10 = "world1", + v11 = JavaSimpleAnnotation_1.class, + v12 = JavaSimpleEnumeration_1.FOO + ), + v101 = {(byte)101, (byte)101}, + v102 = {(short)102, (short)102}, + v103 = {(char)103, (char)103}, + v104 = {(int)104, (int)104}, + v105 = {(long)105, (long)105}, + v106 = {(float)106, (float)106}, + v107 = {(double)107, (double)107}, + v108 = {false, true}, + v110 = {"hello", "world"}, + v111 = {JavaSimpleAnnotation_1.class, JavaComplexAnnotation_1.class}, + v112 = {JavaSimpleEnumeration_1.FOO, JavaSimpleEnumeration_1.BAR}, + v113 = {@JavaSimpleAnnotation_1( + v1 = (byte)21, + v2 = (short)22, + v3 = (char)23, + v4 = (int)24, + v5 = (long)25, + v6 = (float)26, + v7 = (double)27, + v10 = "world2", + v11 = JavaComplexAnnotation_1.class, + v12 = JavaSimpleEnumeration_1.BAR + )}) +public class JavaAnnottee_1 {} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-annotations/JavaComplexAnnotation_1.java b/tests/pending/run/reflection-java-annotations/JavaComplexAnnotation_1.java new file mode 100644 index 000000000000..645eeb9399f2 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations/JavaComplexAnnotation_1.java @@ -0,0 +1,34 @@ +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) +public @interface JavaComplexAnnotation_1 { + byte v1(); + short v2(); + char v3(); + int v4(); + long v5(); + float v6(); + double v7(); + boolean v8() default false; + // void v9(); + String v10(); + Class v11(); + JavaSimpleEnumeration_1 v12(); + JavaSimpleAnnotation_1 v13(); + byte[] v101(); + short[] v102(); + char[] v103(); + int[] v104(); + long[] v105(); + float[] v106(); + double[] v107(); + boolean[] v108(); + String[] v110(); + Class[] v111(); + JavaSimpleEnumeration_1[] v112(); + JavaSimpleAnnotation_1[] v113(); +} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-annotations/JavaSimpleAnnotation_1.java b/tests/pending/run/reflection-java-annotations/JavaSimpleAnnotation_1.java new file mode 100644 index 000000000000..c0f92fad2c75 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations/JavaSimpleAnnotation_1.java @@ -0,0 +1,21 @@ +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) +public @interface JavaSimpleAnnotation_1 { + byte v1(); + short v2(); + char v3(); + int v4(); + long v5(); + float v6(); + double v7(); + boolean v8() default false; + // void v9(); + String v10(); + Class v11(); + JavaSimpleEnumeration_1 v12(); +} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-annotations/JavaSimpleEnumeration_1.java b/tests/pending/run/reflection-java-annotations/JavaSimpleEnumeration_1.java new file mode 100644 index 000000000000..5f4dcce8a754 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations/JavaSimpleEnumeration_1.java @@ -0,0 +1,4 @@ +public enum JavaSimpleEnumeration_1 { + FOO, + BAR +} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-annotations/Test_2.scala b/tests/pending/run/reflection-java-annotations/Test_2.scala new file mode 100644 index 000000000000..3623b6bbb450 --- /dev/null +++ b/tests/pending/run/reflection-java-annotations/Test_2.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + val sym = typeOf[JavaAnnottee_1].typeSymbol + sym.info + sym.annotations foreach (_.javaArgs) + println(sym.annotations) + println("=======") + sym.annotations.map(_.tree).map(println) +} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-crtp.check b/tests/pending/run/reflection-java-crtp.check new file mode 100644 index 000000000000..3e5a77e93a0f --- /dev/null +++ b/tests/pending/run/reflection-java-crtp.check @@ -0,0 +1 @@ +(type E,type E,true) diff --git a/tests/pending/run/reflection-java-crtp/JavaSimpleEnumeration_1.java b/tests/pending/run/reflection-java-crtp/JavaSimpleEnumeration_1.java new file mode 100644 index 000000000000..39246141cc25 --- /dev/null +++ b/tests/pending/run/reflection-java-crtp/JavaSimpleEnumeration_1.java @@ -0,0 +1,4 @@ +enum JavaSimpleEnumeration_1 { + FOO, + BAR +} \ No newline at end of file diff --git a/tests/pending/run/reflection-java-crtp/Main_2.scala b/tests/pending/run/reflection-java-crtp/Main_2.scala new file mode 100644 index 000000000000..0ebac1c5790f --- /dev/null +++ b/tests/pending/run/reflection-java-crtp/Main_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + val enum = typeOf[JavaSimpleEnumeration_1].baseClasses(1).asClass + // make sure that the E's in Enum> are represented by the same symbol + val e1 = enum.typeParams(0).asType + val TypeBounds(_, TypeRef(_, _, List(TypeRef(_, e2: TypeSymbol, _)))) = e1.info + println(e1, e2, e1 eq e2) +} \ No newline at end of file diff --git a/tests/pending/run/reflection-magicsymbols-invoke.check b/tests/pending/run/reflection-magicsymbols-invoke.check new file mode 100644 index 000000000000..f580296ae7f6 --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-invoke.check @@ -0,0 +1,119 @@ +============ +Any +it's important to print the list of Any's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +method !=: (x$1: Any)Boolean +method ##: ()Int +method ==: (x$1: Any)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toString: ()java.lang.String +testing Any.!=: false +testing Any.##: 50 +testing Any.==: true +testing Any.asInstanceOf: class scala.ScalaReflectionException: Any.asInstanceOf requires a type argument, it cannot be invoked with mirrors +testing Any.asInstanceOf: class scala.ScalaReflectionException: final def asInstanceOf[T0]: T0 takes 0 arguments +testing Any.equals: true +testing Any.getClass: class java.lang.String +testing Any.hashCode: 50 +testing Any.isInstanceOf: class scala.ScalaReflectionException: Any.isInstanceOf requires a type argument, it cannot be invoked with mirrors +testing Any.isInstanceOf: class scala.ScalaReflectionException: final def isInstanceOf[T0]: Boolean takes 0 arguments +testing Any.toString: 2 +============ +AnyVal +it's important to print the list of AnyVal's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor AnyVal: ()AnyVal +method getClass: ()Class[_ <: AnyVal] +testing AnyVal.: class scala.ScalaReflectionException: unsupported symbol constructor AnyVal when invoking bytecodeless method mirror for def (): AnyVal (bound to null) +testing AnyVal.getClass: class scala.ScalaReflectionException: expected a member of class Integer, you provided method scala.AnyVal.getClass +============ +AnyRef +it's important to print the list of AnyRef's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Object: ()java.lang.Object +method !=: (x$1: Any)Boolean +method ##: ()Int +method $asInstanceOf: [T0]()T0 +method $isInstanceOf: [T0]()Boolean +method ==: (x$1: Any)Boolean +method asInstanceOf: [T0]=> T0 +method clone: ()java.lang.Object +method eq: (x$1: AnyRef)Boolean +method equals: (x$1: Any)Boolean +method finalize: ()Unit +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method ne: (x$1: AnyRef)Boolean +method notify: ()Unit +method notifyAll: ()Unit +method synchronized: [T0](x$1: T0)T0 +method toString: ()java.lang.String +method wait: ()Unit +method wait: (x$1: Long)Unit +method wait: (x$1: Long, x$2: Int)Unit +testing Object.!=: false +testing Object.##: 50 +testing Object.$asInstanceOf: class scala.ScalaReflectionException: AnyRef.$asInstanceOf is an internal method, it cannot be invoked with mirrors +testing Object.$asInstanceOf: class scala.ScalaReflectionException: final def $asInstanceOf[T0](): T0 takes 0 arguments +testing Object.$isInstanceOf: class scala.ScalaReflectionException: AnyRef.$isInstanceOf is an internal method, it cannot be invoked with mirrors +testing Object.$isInstanceOf: class scala.ScalaReflectionException: final def $isInstanceOf[T0](): Boolean takes 0 arguments +testing Object.==: true +testing Object.clone: class java.lang.CloneNotSupportedException: java.lang.String +testing Object.eq: true +testing Object.equals: true +testing Object.finalize: () +testing Object.getClass: class java.lang.String +testing Object.hashCode: 50 +testing Object.ne: false +testing Object.notify: class java.lang.IllegalMonitorStateException: null +testing Object.notifyAll: class java.lang.IllegalMonitorStateException: null +testing Object.synchronized: 2 +testing Object.toString: 2 +TODO: also test AnyRef.wait overloads +============ +Array +it's important to print the list of Array's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Array: (_length: Int)Array[T] +method !=: (x$1: Any)Boolean +method ##: ()Int +method $asInstanceOf: [T0]()T0 +method $isInstanceOf: [T0]()Boolean +method ==: (x$1: Any)Boolean +method apply: (i: Int)T +method asInstanceOf: [T0]=> T0 +method clone: ()Array[T] +method eq: (x$1: AnyRef)Boolean +method equals: (x$1: Any)Boolean +method finalize: ()Unit +method getClass: ()java.lang.Class[_] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method length: => Int +method ne: (x$1: AnyRef)Boolean +method notify: ()Unit +method notifyAll: ()Unit +method synchronized: [T0](x$1: T0)T0 +method toString: ()java.lang.String +method update: (i: Int, x: T)Unit +method wait: ()Unit +method wait: (x$1: Long)Unit +method wait: (x$1: Long, x$2: Int)Unit +value _length: Int +testing Array.length: 2 +testing Array.apply: 1 +testing Array.update: () +testing Array.clone: List(1, 2) +============ +Other +testing String.+: 23 +============ +CTM +testing Predef.classOf: class scala.ScalaReflectionException: Predef.classOf is a compile-time function, it cannot be invoked with mirrors +testing Predef.classOf: class scala.ScalaReflectionException: def classOf[T]: Class[T] takes 0 arguments +testing Universe.reify: class scala.ScalaReflectionException: scala.reflect.api.Universe.reify is a macro, i.e. a compile-time function, it cannot be invoked with mirrors diff --git a/tests/pending/run/reflection-magicsymbols-invoke.scala b/tests/pending/run/reflection-magicsymbols-invoke.scala new file mode 100644 index 000000000000..bbcf8f5245e3 --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-invoke.scala @@ -0,0 +1,100 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.{currentMirror => cm} + +package scala { + object ExceptionUtils { + def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + } +} + +object Test extends dotty.runtime.LegacyApp { + def key(sym: Symbol) = sym + ": " + sym.info + def test(tpe: Type, receiver: Any, method: String, args: Any*): Unit = { + def wrap[T](op: => T) = + try { + var result = op.asInstanceOf[AnyRef] + if (scala.runtime.ScalaRunTime.isArray(result)) + result = scala.runtime.ScalaRunTime.toObjectArray(result).toList + println(result) + } catch { + case ex: Throwable => + val realex = scala.ExceptionUtils.unwrapThrowable(ex) + println(realex.getClass + ": " + realex.getMessage) + } + print(s"testing ${tpe.typeSymbol.name}.$method: ") + wrap({ + if (method == termNames.CONSTRUCTOR.toString) { + val ctor = tpe.decl(termNames.CONSTRUCTOR).asMethod + cm.reflectClass(ctor.owner.asClass).reflectConstructor(ctor)(args: _*) + } else { + val meth = tpe.decl(TermName(method).encodedName.toTermName).asMethod + cm.reflect(receiver).reflectMethod(meth)(args: _*) + } + }) + } + + println("============\nAny") + println("it's important to print the list of Any's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[Any].members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[Any], "2", "!=", "2") + test(typeOf[Any], "2", "##") + test(typeOf[Any], "2", "==", "2") + test(typeOf[Any], "2", "asInstanceOf") + test(typeOf[Any], "2", "asInstanceOf", typeOf[String]) + test(typeOf[Any], "2", "equals", "2") + test(typeOf[Any], "2", "getClass") + test(typeOf[Any], "2", "hashCode") + test(typeOf[Any], "2", "isInstanceOf") + test(typeOf[Any], "2", "isInstanceOf", typeOf[String]) + test(typeOf[Any], "2", "toString") + + println("============\nAnyVal") + println("it's important to print the list of AnyVal's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[AnyVal].decls.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[AnyVal], null, termNames.CONSTRUCTOR.toString) + test(typeOf[AnyVal], 2, "getClass") + + println("============\nAnyRef") + println("it's important to print the list of AnyRef's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + typeOf[AnyRef].members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(typeOf[AnyRef], "2", "!=", "2") + test(typeOf[AnyRef], "2", "##") + test(typeOf[AnyRef], "2", "$asInstanceOf") + test(typeOf[AnyRef], "2", "$asInstanceOf", typeOf[String]) + test(typeOf[AnyRef], "2", "$isInstanceOf") + test(typeOf[AnyRef], "2", "$isInstanceOf", typeOf[String]) + test(typeOf[AnyRef], "2", "==", "2") + test(typeOf[AnyRef], "2", "clone") + test(typeOf[AnyRef], "2", "eq", "2") + test(typeOf[AnyRef], "2", "equals", "2") + test(typeOf[AnyRef], "2", "finalize") + test(typeOf[AnyRef], "2", "getClass") + test(typeOf[AnyRef], "2", "hashCode") + test(typeOf[AnyRef], "2", "ne", "2") + test(typeOf[AnyRef], "2", "notify") + test(typeOf[AnyRef], "2", "notifyAll") + test(typeOf[AnyRef], "2", "synchronized", "2") + test(typeOf[AnyRef], "2", "toString") + println("TODO: also test AnyRef.wait overloads") + + println("============\nArray") + println("it's important to print the list of Array's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + ArrayClass.info.members.toList.sortBy(key).foreach(sym => println(key(sym))) + test(ArrayClass.info, Array(1, 2), "length") + test(ArrayClass.info, Array(1, 2), "apply", 0) + test(ArrayClass.info, Array(1, 2), "update", 0, 0) + test(ArrayClass.info, Array(1, 2), "clone") + + println("============\nOther") + test(typeOf[String], "2", "+", 3) + + println("============\nCTM") + test(PredefModule.moduleClass.info, Predef, "classOf") + test(PredefModule.moduleClass.info, Predef, "classOf", typeOf[String]) + test(typeOf[scala.reflect.api.Universe], scala.reflect.runtime.universe, "reify", "2") +} diff --git a/tests/pending/run/reflection-magicsymbols-repl.check b/tests/pending/run/reflection-magicsymbols-repl.check new file mode 100644 index 000000000000..ca8857ada44e --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-repl.check @@ -0,0 +1,37 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> class A { + def foo1(x: Int*) = ??? + def foo2(x: => Int) = ??? + def foo3(x: Any) = ??? + def foo4(x: AnyRef) = ??? + def foo5(x: AnyVal) = ??? + def foo6(x: Null) = ??? + def foo7(x: Nothing) = ??? + def foo8(x: Singleton) = ??? +} +defined class A + +scala> def test(n: Int): Unit = { + val sig = typeOf[A] member TermName("foo" + n) info + val x = sig.asInstanceOf[MethodType].params.head + println(x.info) +} +warning: there was one feature warning; re-run with -feature for details +test: (n: Int)Unit + +scala> for (i <- 1 to 8) test(i) +scala.Int* +=> scala.Int +scala.Any +scala.AnyRef +scala.AnyVal +scala.Null +scala.Nothing +scala.Singleton + +scala> :quit diff --git a/tests/pending/run/reflection-magicsymbols-repl.scala b/tests/pending/run/reflection-magicsymbols-repl.scala new file mode 100644 index 000000000000..c006e85b3a29 --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-repl.scala @@ -0,0 +1,23 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.reflect.runtime.universe._ + |class A { + | def foo1(x: Int*) = ??? + | def foo2(x: => Int) = ??? + | def foo3(x: Any) = ??? + | def foo4(x: AnyRef) = ??? + | def foo5(x: AnyVal) = ??? + | def foo6(x: Null) = ??? + | def foo7(x: Nothing) = ??? + | def foo8(x: Singleton) = ??? + |} + |def test(n: Int): Unit = { + | val sig = typeOf[A] member TermName("foo" + n) info + | val x = sig.asInstanceOf[MethodType].params.head + | println(x.info) + |} + |for (i <- 1 to 8) test(i) + |""".stripMargin +} diff --git a/tests/pending/run/reflection-magicsymbols-vanilla.check b/tests/pending/run/reflection-magicsymbols-vanilla.check new file mode 100644 index 000000000000..d3ff15289635 --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-vanilla.check @@ -0,0 +1,8 @@ +Int* +=> Int +Any +AnyRef +AnyVal +Null +Nothing +Singleton diff --git a/tests/pending/run/reflection-magicsymbols-vanilla.scala b/tests/pending/run/reflection-magicsymbols-vanilla.scala new file mode 100644 index 000000000000..3de2a5529966 --- /dev/null +++ b/tests/pending/run/reflection-magicsymbols-vanilla.scala @@ -0,0 +1,22 @@ +import scala.language.postfixOps + +class A { + def foo1(x: Int*) = ??? + def foo2(x: => Int) = ??? + def foo3(x: Any) = ??? + def foo4(x: AnyRef) = ??? + def foo5(x: AnyVal) = ??? + def foo6(x: Null) = ??? + def foo7(x: Nothing) = ??? + def foo8(x: Singleton) = ??? +} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + def test(n: Int): Unit = { + val sig = typeOf[A] member TermName("foo" + n) info + val x = sig.asInstanceOf[MethodType].params.head + println(x.info) + } + for (i <- 1 to 8) test(i) +} diff --git a/tests/pending/run/reflection-mem-glbs.scala b/tests/pending/run/reflection-mem-glbs.scala new file mode 100644 index 000000000000..3f29a914bc06 --- /dev/null +++ b/tests/pending/run/reflection-mem-glbs.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.MemoryTest + +trait A { type T <: A } +trait B { type T <: B } + +object Test extends MemoryTest { + override def maxDelta = 10 + override def calcsPerIter = 50000 + override def calc() { + import scala.reflect.runtime.universe._ + glb(List(typeOf[A], typeOf[B])) + } +} \ No newline at end of file diff --git a/tests/pending/run/reflection-mem-tags.scala b/tests/pending/run/reflection-mem-tags.scala new file mode 100644 index 000000000000..8815e7dcd8a0 --- /dev/null +++ b/tests/pending/run/reflection-mem-tags.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.MemoryTest + +trait A { type T <: A } +trait B { type T <: B } + +object Test extends MemoryTest { + override def maxDelta = 10 + override def calcsPerIter = 100000 + override def calc() { + import scala.reflect.runtime.universe._ + def foo = { + class A { def x = 2; def y: A = new A } + weakTypeOf[A { def z: Int }] + } + foo + } +} \ No newline at end of file diff --git a/tests/pending/run/reflection-mem-typecheck.scala b/tests/pending/run/reflection-mem-typecheck.scala new file mode 100644 index 000000000000..e3cabf689dfb --- /dev/null +++ b/tests/pending/run/reflection-mem-typecheck.scala @@ -0,0 +1,26 @@ +import scala.tools.partest.MemoryTest + +trait A { type T <: A } +trait B { type T <: B } + +object Test extends MemoryTest { + lazy val tb = { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + cm.mkToolBox() + } + + override def maxDelta = 10 + override def calcsPerIter = 8 + override def calc() { + var snippet = """ + trait A { type T <: A } + trait B { type T <: B } + def foo[T](x: List[T]) = x + foo(List(new A {}, new B {})) + """.trim + snippet = snippet + "\n" + (List.fill(50)(snippet.split("\n").last) mkString "\n") + tb.typecheck(tb.parse(snippet)) + } +} \ No newline at end of file diff --git a/tests/pending/run/reflection-methodsymbol-params.check b/tests/pending/run/reflection-methodsymbol-params.check new file mode 100644 index 000000000000..554e72d55313 --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-params.check @@ -0,0 +1,8 @@ +List() +List(List()) +List(List(value x)) +List(List(value x), List(value y)) +List() +List(List()) +List(List(value x)) +List(List(value x), List(value y)) diff --git a/tests/pending/run/reflection-methodsymbol-params.scala b/tests/pending/run/reflection-methodsymbol-params.scala new file mode 100644 index 000000000000..bbf578ecb20d --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-params.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ + +class C { + def x1: Int = ??? + def x2(): Int = ??? + def x3(x: Int): Int = ??? + def x4(x: Int)(y: Int): Int = ??? + + def y1[T]: Int = ??? + def y2[T](): Int = ??? + def y3[T](x: Int): Int = ??? + def y4[T](x: Int)(y: Int): Int = ??? +} + +object Test extends dotty.runtime.LegacyApp { + println(typeOf[C].member(TermName("x1")).asMethod.paramLists) + println(typeOf[C].member(TermName("x2")).asMethod.paramLists) + println(typeOf[C].member(TermName("x3")).asMethod.paramLists) + println(typeOf[C].member(TermName("x4")).asMethod.paramLists) + println(typeOf[C].member(TermName("y1")).asMethod.paramLists) + println(typeOf[C].member(TermName("y2")).asMethod.paramLists) + println(typeOf[C].member(TermName("y3")).asMethod.paramLists) + println(typeOf[C].member(TermName("y4")).asMethod.paramLists) +} diff --git a/tests/pending/run/reflection-methodsymbol-returntype.check b/tests/pending/run/reflection-methodsymbol-returntype.check new file mode 100644 index 000000000000..97ea02956d06 --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-returntype.check @@ -0,0 +1,8 @@ +Int +Int +Int +Int +Int +Int +Int +Int diff --git a/tests/pending/run/reflection-methodsymbol-returntype.scala b/tests/pending/run/reflection-methodsymbol-returntype.scala new file mode 100644 index 000000000000..d242d6941874 --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-returntype.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ + +class C { + def x1: Int = ??? + def x2(): Int = ??? + def x3(x: Int): Int = ??? + def x4(x: Int)(y: Int): Int = ??? + + def y1[T]: Int = ??? + def y2[T](): Int = ??? + def y3[T](x: Int): Int = ??? + def y4[T](x: Int)(y: Int): Int = ??? +} + +object Test extends dotty.runtime.LegacyApp { + println(typeOf[C].member(TermName("x1")).asMethod.returnType) + println(typeOf[C].member(TermName("x2")).asMethod.returnType) + println(typeOf[C].member(TermName("x3")).asMethod.returnType) + println(typeOf[C].member(TermName("x4")).asMethod.returnType) + println(typeOf[C].member(TermName("y1")).asMethod.returnType) + println(typeOf[C].member(TermName("y2")).asMethod.returnType) + println(typeOf[C].member(TermName("y3")).asMethod.returnType) + println(typeOf[C].member(TermName("y4")).asMethod.returnType) +} diff --git a/tests/pending/run/reflection-methodsymbol-typeparams.check b/tests/pending/run/reflection-methodsymbol-typeparams.check new file mode 100644 index 000000000000..f04188775c6c --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-typeparams.check @@ -0,0 +1,8 @@ +List() +List() +List() +List() +List(type T) +List(type T) +List(type T) +List(type T) diff --git a/tests/pending/run/reflection-methodsymbol-typeparams.scala b/tests/pending/run/reflection-methodsymbol-typeparams.scala new file mode 100644 index 000000000000..4aa2454ebf33 --- /dev/null +++ b/tests/pending/run/reflection-methodsymbol-typeparams.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ + +class C { + def x1: Int = ??? + def x2(): Int = ??? + def x3(x: Int): Int = ??? + def x4(x: Int)(y: Int): Int = ??? + + def y1[T]: Int = ??? + def y2[T](): Int = ??? + def y3[T](x: Int): Int = ??? + def y4[T](x: Int)(y: Int): Int = ??? +} + +object Test extends dotty.runtime.LegacyApp { + println(typeOf[C].member(TermName("x1")).asMethod.typeParams) + println(typeOf[C].member(TermName("x2")).asMethod.typeParams) + println(typeOf[C].member(TermName("x3")).asMethod.typeParams) + println(typeOf[C].member(TermName("x4")).asMethod.typeParams) + println(typeOf[C].member(TermName("y1")).asMethod.typeParams) + println(typeOf[C].member(TermName("y2")).asMethod.typeParams) + println(typeOf[C].member(TermName("y3")).asMethod.typeParams) + println(typeOf[C].member(TermName("y4")).asMethod.typeParams) +} diff --git a/tests/pending/run/reflection-modulemirror-inner-badpath.check b/tests/pending/run/reflection-modulemirror-inner-badpath.check new file mode 100644 index 000000000000..a8e7397c8fcf --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-inner-badpath.check @@ -0,0 +1,2 @@ +object R is an inner module, use reflectModule on an InstanceMirror to obtain its ModuleMirror +() diff --git a/tests/pending/run/reflection-modulemirror-inner-badpath.scala b/tests/pending/run/reflection-modulemirror-inner-badpath.scala new file mode 100644 index 000000000000..94c3c5e7b4b3 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-inner-badpath.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + object R { override def toString = "R" } + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + try { + val cls = cm.reflectModule(sym) + cls.instance + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-modulemirror-inner-good.check b/tests/pending/run/reflection-modulemirror-inner-good.check new file mode 100644 index 000000000000..331bae08fb73 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-inner-good.check @@ -0,0 +1 @@ +R diff --git a/tests/pending/run/reflection-modulemirror-inner-good.scala b/tests/pending/run/reflection-modulemirror-inner-good.scala new file mode 100644 index 000000000000..8d115d76a994 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-inner-good.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + object R { override def toString = "R" } + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + val cls = cm.reflect(this).reflectModule(sym) + try { + cls.instance + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-modulemirror-nested-badpath.check b/tests/pending/run/reflection-modulemirror-nested-badpath.check new file mode 100644 index 000000000000..3ef94e1ec6b0 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-nested-badpath.check @@ -0,0 +1,2 @@ +object R is a static module, use reflectModule on a RuntimeMirror to obtain its ModuleMirror +() diff --git a/tests/pending/run/reflection-modulemirror-nested-badpath.scala b/tests/pending/run/reflection-modulemirror-nested-badpath.scala new file mode 100644 index 000000000000..d957e45add61 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-nested-badpath.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + try { + val cls = cm.reflect(this).reflectModule(sym) + cls.instance + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } + +} + +object Test extends dotty.runtime.LegacyApp{ + object R { override def toString = "R" } + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-modulemirror-nested-good.check b/tests/pending/run/reflection-modulemirror-nested-good.check new file mode 100644 index 000000000000..331bae08fb73 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-nested-good.check @@ -0,0 +1 @@ +R diff --git a/tests/pending/run/reflection-modulemirror-nested-good.scala b/tests/pending/run/reflection-modulemirror-nested-good.scala new file mode 100644 index 000000000000..a165ecfdf2c5 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-nested-good.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + val cls = cm.reflectModule(sym) + try { + cls.instance + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends dotty.runtime.LegacyApp{ + object R { override def toString = "R" } + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-modulemirror-toplevel-badpath.check b/tests/pending/run/reflection-modulemirror-toplevel-badpath.check new file mode 100644 index 000000000000..3ef94e1ec6b0 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-toplevel-badpath.check @@ -0,0 +1,2 @@ +object R is a static module, use reflectModule on a RuntimeMirror to obtain its ModuleMirror +() diff --git a/tests/pending/run/reflection-modulemirror-toplevel-badpath.scala b/tests/pending/run/reflection-modulemirror-toplevel-badpath.scala new file mode 100644 index 000000000000..35df3eeb1a71 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-toplevel-badpath.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +object R { override def toString = "R" } + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + try { + val cls = cm.reflect(this).reflectModule(sym) + cls.instance + println("this indicates a failure") + } catch { + case ex: Throwable => + println(ex.getMessage) + } + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-modulemirror-toplevel-good.check b/tests/pending/run/reflection-modulemirror-toplevel-good.check new file mode 100644 index 000000000000..ac044e5e4649 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-toplevel-good.check @@ -0,0 +1 @@ +R \ No newline at end of file diff --git a/tests/pending/run/reflection-modulemirror-toplevel-good.scala b/tests/pending/run/reflection-modulemirror-toplevel-good.scala new file mode 100644 index 000000000000..a278b728eaa9 --- /dev/null +++ b/tests/pending/run/reflection-modulemirror-toplevel-good.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +object R { override def toString = "R" } + +class Foo{ + import Test._ + def foo = { + val classTag = implicitly[ClassTag[R.type]] + val sym = cm.moduleSymbol(classTag.runtimeClass) + val cls = cm.reflectModule(sym) + cls.instance + } +} + +object Test extends dotty.runtime.LegacyApp{ + val foo = new Foo + println(foo.foo) +} diff --git a/tests/pending/run/reflection-names.check b/tests/pending/run/reflection-names.check new file mode 100644 index 000000000000..f8cb78cc67b4 --- /dev/null +++ b/tests/pending/run/reflection-names.check @@ -0,0 +1,4 @@ +(java.lang.String,bc) +(scala.reflect.internal.Names$TermName_R,bc) +(scala.reflect.internal.Names$TypeName_R,bc) +(scala.reflect.internal.Names$TypeName_R,bc) diff --git a/tests/pending/run/reflection-names.scala b/tests/pending/run/reflection-names.scala new file mode 100644 index 000000000000..a297b85825b5 --- /dev/null +++ b/tests/pending/run/reflection-names.scala @@ -0,0 +1,15 @@ +import scala.tools.nsc._ + +object Test { + val global = new Global(new Settings()) + import global._ + + val x1 = "abc" drop 1 // "bc": String + val x2 = TermName("abc") drop 1 // "bc": TermName + val x3 = TypeName("abc") drop 1 // "bc": TypeName + val x4 = (TypeName("abc"): Name) drop 1 // "bc": Name + + def main(args: Array[String]): Unit = { + List(x1, x2, x3, x4) foreach (x => println(x.getClass.getName, x)) + } +} diff --git a/tests/pending/run/reflection-repl-classes.check b/tests/pending/run/reflection-repl-classes.check new file mode 100644 index 000000000000..5ebf993a876d --- /dev/null +++ b/tests/pending/run/reflection-repl-classes.check @@ -0,0 +1,33 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class A +defined class A + +scala> + +scala> class B { + def foo(x: A) = 1 +} +defined class B + +scala> + +scala> object defs { + val cm = reflect.runtime.currentMirror + val u = cm.universe + val im = cm.reflect(new B) + val method = im.symbol.info.member(u.TermName("foo")).asMethod + val mm = im.reflectMethod(method) +} +defined object defs + +scala> import defs._ +import defs._ + +scala> + +scala> mm(new A) +res0: Any = 1 + +scala> :quit diff --git a/tests/pending/run/reflection-repl-classes.scala b/tests/pending/run/reflection-repl-classes.scala new file mode 100644 index 000000000000..048e6b8ce0d7 --- /dev/null +++ b/tests/pending/run/reflection-repl-classes.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |class A + | + |class B { + | def foo(x: A) = 1 + |} + | + |object defs { + | val cm = reflect.runtime.currentMirror + | val u = cm.universe + | val im = cm.reflect(new B) + | val method = im.symbol.info.member(u.TermName("foo")).asMethod + | val mm = im.reflectMethod(method) + |} + |import defs._ + | + |mm(new A) + |""".stripMargin +} diff --git a/tests/pending/run/reflection-repl-elementary.check b/tests/pending/run/reflection-repl-elementary.check new file mode 100644 index 000000000000..e948c9fd614b --- /dev/null +++ b/tests/pending/run/reflection-repl-elementary.check @@ -0,0 +1,7 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> scala.reflect.runtime.universe.typeOf[List[Nothing]] +res0: reflect.runtime.universe.Type = scala.List[Nothing] + +scala> :quit diff --git a/tests/pending/run/reflection-repl-elementary.scala b/tests/pending/run/reflection-repl-elementary.scala new file mode 100644 index 000000000000..72b65a1a70d5 --- /dev/null +++ b/tests/pending/run/reflection-repl-elementary.scala @@ -0,0 +1,7 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |scala.reflect.runtime.universe.typeOf[List[Nothing]] + |""".stripMargin +} diff --git a/tests/pending/run/reflection-sanitychecks.check b/tests/pending/run/reflection-sanitychecks.check new file mode 100644 index 000000000000..821457a9998b --- /dev/null +++ b/tests/pending/run/reflection-sanitychecks.check @@ -0,0 +1,30 @@ +=========members of C in a mirror of D========= +field #1: 11 +method #1: 22 +field #2: 13 +method #2: 14 +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: scala.ScalaReflectionException: expected a constructor of class D, you provided constructor C +class: CC +object: CO + +=========members of D in a mirror of D========= +field #1: 21 +method #1: 22 +field #2: 13 +method #2: 14 +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: an instance of class D +class: CC +object: CO + +=========members of E in a mirror of D========= +field #1: scala.ScalaReflectionException: expected a member of class D, you provided value E.foo +method #1: scala.ScalaReflectionException: expected a member of class D, you provided method E.bar +field #2: scala.ScalaReflectionException: expected a member of class D, you provided value E.quux +method #2: scala.ScalaReflectionException: expected a member of class D, you provided method E.baz +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: scala.ScalaReflectionException: expected a constructor of class D, you provided constructor E +class: scala.ScalaReflectionException: expected a member of class D, you provided class E.C +object: scala.ScalaReflectionException: expected a member of class D, you provided object E.O + diff --git a/tests/pending/run/reflection-sanitychecks.scala b/tests/pending/run/reflection-sanitychecks.scala new file mode 100644 index 000000000000..9febed474505 --- /dev/null +++ b/tests/pending/run/reflection-sanitychecks.scala @@ -0,0 +1,49 @@ +class C { + val foo = 11 + def bar = 12 + val quux = 13 + def baz = 14 + class C { override def toString = "CC" } + object O { override def toString = "CO" } + override def toString = "an instance of class C" +} + +class D extends C { + override val foo = 21 + override def bar = 22 + override def toString = "an instance of class D" +} + +class E { + val foo = 31 + def bar = 32 + val quux = 33 + def baz = 34 + class C { override def toString = "EC" } + object O { override def toString = "EO" } + override def toString = "an instance of class E" +} + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + val im = cm.reflect(new D) + + def test(tpe: Type): Unit = { + def failsafe(action: => Any): Any = try action catch { case ex: Throwable => ex.toString } + println(s"=========members of ${tpe.typeSymbol.name} in a mirror of D=========") + println("field #1: " + failsafe(im.reflectField(tpe.member(TermName("foo")).asTerm).get)) + println("method #1: " + failsafe(im.reflectMethod(tpe.member(TermName("bar")).asMethod)())) + println("field #2: " + failsafe(im.reflectField(tpe.member(TermName("quux")).asTerm).get)) + println("method #2: " + failsafe(im.reflectMethod(tpe.member(TermName("baz")).asMethod)())) + println("constructor #1: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("bar")).asMethod)())) + println("constructor #2: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("")).asMethod)())) + println("class: " + failsafe(im.reflectClass(tpe.member(TypeName("C")).asClass).reflectConstructor(typeOf[C].member(TypeName("C")).asClass.info.member(termNames.CONSTRUCTOR).asMethod)())) + println("object: " + failsafe(im.reflectModule(tpe.member(TermName("O")).asModule).instance)) + println() + } + + test(typeOf[C]) + test(typeOf[D]) + test(typeOf[E]) +} diff --git a/tests/pending/run/reflection-scala-annotations.check b/tests/pending/run/reflection-scala-annotations.check new file mode 100644 index 000000000000..5bc27861614a --- /dev/null +++ b/tests/pending/run/reflection-scala-annotations.check @@ -0,0 +1,7 @@ +reflection-scala-annotations.scala:5: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class jann(x: Int, y: Array[Int]) extends ClassfileAnnotation + ^ +new sann(1, immutable.this.List.apply[Int](1, 2)) +new jann(y = Array(1, 2), x = 2) diff --git a/tests/pending/run/reflection-scala-annotations.scala b/tests/pending/run/reflection-scala-annotations.scala new file mode 100644 index 000000000000..d95f05fcbc40 --- /dev/null +++ b/tests/pending/run/reflection-scala-annotations.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.annotation._ + +class sann(x: Int, y: List[Int]) extends StaticAnnotation +class jann(x: Int, y: Array[Int]) extends ClassfileAnnotation + +@sann(1, List(1, 2)) +class S + +@jann(y = Array(1, 2), x = 2) +class J + +object Test extends dotty.runtime.LegacyApp { + println(symbolOf[S].annotations.head.tree) + println(symbolOf[J].annotations.head.tree) +} diff --git a/tests/pending/run/reflection-sorted-decls.check b/tests/pending/run/reflection-sorted-decls.check new file mode 100644 index 000000000000..415e07314928 --- /dev/null +++ b/tests/pending/run/reflection-sorted-decls.check @@ -0,0 +1,3 @@ +value a +value b +value c diff --git a/tests/pending/run/reflection-sorted-decls.scala b/tests/pending/run/reflection-sorted-decls.scala new file mode 100644 index 000000000000..9befd942cfe4 --- /dev/null +++ b/tests/pending/run/reflection-sorted-decls.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + class Foo(val a: Int, val b: Int, val c: Int) + import scala.reflect.runtime.{currentMirror => cm} + val decls = cm.classSymbol(classOf[Foo]).info.decls + decls.sorted.toList.filter(!_.isMethod) foreach System.out.println + } +} diff --git a/tests/pending/run/reflection-sorted-members.check b/tests/pending/run/reflection-sorted-members.check new file mode 100644 index 000000000000..415e07314928 --- /dev/null +++ b/tests/pending/run/reflection-sorted-members.check @@ -0,0 +1,3 @@ +value a +value b +value c diff --git a/tests/pending/run/reflection-sorted-members.scala b/tests/pending/run/reflection-sorted-members.scala new file mode 100644 index 000000000000..7a09f9d296b0 --- /dev/null +++ b/tests/pending/run/reflection-sorted-members.scala @@ -0,0 +1,11 @@ +object Test { + def main(args: Array[String]): Unit = { + trait T1 { def a: Int; def c: Int } + trait T2 { def a: Int; def b: Int } + class Bar(val x: Int) + class Foo(val a: Int, val b: Int, val c: Int) extends Bar(a + b + c) with T1 with T2 + import scala.reflect.runtime.{currentMirror => cm} + val members = cm.classSymbol(classOf[Foo]).info.members + members.sorted.toList.filter(!_.isMethod) foreach System.out.println + } +} diff --git a/tests/pending/run/reflection-sync-potpourri.scala b/tests/pending/run/reflection-sync-potpourri.scala new file mode 100644 index 000000000000..14e7f281be0f --- /dev/null +++ b/tests/pending/run/reflection-sync-potpourri.scala @@ -0,0 +1,32 @@ +import scala.reflect.runtime.universe._ + +// this test checks that under heavily multithreaded conditions: +// 1) scala.reflect.runtime.universe, its rootMirror and definitions are initialized correctly +// 2) symbols are correctly materialized into PackageScopes (no dupes) +// 3) unpickling works okay even we unpickle the same symbol a lot of times + +object Test extends dotty.runtime.LegacyApp { + def foo[T: TypeTag](x: T) = typeOf[T].toString + val n = 1000 + val rng = new scala.util.Random() + val types = List( + () => typeOf[java.lang.reflect.Method], + () => typeOf[java.lang.annotation.Annotation], + () => typeOf[scala.io.BufferedSource], + () => typeOf[scala.io.Codec]) + val perms = types.permutations.toList + def force(lazytpe: () => Type): String = { + lazytpe().typeSymbol.info + lazytpe().toString + } + val diceRolls = List.fill(n)(rng.nextInt(perms.length)) + val threads = (1 to n) map (i => new Thread(s"Reflector-$i") { + override def run(): Unit = { + val s1 = foo("42") + val s2 = perms(diceRolls(i - 1)).map(x => force(x)).sorted.mkString(", ") + assert(s1 == "String" || s1 == "java.lang.String") + assert(s2 == "java.lang.annotation.Annotation, java.lang.reflect.Method, scala.io.BufferedSource, scala.io.Codec") + } + }) + threads foreach (_.start) +} diff --git a/tests/pending/run/reflection-sync-subtypes.check b/tests/pending/run/reflection-sync-subtypes.check new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/pending/run/reflection-sync-subtypes.scala b/tests/pending/run/reflection-sync-subtypes.scala new file mode 100644 index 000000000000..1542b816f349 --- /dev/null +++ b/tests/pending/run/reflection-sync-subtypes.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val n = 1000 + val rng = new scala.util.Random() + val tasks = List( + () => typeOf[List[Int]] <:< typeOf[List[_]], + () => typeOf[List[_]] <:< typeOf[List[Any]], + () => typeOf[Map[Int, Object]] <:< typeOf[Iterable[(Int, String)]], + () => typeOf[Expr[Any] { val mirror: rootMirror.type }] <:< typeOf[Expr[List[List[List[Int]]]]{ val mirror: rootMirror.type }]) + val perms = tasks.permutations.toList + val diceRolls = List.fill(n)(rng.nextInt(perms.length)) + val threads = (1 to n) map (i => new Thread(s"Reflector-$i") { + override def run(): Unit = { + val result = perms(diceRolls(i - 1)).map(_()) + assert(result.sorted == List(false, false, true, true)) + } + }) + threads foreach (_.start) +} diff --git a/tests/pending/run/reflection-tags.check b/tests/pending/run/reflection-tags.check new file mode 100644 index 000000000000..375518e921cd --- /dev/null +++ b/tests/pending/run/reflection-tags.check @@ -0,0 +1 @@ +List() diff --git a/tests/pending/run/reflection-tags.scala b/tests/pending/run/reflection-tags.scala new file mode 100644 index 000000000000..6f10519eb816 --- /dev/null +++ b/tests/pending/run/reflection-tags.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.ClassTag + +object Test extends dotty.runtime.LegacyApp { + var typeMembers = typeOf[scala.reflect.api.Universe].members.filter(sym => sym.isType && !sym.isClass).toList + typeMembers = typeMembers.filter(_.name != TypeName("ModifiersCreator")) // type ModifiersCreator = ModifiersExtractor + typeMembers = typeMembers.filter(_.name != TypeName("Importer")) // deprecated + typeMembers = typeMembers.filter(_.name != TypeName("Internal")) // internal + typeMembers = typeMembers.filter(_.name != TypeName("Compat")) // internal + typeMembers = typeMembers.filter(_.name != TypeName("BuildApi")) // deprecated + val tags = typeOf[scala.reflect.api.Universe].members.filter(sym => sym.isImplicit).toList + + typeMembers.foreach(_.info) + tags.foreach(_.info) + + val outliers = typeMembers.filter(tm => !tags.exists(tag => tag.info match { + case NullaryMethodType(TypeRef(_, sym, targ :: Nil)) => sym == typeOf[ClassTag[_]].typeSymbol && targ.typeSymbol == tm + case _ => false + })) + println(outliers) +} diff --git a/tests/pending/run/reflection-valueclasses-derived.check b/tests/pending/run/reflection-valueclasses-derived.check new file mode 100644 index 000000000000..3382d4155616 --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-derived.check @@ -0,0 +1,3 @@ +4 +class C +C@2 diff --git a/tests/pending/run/reflection-valueclasses-derived.scala b/tests/pending/run/reflection-valueclasses-derived.scala new file mode 100644 index 000000000000..2121e260a374 --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-derived.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C(val x: Int) extends AnyVal { + def foo(y: Int) = x + y +} + +object Test extends dotty.runtime.LegacyApp { + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("foo")).asMethod)(2)) + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("getClass")).asMethod)()) + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("toString")).asMethod)()) +} diff --git a/tests/pending/run/reflection-valueclasses-magic.check b/tests/pending/run/reflection-valueclasses-magic.check new file mode 100644 index 000000000000..8ecad3eb9119 --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-magic.check @@ -0,0 +1,1456 @@ +============ +Byte +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Byte: ()Byte +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Int +method %: (x: Char)Int +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Int +method %: (x: Long)Long +method %: (x: Short)Int +method &: (x: Byte)Int +method &: (x: Char)Int +method &: (x: Int)Int +method &: (x: Long)Long +method &: (x: Short)Int +method *: (x: Byte)Int +method *: (x: Char)Int +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Int +method *: (x: Long)Long +method *: (x: Short)Int +method +: (x: Byte)Int +method +: (x: Char)Int +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Int +method +: (x: Long)Long +method +: (x: Short)Int +method +: (x: String)String +method -: (x: Byte)Int +method -: (x: Char)Int +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Int +method -: (x: Long)Long +method -: (x: Short)Int +method /: (x: Byte)Int +method /: (x: Char)Int +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Int +method /: (x: Long)Long +method /: (x: Short)Int +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <<: (x: Int)Int +method <<: (x: Long)Int +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method >>: (x: Int)Int +method >>: (x: Long)Int +method >>>: (x: Int)Int +method >>>: (x: Long)Int +method ^: (x: Byte)Int +method ^: (x: Char)Int +method ^: (x: Int)Int +method ^: (x: Long)Long +method ^: (x: Short)Int +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Byte] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Int +method unary_-: => Int +method unary_~: => Int +method |: (x: Byte)Int +method |: (x: Char)Int +method |: (x: Int)Int +method |: (x: Long)Long +method |: (x: Short)Int +testing Byte.toByte() with receiver = 2 and args = List(): [class java.lang.Byte] =======> 2 +testing Byte.toShort() with receiver = 2 and args = List(): [class java.lang.Short] =======> 2 +testing Byte.toChar() with receiver = 2 and args = List(): [class java.lang.Character] =======>  +testing Byte.toInt() with receiver = 2 and args = List(): [class java.lang.Integer] =======> 2 +testing Byte.toLong() with receiver = 2 and args = List(): [class java.lang.Long] =======> 2 +testing Byte.toFloat() with receiver = 2 and args = List(): [class java.lang.Float] =======> 2.0 +testing Byte.toDouble() with receiver = 2 and args = List(): [class java.lang.Double] =======> 2.0 +testing Byte.==(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Byte.==(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Byte.==(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Byte.==(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Byte.==(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Byte.==(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Byte.==(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Byte.!=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Byte.!=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Byte.!=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Byte.!=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Byte.!=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Byte.!=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Byte.!=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Byte.<(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Byte.<(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Byte.<(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Byte.<(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Byte.<(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Byte.<(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Byte.<(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Byte.<=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Byte.<=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Byte.<=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Byte.<=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Byte.<=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Byte.<=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Byte.<=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Byte.>(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Byte.>(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Byte.>(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Byte.>(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Byte.>(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Byte.>(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Byte.>(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Byte.>=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Byte.>=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Byte.>=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Byte.>=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Byte.>=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Byte.>=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Byte.>=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Byte.+(String) with receiver = 2 and args = List(2 class java.lang.String): [class java.lang.String] =======> 22 +testing Byte.+(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Byte.+(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Byte.+(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Byte.+(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Byte.+(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Byte.+(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Byte.+(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Byte.-(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Byte.-(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Byte.-(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Byte.-(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Byte.-(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Byte.-(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Byte.-(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Byte.*(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Byte.*(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Byte.*(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Byte.*(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Byte.*(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Byte.*(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Byte.*(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Byte./(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 1 +testing Byte./(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 1 +testing Byte./(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 1 +testing Byte./(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 1 +testing Byte./(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 1 +testing Byte./(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Byte./(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Byte.%(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Byte.%(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Byte.%(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Byte.%(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Byte.%(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Byte.%(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Byte.%(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Short +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Short: ()Short +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Int +method %: (x: Char)Int +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Int +method %: (x: Long)Long +method %: (x: Short)Int +method &: (x: Byte)Int +method &: (x: Char)Int +method &: (x: Int)Int +method &: (x: Long)Long +method &: (x: Short)Int +method *: (x: Byte)Int +method *: (x: Char)Int +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Int +method *: (x: Long)Long +method *: (x: Short)Int +method +: (x: Byte)Int +method +: (x: Char)Int +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Int +method +: (x: Long)Long +method +: (x: Short)Int +method +: (x: String)String +method -: (x: Byte)Int +method -: (x: Char)Int +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Int +method -: (x: Long)Long +method -: (x: Short)Int +method /: (x: Byte)Int +method /: (x: Char)Int +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Int +method /: (x: Long)Long +method /: (x: Short)Int +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <<: (x: Int)Int +method <<: (x: Long)Int +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method >>: (x: Int)Int +method >>: (x: Long)Int +method >>>: (x: Int)Int +method >>>: (x: Long)Int +method ^: (x: Byte)Int +method ^: (x: Char)Int +method ^: (x: Int)Int +method ^: (x: Long)Long +method ^: (x: Short)Int +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Short] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Int +method unary_-: => Int +method unary_~: => Int +method |: (x: Byte)Int +method |: (x: Char)Int +method |: (x: Int)Int +method |: (x: Long)Long +method |: (x: Short)Int +testing Short.toByte() with receiver = 2 and args = List(): [class java.lang.Byte] =======> 2 +testing Short.toShort() with receiver = 2 and args = List(): [class java.lang.Short] =======> 2 +testing Short.toChar() with receiver = 2 and args = List(): [class java.lang.Character] =======>  +testing Short.toInt() with receiver = 2 and args = List(): [class java.lang.Integer] =======> 2 +testing Short.toLong() with receiver = 2 and args = List(): [class java.lang.Long] =======> 2 +testing Short.toFloat() with receiver = 2 and args = List(): [class java.lang.Float] =======> 2.0 +testing Short.toDouble() with receiver = 2 and args = List(): [class java.lang.Double] =======> 2.0 +testing Short.==(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Short.==(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Short.==(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Short.==(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Short.==(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Short.==(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Short.==(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Short.!=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Short.!=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Short.!=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Short.!=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Short.!=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Short.!=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Short.!=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Short.<(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Short.<(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Short.<(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Short.<(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Short.<(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Short.<(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Short.<(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Short.<=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Short.<=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Short.<=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Short.<=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Short.<=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Short.<=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Short.<=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Short.>(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Short.>(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Short.>(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Short.>(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Short.>(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Short.>(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Short.>(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Short.>=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Short.>=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Short.>=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Short.>=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Short.>=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Short.>=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Short.>=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Short.+(String) with receiver = 2 and args = List(2 class java.lang.String): [class java.lang.String] =======> 22 +testing Short.+(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Short.+(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Short.+(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Short.+(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Short.+(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Short.+(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Short.+(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Short.-(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Short.-(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Short.-(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Short.-(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Short.-(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Short.-(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Short.-(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Short.*(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Short.*(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Short.*(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Short.*(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Short.*(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Short.*(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Short.*(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Short./(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 1 +testing Short./(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 1 +testing Short./(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 1 +testing Short./(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 1 +testing Short./(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 1 +testing Short./(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Short./(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Short.%(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Short.%(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Short.%(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Short.%(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Short.%(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Short.%(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Short.%(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Char +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Char: ()Char +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Int +method %: (x: Char)Int +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Int +method %: (x: Long)Long +method %: (x: Short)Int +method &: (x: Byte)Int +method &: (x: Char)Int +method &: (x: Int)Int +method &: (x: Long)Long +method &: (x: Short)Int +method *: (x: Byte)Int +method *: (x: Char)Int +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Int +method *: (x: Long)Long +method *: (x: Short)Int +method +: (x: Byte)Int +method +: (x: Char)Int +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Int +method +: (x: Long)Long +method +: (x: Short)Int +method +: (x: String)String +method -: (x: Byte)Int +method -: (x: Char)Int +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Int +method -: (x: Long)Long +method -: (x: Short)Int +method /: (x: Byte)Int +method /: (x: Char)Int +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Int +method /: (x: Long)Long +method /: (x: Short)Int +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <<: (x: Int)Int +method <<: (x: Long)Int +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method >>: (x: Int)Int +method >>: (x: Long)Int +method >>>: (x: Int)Int +method >>>: (x: Long)Int +method ^: (x: Byte)Int +method ^: (x: Char)Int +method ^: (x: Int)Int +method ^: (x: Long)Long +method ^: (x: Short)Int +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Char] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Int +method unary_-: => Int +method unary_~: => Int +method |: (x: Byte)Int +method |: (x: Char)Int +method |: (x: Int)Int +method |: (x: Long)Long +method |: (x: Short)Int +testing Char.toByte() with receiver =  and args = List(): [class java.lang.Byte] =======> 2 +testing Char.toShort() with receiver =  and args = List(): [class java.lang.Short] =======> 2 +testing Char.toChar() with receiver =  and args = List(): [class java.lang.Character] =======>  +testing Char.toInt() with receiver =  and args = List(): [class java.lang.Integer] =======> 2 +testing Char.toLong() with receiver =  and args = List(): [class java.lang.Long] =======> 2 +testing Char.toFloat() with receiver =  and args = List(): [class java.lang.Float] =======> 2.0 +testing Char.toDouble() with receiver =  and args = List(): [class java.lang.Double] =======> 2.0 +testing Char.==(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Char.==(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Char.==(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Char.==(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Char.==(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Char.==(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Char.==(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Char.!=(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Char.!=(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Char.!=(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Char.!=(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Char.!=(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Char.!=(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Char.!=(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Char.<(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Char.<(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Char.<(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Char.<(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Char.<(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Char.<(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Char.<(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Char.<=(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Char.<=(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Char.<=(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Char.<=(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Char.<=(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Char.<=(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Char.<=(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Char.>(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Char.>(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Char.>(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Char.>(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Char.>(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Char.>(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Char.>(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Char.>=(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Char.>=(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Char.>=(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Char.>=(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Char.>=(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Char.>=(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Char.>=(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Char.+(String) with receiver =  and args = List(2 class java.lang.String): [class java.lang.String] =======> 2 +testing Char.+(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Char.+(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Char.+(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Char.+(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Char.+(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Char.+(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Char.+(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Char.-(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Char.-(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Char.-(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Char.-(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Char.-(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Char.-(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Char.-(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Char.*(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Char.*(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Char.*(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Char.*(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Char.*(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Char.*(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Char.*(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Char./(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 1 +testing Char./(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 1 +testing Char./(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Integer] =======> 1 +testing Char./(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 1 +testing Char./(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 1 +testing Char./(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Char./(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Char.%(Byte) with receiver =  and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Char.%(Short) with receiver =  and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Char.%(Char) with receiver =  and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Char.%(Int) with receiver =  and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Char.%(Long) with receiver =  and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Char.%(Float) with receiver =  and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Char.%(Double) with receiver =  and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Int +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Int: ()Int +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Int +method %: (x: Char)Int +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Int +method %: (x: Long)Long +method %: (x: Short)Int +method &: (x: Byte)Int +method &: (x: Char)Int +method &: (x: Int)Int +method &: (x: Long)Long +method &: (x: Short)Int +method *: (x: Byte)Int +method *: (x: Char)Int +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Int +method *: (x: Long)Long +method *: (x: Short)Int +method +: (x: Byte)Int +method +: (x: Char)Int +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Int +method +: (x: Long)Long +method +: (x: Short)Int +method +: (x: String)String +method -: (x: Byte)Int +method -: (x: Char)Int +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Int +method -: (x: Long)Long +method -: (x: Short)Int +method /: (x: Byte)Int +method /: (x: Char)Int +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Int +method /: (x: Long)Long +method /: (x: Short)Int +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <<: (x: Int)Int +method <<: (x: Long)Int +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method >>: (x: Int)Int +method >>: (x: Long)Int +method >>>: (x: Int)Int +method >>>: (x: Long)Int +method ^: (x: Byte)Int +method ^: (x: Char)Int +method ^: (x: Int)Int +method ^: (x: Long)Long +method ^: (x: Short)Int +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Int] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Int +method unary_-: => Int +method unary_~: => Int +method |: (x: Byte)Int +method |: (x: Char)Int +method |: (x: Int)Int +method |: (x: Long)Long +method |: (x: Short)Int +testing Int.toByte() with receiver = 2 and args = List(): [class java.lang.Byte] =======> 2 +testing Int.toShort() with receiver = 2 and args = List(): [class java.lang.Short] =======> 2 +testing Int.toChar() with receiver = 2 and args = List(): [class java.lang.Character] =======>  +testing Int.toInt() with receiver = 2 and args = List(): [class java.lang.Integer] =======> 2 +testing Int.toLong() with receiver = 2 and args = List(): [class java.lang.Long] =======> 2 +testing Int.toFloat() with receiver = 2 and args = List(): [class java.lang.Float] =======> 2.0 +testing Int.toDouble() with receiver = 2 and args = List(): [class java.lang.Double] =======> 2.0 +testing Int.==(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Int.==(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Int.==(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Int.==(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Int.==(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Int.==(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Int.==(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Int.!=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Int.!=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Int.!=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Int.!=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Int.!=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Int.!=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Int.!=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Int.<(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Int.<(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Int.<(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Int.<(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Int.<(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Int.<(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Int.<(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Int.<=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Int.<=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Int.<=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Int.<=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Int.<=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Int.<=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Int.<=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Int.>(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Int.>(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Int.>(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Int.>(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Int.>(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Int.>(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Int.>(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Int.>=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Int.>=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Int.>=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Int.>=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Int.>=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Int.>=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Int.>=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Int.+(String) with receiver = 2 and args = List(2 class java.lang.String): [class java.lang.String] =======> 22 +testing Int.+(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Int.+(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Int.+(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Int.+(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Int.+(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Int.+(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Int.+(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Int.-(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Int.-(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Int.-(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Int.-(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Int.-(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Int.-(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Int.-(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Int.*(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 4 +testing Int.*(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 4 +testing Int.*(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 4 +testing Int.*(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 4 +testing Int.*(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Int.*(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Int.*(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Int./(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 1 +testing Int./(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 1 +testing Int./(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 1 +testing Int./(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 1 +testing Int./(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 1 +testing Int./(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Int./(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Int.%(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Integer] =======> 0 +testing Int.%(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Integer] =======> 0 +testing Int.%(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Integer] =======> 0 +testing Int.%(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Integer] =======> 0 +testing Int.%(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Int.%(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Int.%(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Long +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Long: ()Long +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Long +method %: (x: Char)Long +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Long +method %: (x: Long)Long +method %: (x: Short)Long +method &: (x: Byte)Long +method &: (x: Char)Long +method &: (x: Int)Long +method &: (x: Long)Long +method &: (x: Short)Long +method *: (x: Byte)Long +method *: (x: Char)Long +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Long +method *: (x: Long)Long +method *: (x: Short)Long +method +: (x: Byte)Long +method +: (x: Char)Long +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Long +method +: (x: Long)Long +method +: (x: Short)Long +method +: (x: String)String +method -: (x: Byte)Long +method -: (x: Char)Long +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Long +method -: (x: Long)Long +method -: (x: Short)Long +method /: (x: Byte)Long +method /: (x: Char)Long +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Long +method /: (x: Long)Long +method /: (x: Short)Long +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <<: (x: Int)Long +method <<: (x: Long)Long +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method >>: (x: Int)Long +method >>: (x: Long)Long +method >>>: (x: Int)Long +method >>>: (x: Long)Long +method ^: (x: Byte)Long +method ^: (x: Char)Long +method ^: (x: Int)Long +method ^: (x: Long)Long +method ^: (x: Short)Long +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Long] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Long +method unary_-: => Long +method unary_~: => Long +method |: (x: Byte)Long +method |: (x: Char)Long +method |: (x: Int)Long +method |: (x: Long)Long +method |: (x: Short)Long +testing Long.toByte() with receiver = 2 and args = List(): [class java.lang.Byte] =======> 2 +testing Long.toShort() with receiver = 2 and args = List(): [class java.lang.Short] =======> 2 +testing Long.toChar() with receiver = 2 and args = List(): [class java.lang.Character] =======>  +testing Long.toInt() with receiver = 2 and args = List(): [class java.lang.Integer] =======> 2 +testing Long.toLong() with receiver = 2 and args = List(): [class java.lang.Long] =======> 2 +testing Long.toFloat() with receiver = 2 and args = List(): [class java.lang.Float] =======> 2.0 +testing Long.toDouble() with receiver = 2 and args = List(): [class java.lang.Double] =======> 2.0 +testing Long.==(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Long.==(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Long.==(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Long.==(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Long.==(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Long.==(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Long.==(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Long.!=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Long.!=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Long.!=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Long.!=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Long.!=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Long.!=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Long.!=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Long.<(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Long.<(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Long.<(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Long.<(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Long.<(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Long.<(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Long.<(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Long.<=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Long.<=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Long.<=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Long.<=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Long.<=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Long.<=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Long.<=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Long.>(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Long.>(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Long.>(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Long.>(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Long.>(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Long.>(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Long.>(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Long.>=(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Long.>=(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Long.>=(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Long.>=(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Long.>=(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Long.>=(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Long.>=(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Long.+(String) with receiver = 2 and args = List(2 class java.lang.String): [class java.lang.String] =======> 22 +testing Long.+(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Long] =======> 4 +testing Long.+(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Long] =======> 4 +testing Long.+(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Long] =======> 4 +testing Long.+(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Long] =======> 4 +testing Long.+(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Long.+(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Long.+(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Long.-(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Long] =======> 0 +testing Long.-(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Long] =======> 0 +testing Long.-(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Long] =======> 0 +testing Long.-(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Long] =======> 0 +testing Long.-(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Long.-(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Long.-(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Long.*(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Long] =======> 4 +testing Long.*(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Long] =======> 4 +testing Long.*(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Long] =======> 4 +testing Long.*(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Long] =======> 4 +testing Long.*(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 4 +testing Long.*(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Long.*(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Long./(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Long] =======> 1 +testing Long./(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Long] =======> 1 +testing Long./(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Long] =======> 1 +testing Long./(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Long] =======> 1 +testing Long./(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 1 +testing Long./(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Long./(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Long.%(Byte) with receiver = 2 and args = List(2 class java.lang.Byte): [class java.lang.Long] =======> 0 +testing Long.%(Short) with receiver = 2 and args = List(2 class java.lang.Short): [class java.lang.Long] =======> 0 +testing Long.%(Char) with receiver = 2 and args = List( class java.lang.Character): [class java.lang.Long] =======> 0 +testing Long.%(Int) with receiver = 2 and args = List(2 class java.lang.Integer): [class java.lang.Long] =======> 0 +testing Long.%(Long) with receiver = 2 and args = List(2 class java.lang.Long): [class java.lang.Long] =======> 0 +testing Long.%(Float) with receiver = 2 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Long.%(Double) with receiver = 2 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Float +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Float: ()Float +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Float +method %: (x: Char)Float +method %: (x: Double)Double +method %: (x: Float)Float +method %: (x: Int)Float +method %: (x: Long)Float +method %: (x: Short)Float +method *: (x: Byte)Float +method *: (x: Char)Float +method *: (x: Double)Double +method *: (x: Float)Float +method *: (x: Int)Float +method *: (x: Long)Float +method *: (x: Short)Float +method +: (x: Byte)Float +method +: (x: Char)Float +method +: (x: Double)Double +method +: (x: Float)Float +method +: (x: Int)Float +method +: (x: Long)Float +method +: (x: Short)Float +method +: (x: String)String +method -: (x: Byte)Float +method -: (x: Char)Float +method -: (x: Double)Double +method -: (x: Float)Float +method -: (x: Int)Float +method -: (x: Long)Float +method -: (x: Short)Float +method /: (x: Byte)Float +method /: (x: Char)Float +method /: (x: Double)Double +method /: (x: Float)Float +method /: (x: Int)Float +method /: (x: Long)Float +method /: (x: Short)Float +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Float] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Float +method unary_-: => Float +testing Float.toByte() with receiver = 2.0 and args = List(): [class java.lang.Byte] =======> 2 +testing Float.toShort() with receiver = 2.0 and args = List(): [class java.lang.Short] =======> 2 +testing Float.toChar() with receiver = 2.0 and args = List(): [class java.lang.Character] =======>  +testing Float.toInt() with receiver = 2.0 and args = List(): [class java.lang.Integer] =======> 2 +testing Float.toLong() with receiver = 2.0 and args = List(): [class java.lang.Long] =======> 2 +testing Float.toFloat() with receiver = 2.0 and args = List(): [class java.lang.Float] =======> 2.0 +testing Float.toDouble() with receiver = 2.0 and args = List(): [class java.lang.Double] =======> 2.0 +testing Float.==(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Float.==(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Float.==(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Float.==(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Float.==(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Float.==(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Float.==(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Float.!=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Float.!=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Float.!=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Float.!=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Float.!=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Float.!=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Float.!=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Float.<(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Float.<(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Float.<(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Float.<(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Float.<(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Float.<(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Float.<(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Float.<=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Float.<=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Float.<=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Float.<=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Float.<=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Float.<=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Float.<=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Float.>(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Float.>(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Float.>(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Float.>(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Float.>(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Float.>(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Float.>(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Float.>=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Float.>=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Float.>=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Float.>=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Float.>=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Float.>=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Float.>=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Float.+(String) with receiver = 2.0 and args = List(2 class java.lang.String): [class java.lang.String] =======> 2.02 +testing Float.+(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Float] =======> 4.0 +testing Float.+(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Float] =======> 4.0 +testing Float.+(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Float] =======> 4.0 +testing Float.+(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Float] =======> 4.0 +testing Float.+(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Float] =======> 4.0 +testing Float.+(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Float.+(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Float.-(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Float] =======> 0.0 +testing Float.-(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Float] =======> 0.0 +testing Float.-(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Float] =======> 0.0 +testing Float.-(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Float] =======> 0.0 +testing Float.-(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Float] =======> 0.0 +testing Float.-(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Float.-(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Float.*(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Float] =======> 4.0 +testing Float.*(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Float] =======> 4.0 +testing Float.*(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Float] =======> 4.0 +testing Float.*(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Float] =======> 4.0 +testing Float.*(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Float] =======> 4.0 +testing Float.*(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 4.0 +testing Float.*(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Float./(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Float] =======> 1.0 +testing Float./(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Float] =======> 1.0 +testing Float./(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Float] =======> 1.0 +testing Float./(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Float] =======> 1.0 +testing Float./(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Float] =======> 1.0 +testing Float./(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 1.0 +testing Float./(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Float.%(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Float] =======> 0.0 +testing Float.%(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Float] =======> 0.0 +testing Float.%(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Float] =======> 0.0 +testing Float.%(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Float] =======> 0.0 +testing Float.%(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Float] =======> 0.0 +testing Float.%(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Float] =======> 0.0 +testing Float.%(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Double +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Double: ()Double +method !=: (x$1: Any)Boolean +method !=: (x: Byte)Boolean +method !=: (x: Char)Boolean +method !=: (x: Double)Boolean +method !=: (x: Float)Boolean +method !=: (x: Int)Boolean +method !=: (x: Long)Boolean +method !=: (x: Short)Boolean +method ##: ()Int +method %: (x: Byte)Double +method %: (x: Char)Double +method %: (x: Double)Double +method %: (x: Float)Double +method %: (x: Int)Double +method %: (x: Long)Double +method %: (x: Short)Double +method *: (x: Byte)Double +method *: (x: Char)Double +method *: (x: Double)Double +method *: (x: Float)Double +method *: (x: Int)Double +method *: (x: Long)Double +method *: (x: Short)Double +method +: (x: Byte)Double +method +: (x: Char)Double +method +: (x: Double)Double +method +: (x: Float)Double +method +: (x: Int)Double +method +: (x: Long)Double +method +: (x: Short)Double +method +: (x: String)String +method -: (x: Byte)Double +method -: (x: Char)Double +method -: (x: Double)Double +method -: (x: Float)Double +method -: (x: Int)Double +method -: (x: Long)Double +method -: (x: Short)Double +method /: (x: Byte)Double +method /: (x: Char)Double +method /: (x: Double)Double +method /: (x: Float)Double +method /: (x: Int)Double +method /: (x: Long)Double +method /: (x: Short)Double +method <: (x: Byte)Boolean +method <: (x: Char)Boolean +method <: (x: Double)Boolean +method <: (x: Float)Boolean +method <: (x: Int)Boolean +method <: (x: Long)Boolean +method <: (x: Short)Boolean +method <=: (x: Byte)Boolean +method <=: (x: Char)Boolean +method <=: (x: Double)Boolean +method <=: (x: Float)Boolean +method <=: (x: Int)Boolean +method <=: (x: Long)Boolean +method <=: (x: Short)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Byte)Boolean +method ==: (x: Char)Boolean +method ==: (x: Double)Boolean +method ==: (x: Float)Boolean +method ==: (x: Int)Boolean +method ==: (x: Long)Boolean +method ==: (x: Short)Boolean +method >: (x: Byte)Boolean +method >: (x: Char)Boolean +method >: (x: Double)Boolean +method >: (x: Float)Boolean +method >: (x: Int)Boolean +method >: (x: Long)Boolean +method >: (x: Short)Boolean +method >=: (x: Byte)Boolean +method >=: (x: Char)Boolean +method >=: (x: Double)Boolean +method >=: (x: Float)Boolean +method >=: (x: Int)Boolean +method >=: (x: Long)Boolean +method >=: (x: Short)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Double] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toByte: => Byte +method toChar: => Char +method toDouble: => Double +method toFloat: => Float +method toInt: => Int +method toLong: => Long +method toShort: => Short +method toString: ()java.lang.String +method unary_+: => Double +method unary_-: => Double +testing Double.toByte() with receiver = 2.0 and args = List(): [class java.lang.Byte] =======> 2 +testing Double.toShort() with receiver = 2.0 and args = List(): [class java.lang.Short] =======> 2 +testing Double.toChar() with receiver = 2.0 and args = List(): [class java.lang.Character] =======>  +testing Double.toInt() with receiver = 2.0 and args = List(): [class java.lang.Integer] =======> 2 +testing Double.toLong() with receiver = 2.0 and args = List(): [class java.lang.Long] =======> 2 +testing Double.toFloat() with receiver = 2.0 and args = List(): [class java.lang.Float] =======> 2.0 +testing Double.toDouble() with receiver = 2.0 and args = List(): [class java.lang.Double] =======> 2.0 +testing Double.==(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Double.==(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Double.==(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Double.==(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Double.==(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Double.==(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Double.==(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Double.!=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Double.!=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Double.!=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Double.!=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Double.!=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Double.!=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Double.!=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Double.<(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Double.<(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Double.<(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Double.<(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Double.<(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Double.<(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Double.<(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Double.<=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Double.<=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Double.<=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Double.<=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Double.<=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Double.<=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Double.<=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Double.>(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> false +testing Double.>(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> false +testing Double.>(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> false +testing Double.>(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> false +testing Double.>(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> false +testing Double.>(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> false +testing Double.>(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> false +testing Double.>=(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Boolean] =======> true +testing Double.>=(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Boolean] =======> true +testing Double.>=(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Boolean] =======> true +testing Double.>=(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Boolean] =======> true +testing Double.>=(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Boolean] =======> true +testing Double.>=(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Boolean] =======> true +testing Double.>=(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Boolean] =======> true +testing Double.+(String) with receiver = 2.0 and args = List(2 class java.lang.String): [class java.lang.String] =======> 2.02 +testing Double.+(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Double] =======> 4.0 +testing Double.+(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Double] =======> 4.0 +testing Double.+(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Double] =======> 4.0 +testing Double.+(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Double] =======> 4.0 +testing Double.+(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Double] =======> 4.0 +testing Double.+(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Double] =======> 4.0 +testing Double.+(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Double.-(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Double] =======> 0.0 +testing Double.-(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Double] =======> 0.0 +testing Double.-(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Double] =======> 0.0 +testing Double.-(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Double] =======> 0.0 +testing Double.-(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Double] =======> 0.0 +testing Double.-(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Double] =======> 0.0 +testing Double.-(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +testing Double.*(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Double] =======> 4.0 +testing Double.*(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Double] =======> 4.0 +testing Double.*(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Double] =======> 4.0 +testing Double.*(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Double] =======> 4.0 +testing Double.*(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Double] =======> 4.0 +testing Double.*(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Double] =======> 4.0 +testing Double.*(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 4.0 +testing Double./(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Double] =======> 1.0 +testing Double./(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Double] =======> 1.0 +testing Double./(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Double] =======> 1.0 +testing Double./(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Double] =======> 1.0 +testing Double./(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Double] =======> 1.0 +testing Double./(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Double] =======> 1.0 +testing Double./(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 1.0 +testing Double.%(Byte) with receiver = 2.0 and args = List(2 class java.lang.Byte): [class java.lang.Double] =======> 0.0 +testing Double.%(Short) with receiver = 2.0 and args = List(2 class java.lang.Short): [class java.lang.Double] =======> 0.0 +testing Double.%(Char) with receiver = 2.0 and args = List( class java.lang.Character): [class java.lang.Double] =======> 0.0 +testing Double.%(Int) with receiver = 2.0 and args = List(2 class java.lang.Integer): [class java.lang.Double] =======> 0.0 +testing Double.%(Long) with receiver = 2.0 and args = List(2 class java.lang.Long): [class java.lang.Double] =======> 0.0 +testing Double.%(Float) with receiver = 2.0 and args = List(2.0 class java.lang.Float): [class java.lang.Double] =======> 0.0 +testing Double.%(Double) with receiver = 2.0 and args = List(2.0 class java.lang.Double): [class java.lang.Double] =======> 0.0 +============ +Boolean +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Boolean: ()Boolean +method !=: (x$1: Any)Boolean +method !=: (x: Boolean)Boolean +method ##: ()Int +method &&: (x: Boolean)Boolean +method &: (x: Boolean)Boolean +method ==: (x$1: Any)Boolean +method ==: (x: Boolean)Boolean +method ^: (x: Boolean)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Boolean] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toString: ()java.lang.String +method unary_!: => Boolean +method |: (x: Boolean)Boolean +method ||: (x: Boolean)Boolean +testing Boolean.unary_!() with receiver = true and args = List(): [class java.lang.Boolean] =======> false +testing Boolean.==(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> true +testing Boolean.!=(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> false +testing Boolean.||(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> true +testing Boolean.&&(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> true +testing Boolean.|(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> true +testing Boolean.&(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> true +testing Boolean.^(Boolean) with receiver = true and args = List(true class java.lang.Boolean): [class java.lang.Boolean] =======> false +============ +Unit +it's important to print the list of Byte's members +if some of them change (possibly, adding and/or removing magic symbols), we must update this test +constructor Unit: ()Unit +method !=: (x$1: Any)Boolean +method ##: ()Int +method ==: (x$1: Any)Boolean +method asInstanceOf: [T0]=> T0 +method equals: (x$1: Any)Boolean +method getClass: ()Class[Unit] +method hashCode: ()Int +method isInstanceOf: [T0]=> Boolean +method toString: ()java.lang.String diff --git a/tests/pending/run/reflection-valueclasses-magic.scala b/tests/pending/run/reflection-valueclasses-magic.scala new file mode 100644 index 000000000000..ef128a82d93a --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-magic.scala @@ -0,0 +1,116 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.ClassTag + +package scala { + object ExceptionUtils { + def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + } +} + +object Test extends dotty.runtime.LegacyApp { + def key(sym: Symbol) = { + sym match { + // initialize parameter symbols + case meth: MethodSymbol => meth.paramLists.flatten.map(_.info) + } + sym + ": " + sym.info + } + + def convert(value: Any, tpe: Type) = { + import scala.runtime.BoxesRunTime._ + if (tpe =:= typeOf[Byte]) toByte(value) + else if (tpe =:= typeOf[Short]) toShort(value) + else if (tpe =:= typeOf[Char]) toCharacter(value) + else if (tpe =:= typeOf[Int]) toInteger(value) + else if (tpe =:= typeOf[Long]) toLong(value) + else if (tpe =:= typeOf[Float]) toFloat(value) + else if (tpe =:= typeOf[Double]) toDouble(value) + else if (tpe =:= typeOf[String]) value.toString + else if (tpe =:= typeOf[Boolean]) value.asInstanceOf[Boolean] + else throw new Exception(s"not supported: value = $value, tpe = $tpe") + } + + def test[T: ClassTag](tpe: Type, receiver: T, method: String, args: Any*): Unit = { + def wrap[T](op: => T) = + try { + var result = op.asInstanceOf[AnyRef] + if (scala.runtime.ScalaRunTime.isArray(result)) + result = scala.runtime.ScalaRunTime.toObjectArray(result).toList + println(s"[${result.getClass}] =======> $result") + } catch { + case ex: Throwable => + val realex = scala.ExceptionUtils.unwrapThrowable(ex) + println(realex.getClass + ": " + realex.getMessage) + } + val meth = tpe.decl(TermName(method).encodedName.toTermName) + val testees = if (meth.isMethod) List(meth.asMethod) else meth.asTerm.alternatives.map(_.asMethod) + testees foreach (testee => { + val convertedArgs = args.zipWithIndex.map { case (arg, i) => convert(arg, testee.paramLists.flatten.apply(i).info) } + print(s"testing ${tpe.typeSymbol.name}.$method(${testee.paramLists.flatten.map(_.info).mkString(','.toString)}) with receiver = $receiver and args = ${convertedArgs.map(arg => arg + ' '.toString + arg.getClass).toList}: ") + wrap(cm.reflect(receiver).reflectMethod(testee)(convertedArgs: _*)) + }) + } + def header(tpe: Type): Unit = { + println(s"============\n$tpe") + println("it's important to print the list of Byte's members") + println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") + tpe.members.toList.sortBy(key).foreach(sym => println(key(sym))) + } + + def testNumeric[T: ClassTag](tpe: Type, value: T): Unit = { + header(tpe) + List("toByte", "toShort", "toChar", "toInt", "toLong", "toFloat", "toDouble") foreach (meth => test(tpe, value, meth)) + test(tpe, value, "==", 2) + test(tpe, value, "!=", 2) + test(tpe, value, "<", 2) + test(tpe, value, "<=", 2) + test(tpe, value, ">", 2) + test(tpe, value, ">=", 2) + test(tpe, value, "+", 2) + test(tpe, value, "-", 2) + test(tpe, value, "*", 2) + test(tpe, value, "/", 2) + test(tpe, value, "%", 2) + } + + def testIntegral[T: ClassTag](tpe: Type, value: T): Unit = { + testNumeric(tpe, value) + test(tpe, value, "unary_~") + test(tpe, value, "unary_+") + test(tpe, value, "unary_-") + test(tpe, value, "<<", 2) + test(tpe, value, ">>", 2) + test(tpe, value, ">>>", 2) + test(tpe, value, "|", 2) + test(tpe, value, "&", 2) + test(tpe, value, "^", 2) + } + + def testBoolean(): Unit = { + header(typeOf[Boolean]) + test(typeOf[Boolean], true, "unary_!") + test(typeOf[Boolean], true, "==", true) + test(typeOf[Boolean], true, "!=", true) + test(typeOf[Boolean], true, "||", true) + test(typeOf[Boolean], true, "&&", true) + test(typeOf[Boolean], true, "|", true) + test(typeOf[Boolean], true, "&", true) + test(typeOf[Boolean], true, "^", true) + } + + def testUnit(): Unit = { + header(typeOf[Unit]) + } + + testNumeric(typeOf[Byte], 2.toByte) + testNumeric(typeOf[Short], 2.toShort) + testNumeric(typeOf[Char], 2.toChar) + testNumeric(typeOf[Int], 2.toInt) + testNumeric(typeOf[Long], 2.toLong) + testNumeric(typeOf[Float], 2.toFloat) + testNumeric(typeOf[Double], 2.toDouble) + testBoolean() + testUnit() +} diff --git a/tests/pending/run/reflection-valueclasses-standard.check b/tests/pending/run/reflection-valueclasses-standard.check new file mode 100644 index 000000000000..643c3d048c19 --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-standard.check @@ -0,0 +1,27 @@ +========byte======== +byte +2 +========short======== +short +2 +========int======== +int +2 +========long======== +long +2 +========float======== +float +2.0 +========double======== +double +2.0 +========char======== +char +2 +========boolean======== +boolean +true +========void======== +void +() diff --git a/tests/pending/run/reflection-valueclasses-standard.scala b/tests/pending/run/reflection-valueclasses-standard.scala new file mode 100644 index 000000000000..692c768f26e8 --- /dev/null +++ b/tests/pending/run/reflection-valueclasses-standard.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + def test[T: ClassTag: TypeTag](x: T) = { + println(s"========${classTag[T].runtimeClass}========") + println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("getClass")).asMethod)()) + println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("toString")).asMethod)()) + } + + test(2.toByte) + test(2.toShort) + test(2.toInt) + test(2.toLong) + test(2.toFloat) + test(2.toDouble) + test('2') + test(true) + test(()) +} diff --git a/tests/pending/run/reflinit.check b/tests/pending/run/reflinit.check new file mode 100644 index 000000000000..a9df3544acce --- /dev/null +++ b/tests/pending/run/reflinit.check @@ -0,0 +1 @@ +List[Int] diff --git a/tests/pending/run/reflinit.scala b/tests/pending/run/reflinit.scala new file mode 100644 index 000000000000..ae9ca407e60f --- /dev/null +++ b/tests/pending/run/reflinit.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tt2 = typeOf[List[Int]] + println(tt2) +} diff --git a/tests/pending/run/reify-aliases.check b/tests/pending/run/reify-aliases.check new file mode 100644 index 000000000000..da784227af7e --- /dev/null +++ b/tests/pending/run/reify-aliases.check @@ -0,0 +1 @@ +TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) diff --git a/tests/pending/run/reify-aliases.scala b/tests/pending/run/reify-aliases.scala new file mode 100644 index 000000000000..0b1d706551b2 --- /dev/null +++ b/tests/pending/run/reify-aliases.scala @@ -0,0 +1,5 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(showRaw(typeOf[String])) +} diff --git a/tests/pending/run/reify-each-node-type.check b/tests/pending/run/reify-each-node-type.check new file mode 100644 index 000000000000..afc65add7af2 --- /dev/null +++ b/tests/pending/run/reify-each-node-type.check @@ -0,0 +1,35 @@ + 1 s Ident + 2 r.List Select + 3 r.List.apply() Apply + 4 r.List.apply(1) Literal + 5 r.List.apply[Int]() TypeApply + 6 (1: Int) Typed + 7 (null: r.List[Int]) AppliedTypeTree + 8 { (); () } Block + 9 { val x: Int = 0; () } ValDef +10 { val x = 0; () } TypeTree +11 if (true) () else () If +12 { def f: Unit = (); () } DefDef +13 { def m = NN.super.q; () } Super +14 { abstract trait A extends AnyRef; () } ClassDef Template +15 { def f(x: Any): Unit = (); () } EmptyTree +16 (null: r.D with r.E) CompoundTypeTree +17 { type T = Int; () } TypeDef +18 { type CC[T <: r.D] = r.C[T]; () } TypeBoundsTree +19 try { 0 } finally Predef.println("") Try +20 ((x: Int) => x) Function +21 { var v = 1; v = 2 } Assign +22 { class A extends AnyRef { def () = { super.(); This +23 new r.List[Int]() New +24 0: @unchecked Annotated +25 (null: r.Outer#Inner) SelectFromTypeTree +26 (null: Nil.type) SingletonTypeTree +27 (null: T forSome { type T }) ExistentialTypeTree +28 { import r.{A, B=>C}; () } Import +29 { def f: Int = return 0; () } Return +30 { object x extends AnyRef { def () = { super.(); ModuleDef +31 throw new Exception() Throw +32 0 match { case _ => 0 } Match CaseDef +33 0 match { case (1| 2) => 0 } Alternative +34 NN.q match { case (x @ r.List) => 0 } Bind +35 NN.q match { case r.UnSeq(1, (_)*) => 0 } Star diff --git a/tests/pending/run/reify-each-node-type.scala b/tests/pending/run/reify-each-node-type.scala new file mode 100644 index 000000000000..43d32e59dedd --- /dev/null +++ b/tests/pending/run/reify-each-node-type.scala @@ -0,0 +1,110 @@ + +import scala.language.{ existentials, postfixOps } +import scala.reflect.runtime.universe._ + +object r { + class A + class B + class List[+A] + object List { def apply[A](xs: A*): List[A] = new List[A] } + object Nil extends List[Nothing] + + trait OuterP[A] { + trait Inner + trait InnerP[B] + } + trait Outer { + trait Inner + trait InnerP[B] + } + object Un { def unapply(x: Any) = Some(5) } + object UnSeq { def unapplySeq(x: Any) = Some(Seq(5)) } + class C[T] + class D + trait E + + trait SN { + def q: Any = null + } +} + +object s { + import r._ + + trait NN extends SN { + def act[T](expr: Expr[T]): Unit + + act(reify { s /* Ident */ }) + act(reify { r.List /* Select */ }) + act(reify { List() /* Apply */ }) + act(reify { List(1) /* Literal */ }) + act(reify { List[Int]() /* TypeApply */ }) + act(reify { 1: Int /* Typed */ }) + act(reify { null: List[Int] /* AppliedTypeTree */ }) + act(reify { () ; () /* Block */ }) + act(reify { val x: Int = 0 /* ValDef */ }) + act(reify { val x = 0 /* TypeTree */ }) + act(reify { if (true) () /* If */ }) + act(reify { def f: Unit = { } /* DefDef */ }) + act(reify { def m = super.q /* Super */ }) + act(reify { trait A /* ClassDef Template */ }) + act(reify { def f(x: Any): Unit = { } /* EmptyTree */ }) + act(reify { null: D with E /* CompoundTypeTree */ }) + act(reify { type T = Int /* TypeDef */ }) + act(reify { type CC[T <: D] = C[T] /* TypeBoundsTree */ }) + act(reify { try 0 finally println("") /* Try */ }) + act(reify { (x: Int) => x /* Function */ }) + act(reify { var v = 1 ; v = 2 /* Assign */ }) + act(reify { class A() { def this(x: A) = this() } /* This */ }) + act(reify { new List[Int] /* New */ }) + act(reify { 0: @unchecked /* Annotated */ }) + act(reify { null: Outer#Inner /* SelectFromTypeTree */ }) + act(reify { null: Nil.type /* SingletonTypeTree */ }) + act(reify { null: (T forSome { type T }) /* ExistentialTypeTree */ }) + act(reify { import r.{ A, B => C }; /* Import */ }) + act(reify { def f: Int = return 0 /* Return */ }) + act(reify { object x /* ModuleDef */ }) + act(reify { throw new java.lang.Exception /* Throw */ }) + act(reify { 0 match { case _ => 0 } /* Match CaseDef */ }) + act(reify { 0 match { case 1 | 2 => 0 } /* Alternative */ }) + act(reify { q match { case x @ List => 0 } /* Bind */ }) + act(reify { q match { case UnSeq(1, _*) => 0 } /* Star */ }) + + // ``unexpected: bound type that doesn't have a tpe: Ident(newTypeName("Int"))'' + // act(reify { r.List[T forSome { type T <: Int }]() }) // Was crashing , no longer + // + // error: exception during macro expansion: + // scala.MatchError: collection.this.Seq.unapplySeq[A] (of class scala.reflect.internal.Trees$TypeApply) + // at scala.reflect.reify.phases.Reshape$$anon$1.extractExtractor$1(Reshape.scala:73) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:82) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:24) + // at scala.reflect.internal.Trees$class.itransform(Trees.scala:1290) + // + // act(reify { r.List[Any]() match { case Seq(1, _*) => 1 } } ) + + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // + // SI-7243 + // + // test/files/run/reify-each-node-type.scala:85: error: Cannot materialize r.List.apply[r.OuterP[Int]#InnerP[Byte]]() as { ... } because: + // scala.reflect.macros.TypecheckException: value TypeTreeWithDeferredRefCheck is not a member of type parameter U + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // ^ + // one error found + } +} + +object Test { + var idx = 0 + val seen = scala.collection.mutable.Set[String]() + + object N extends s.NN { + def act[T](expr: Expr[T]): Unit = { + idx += 1 + val ts = expr.tree filter (_ => true) map (_.getClass.getName split "[.$]" last) filterNot seen distinct; + println("%2d %60s %s".format(idx, expr.tree.toString.replaceAll("""\s+""", " ").take(60), ts mkString " ")) + seen ++= ts + } + } + def main(args: Array[String]): Unit = N +} diff --git a/tests/pending/run/reify-repl-fail-gracefully.check b/tests/pending/run/reify-repl-fail-gracefully.check new file mode 100644 index 000000000000..c9e69744d607 --- /dev/null +++ b/tests/pending/run/reify-repl-fail-gracefully.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import language.experimental.macros +import language.experimental.macros + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> + +scala> reify +:12: error: too few argument lists for macro invocation + reify + ^ + +scala> :quit diff --git a/tests/pending/run/reify-repl-fail-gracefully.scala b/tests/pending/run/reify-repl-fail-gracefully.scala new file mode 100644 index 000000000000..ed6d6cb6c957 --- /dev/null +++ b/tests/pending/run/reify-repl-fail-gracefully.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |import scala.reflect.runtime.universe._ + | + |reify + """.stripMargin +} diff --git a/tests/pending/run/reify-staticXXX.check b/tests/pending/run/reify-staticXXX.check new file mode 100644 index 000000000000..37102b29e192 --- /dev/null +++ b/tests/pending/run/reify-staticXXX.check @@ -0,0 +1,24 @@ +object +object +class +class +object > object +object > object +object > class +object > class +package > object +package > object +package > class +package > class +object +object +class +class +object > object +object > object +object > class +object > class +package > object +package > object +package > class +package > class diff --git a/tests/pending/run/reify-staticXXX.scala b/tests/pending/run/reify-staticXXX.scala new file mode 100644 index 000000000000..cfbd756ec205 --- /dev/null +++ b/tests/pending/run/reify-staticXXX.scala @@ -0,0 +1,56 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object B { override def toString = "object" } +class C { override def toString = "class" } + +package foo1 { + object B { override def toString = "package > object" } + class C { override def toString = "package > class" } +} + +object Foo2 { + object B { override def toString = "object > object" } + class C { override def toString = "object > class" } +} + +object packageless { + def test = { + println(B) + println(reify(B).eval) + println(new C) + println(reify(new C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) + } +} + +package packageful { + object Test { + def test = { + println(B) + println(reify(B).eval) + println(new C) + println(reify(new C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) + } + } +} + +object Test extends dotty.runtime.LegacyApp { + packageless.test + packageful.Test.test +} diff --git a/tests/pending/run/reify_ann1a.check b/tests/pending/run/reify_ann1a.check new file mode 100644 index 000000000000..71841ff83b46 --- /dev/null +++ b/tests/pending/run/reify_ann1a.check @@ -0,0 +1,30 @@ +{ + @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { + @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; + def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { + super.(); + () + }; + @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { + @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); + val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); + r.$plus(s) + } + }; + () +} +{ + @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { + @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; + def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { + C.super.(); + () + }; + @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { + @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); + val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); + r.+(s) + } + }; + () +} diff --git a/tests/pending/run/reify_ann1a.scala b/tests/pending/run/reify_ann1a.scala new file mode 100644 index 000000000000..9252ddcf7168 --- /dev/null +++ b/tests/pending/run/reify_ann1a.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: List[String]) extends annotation.StaticAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { + @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { + @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) + val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_ann1b.check b/tests/pending/run/reify_ann1b.check new file mode 100644 index 000000000000..a046dafeab0d --- /dev/null +++ b/tests/pending/run/reify_ann1b.check @@ -0,0 +1,35 @@ +reify_ann1b.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String) extends annotation.ClassfileAnnotation + ^ +{ + @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends AnyRef { + @new ann(bar = "3a") @new ann(bar = "3b") private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _; + def (@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = { + super.(); + () + }; + @new ann(bar = "5a") @new ann(bar = "5b") def f(x: Int @ann(bar = "6a") @ann(bar = "6b")) = { + @new ann(bar = "7a") @new ann(bar = "7b") val r = x.$plus(3): @ann(bar = "8a"): @ann(bar = "8b"); + val s = (4: Int @ann(bar = "9a") @ann(bar = "9b")); + r.$plus(s) + } + }; + () +} +{ + @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T] extends AnyRef { + @ann(bar = "3a") @ann(bar = "3b") private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _; + def (@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = { + C.super.(); + () + }; + @ann(bar = "5a") @ann(bar = "5b") def f(x: Int @ann(bar = "6b") @ann(bar = "6a")): Int = { + @ann(bar = "7a") @ann(bar = "7b") val r: Int @ann(bar = "8b") @ann(bar = "8a") = ((x.+(3): Int @ann(bar = "8a")): Int @ann(bar = "8b") @ann(bar = "8a")); + val s: Int @ann(bar = "9b") @ann(bar = "9a") = (4: Int @ann(bar = "9b") @ann(bar = "9a")); + r.+(s) + } + }; + () +} diff --git a/tests/pending/run/reify_ann1b.scala b/tests/pending/run/reify_ann1b.scala new file mode 100644 index 000000000000..d3c6a4da3a6c --- /dev/null +++ b/tests/pending/run/reify_ann1b.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar="1a") @ann(bar="1b") class C[@ann(bar="2a") @ann(bar="2b") T](@ann(bar="3a") @ann(bar="3b") x: T @ann(bar="4a") @ann(bar="4b")) { + @ann(bar="5a") @ann(bar="5b") def f(x: Int @ann(bar="6a") @ann(bar="6b")) = { + @ann(bar="7a") @ann(bar="7b") val r = (x + 3): @ann(bar="8a") @ann(bar="8b") + val s = 4: Int @ann(bar="9a") @ann(bar="9b") + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_ann2a.check b/tests/pending/run/reify_ann2a.check new file mode 100644 index 000000000000..a26fa42045ec --- /dev/null +++ b/tests/pending/run/reify_ann2a.check @@ -0,0 +1,44 @@ +{ + class ann extends StaticAnnotation { + private[this] val bar: `package`.List[Predef.String] = _; + def (bar: `package`.List[Predef.String]) = { + super.(); + () + } + }; + @new ann(List.apply("1a")) @new ann(List.apply("1b")) class C[@new ann(List.apply("2a")) @new ann(List.apply("2b")) T] extends AnyRef { + @new ann(List.apply("3a")) @new ann(List.apply("3b")) private[this] val x: T @ann(List.apply("4a")) @ann(List.apply("4b")) = _; + def (@new ann(List.apply("3a")) @new ann(List.apply("3b")) x: T @ann(List.apply("4a")) @ann(List.apply("4b"))) = { + super.(); + () + }; + @new ann(List.apply("5a")) @new ann(List.apply("5b")) def f(x: Int @ann(List.apply("6a")) @ann(List.apply("6b"))) = { + @new ann(List.apply("7a")) @new ann(List.apply("7b")) val r = x.$plus(3): @ann(List.apply("8a")): @ann(List.apply("8b")); + val s = (4: Int @ann(List.apply("9a")) @ann(List.apply("9b"))); + r.$plus(s) + } + }; + () +} +{ + class ann extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { + private[this] val bar: List[String] = _; + def (bar: List[String]): ann = { + ann.super.(); + () + } + }; + @ann(List.apply[String]("1a")) @ann(List.apply[String]("1b")) class C[@ann(List.apply[String]("2a")) @ann(List.apply[String]("2b")) T] extends AnyRef { + @ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) private[this] val x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a")) = _; + def (@ann(List.apply[String]("3a")) @ann(List.apply[String]("3b")) x: T @ann(List.apply[String]("4b")) @ann(List.apply[String]("4a"))): C[T] = { + C.super.(); + () + }; + @ann(List.apply[String]("5a")) @ann(List.apply[String]("5b")) def f(x: Int @ann(List.apply[String]("6b")) @ann(List.apply[String]("6a"))): Int = { + @ann(List.apply[String]("7a")) @ann(List.apply[String]("7b")) val r: Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a")) = ((x.+(3): Int @ann(List.apply[String]("8a"))): Int @ann(List.apply[String]("8b")) @ann(List.apply[String]("8a"))); + val s: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a")) = (4: Int @ann(List.apply[String]("9b")) @ann(List.apply[String]("9a"))); + r.+(s) + } + }; + () +} diff --git a/tests/pending/run/reify_ann2a.scala b/tests/pending/run/reify_ann2a.scala new file mode 100644 index 000000000000..861cb6297353 --- /dev/null +++ b/tests/pending/run/reify_ann2a.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class ann(bar: List[String]) extends annotation.StaticAnnotation + + @ann(bar=List("1a")) @ann(bar=List("1b")) class C[@ann(bar=List("2a")) @ann(bar=List("2b")) T](@ann(bar=List("3a")) @ann(bar=List("3b")) x: T @ann(bar=List("4a")) @ann(bar=List("4b"))) { + @ann(bar=List("5a")) @ann(bar=List("5b")) def f(x: Int @ann(bar=List("6a")) @ann(bar=List("6b"))) = { + @ann(bar=List("7a")) @ann(bar=List("7b")) val r = (x + 3): @ann(bar=List("8a")) @ann(bar=List("8b")) + val s = 4: Int @ann(bar=List("9a")) @ann(bar=List("9b")) + r + s + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_ann3.check b/tests/pending/run/reify_ann3.check new file mode 100644 index 000000000000..4f1c61cf0e68 --- /dev/null +++ b/tests/pending/run/reify_ann3.check @@ -0,0 +1,21 @@ +{ + class Tree[A, +B] extends AnyRef { + @new inline @getter() final val key: A = _; + def (key: A) = { + super.(); + () + } + }; + () +} +{ + class Tree[A, +B] extends AnyRef { + final private[this] val key: A = _; + @inline @scala.annotation.meta.getter final def key: A = Tree.this.key; + def (key: A): Tree[A,B] = { + Tree.super.(); + () + } + }; + () +} diff --git a/tests/pending/run/reify_ann3.scala b/tests/pending/run/reify_ann3.scala new file mode 100644 index 000000000000..7eadd569bd55 --- /dev/null +++ b/tests/pending/run/reify_ann3.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class Tree[A, +B](@(inline @getter) final val key: A) + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_ann4.check b/tests/pending/run/reify_ann4.check new file mode 100644 index 000000000000..8bf5fe32423e --- /dev/null +++ b/tests/pending/run/reify_ann4.check @@ -0,0 +1,32 @@ +{ + class D extends StaticAnnotation { + def () = { + super.(); + () + } + }; + class C extends AnyRef { + def () = { + super.(); + () + } + }; + val c1 = new C @D(); + () +} +{ + class D extends scala.annotation.Annotation with scala.annotation.StaticAnnotation { + def (): D = { + D.super.(); + () + } + }; + class C extends AnyRef { + def (): C = { + C.super.(); + () + } + }; + val c1: C = new C @D(); + () +} diff --git a/tests/pending/run/reify_ann4.scala b/tests/pending/run/reify_ann4.scala new file mode 100644 index 000000000000..074ceb81548c --- /dev/null +++ b/tests/pending/run/reify_ann4.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class D extends StaticAnnotation + class C + val c1 = new C @D + //val c2 = (new C) @D // illegal syntax + //val c3 = c1 @D // illegal syntax + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_ann5.check b/tests/pending/run/reify_ann5.check new file mode 100644 index 000000000000..1ec0457e542c --- /dev/null +++ b/tests/pending/run/reify_ann5.check @@ -0,0 +1,22 @@ +{ + class C extends AnyRef { + @new inline @beanGetter() @new BeanProperty() val x: Int = _; + def (x: Int) = { + super.(); + () + } + }; + () +} +{ + class C extends AnyRef { + @scala.beans.BeanProperty private[this] val x: Int = _; + def x: Int = C.this.x; + def (x: Int): C = { + C.super.(); + () + }; + @inline @scala.annotation.meta.beanGetter def getX(): Int = C.this.x + }; + () +} diff --git a/tests/pending/run/reify_ann5.scala b/tests/pending/run/reify_ann5.scala new file mode 100644 index 000000000000..84e5bda9c43c --- /dev/null +++ b/tests/pending/run/reify_ann5.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.annotation._ +import scala.annotation.meta._ +import scala.beans._ + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class C(@BeanProperty @(inline @beanGetter) val x: Int) + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_anonymous.check b/tests/pending/run/reify_anonymous.check new file mode 100644 index 000000000000..b8626c4cff28 --- /dev/null +++ b/tests/pending/run/reify_anonymous.check @@ -0,0 +1 @@ +4 diff --git a/tests/pending/run/reify_anonymous.scala b/tests/pending/run/reify_anonymous.scala new file mode 100644 index 000000000000..a7aad4065cfa --- /dev/null +++ b/tests/pending/run/reify_anonymous.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new {def x = 2; def y = x * x}.y) + }.eval +} diff --git a/tests/pending/run/reify_classfileann_a.check b/tests/pending/run/reify_classfileann_a.check new file mode 100644 index 000000000000..51f255b23295 --- /dev/null +++ b/tests/pending/run/reify_classfileann_a.check @@ -0,0 +1,23 @@ +reify_classfileann_a.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + ^ +{ + @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends AnyRef { + def () = { + super.(); + () + } + }; + () +} +{ + @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends AnyRef { + def (): C = { + C.super.(); + () + } + }; + () +} diff --git a/tests/pending/run/reify_classfileann_a.scala b/tests/pending/run/reify_classfileann_a.scala new file mode 100644 index 000000000000..74546df37159 --- /dev/null +++ b/tests/pending/run/reify_classfileann_a.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) class C + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_classfileann_b.check b/tests/pending/run/reify_classfileann_b.check new file mode 100644 index 000000000000..05f2e5bfc6da --- /dev/null +++ b/tests/pending/run/reify_classfileann_b.check @@ -0,0 +1,25 @@ +reify_classfileann_b.scala:6: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + ^ +{ + class C extends AnyRef { + def () = { + super.(); + () + }; + def x: Int = 2: @ann(bar = "1",quux = Array("2", "3"),baz = new ann(bar = "4")) + }; + () +} +{ + class C extends AnyRef { + def (): C = { + C.super.(); + () + }; + def x: Int = (2: Int(2) @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4"))) + }; + () +} diff --git a/tests/pending/run/reify_classfileann_b.scala b/tests/pending/run/reify_classfileann_b.scala new file mode 100644 index 000000000000..920d671f9874 --- /dev/null +++ b/tests/pending/run/reify_classfileann_b.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ + class C { + def x: Int = { + 2: @ann(bar="1", quux=Array("2", "3"), baz = new ann(bar = "4")) + } + } + }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/reify_closure1.check b/tests/pending/run/reify_closure1.check new file mode 100644 index 000000000000..b2f7f08c1707 --- /dev/null +++ b/tests/pending/run/reify_closure1.check @@ -0,0 +1,2 @@ +10 +10 diff --git a/tests/pending/run/reify_closure1.scala b/tests/pending/run/reify_closure1.scala new file mode 100644 index 000000000000..6a5684b2aaa9 --- /dev/null +++ b/tests/pending/run/reify_closure1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo[T](ys: List[T]): Int => Int = { + val fun = reify{(x: Int) => { + x + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(List(1, 2, 3))(10)) + println(foo(List(1, 2, 3, 4))(10)) +} diff --git a/tests/pending/run/reify_closure2a.check b/tests/pending/run/reify_closure2a.check new file mode 100644 index 000000000000..c1f3abd7e69f --- /dev/null +++ b/tests/pending/run/reify_closure2a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/pending/run/reify_closure2a.scala b/tests/pending/run/reify_closure2a.scala new file mode 100644 index 000000000000..cc194bc6d14c --- /dev/null +++ b/tests/pending/run/reify_closure2a.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + val fun = reify{(x: Int) => { + x + y + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/pending/run/reify_closure3a.check b/tests/pending/run/reify_closure3a.check new file mode 100644 index 000000000000..c1f3abd7e69f --- /dev/null +++ b/tests/pending/run/reify_closure3a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/pending/run/reify_closure3a.scala b/tests/pending/run/reify_closure3a.scala new file mode 100644 index 000000000000..0d540d1dd9af --- /dev/null +++ b/tests/pending/run/reify_closure3a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + def y1 = y + + val fun = reify{(x: Int) => { + x + y1 + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/pending/run/reify_closure4a.check b/tests/pending/run/reify_closure4a.check new file mode 100644 index 000000000000..c1f3abd7e69f --- /dev/null +++ b/tests/pending/run/reify_closure4a.check @@ -0,0 +1,2 @@ +11 +12 diff --git a/tests/pending/run/reify_closure4a.scala b/tests/pending/run/reify_closure4a.scala new file mode 100644 index 000000000000..373c3b2fa8e1 --- /dev/null +++ b/tests/pending/run/reify_closure4a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo(y: Int): Int => Int = { + val y1 = y + + val fun = reify{(x: Int) => { + x + y1 + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(1)(10)) + println(foo(2)(10)) +} diff --git a/tests/pending/run/reify_closure5a.check b/tests/pending/run/reify_closure5a.check new file mode 100644 index 000000000000..df9e19c591f8 --- /dev/null +++ b/tests/pending/run/reify_closure5a.check @@ -0,0 +1,2 @@ +13 +14 diff --git a/tests/pending/run/reify_closure5a.scala b/tests/pending/run/reify_closure5a.scala new file mode 100644 index 000000000000..e2bd24ad2375 --- /dev/null +++ b/tests/pending/run/reify_closure5a.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val fun = reify{(x: Int) => { + x + ys.length + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + var fun1 = foo(List(1, 2, 3)) + println(fun1(10)) + var fun2 = foo(List(1, 2, 3, 4)) + println(fun2(10)) +} diff --git a/tests/pending/run/reify_closure6.check b/tests/pending/run/reify_closure6.check new file mode 100644 index 000000000000..b9de4c6baf61 --- /dev/null +++ b/tests/pending/run/reify_closure6.check @@ -0,0 +1,7 @@ +q = 1 +y = 1 +first invocation = 15 +q = 2 +y = 1 +second invocation = 17 +q after second invocation = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_closure6.scala b/tests/pending/run/reify_closure6.scala new file mode 100644 index 000000000000..1c3589cdf0db --- /dev/null +++ b/tests/pending/run/reify_closure6.scala @@ -0,0 +1,29 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + var q = 0 + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val z = 1 + var y = 0 + val fun = reify{(x: Int) => { + y += 1 + q += 1 + println("q = " + q) + println("y = " + y) + x + ys.length * z + q + y + }} + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + dyn.asInstanceOf[Int => Int] + } + + val fun1 = foo(List(1, 2, 3)) + println("first invocation = " + fun1(10)) + val fun2 = foo(List(1, 2, 3, 4)) + println("second invocation = " + fun2(10)) + println("q after second invocation = " + q) +} diff --git a/tests/pending/run/reify_closure7.check b/tests/pending/run/reify_closure7.check new file mode 100644 index 000000000000..bf58b52bce87 --- /dev/null +++ b/tests/pending/run/reify_closure7.check @@ -0,0 +1,6 @@ +q = 1 +y = 1 +first invocation = 15 +q = 2 +y = 2 +second invocation = 17 diff --git a/tests/pending/run/reify_closure7.scala b/tests/pending/run/reify_closure7.scala new file mode 100644 index 000000000000..93f2f22a45c0 --- /dev/null +++ b/tests/pending/run/reify_closure7.scala @@ -0,0 +1,33 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + var q = 0 + var clo: Int => Int = null + def foo[T: TypeTag](ys: List[T]): Int => Int = { + val z = 1 + var y = 0 + val fun = reify{(x: Int) => { + y += 1 + q += 1 + println("q = " + q) + println("y = " + y) + x + ys.length * z + q + y + }} + + if (clo == null) { + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(fun.tree) + clo = dyn.asInstanceOf[Int => Int] + } + + clo + } + + val fun1 = foo(List(1, 2, 3)) + println("first invocation = " + fun1(10)) + val fun2 = foo(List(1, 2, 3, 4)) + println("second invocation = " + fun2(10)) +} diff --git a/tests/pending/run/reify_closure8a.check b/tests/pending/run/reify_closure8a.check new file mode 100644 index 000000000000..9a037142aa3c --- /dev/null +++ b/tests/pending/run/reify_closure8a.check @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/tests/pending/run/reify_closure8a.scala b/tests/pending/run/reify_closure8a.scala new file mode 100644 index 000000000000..ad343dd15528 --- /dev/null +++ b/tests/pending/run/reify_closure8a.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + class Foo(val y: Int) { + def fun = reify{y} + } + + val toolbox = cm.mkToolBox() + val dyn = toolbox.eval(new Foo(10).fun.tree) + val foo = dyn.asInstanceOf[Int] + println(foo) +} diff --git a/tests/pending/run/reify_closure8b.check b/tests/pending/run/reify_closure8b.check new file mode 100644 index 000000000000..5d48d3ab36c7 --- /dev/null +++ b/tests/pending/run/reify_closure8b.check @@ -0,0 +1,3 @@ +scala.tools.reflect.ToolBoxError: reflective compilation has failed: + +value y is not a member of Test.Foo diff --git a/tests/pending/run/reify_closure8b.scala b/tests/pending/run/reify_closure8b.scala new file mode 100644 index 000000000000..f28b18e01fbf --- /dev/null +++ b/tests/pending/run/reify_closure8b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // will fail because y is a private field + // reification doesn't magically make unavailable stuff available + class Foo(y: Int) { + def fun = reify{y} + } + + try { + val dyn = cm.mkToolBox().eval(new Foo(10).fun.tree) + val foo = dyn.asInstanceOf[Int] + println(foo) + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/pending/run/reify_closures10.check b/tests/pending/run/reify_closures10.check new file mode 100644 index 000000000000..fd3c81a4d763 --- /dev/null +++ b/tests/pending/run/reify_closures10.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/pending/run/reify_closures10.scala b/tests/pending/run/reify_closures10.scala new file mode 100644 index 000000000000..9c486e4361c5 --- /dev/null +++ b/tests/pending/run/reify_closures10.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val y = 3 + val code = reify{println(x + y); x + y} + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/pending/run/reify_complex.check b/tests/pending/run/reify_complex.check new file mode 100644 index 000000000000..7df35e33a0d2 --- /dev/null +++ b/tests/pending/run/reify_complex.check @@ -0,0 +1 @@ +3.0+4.0*i diff --git a/tests/pending/run/reify_complex.scala b/tests/pending/run/reify_complex.scala new file mode 100644 index 000000000000..45b72d899674 --- /dev/null +++ b/tests/pending/run/reify_complex.scala @@ -0,0 +1,25 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class Complex(val re: Double, val im: Double) { + def + (that: Complex) = + new Complex(re + that.re, im + that.im) + def - (that: Complex) = + new Complex(re - that.re, im - that.im) + def * (that: Complex) = + new Complex(re * that.re - im * that.im, + re * that.im + im * that.re) + def / (that: Complex) = { + val denom = that.re * that.re + that.im * that.im + new Complex((re * that.re + im * that.im) / denom, + (im * that.re - re * that.im) / denom) + } + override def toString = + re + (if (im < 0) "-" + (-im) else "+" + im) + "*i" + } + val x = new Complex(2, 1); val y = new Complex(1, 3) + println(x + y) + }.eval +} diff --git a/tests/pending/run/reify_copypaste1.check b/tests/pending/run/reify_copypaste1.check new file mode 100644 index 000000000000..b204f9c45427 --- /dev/null +++ b/tests/pending/run/reify_copypaste1.check @@ -0,0 +1,2 @@ +List(1, 2) + diff --git a/tests/pending/run/reify_copypaste1.scala b/tests/pending/run/reify_copypaste1.scala new file mode 100644 index 000000000000..e255403ad9fc --- /dev/null +++ b/tests/pending/run/reify_copypaste1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe.definitions._ +import scala.reflect.runtime.universe.Flag._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val stdout = System.out + val output = new java.io.ByteArrayOutputStream() + System.setOut(new java.io.PrintStream(output)) + val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste") + val reify = Select(Select(Select(Select(Ident(ScalaPackage), TermName("reflect")), TermName("runtime")), TermName("universe")), TermName("reify")) + val reifee = Block(List(ValDef(Modifiers(LAZY), TermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(TermName("x"))) + toolBox.eval(Apply(reify, List(reifee))) + val Block(List(tpeCopypaste, exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))), Literal(Constant(()))) = toolBox.parse(output.toString()) + output.reset() + toolBox.eval(Block(stats, expr)) + stdout.println(output.toString) +} diff --git a/tests/pending/run/reify_copypaste2.check b/tests/pending/run/reify_copypaste2.check new file mode 100644 index 000000000000..f5c1076962c1 --- /dev/null +++ b/tests/pending/run/reify_copypaste2.check @@ -0,0 +1 @@ +`package`.universe.reify(Test.this.x) diff --git a/tests/pending/run/reify_copypaste2.scala b/tests/pending/run/reify_copypaste2.scala new file mode 100644 index 000000000000..2f9bea1fe617 --- /dev/null +++ b/tests/pending/run/reify_copypaste2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} + println(outer.tree) +} diff --git a/tests/pending/run/reify_csv.check b/tests/pending/run/reify_csv.check new file mode 100644 index 000000000000..b56f4bb50b37 --- /dev/null +++ b/tests/pending/run/reify_csv.check @@ -0,0 +1,10 @@ +List(phase name, id, description) +record(parser,1,parse source into ASTs, perform simple desugaring) +record(namer,2,resolve names, attach symbols to named trees) +record(packageobjects,3,load package objects) +record(typer,4,the meat and potatoes: type the trees) +record(superaccessors,5,add super accessors in traits and nested classes) +record(pickler,6,serialize symbol tables) +record(refchecks,7,reference/override checking, translate nested objects) +record(selectiveanf,8,) +record(liftcode,9,reify trees) diff --git a/tests/pending/run/reify_csv.scala b/tests/pending/run/reify_csv.scala new file mode 100644 index 000000000000..1c567c9042b0 --- /dev/null +++ b/tests/pending/run/reify_csv.scala @@ -0,0 +1,36 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val csv = """ + | phase name; id; description + | parser; 1; parse source into ASTs, perform simple desugaring + | namer; 2; resolve names, attach symbols to named trees + |packageobjects; 3; load package objects + | typer; 4; the meat and potatoes: type the trees + |superaccessors; 5; add super accessors in traits and nested classes + | pickler; 6; serialize symbol tables + | refchecks; 7; reference/override checking, translate nested objects + | selectiveanf; 8; + | liftcode; 9; reify trees""".stripMargin.split("\n").map{_.trim()}.drop(1).toList + + val fields = csv.head.split(";").map{_.trim()}.toList + println(fields) + + reify({ + object Csv { + case class record(`phase name`: String, id: String, description: String) + + object record { + def parse(lines: List[String]) = { + lines drop(1) map { line => line.split(";", -1).toList match { + case phase$whitespace$name :: id :: description :: _ => record(phase$whitespace$name.trim(), id.trim(), description.trim()) + case _ => throw new Exception("format error") + }} + } + } + } + + Csv.record.parse(csv) foreach println + }).eval +} diff --git a/tests/pending/run/reify_extendbuiltins.check b/tests/pending/run/reify_extendbuiltins.check new file mode 100644 index 000000000000..a48033a30d48 --- /dev/null +++ b/tests/pending/run/reify_extendbuiltins.check @@ -0,0 +1 @@ +10! = 3628800 diff --git a/tests/pending/run/reify_extendbuiltins.scala b/tests/pending/run/reify_extendbuiltins.scala new file mode 100644 index 000000000000..3056db6e4253 --- /dev/null +++ b/tests/pending/run/reify_extendbuiltins.scala @@ -0,0 +1,17 @@ + +import scala.language.{ implicitConversions, postfixOps } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def fact(n: Int): BigInt = + if (n == 0) 1 else fact(n-1) * n + class Factorizer(n: Int) { + def ! = fact(n) + } + implicit def int2fact(n: Int) = new Factorizer(n) + + println("10! = " + (10!)) + }.eval +} diff --git a/tests/pending/run/reify_for1.scala b/tests/pending/run/reify_for1.scala new file mode 100644 index 000000000000..1233782adbb7 --- /dev/null +++ b/tests/pending/run/reify_for1.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val sumOfSquares1 = (for (i <- 1 to 100; if (i % 3 == 0)) yield Math.pow(i, 2)).sum + val sumOfSquares2 = (1 to 100).filter(_ % 3 == 0).map(Math.pow(_, 2)).sum + assert(sumOfSquares1 == sumOfSquares2) + }.eval +} diff --git a/tests/pending/run/reify_fors_newpatmat.check b/tests/pending/run/reify_fors_newpatmat.check new file mode 100644 index 000000000000..eefddedc2089 --- /dev/null +++ b/tests/pending/run/reify_fors_newpatmat.check @@ -0,0 +1,5 @@ +Persons over 20: John Richard +divisors(34) = List(1, 2, 17, 34) +findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) +average(List(3.5, 5.0, 4.5)) = 4.333333333333333 +scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/pending/run/reify_fors_newpatmat.scala b/tests/pending/run/reify_fors_newpatmat.scala new file mode 100644 index 000000000000..d366169a40c4 --- /dev/null +++ b/tests/pending/run/reify_fors_newpatmat.scala @@ -0,0 +1,101 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object Persons { + /** A list of persons. To create a list, we use Predef.List + * which takes a variable number of arguments and constructs + * a list out of them. + */ + val persons = List( + new Person("Bob", 17), + new Person("John", 40), + new Person("Richard", 68) + ) + + /** A Person class. 'val' constructor parameters become + * public members of the class. + */ + class Person(val name: String, val age: Int) + + /** Return an iterator over persons that are older than 20. + */ + def olderThan20(xs: Seq[Person]): Iterator[String] = + olderThan20(xs.iterator) + + /** Return an iterator over persons older than 20, given + * an iterator over persons. + */ + def olderThan20(xs: Iterator[Person]): Iterator[String] = { + + // The first expression is called a 'generator' and makes + // 'p' take values from 'xs'. The second expression is + // called a 'filter' and it is a boolean expression which + // selects only persons older than 20. There can be more than + // one generator and filter. The 'yield' expression is evaluated + // for each 'p' which satisfies the filters and used to assemble + // the resulting iterator + for (p <- xs if p.age > 20) yield p.name + } + } + + /** Some functions over lists of numbers which demonstrate + * the use of for comprehensions. + */ + object Numeric { + + /** Return the divisors of n. */ + def divisors(n: Int): List[Int] = + for (i <- List.range(1, n+1) if n % i == 0) yield i + + /** Is 'n' a prime number? */ + def isPrime(n: Int) = divisors(n).length == 2 + + /** Return pairs of numbers whose sum is prime. */ + def findNums(n: Int): Iterable[(Int, Int)] = { + + // a for comprehension using two generators + for (i <- 1 until n; + j <- 1 until (i-1); + if isPrime(i + j)) yield (i, j) + } + + /** Return the sum of the elements of 'xs'. */ + def sum(xs: List[Double]): Double = + xs.foldLeft(0.0) { (x, y) => x + y } + + /** Return the sum of pairwise product of the two lists. */ + def scalProd(xs: List[Double], ys: List[Double]) = + sum(for((x, y) <- xs zip ys) yield x * y); + + /** Remove duplicate elements in 'xs'. */ + def removeDuplicates[A](xs: List[A]): List[A] = + if (xs.isEmpty) + xs + else + xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) + } + + // import all members of object 'persons' in the current scope + import Persons._ + + print("Persons over 20:") + olderThan20(persons) foreach { x => print(" " + x) } + println + + import Numeric._ + + println("divisors(34) = " + divisors(34)) + + print("findNums(15) =") + findNums(15) foreach { x => print(" " + x) } + println + + val xs = List(3.5, 5.0, 4.5) + println("average(" + xs + ") = " + sum(xs) / xs.length) + + val ys = List(2.0, 1.0, 3.0) + println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) + }.eval +} diff --git a/tests/pending/run/reify_fors_oldpatmat.check b/tests/pending/run/reify_fors_oldpatmat.check new file mode 100644 index 000000000000..eefddedc2089 --- /dev/null +++ b/tests/pending/run/reify_fors_oldpatmat.check @@ -0,0 +1,5 @@ +Persons over 20: John Richard +divisors(34) = List(1, 2, 17, 34) +findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) +average(List(3.5, 5.0, 4.5)) = 4.333333333333333 +scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/tests/pending/run/reify_fors_oldpatmat.scala b/tests/pending/run/reify_fors_oldpatmat.scala new file mode 100644 index 000000000000..d366169a40c4 --- /dev/null +++ b/tests/pending/run/reify_fors_oldpatmat.scala @@ -0,0 +1,101 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object Persons { + /** A list of persons. To create a list, we use Predef.List + * which takes a variable number of arguments and constructs + * a list out of them. + */ + val persons = List( + new Person("Bob", 17), + new Person("John", 40), + new Person("Richard", 68) + ) + + /** A Person class. 'val' constructor parameters become + * public members of the class. + */ + class Person(val name: String, val age: Int) + + /** Return an iterator over persons that are older than 20. + */ + def olderThan20(xs: Seq[Person]): Iterator[String] = + olderThan20(xs.iterator) + + /** Return an iterator over persons older than 20, given + * an iterator over persons. + */ + def olderThan20(xs: Iterator[Person]): Iterator[String] = { + + // The first expression is called a 'generator' and makes + // 'p' take values from 'xs'. The second expression is + // called a 'filter' and it is a boolean expression which + // selects only persons older than 20. There can be more than + // one generator and filter. The 'yield' expression is evaluated + // for each 'p' which satisfies the filters and used to assemble + // the resulting iterator + for (p <- xs if p.age > 20) yield p.name + } + } + + /** Some functions over lists of numbers which demonstrate + * the use of for comprehensions. + */ + object Numeric { + + /** Return the divisors of n. */ + def divisors(n: Int): List[Int] = + for (i <- List.range(1, n+1) if n % i == 0) yield i + + /** Is 'n' a prime number? */ + def isPrime(n: Int) = divisors(n).length == 2 + + /** Return pairs of numbers whose sum is prime. */ + def findNums(n: Int): Iterable[(Int, Int)] = { + + // a for comprehension using two generators + for (i <- 1 until n; + j <- 1 until (i-1); + if isPrime(i + j)) yield (i, j) + } + + /** Return the sum of the elements of 'xs'. */ + def sum(xs: List[Double]): Double = + xs.foldLeft(0.0) { (x, y) => x + y } + + /** Return the sum of pairwise product of the two lists. */ + def scalProd(xs: List[Double], ys: List[Double]) = + sum(for((x, y) <- xs zip ys) yield x * y); + + /** Remove duplicate elements in 'xs'. */ + def removeDuplicates[A](xs: List[A]): List[A] = + if (xs.isEmpty) + xs + else + xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) + } + + // import all members of object 'persons' in the current scope + import Persons._ + + print("Persons over 20:") + olderThan20(persons) foreach { x => print(" " + x) } + println + + import Numeric._ + + println("divisors(34) = " + divisors(34)) + + print("findNums(15) =") + findNums(15) foreach { x => print(" " + x) } + println + + val xs = List(3.5, 5.0, 4.5) + println("average(" + xs + ") = " + sum(xs) / xs.length) + + val ys = List(2.0, 1.0, 3.0) + println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) + }.eval +} diff --git a/tests/pending/run/reify_generic.check b/tests/pending/run/reify_generic.check new file mode 100644 index 000000000000..b8626c4cff28 --- /dev/null +++ b/tests/pending/run/reify_generic.check @@ -0,0 +1 @@ +4 diff --git a/tests/pending/run/reify_generic.scala b/tests/pending/run/reify_generic.scala new file mode 100644 index 000000000000..4221dbf6ce68 --- /dev/null +++ b/tests/pending/run/reify_generic.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val product = List(1, 2, 3).head * List[Any](4, 2, 0).head.asInstanceOf[Int] + println(product) + }.eval +} diff --git a/tests/pending/run/reify_generic2.check b/tests/pending/run/reify_generic2.check new file mode 100644 index 000000000000..b8626c4cff28 --- /dev/null +++ b/tests/pending/run/reify_generic2.check @@ -0,0 +1 @@ +4 diff --git a/tests/pending/run/reify_generic2.scala b/tests/pending/run/reify_generic2.scala new file mode 100644 index 000000000000..6941d9ff7100 --- /dev/null +++ b/tests/pending/run/reify_generic2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C + val product = List(new C, new C).length * List[C](new C, new C).length + println(product) + }.eval +} diff --git a/tests/pending/run/reify_getter.check b/tests/pending/run/reify_getter.check new file mode 100644 index 000000000000..5ef4ff4d04d9 --- /dev/null +++ b/tests/pending/run/reify_getter.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/pending/run/reify_getter.scala b/tests/pending/run/reify_getter.scala new file mode 100644 index 000000000000..18c9a1a3260d --- /dev/null +++ b/tests/pending/run/reify_getter.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { + val x = 2 + } + + new C().x + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_implicits-new.check b/tests/pending/run/reify_implicits-new.check new file mode 100644 index 000000000000..e3aeb20f6b32 --- /dev/null +++ b/tests/pending/run/reify_implicits-new.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/tests/pending/run/reify_implicits-new.scala b/tests/pending/run/reify_implicits-new.scala new file mode 100644 index 000000000000..5ff90871ab4c --- /dev/null +++ b/tests/pending/run/reify_implicits-new.scala @@ -0,0 +1,18 @@ + +import scala.language.{ implicitConversions, reflectiveCalls } +import scala.reflect.{ClassTag, classTag} +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit def arrayWrapper[A : ClassTag](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +} diff --git a/tests/pending/run/reify_implicits-old.check b/tests/pending/run/reify_implicits-old.check new file mode 100644 index 000000000000..e3aeb20f6b32 --- /dev/null +++ b/tests/pending/run/reify_implicits-old.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/tests/pending/run/reify_implicits-old.scala b/tests/pending/run/reify_implicits-old.scala new file mode 100644 index 000000000000..ccd9375d6d5e --- /dev/null +++ b/tests/pending/run/reify_implicits-old.scala @@ -0,0 +1,17 @@ + +import scala.language.{ implicitConversions, reflectiveCalls } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +} diff --git a/tests/pending/run/reify_inheritance.check b/tests/pending/run/reify_inheritance.check new file mode 100644 index 000000000000..25bf17fc5aaa --- /dev/null +++ b/tests/pending/run/reify_inheritance.check @@ -0,0 +1 @@ +18 \ No newline at end of file diff --git a/tests/pending/run/reify_inheritance.scala b/tests/pending/run/reify_inheritance.scala new file mode 100644 index 000000000000..f4fb49edc78e --- /dev/null +++ b/tests/pending/run/reify_inheritance.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + def x = 2 + def y = x * x + } + + class D extends C { + override def x = 3 + } + + println(new D().y * new C().x) + }.eval +} diff --git a/tests/pending/run/reify_inner1.check b/tests/pending/run/reify_inner1.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_inner1.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner1.scala b/tests/pending/run/reify_inner1.scala new file mode 100644 index 000000000000..bae49f910a1b --- /dev/null +++ b/tests/pending/run/reify_inner1.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + class D { + val x = 2 + } + } + + val outer = new C() + val inner = new outer.D() + println(inner.x) + }.eval +} diff --git a/tests/pending/run/reify_inner2.check b/tests/pending/run/reify_inner2.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_inner2.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner2.scala b/tests/pending/run/reify_inner2.scala new file mode 100644 index 000000000000..fbe54b072b42 --- /dev/null +++ b/tests/pending/run/reify_inner2.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + object D { + val x = 2 + } + } + + val outer = new C() + val inner = outer.D + println(inner.x) + }.eval +} diff --git a/tests/pending/run/reify_inner3.check b/tests/pending/run/reify_inner3.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_inner3.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner3.scala b/tests/pending/run/reify_inner3.scala new file mode 100644 index 000000000000..004041b7dc22 --- /dev/null +++ b/tests/pending/run/reify_inner3.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C { + class D { + val x = 2 + } + } + + val outer = C + val inner = new outer.D + println(inner.x) + }.eval +} diff --git a/tests/pending/run/reify_inner4.check b/tests/pending/run/reify_inner4.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_inner4.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_inner4.scala b/tests/pending/run/reify_inner4.scala new file mode 100644 index 000000000000..5292cf040f8a --- /dev/null +++ b/tests/pending/run/reify_inner4.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C { + object D { + val x = 2 + } + } + + val outer = C + val inner = outer.D + println(inner.x) + }.eval +} diff --git a/tests/pending/run/reify_lazyevaluation.check b/tests/pending/run/reify_lazyevaluation.check new file mode 100644 index 000000000000..1c7f96cd96b2 --- /dev/null +++ b/tests/pending/run/reify_lazyevaluation.check @@ -0,0 +1,8 @@ +s = Susp(?) +evaluating... +s() = 3 +s = Susp(3) +2 + s = 5 +sl2 = Susp(?) +sl2() = Some(3) +sl2 = Susp(Some(3)) diff --git a/tests/pending/run/reify_lazyevaluation.scala b/tests/pending/run/reify_lazyevaluation.scala new file mode 100644 index 000000000000..564e7f1cdf0e --- /dev/null +++ b/tests/pending/run/reify_lazyevaluation.scala @@ -0,0 +1,61 @@ + +import scala.language.{ implicitConversions } +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object lazyLib { + + /** Delay the evaluation of an expression until it is needed. */ + def delay[A](value: => A): Susp[A] = new SuspImpl[A](value) + + /** Get the value of a delayed expression. */ + implicit def force[A](s: Susp[A]): A = s() + + /** + * Data type of suspended computations. (The name froms from ML.) + */ + abstract class Susp[+A] extends Function0[A] + + /** + * Implementation of suspended computations, separated from the + * abstract class so that the type parameter can be invariant. + */ + class SuspImpl[A](lazyValue: => A) extends Susp[A] { + private var maybeValue: Option[A] = None + + override def apply() = maybeValue match { + case None => + val value = lazyValue + maybeValue = Some(value) + value + case Some(value) => + value + } + + override def toString() = maybeValue match { + case None => "Susp(?)" + case Some(value) => "Susp(" + value + ")" + } + } + } + + import lazyLib._ + + val s: Susp[Int] = delay { println("evaluating..."); 3 } + + println("s = " + s) // show that s is unevaluated + println("s() = " + s()) // evaluate s + println("s = " + s) // show that the value is saved + println("2 + s = " + (2 + s)) // implicit call to force() + + val sl = delay { Some(3) } + val sl1: Susp[Some[Int]] = sl + val sl2: Susp[Option[Int]] = sl1 // the type is covariant + + println("sl2 = " + sl2) + println("sl2() = " + sl2()) + println("sl2 = " + sl2) + }.eval +} diff --git a/tests/pending/run/reify_lazyunit.check b/tests/pending/run/reify_lazyunit.check new file mode 100644 index 000000000000..579ecfe8aa2f --- /dev/null +++ b/tests/pending/run/reify_lazyunit.check @@ -0,0 +1,6 @@ +reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + lazy val x = { 0; println("12")} + ^ +12 +one +two diff --git a/tests/pending/run/reify_lazyunit.scala b/tests/pending/run/reify_lazyunit.scala new file mode 100644 index 000000000000..70caf4f33866 --- /dev/null +++ b/tests/pending/run/reify_lazyunit.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + lazy val x = { 0; println("12")} + x + println("one") + x + println("two") + }.eval +} + diff --git a/tests/pending/run/reify_magicsymbols.check b/tests/pending/run/reify_magicsymbols.check new file mode 100644 index 000000000000..c9d892d79328 --- /dev/null +++ b/tests/pending/run/reify_magicsymbols.check @@ -0,0 +1,13 @@ +Any +AnyVal +AnyRef +Null +Nothing +List[Any] +List[AnyVal] +List[AnyRef] +List[Null] +List[Nothing] +AnyRef{def foo(x: Int): Int} +Int* => Unit +(=> Int) => Unit diff --git a/tests/pending/run/reify_magicsymbols.scala b/tests/pending/run/reify_magicsymbols.scala new file mode 100644 index 000000000000..9d4e06b8a45b --- /dev/null +++ b/tests/pending/run/reify_magicsymbols.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(typeOf[Any]) + println(typeOf[AnyVal]) + println(typeOf[AnyRef]) + println(typeOf[Null]) + println(typeOf[Nothing]) + println(typeOf[List[Any]]) + println(typeOf[List[AnyVal]]) + println(typeOf[List[AnyRef]]) + println(typeOf[List[Null]]) + println(typeOf[List[Nothing]]) + println(typeOf[{def foo(x: Int): Int}]) + println(typeOf[(Int*) => Unit]) + println(typeOf[(=> Int) => Unit]) +} diff --git a/tests/pending/run/reify_maps_newpatmat.check b/tests/pending/run/reify_maps_newpatmat.check new file mode 100644 index 000000000000..08cbbb135925 --- /dev/null +++ b/tests/pending/run/reify_maps_newpatmat.check @@ -0,0 +1,4 @@ +red has code: 16711680 +Unknown color: green +Unknown color: blue +turquoise has code: 65535 diff --git a/tests/pending/run/reify_maps_newpatmat.scala b/tests/pending/run/reify_maps_newpatmat.scala new file mode 100644 index 000000000000..18adb5c36a03 --- /dev/null +++ b/tests/pending/run/reify_maps_newpatmat.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val colors = Map("red" -> 0xFF0000, + "turquoise" -> 0x00FFFF, + "black" -> 0x000000, + "orange" -> 0xFF8040, + "brown" -> 0x804000) + for (name <- List("red", "green", "blue", "turquoise")) println( + colors.get(name) match { + case Some(code) => + name + " has code: " + code + case None => + "Unknown color: " + name + } + ) + }.eval +} diff --git a/tests/pending/run/reify_maps_oldpatmat.check b/tests/pending/run/reify_maps_oldpatmat.check new file mode 100644 index 000000000000..08cbbb135925 --- /dev/null +++ b/tests/pending/run/reify_maps_oldpatmat.check @@ -0,0 +1,4 @@ +red has code: 16711680 +Unknown color: green +Unknown color: blue +turquoise has code: 65535 diff --git a/tests/pending/run/reify_maps_oldpatmat.scala b/tests/pending/run/reify_maps_oldpatmat.scala new file mode 100644 index 000000000000..18adb5c36a03 --- /dev/null +++ b/tests/pending/run/reify_maps_oldpatmat.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val colors = Map("red" -> 0xFF0000, + "turquoise" -> 0x00FFFF, + "black" -> 0x000000, + "orange" -> 0xFF8040, + "brown" -> 0x804000) + for (name <- List("red", "green", "blue", "turquoise")) println( + colors.get(name) match { + case Some(code) => + name + " has code: " + code + case None => + "Unknown color: " + name + } + ) + }.eval +} diff --git a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check new file mode 100644 index 000000000000..5bfed17f8eb5 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala new file mode 100644 index 000000000000..2f930c25e692 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_+0_refers_to_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 + val inner = reify{x} +// was: inner.splice + inner.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check new file mode 100644 index 000000000000..5bfed17f8eb5 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala new file mode 100644 index 000000000000..526ed3d13505 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_a.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} +// was: val code = reify{outer.splice.splice} + val code = reify{outer.eval.eval} + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check new file mode 100644 index 000000000000..5bfed17f8eb5 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala new file mode 100644 index 000000000000..96793c6348d0 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_0_b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val code = reify{ + { + val inner = reify{reify{x}} +// was: inner.splice + inner.eval +// was: }.splice + }.eval + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check new file mode 100644 index 000000000000..5bfed17f8eb5 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala new file mode 100644 index 000000000000..0fc985b6aac7 --- /dev/null +++ b/tests/pending/run/reify_metalevel_breach_-1_refers_to_1.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 + val inner = reify{reify{x}} +// was: inner.splice.splice + inner.eval.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_nested_inner_refers_to_global.check b/tests/pending/run/reify_nested_inner_refers_to_global.check new file mode 100644 index 000000000000..5ef4ff4d04d9 --- /dev/null +++ b/tests/pending/run/reify_nested_inner_refers_to_global.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/pending/run/reify_nested_inner_refers_to_global.scala b/tests/pending/run/reify_nested_inner_refers_to_global.scala new file mode 100644 index 000000000000..41d378e91436 --- /dev/null +++ b/tests/pending/run/reify_nested_inner_refers_to_global.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = { + val x = 2 + reify{ + reify{x}.splice + } + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_nested_inner_refers_to_local.check b/tests/pending/run/reify_nested_inner_refers_to_local.check new file mode 100644 index 000000000000..5bfed17f8eb5 --- /dev/null +++ b/tests/pending/run/reify_nested_inner_refers_to_local.check @@ -0,0 +1 @@ +evaluated = 2 \ No newline at end of file diff --git a/tests/pending/run/reify_nested_inner_refers_to_local.scala b/tests/pending/run/reify_nested_inner_refers_to_local.scala new file mode 100644 index 000000000000..102278c84e0f --- /dev/null +++ b/tests/pending/run/reify_nested_inner_refers_to_local.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify{ + val x = 2 +// was: reify{x}.eval + reify{x}.eval + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_nested_outer_refers_to_global.check b/tests/pending/run/reify_nested_outer_refers_to_global.check new file mode 100644 index 000000000000..5ef4ff4d04d9 --- /dev/null +++ b/tests/pending/run/reify_nested_outer_refers_to_global.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/pending/run/reify_nested_outer_refers_to_global.scala b/tests/pending/run/reify_nested_outer_refers_to_global.scala new file mode 100644 index 000000000000..bff5dc407ce7 --- /dev/null +++ b/tests/pending/run/reify_nested_outer_refers_to_global.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = { + val x = 2 + val outer = reify{x} + reify{ + val x = 42 + outer.splice + }; + } + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_nested_outer_refers_to_local.check b/tests/pending/run/reify_nested_outer_refers_to_local.check new file mode 100644 index 000000000000..5ef4ff4d04d9 --- /dev/null +++ b/tests/pending/run/reify_nested_outer_refers_to_local.check @@ -0,0 +1 @@ +evaluated = 2 diff --git a/tests/pending/run/reify_nested_outer_refers_to_local.scala b/tests/pending/run/reify_nested_outer_refers_to_local.scala new file mode 100644 index 000000000000..70c400bc2cae --- /dev/null +++ b/tests/pending/run/reify_nested_outer_refers_to_local.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val outer = { + val x = 2 + reify{x} + } + val code = reify{ + val x = 42 + outer.splice + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_newimpl_01.check b/tests/pending/run/reify_newimpl_01.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_01.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_01.scala b/tests/pending/run/reify_newimpl_01.scala new file mode 100644 index 000000000000..1a5f96b539ba --- /dev/null +++ b/tests/pending/run/reify_newimpl_01.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 2 + val code = reify { + x + } + println(code.eval) + } +} diff --git a/tests/pending/run/reify_newimpl_02.check b/tests/pending/run/reify_newimpl_02.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_02.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_02.scala b/tests/pending/run/reify_newimpl_02.scala new file mode 100644 index 000000000000..1ef3f03ed5e7 --- /dev/null +++ b/tests/pending/run/reify_newimpl_02.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var x = 2 + val code = reify { + x + } + println(code.eval) + } +} diff --git a/tests/pending/run/reify_newimpl_03.check b/tests/pending/run/reify_newimpl_03.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_03.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_03.scala b/tests/pending/run/reify_newimpl_03.scala new file mode 100644 index 000000000000..531bc76fe40a --- /dev/null +++ b/tests/pending/run/reify_newimpl_03.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + val x = 2 + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/pending/run/reify_newimpl_04.check b/tests/pending/run/reify_newimpl_04.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_04.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_04.scala b/tests/pending/run/reify_newimpl_04.scala new file mode 100644 index 000000000000..b6071f843db7 --- /dev/null +++ b/tests/pending/run/reify_newimpl_04.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + var x = 2 + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/pending/run/reify_newimpl_05.check b/tests/pending/run/reify_newimpl_05.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_05.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_05.scala b/tests/pending/run/reify_newimpl_05.scala new file mode 100644 index 000000000000..0ff5bb07c933 --- /dev/null +++ b/tests/pending/run/reify_newimpl_05.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val code = reify { + var x = 2 + def y = x // forcibly captures x + reify{x}.eval + } + println(code.eval) + } +} diff --git a/tests/pending/run/reify_newimpl_06.check b/tests/pending/run/reify_newimpl_06.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_06.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_06.scala b/tests/pending/run/reify_newimpl_06.scala new file mode 100644 index 000000000000..8743da10033d --- /dev/null +++ b/tests/pending/run/reify_newimpl_06.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C(val y: Int) { + val code = reify { + reify{y}.eval + } + } + + println(new C(2).code.eval) +} diff --git a/tests/pending/run/reify_newimpl_11.check b/tests/pending/run/reify_newimpl_11.check new file mode 100644 index 000000000000..c019c6db2daa --- /dev/null +++ b/tests/pending/run/reify_newimpl_11.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_11.scala:6:11 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_11.scala b/tests/pending/run/reify_newimpl_11.scala new file mode 100644 index 000000000000..bb08808c2c72 --- /dev/null +++ b/tests/pending/run/reify_newimpl_11.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[T] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C[Int] + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/pending/run/reify_newimpl_12.check b/tests/pending/run/reify_newimpl_12.check new file mode 100644 index 000000000000..220bd6875aae --- /dev/null +++ b/tests/pending/run/reify_newimpl_12.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_12.scala b/tests/pending/run/reify_newimpl_12.scala new file mode 100644 index 000000000000..c2b9d42ca65b --- /dev/null +++ b/tests/pending/run/reify_newimpl_12.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[T: TypeTag] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] +} diff --git a/tests/pending/run/reify_newimpl_13.check b/tests/pending/run/reify_newimpl_13.check new file mode 100644 index 000000000000..13e3c9af1e55 --- /dev/null +++ b/tests/pending/run/reify_newimpl_13.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_13.scala:7:13 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_13.scala b/tests/pending/run/reify_newimpl_13.scala new file mode 100644 index 000000000000..79a99c334ee3 --- /dev/null +++ b/tests/pending/run/reify_newimpl_13.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C[T] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C[Int] + } catch { + case ex: Throwable => + println(ex) + } + } +} diff --git a/tests/pending/run/reify_newimpl_14.check b/tests/pending/run/reify_newimpl_14.check new file mode 100644 index 000000000000..220bd6875aae --- /dev/null +++ b/tests/pending/run/reify_newimpl_14.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_14.scala b/tests/pending/run/reify_newimpl_14.scala new file mode 100644 index 000000000000..af2c7f136231 --- /dev/null +++ b/tests/pending/run/reify_newimpl_14.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C[T: TypeTag] { + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] + } +} diff --git a/tests/pending/run/reify_newimpl_15.check b/tests/pending/run/reify_newimpl_15.check new file mode 100644 index 000000000000..220bd6875aae --- /dev/null +++ b/tests/pending/run/reify_newimpl_15.check @@ -0,0 +1 @@ +List(2) \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_15.scala b/tests/pending/run/reify_newimpl_15.scala new file mode 100644 index 000000000000..4bcfc7107121 --- /dev/null +++ b/tests/pending/run/reify_newimpl_15.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T = Int + val code = reify { + List[T](2) + } + println(code.eval) + } + + new C +} diff --git a/tests/pending/run/reify_newimpl_18.check b/tests/pending/run/reify_newimpl_18.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_18.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_18.scala b/tests/pending/run/reify_newimpl_18.scala new file mode 100644 index 000000000000..e60bed8c77c9 --- /dev/null +++ b/tests/pending/run/reify_newimpl_18.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C[U: TypeTag] { + type T = U + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C[Int] +} diff --git a/tests/pending/run/reify_newimpl_19.check b/tests/pending/run/reify_newimpl_19.check new file mode 100644 index 000000000000..c749d4f10647 --- /dev/null +++ b/tests/pending/run/reify_newimpl_19.check @@ -0,0 +1,4 @@ +scala.tools.reflect.ToolBoxError: reflective toolbox failed due to unresolved free type variables: + T defined by C in reify_newimpl_19.scala:7:10 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_19.scala b/tests/pending/run/reify_newimpl_19.scala new file mode 100644 index 000000000000..eaa6ca20669a --- /dev/null +++ b/tests/pending/run/reify_newimpl_19.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + try { + new C { val T = Int } + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/pending/run/reify_newimpl_20.check b/tests/pending/run/reify_newimpl_20.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_20.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_20.scala b/tests/pending/run/reify_newimpl_20.scala new file mode 100644 index 000000000000..c483e0b7e0f5 --- /dev/null +++ b/tests/pending/run/reify_newimpl_20.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T + implicit val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] + val code = reify { + List[T](2.asInstanceOf[T]) + } + println(code.eval) + } + + new C { type T = String } // this "mistake" is made for a reason! +} diff --git a/tests/pending/run/reify_newimpl_21.check b/tests/pending/run/reify_newimpl_21.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_21.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_21.scala b/tests/pending/run/reify_newimpl_21.scala new file mode 100644 index 000000000000..0875ede6ba14 --- /dev/null +++ b/tests/pending/run/reify_newimpl_21.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + trait C { + type T + implicit val tt: TypeTag[T] + lazy val code = reify { + List[T](2.asInstanceOf[T]) + } + } + + class D extends C { + type T = String // this "mistake" is made for a reason! + override val tt: TypeTag[T] = implicitly[TypeTag[Int]].asInstanceOf[TypeTag[T]] + } + + println((new D).code.eval) +} diff --git a/tests/pending/run/reify_newimpl_22.check b/tests/pending/run/reify_newimpl_22.check new file mode 100644 index 000000000000..952f384a1c67 --- /dev/null +++ b/tests/pending/run/reify_newimpl_22.check @@ -0,0 +1,25 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.tools.reflect.Eval +import scala.tools.reflect.Eval + +scala> { + val x = 2 + val code = reify { + x + } + println(code.eval) +} +:15: free term: Ident(TermName("x")) defined by res0 in :14:21 + val code = reify { + ^ +2 + +scala> :quit diff --git a/tests/pending/run/reify_newimpl_22.scala b/tests/pending/run/reify_newimpl_22.scala new file mode 100644 index 000000000000..8512620a16eb --- /dev/null +++ b/tests/pending/run/reify_newimpl_22.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-terms" + def code = """ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +{ + val x = 2 + val code = reify { + x + } + println(code.eval) +} + """ +} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_23.check b/tests/pending/run/reify_newimpl_23.check new file mode 100644 index 000000000000..b7e9bfdfbc69 --- /dev/null +++ b/tests/pending/run/reify_newimpl_23.check @@ -0,0 +1,24 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.tools.reflect.Eval +import scala.tools.reflect.Eval + +scala> def foo[T]{ + val code = reify { + List[T]() + } + println(code.eval) +} +:13: free type: Ident(TypeName("T")) defined by foo in :12:16 + val code = reify { + ^ +foo: [T]=> Unit + +scala> :quit diff --git a/tests/pending/run/reify_newimpl_23.scala b/tests/pending/run/reify_newimpl_23.scala new file mode 100644 index 000000000000..d4c2a68ce65d --- /dev/null +++ b/tests/pending/run/reify_newimpl_23.scala @@ -0,0 +1,16 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-types" + def code = """ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +def foo[T]{ + val code = reify { + List[T]() + } + println(code.eval) +} + """ +} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_25.check b/tests/pending/run/reify_newimpl_25.check new file mode 100644 index 000000000000..4f36ba10ee15 --- /dev/null +++ b/tests/pending/run/reify_newimpl_25.check @@ -0,0 +1,15 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> { + import scala.reflect.runtime.universe._ + val x = "2" + val tt = implicitly[TypeTag[x.type]] + println(tt) +} +:11: free term: Ident(TermName("x")) defined by res0 in :10:21 + val tt = implicitly[TypeTag[x.type]] + ^ +TypeTag[x.type] + +scala> :quit diff --git a/tests/pending/run/reify_newimpl_25.scala b/tests/pending/run/reify_newimpl_25.scala new file mode 100644 index 000000000000..01cc04b59f3d --- /dev/null +++ b/tests/pending/run/reify_newimpl_25.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-terms" + def code = """ +{ + import scala.reflect.runtime.universe._ + val x = "2" + val tt = implicitly[TypeTag[x.type]] + println(tt) +} + """ +} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_26.check b/tests/pending/run/reify_newimpl_26.check new file mode 100644 index 000000000000..681b86279564 --- /dev/null +++ b/tests/pending/run/reify_newimpl_26.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def foo[T]{ + import scala.reflect.runtime.universe._ + val tt = implicitly[WeakTypeTag[List[T]]] + println(tt) +} +:9: free type: Ident(TypeName("T")) defined by foo in :7:16 + val tt = implicitly[WeakTypeTag[List[T]]] + ^ +foo: [T]=> Unit + +scala> foo[Int] +WeakTypeTag[scala.List[T]] + +scala> :quit diff --git a/tests/pending/run/reify_newimpl_26.scala b/tests/pending/run/reify_newimpl_26.scala new file mode 100644 index 000000000000..af74d60e8b12 --- /dev/null +++ b/tests/pending/run/reify_newimpl_26.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-types" + def code = """ +def foo[T]{ + import scala.reflect.runtime.universe._ + val tt = implicitly[WeakTypeTag[List[T]]] + println(tt) +} +foo[Int] + """ +} \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_27.check b/tests/pending/run/reify_newimpl_27.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_27.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_27.scala b/tests/pending/run/reify_newimpl_27.scala new file mode 100644 index 000000000000..332dbec91360 --- /dev/null +++ b/tests/pending/run/reify_newimpl_27.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val code = reify { + List[T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/pending/run/reify_newimpl_29.check b/tests/pending/run/reify_newimpl_29.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_29.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_29.scala b/tests/pending/run/reify_newimpl_29.scala new file mode 100644 index 000000000000..1865075f44dc --- /dev/null +++ b/tests/pending/run/reify_newimpl_29.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + class C { + type T = Int + val code = reify { + List[C#T](2) + } + println(code.eval) + } + + new C +} diff --git a/tests/pending/run/reify_newimpl_30.check b/tests/pending/run/reify_newimpl_30.check new file mode 100644 index 000000000000..7557c750a65b --- /dev/null +++ b/tests/pending/run/reify_newimpl_30.check @@ -0,0 +1,4 @@ +reflective toolbox failed due to unresolved free type variables: + C defined by in reify_newimpl_30.scala:7:11 +have you forgotten to use TypeTag annotations for type parameters external to a reifee? +if you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/tests/pending/run/reify_newimpl_30.scala b/tests/pending/run/reify_newimpl_30.scala new file mode 100644 index 000000000000..afc199d5068c --- /dev/null +++ b/tests/pending/run/reify_newimpl_30.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.{ ToolBox, ToolBoxError } +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + class C { + type T = Int + val code = reify { + List[C#T](2) + } + try { println(code.eval) } + catch { case e: ToolBoxError => println(e.getMessage) } + } + + new C + } +} diff --git a/tests/pending/run/reify_newimpl_31.check b/tests/pending/run/reify_newimpl_31.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_31.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_31.scala b/tests/pending/run/reify_newimpl_31.scala new file mode 100644 index 000000000000..535c9b67b3b5 --- /dev/null +++ b/tests/pending/run/reify_newimpl_31.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val code = reify { + List[C.T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/pending/run/reify_newimpl_33.check b/tests/pending/run/reify_newimpl_33.check new file mode 100644 index 000000000000..c23af69b084c --- /dev/null +++ b/tests/pending/run/reify_newimpl_33.check @@ -0,0 +1 @@ +List(2) diff --git a/tests/pending/run/reify_newimpl_33.scala b/tests/pending/run/reify_newimpl_33.scala new file mode 100644 index 000000000000..55a808edadc1 --- /dev/null +++ b/tests/pending/run/reify_newimpl_33.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + object C { + type T = Int + val c = C + val code = reify { + List[c.T](2) + } + println(code.eval) + } + + C +} diff --git a/tests/pending/run/reify_newimpl_35.check b/tests/pending/run/reify_newimpl_35.check new file mode 100644 index 000000000000..bd9b3a2fb1af --- /dev/null +++ b/tests/pending/run/reify_newimpl_35.check @@ -0,0 +1,13 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> def foo[T: TypeTag] = reify{List[T]()} +foo: [T](implicit evidence$1: reflect.runtime.universe.TypeTag[T])reflect.runtime.universe.Expr[List[T]] + +scala> println(foo) +Expr[List[Nothing]](Nil) + +scala> :quit diff --git a/tests/pending/run/reify_newimpl_35.scala b/tests/pending/run/reify_newimpl_35.scala new file mode 100644 index 000000000000..f2ebf5181be8 --- /dev/null +++ b/tests/pending/run/reify_newimpl_35.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-Xlog-free-types" + def code = """ +import scala.reflect.runtime.universe._ +def foo[T: TypeTag] = reify{List[T]()} +println(foo) + """ +} diff --git a/tests/pending/run/reify_newimpl_36.check b/tests/pending/run/reify_newimpl_36.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_36.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/reify_newimpl_36.scala b/tests/pending/run/reify_newimpl_36.scala new file mode 100644 index 000000000000..19f8617c69e6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_36.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify(reify(x)); + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + println(code2.eval) + } + } +} diff --git a/tests/pending/run/reify_newimpl_37.check b/tests/pending/run/reify_newimpl_37.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_37.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/reify_newimpl_37.scala b/tests/pending/run/reify_newimpl_37.scala new file mode 100644 index 000000000000..5eeda212544d --- /dev/null +++ b/tests/pending/run/reify_newimpl_37.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify(reify(reify(x))); + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/pending/run/reify_newimpl_38.check b/tests/pending/run/reify_newimpl_38.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_38.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/reify_newimpl_38.scala b/tests/pending/run/reify_newimpl_38.scala new file mode 100644 index 000000000000..a313b7d8dd22 --- /dev/null +++ b/tests/pending/run/reify_newimpl_38.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify(y) }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + println(code2.eval) + } + } +} diff --git a/tests/pending/run/reify_newimpl_39.check b/tests/pending/run/reify_newimpl_39.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_39.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/reify_newimpl_39.scala b/tests/pending/run/reify_newimpl_39.scala new file mode 100644 index 000000000000..4b779fc07069 --- /dev/null +++ b/tests/pending/run/reify_newimpl_39.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify{ val z = y; reify(z) } }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/pending/run/reify_newimpl_40.check b/tests/pending/run/reify_newimpl_40.check new file mode 100644 index 000000000000..cc0001ab3bb7 --- /dev/null +++ b/tests/pending/run/reify_newimpl_40.check @@ -0,0 +1 @@ +74088 diff --git a/tests/pending/run/reify_newimpl_40.scala b/tests/pending/run/reify_newimpl_40.scala new file mode 100644 index 000000000000..1bc37973f81d --- /dev/null +++ b/tests/pending/run/reify_newimpl_40.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + val x = 42 + def foo() = reify{ val y = x; reify{ val z = y * x; reify(z * x) } }; + { + val x = 2 + val code1 = foo() + val code2 = code1.eval + val code3 = code2.eval + println(code3.eval) + } + } +} diff --git a/tests/pending/run/reify_newimpl_41.check b/tests/pending/run/reify_newimpl_41.check new file mode 100644 index 000000000000..0b427f2ee681 --- /dev/null +++ b/tests/pending/run/reify_newimpl_41.check @@ -0,0 +1,3 @@ +42 +44 +43 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_41.scala b/tests/pending/run/reify_newimpl_41.scala new file mode 100644 index 000000000000..514e206a3f33 --- /dev/null +++ b/tests/pending/run/reify_newimpl_41.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var _x = 42 + def x = { val x0 = _x; _x += 1; x0 } + var _y = 1 + def y = { val y0 = _y + _x; _y += y0; y0 } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_42.check b/tests/pending/run/reify_newimpl_42.check new file mode 100644 index 000000000000..0b427f2ee681 --- /dev/null +++ b/tests/pending/run/reify_newimpl_42.check @@ -0,0 +1,3 @@ +42 +44 +43 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_42.scala b/tests/pending/run/reify_newimpl_42.scala new file mode 100644 index 000000000000..64c1cf3452c7 --- /dev/null +++ b/tests/pending/run/reify_newimpl_42.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var _x = 42 + def x = { val x0 = _x; _x += 1; x0 } + var _y = 1 + def y = { val y0 = _y + _x; _y += y0; y0 } + val code = reify { + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_43.check b/tests/pending/run/reify_newimpl_43.check new file mode 100644 index 000000000000..7a754f414cd8 --- /dev/null +++ b/tests/pending/run/reify_newimpl_43.check @@ -0,0 +1,2 @@ +1 +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_43.scala b/tests/pending/run/reify_newimpl_43.scala new file mode 100644 index 000000000000..736536cb30ce --- /dev/null +++ b/tests/pending/run/reify_newimpl_43.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_44.check b/tests/pending/run/reify_newimpl_44.check new file mode 100644 index 000000000000..7a754f414cd8 --- /dev/null +++ b/tests/pending/run/reify_newimpl_44.check @@ -0,0 +1,2 @@ +1 +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_44.scala b/tests/pending/run/reify_newimpl_44.scala new file mode 100644 index 000000000000..736536cb30ce --- /dev/null +++ b/tests/pending/run/reify_newimpl_44.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_45.check b/tests/pending/run/reify_newimpl_45.check new file mode 100644 index 000000000000..6e14f71e2617 --- /dev/null +++ b/tests/pending/run/reify_newimpl_45.check @@ -0,0 +1,2 @@ +List(free type T) +ima worx: 2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_45.scala b/tests/pending/run/reify_newimpl_45.scala new file mode 100644 index 000000000000..cfda46a6a3e9 --- /dev/null +++ b/tests/pending/run/reify_newimpl_45.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +object Test extends dotty.runtime.LegacyApp { + class C[T >: Null] { + val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x} + println(freeTypes(code.tree)) + val tree = substituteSymbols(code.tree, freeTypes(code.tree), List(definitions.StringClass)) + cm.mkToolBox().eval(tree) + } + + new C[String] +} diff --git a/tests/pending/run/reify_newimpl_47.check b/tests/pending/run/reify_newimpl_47.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/reify_newimpl_47.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_47.scala b/tests/pending/run/reify_newimpl_47.scala new file mode 100644 index 000000000000..c0ad6cbe5a00 --- /dev/null +++ b/tests/pending/run/reify_newimpl_47.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val outer = { + val x = 2 + reify{x} + } + + val code = reify{ + val x = 42 + outer.splice + } + + println(code.eval) +} diff --git a/tests/pending/run/reify_newimpl_48.check b/tests/pending/run/reify_newimpl_48.check new file mode 100644 index 000000000000..f11c82a4cb6c --- /dev/null +++ b/tests/pending/run/reify_newimpl_48.check @@ -0,0 +1 @@ +9 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_48.scala b/tests/pending/run/reify_newimpl_48.scala new file mode 100644 index 000000000000..7d1c1d642445 --- /dev/null +++ b/tests/pending/run/reify_newimpl_48.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val outer1 = { + val x = 2 + reify{x} + } + + val outer2 = { + val x = 3 + reify{x} + } + + val code = reify{ + val x = 4 + x + outer1.splice + outer2.splice + } + + println(code.eval) +} diff --git a/tests/pending/run/reify_newimpl_49.check b/tests/pending/run/reify_newimpl_49.check new file mode 100644 index 000000000000..d8a621df001d --- /dev/null +++ b/tests/pending/run/reify_newimpl_49.check @@ -0,0 +1,3 @@ +3 +3 +5 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_49.scala b/tests/pending/run/reify_newimpl_49.scala new file mode 100644 index 000000000000..61ddfafa3601 --- /dev/null +++ b/tests/pending/run/reify_newimpl_49.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var y = 1 + def x = { y += 2; y } + val code = reify { + def foo = y // ensures that y is the first freevar we find + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_50.check b/tests/pending/run/reify_newimpl_50.check new file mode 100644 index 000000000000..d8a621df001d --- /dev/null +++ b/tests/pending/run/reify_newimpl_50.check @@ -0,0 +1,3 @@ +3 +3 +5 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_50.scala b/tests/pending/run/reify_newimpl_50.scala new file mode 100644 index 000000000000..8ecdeb55c778 --- /dev/null +++ b/tests/pending/run/reify_newimpl_50.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var y = 1 + def x = { y += 2; y } + val code = reify { + println(x) + println(y) + println(x) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_51.check b/tests/pending/run/reify_newimpl_51.check new file mode 100644 index 000000000000..9a4ddeacd37f --- /dev/null +++ b/tests/pending/run/reify_newimpl_51.check @@ -0,0 +1,3 @@ +2 +1 +2 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_51.scala b/tests/pending/run/reify_newimpl_51.scala new file mode 100644 index 000000000000..8a4a325f033d --- /dev/null +++ b/tests/pending/run/reify_newimpl_51.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + val bar = reify { println(x * y) } + bar.eval + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/pending/run/reify_newimpl_52.check b/tests/pending/run/reify_newimpl_52.check new file mode 100644 index 000000000000..9359a2b211f6 --- /dev/null +++ b/tests/pending/run/reify_newimpl_52.check @@ -0,0 +1,3 @@ +2 +2 +1 \ No newline at end of file diff --git a/tests/pending/run/reify_newimpl_52.scala b/tests/pending/run/reify_newimpl_52.scala new file mode 100644 index 000000000000..4dc82b145261 --- /dev/null +++ b/tests/pending/run/reify_newimpl_52.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + { + var counter = 0 + lazy val x = { counter += 1; counter } + lazy val y = { counter += 1; counter } + val code = reify { + def foo = y // ensures that y is the first freevar we find + val bar = reify { println(y * x) } + bar.eval + println(x) + println(y) + } + code.eval + } +} diff --git a/tests/pending/run/reify_printf.check b/tests/pending/run/reify_printf.check new file mode 100644 index 000000000000..3b18e512dba7 --- /dev/null +++ b/tests/pending/run/reify_printf.check @@ -0,0 +1 @@ +hello world diff --git a/tests/pending/run/reify_printf.scala b/tests/pending/run/reify_printf.scala new file mode 100644 index 000000000000..b957c41bb93a --- /dev/null +++ b/tests/pending/run/reify_printf.scala @@ -0,0 +1,71 @@ +import java.io.{ ByteArrayOutputStream, PrintStream } +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.reflect.api._ +import scala.reflect.api.Trees +import scala.reflect.internal.Types +import scala.util.matching.Regex + +object Test extends dotty.runtime.LegacyApp { + //val output = new ByteArrayOutputStream() + //Console.setOut(new PrintStream(output)) + val toolbox = cm.mkToolBox() + + val tree = tree_printf(reify("hello %s").tree, reify("world").tree) + val evaluated = toolbox.eval(tree) + //assert(output.toString() == "hello world", output.toString() +" == hello world") + + /* + // upd. Oh, good old times, our very-very first experiments with macros :) + macro def printf(format: String, params: Any*) : String = tree_printf(format: Tree, (params: Seq[Tree]): _*) + */ + + var i = 0 + def gensym(name: String) = { i += 1; TermName(name + i) } + + def createTempValDef( value : Tree, tpe : Type ) : (Option[Tree],Tree) = { + val local = gensym("temp") + ( + Some( + ValDef( + NoMods + , local + , TypeTree(tpe) + , value + ) + ) + , Ident(local) + ) + } + + def tree_printf(format: Tree, params: Tree*) = { + val Literal(Constant(s_format: String)) = format + val paramsStack = scala.collection.mutable.Stack(params: _*) + val parsed = s_format.split("(?<=%[\\w%])|(?=%[\\w%])") map { + case "%d" => createTempValDef( paramsStack.pop, typeOf[Int] ) + case "%s" => createTempValDef( paramsStack.pop, typeOf[String] ) + case "%%" => { + (None:Option[Tree], Literal(Constant("%"))) + } + case part => { + (None:Option[Tree], Literal(Constant(part))) + } + } + + val evals = for ((Some(eval), _) <- parsed if eval != None) yield (eval: Tree) + val prints = for ((_, ref) <- parsed) yield + Apply( + Select( + Select( + Ident( TermName("scala") ) + , TermName("Predef") + ) + , TermName("print") + ) + , List(ref) + ): Tree + Block((evals ++ prints).toList, Literal(Constant(()))) + } +} diff --git a/tests/pending/run/reify_properties.check b/tests/pending/run/reify_properties.check new file mode 100644 index 000000000000..d769bea4b0d1 --- /dev/null +++ b/tests/pending/run/reify_properties.check @@ -0,0 +1,2 @@ +user1: MR. ROBERT +user2: MR. BOB KUZ diff --git a/tests/pending/run/reify_properties.scala b/tests/pending/run/reify_properties.scala new file mode 100644 index 000000000000..b6ce5f305312 --- /dev/null +++ b/tests/pending/run/reify_properties.scala @@ -0,0 +1,57 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** A mutable property whose getter and setter may be customized. */ + case class Property[T](init: T) { + private var value: T = init + + /** The getter function, defaults to identity. */ + private var setter: T => T = identity[T] + + /** The setter function, defaults to identity. */ + private var getter: T => T = identity[T] + + /** Retrive the value held in this property. */ + def apply(): T = getter(value) + + /** Update the value held in this property, through the setter. */ + def update(newValue: T) = value = setter(newValue) + + /** Change the getter. */ + def get(newGetter: T => T) = { getter = newGetter; this } + + /** Change the setter */ + def set(newSetter: T => T) = { setter = newSetter; this } + } + + class User { + // Create a property with custom getter and setter + val firstname = Property("") + .get { v => v.toUpperCase() } + .set { v => "Mr. " + v } + val lastname = Property("") + + /** Scala provides syntactic sugar for calling 'apply'. Simply + * adding a list of arguments between parenthesis (in this case, + * an empty list) is translated to a call to 'apply' with those + * arguments. + */ + override def toString() = firstname() + " " + lastname() + } + + val user1 = new User + + // Syntactic sugar for 'update': an assignment is translated to a + // call to method 'update' + user1.firstname() = "Robert" + + val user2 = new User + user2.firstname() = "bob" + user2.lastname() = "KUZ" + + println("user1: " + user1) + println("user2: " + user2) + }.eval +} diff --git a/tests/pending/run/reify_renamed_term_basic.check b/tests/pending/run/reify_renamed_term_basic.check new file mode 100644 index 000000000000..e78f94fffd7e --- /dev/null +++ b/tests/pending/run/reify_renamed_term_basic.check @@ -0,0 +1 @@ +((),(),()) diff --git a/tests/pending/run/reify_renamed_term_basic.scala b/tests/pending/run/reify_renamed_term_basic.scala new file mode 100644 index 000000000000..7971d3d11778 --- /dev/null +++ b/tests/pending/run/reify_renamed_term_basic.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object A { + object B { + val c = () + } +} + +object Test extends dotty.runtime.LegacyApp { + import A.{B => X} + import A.B.{c => y} + import X.{c => z} + + val expr = reify ( + X.c, y, z + ) + + println(expr.eval) +} diff --git a/tests/pending/run/reify_renamed_term_local_to_reifee.check b/tests/pending/run/reify_renamed_term_local_to_reifee.check new file mode 100644 index 000000000000..e78f94fffd7e --- /dev/null +++ b/tests/pending/run/reify_renamed_term_local_to_reifee.check @@ -0,0 +1 @@ +((),(),()) diff --git a/tests/pending/run/reify_renamed_term_local_to_reifee.scala b/tests/pending/run/reify_renamed_term_local_to_reifee.scala new file mode 100644 index 000000000000..b9327937620d --- /dev/null +++ b/tests/pending/run/reify_renamed_term_local_to_reifee.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object A { + object B { + val c = () + } +} + +object Test extends dotty.runtime.LegacyApp { + val expr = reify { + import A.{B => X} + import A.B.{c => y} + import X.{c => z} + + (X.c, y, z) + } + + println(expr.eval) +} diff --git a/tests/pending/run/reify_renamed_term_overloaded_method.check b/tests/pending/run/reify_renamed_term_overloaded_method.check new file mode 100644 index 000000000000..48082f72f087 --- /dev/null +++ b/tests/pending/run/reify_renamed_term_overloaded_method.check @@ -0,0 +1 @@ +12 diff --git a/tests/pending/run/reify_renamed_term_overloaded_method.scala b/tests/pending/run/reify_renamed_term_overloaded_method.scala new file mode 100644 index 000000000000..1f78976792a1 --- /dev/null +++ b/tests/pending/run/reify_renamed_term_overloaded_method.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + def show(i: Int) = i.toString + def show(s: String) = s +} + +object Test extends dotty.runtime.LegacyApp { + import O.{show => s} + + val expr = reify { + s("1") + s(2) + } + + println(expr.eval) +} diff --git a/tests/pending/run/reify_renamed_term_t5841.check b/tests/pending/run/reify_renamed_term_t5841.check new file mode 100644 index 000000000000..6031277b761a --- /dev/null +++ b/tests/pending/run/reify_renamed_term_t5841.check @@ -0,0 +1 @@ +class scala.reflect.runtime.JavaUniverse diff --git a/tests/pending/run/reify_renamed_term_t5841.scala b/tests/pending/run/reify_renamed_term_t5841.scala new file mode 100644 index 000000000000..d4c051c1bf00 --- /dev/null +++ b/tests/pending/run/reify_renamed_term_t5841.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + println(reify{ru}.eval.getClass) +} diff --git a/tests/pending/run/reify_renamed_type_basic.check b/tests/pending/run/reify_renamed_type_basic.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/reify_renamed_type_basic.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/reify_renamed_type_basic.scala b/tests/pending/run/reify_renamed_type_basic.scala new file mode 100644 index 000000000000..50506e1442ca --- /dev/null +++ b/tests/pending/run/reify_renamed_type_basic.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + type A = Unit +} + +object Test extends dotty.runtime.LegacyApp { + import O.{A => X} + + def expr = reify { + val a: X = () + } + + println(expr.eval) +} diff --git a/tests/pending/run/reify_renamed_type_local_to_reifee.check b/tests/pending/run/reify_renamed_type_local_to_reifee.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/reify_renamed_type_local_to_reifee.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/reify_renamed_type_local_to_reifee.scala b/tests/pending/run/reify_renamed_type_local_to_reifee.scala new file mode 100644 index 000000000000..01280e99319b --- /dev/null +++ b/tests/pending/run/reify_renamed_type_local_to_reifee.scala @@ -0,0 +1,24 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object O { + type A = Unit +} + +object Test extends dotty.runtime.LegacyApp { + val expr = reify { + import O.{A => X} + + val a: X = () + + object P { + type B = Unit + } + + import P.{B => Y} + + val b: Y = () + } + + println(expr.eval) +} diff --git a/tests/pending/run/reify_renamed_type_spliceable.check b/tests/pending/run/reify_renamed_type_spliceable.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/reify_renamed_type_spliceable.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/reify_renamed_type_spliceable.scala b/tests/pending/run/reify_renamed_type_spliceable.scala new file mode 100644 index 000000000000..6a34d17227c2 --- /dev/null +++ b/tests/pending/run/reify_renamed_type_spliceable.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +abstract class C { + type T >: Null +} + +object Test extends dotty.runtime.LegacyApp { + def foo(c: C) = { + import c.{T => U} + reify { + val x: U = null + } + } + + val expr = foo(new C { + type T = AnyRef + }) + + println(expr.eval) +} diff --git a/tests/pending/run/reify_sort.check b/tests/pending/run/reify_sort.check new file mode 100644 index 000000000000..375536cc296b --- /dev/null +++ b/tests/pending/run/reify_sort.check @@ -0,0 +1,2 @@ +[6,2,8,5,1] +[1,2,5,6,8] diff --git a/tests/pending/run/reify_sort.scala b/tests/pending/run/reify_sort.scala new file mode 100644 index 000000000000..b484111edd97 --- /dev/null +++ b/tests/pending/run/reify_sort.scala @@ -0,0 +1,51 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** Nested methods can use and even update everything + * visible in their scope (including local variables or + * arguments of enclosing methods). + */ + def sort(a: Array[Int]): Unit = { + + def swap(i: Int, j: Int): Unit = { + val t = a(i); a(i) = a(j); a(j) = t + } + + def sort1(l: Int, r: Int): Unit = { + val pivot = a((l + r) / 2) + var i = l + var j = r + while (i <= j) { + while (a(i) < pivot) i += 1 + while (a(j) > pivot) j -= 1 + if (i <= j) { + swap(i, j) + i += 1 + j -= 1 + } + } + if (l < j) sort1(l, j) + if (j < r) sort1(i, r) + } + + if (a.length > 0) + sort1(0, a.length - 1) + } + + def println(ar: Array[Int]): Unit = { + def print1 = { + def iter(i: Int): String = + ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") + if (ar.length == 0) "" else iter(0) + } + Console.println("[" + print1 + "]") + } + + val ar = Array(6, 2, 8, 5, 1) + println(ar) + sort(ar) + println(ar) + }.eval +} diff --git a/tests/pending/run/reify_sort1.check b/tests/pending/run/reify_sort1.check new file mode 100644 index 000000000000..0d3080514105 --- /dev/null +++ b/tests/pending/run/reify_sort1.check @@ -0,0 +1,2 @@ +List(6, 2, 8, 5, 1) +List(1, 2, 5, 6, 8) diff --git a/tests/pending/run/reify_sort1.scala b/tests/pending/run/reify_sort1.scala new file mode 100644 index 000000000000..24ca06283528 --- /dev/null +++ b/tests/pending/run/reify_sort1.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def sort(a: List[Int]): List[Int] = { + if (a.length < 2) + a + else { + val pivot = a(a.length / 2) + sort(a.filter(_ < pivot)) ::: + a.filter(_ == pivot) ::: + sort(a.filter(_ > pivot)) + } + } + + val xs = List(6, 2, 8, 5, 1) + println(xs) + println(sort(xs)) + }.eval +} diff --git a/tests/pending/run/reify_this.check b/tests/pending/run/reify_this.check new file mode 100644 index 000000000000..af3d0652a930 --- /dev/null +++ b/tests/pending/run/reify_this.check @@ -0,0 +1,5 @@ +foo +false +2 +bar +2 \ No newline at end of file diff --git a/tests/pending/run/reify_this.scala b/tests/pending/run/reify_this.scala new file mode 100644 index 000000000000..339fcca54153 --- /dev/null +++ b/tests/pending/run/reify_this.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +trait Transvaal { + def eval(tree: Expr[_]) = tree.eval +} + +object Test extends dotty.runtime.LegacyApp with Transvaal { + // select a value from package + eval(reify{println("foo")}) + eval(reify{println((new Object).toString == (new Object).toString)}) + + // select a type from package + eval(reify{val x: Any = 2; println(x)}) + eval(reify{val x: Object = "bar"; println(x)}) + + // select a value from module + val x = 2 + eval(reify{println(x)}) +} diff --git a/tests/pending/run/reify_timeofday.check b/tests/pending/run/reify_timeofday.check new file mode 100644 index 000000000000..3fd3b76a6261 --- /dev/null +++ b/tests/pending/run/reify_timeofday.check @@ -0,0 +1 @@ +DateError diff --git a/tests/pending/run/reify_timeofday.scala b/tests/pending/run/reify_timeofday.scala new file mode 100644 index 000000000000..ff30a962b451 --- /dev/null +++ b/tests/pending/run/reify_timeofday.scala @@ -0,0 +1,42 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class DateError extends Exception + + /** Simulating properties in Scala + * (example 4.2.1 in ScalaReference.pdf) + */ + class TimeOfDayVar { + private var h, m, s: Int = 0 + + def hours = h + + /** A method 'ident_=' is a setter for 'ident'. 'code.ident = ...' will + * be translated to a call to 'ident_=' + */ + def hours_= (h: Int) = + if (0 <= h && h < 24) this.h = h + else throw new DateError() + + def minutes = m + def minutes_= (m: Int) = + if (0 <= m && m < 60) this.m = m + else throw new DateError() + + def seconds = s + def seconds_= (s: Int) = + if (0 <= s && s < 60) this.s = s + else throw new DateError() + } + + val d = new TimeOfDayVar + d.hours = 8; d.minutes = 30; d.seconds = 0 + try { d.hours = 25 // throws a DateError exception + } catch { + case de: DateError => println("DateError") + case e: Exception => println("Exception") + } + }.eval +} diff --git a/tests/pending/run/reify_typerefs_1a.check b/tests/pending/run/reify_typerefs_1a.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_1a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_1a.scala b/tests/pending/run/reify_typerefs_1a.scala new file mode 100644 index 000000000000..b4f608a950ac --- /dev/null +++ b/tests/pending/run/reify_typerefs_1a.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class Expression { + override def toString = "Expression" +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new Expression, new Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_typerefs_1b.check b/tests/pending/run/reify_typerefs_1b.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_1b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_1b.scala b/tests/pending/run/reify_typerefs_1b.scala new file mode 100644 index 000000000000..7c4d025f0bbc --- /dev/null +++ b/tests/pending/run/reify_typerefs_1b.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Expression { + override def toString = "Expression" +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(Expression, Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_typerefs_2a.check b/tests/pending/run/reify_typerefs_2a.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_2a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_2a.scala b/tests/pending/run/reify_typerefs_2a.scala new file mode 100644 index 000000000000..a2d5676c07ba --- /dev/null +++ b/tests/pending/run/reify_typerefs_2a.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +package foo { + class Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new foo.Expression, new foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_typerefs_2b.check b/tests/pending/run/reify_typerefs_2b.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_2b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_2b.scala b/tests/pending/run/reify_typerefs_2b.scala new file mode 100644 index 000000000000..f5543eaf6bca --- /dev/null +++ b/tests/pending/run/reify_typerefs_2b.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +package foo { + object Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(foo.Expression, foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_typerefs_3a.check b/tests/pending/run/reify_typerefs_3a.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_3a.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_3a.scala b/tests/pending/run/reify_typerefs_3a.scala new file mode 100644 index 000000000000..8d81721f1be9 --- /dev/null +++ b/tests/pending/run/reify_typerefs_3a.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object foo { + class Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(new foo.Expression, new foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_typerefs_3b.check b/tests/pending/run/reify_typerefs_3b.check new file mode 100644 index 000000000000..919c298ba302 --- /dev/null +++ b/tests/pending/run/reify_typerefs_3b.check @@ -0,0 +1 @@ +evaluated = List(Expression, Expression) \ No newline at end of file diff --git a/tests/pending/run/reify_typerefs_3b.scala b/tests/pending/run/reify_typerefs_3b.scala new file mode 100644 index 000000000000..212f40fc04d9 --- /dev/null +++ b/tests/pending/run/reify_typerefs_3b.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object foo { + object Expression { + override def toString = "Expression" + } +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + List(foo.Expression, foo.Expression) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/reify_varargs.check b/tests/pending/run/reify_varargs.check new file mode 100644 index 000000000000..e300a570a75b --- /dev/null +++ b/tests/pending/run/reify_varargs.check @@ -0,0 +1 @@ +Message=On the fifth of August there was a disturbance in the Force on planet Hoth. diff --git a/tests/pending/run/reify_varargs.scala b/tests/pending/run/reify_varargs.scala new file mode 100644 index 000000000000..36777fe98ca2 --- /dev/null +++ b/tests/pending/run/reify_varargs.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val msg = java.text.MessageFormat.format( + "On {1} there was {2} on planet {0}.", + "Hoth", "the fifth of August", "a disturbance in the Force") + println("Message="+msg) + }.eval +} diff --git a/tests/pending/run/repl-assign.check b/tests/pending/run/repl-assign.check new file mode 100644 index 000000000000..faa8a93244fe --- /dev/null +++ b/tests/pending/run/repl-assign.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> var x = 10 +x: Int = 10 + +scala> var y = 11 +y: Int = 11 + +scala> x = 12 +x: Int = 12 + +scala> y = 13 +y: Int = 13 + +scala> :quit diff --git a/tests/pending/run/repl-assign.scala b/tests/pending/run/repl-assign.scala new file mode 100644 index 000000000000..ee3c1649d8b9 --- /dev/null +++ b/tests/pending/run/repl-assign.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +var x = 10 +var y = 11 +x = 12 +y = 13 + """ +} \ No newline at end of file diff --git a/tests/pending/run/repl-backticks.check b/tests/pending/run/repl-backticks.check new file mode 100644 index 000000000000..c0561abd7c92 --- /dev/null +++ b/tests/pending/run/repl-backticks.check @@ -0,0 +1,2 @@ +import java.lang.Thread.`yield` +import scala.`package`.Throwable diff --git a/tests/pending/run/repl-backticks.scala b/tests/pending/run/repl-backticks.scala new file mode 100644 index 000000000000..37cfaec3ef1b --- /dev/null +++ b/tests/pending/run/repl-backticks.scala @@ -0,0 +1,18 @@ +import scala.tools.nsc._ + +object Test { + val testCode = """ + import java.lang.Thread.`yield` + import scala.`package`.Throwable + + `yield` + """ + + def main(args: Array[String]): Unit = { + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + val repl = new interpreter.IMain(settings) + repl.interpret(testCode) + } +} + diff --git a/tests/pending/run/repl-bare-expr.check b/tests/pending/run/repl-bare-expr.check new file mode 100644 index 000000000000..07cf23412fd3 --- /dev/null +++ b/tests/pending/run/repl-bare-expr.check @@ -0,0 +1,50 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> 2 ; 3 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 2 ;; + ^ +res0: Int = 3 + +scala> { 2 ; 3 } +:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + { 2 ; 3 } + ^ +res1: Int = 3 + +scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + 1 + + 2 + + 3 } ; bippy+88+11 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +defined object Cow +defined class Moo +bippy: Int +res2: Int = 105 + +scala> + +scala> object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy +defined object Bovine +defined class Ruminant +res3: Int = 216 + +scala> Bovine.x = List(Ruminant(5), Cow, new Moo) +Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo) + +scala> Bovine.x +res4: List[Any] = List(Ruminant(5), Cow, Moooooo) + +scala> :quit diff --git a/tests/pending/run/repl-bare-expr.scala b/tests/pending/run/repl-bare-expr.scala new file mode 100644 index 000000000000..df9849fa6d86 --- /dev/null +++ b/tests/pending/run/repl-bare-expr.scala @@ -0,0 +1,16 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +2 ; 3 +{ 2 ; 3 } +5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + 1 + + 2 + + 3 } ; bippy+88+11 + +object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy +Bovine.x = List(Ruminant(5), Cow, new Moo) +Bovine.x + """ +} \ No newline at end of file diff --git a/tests/pending/run/repl-colon-type.check b/tests/pending/run/repl-colon-type.check new file mode 100644 index 000000000000..9898027c1dd2 --- /dev/null +++ b/tests/pending/run/repl-colon-type.check @@ -0,0 +1,221 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :type List[1, 2, 3] +:1: error: identifier expected but integer literal found. + List[1, 2, 3] + ^ + +scala> :type List(1, 2, 3) +List[Int] + +scala> :type def foo[T](x: T) = List(x) +[T](x: T)List[T] + +scala> :type val bar = List(Set(1)) +List[scala.collection.immutable.Set[Int]] + +scala> :type lazy val bar = Set(Set(1)) +scala.collection.immutable.Set[scala.collection.immutable.Set[Int]] + +scala> :type def f[T >: Null, U <: String](x: T, y: U) = Set(x, y) +[T >: Null, U <: String](x: T, y: U)scala.collection.immutable.Set[Any] + +scala> :type def x = 1 ; def bar[T >: Null <: AnyRef](xyz: T) = 5 +=> Int [T >: Null <: AnyRef](xyz: T)Int + +scala> + +scala> :type 5 +Int + +scala> :type val f = 5 +Int + +scala> :type lazy val f = 5 +Int + +scala> :type protected lazy val f = 5 +:5: error: lazy value f cannot be accessed in object $iw + Access to protected value f not permitted because + enclosing object $eval in package $line13 is not a subclass of + object $iw where target is defined + lazy val $result = f + ^ + +scala> :type def f = 5 +=> Int + +scala> :type def f() = 5 +()Int + +scala> + +scala> :type def g[T](xs: Set[_ <: T]) = Some(xs.head) +[T](xs: Set[_ <: T])Some[T] + +scala> + +scala> // verbose! + +scala> :type -v List(1,2,3) filter _ +// Type signature +(Int => Boolean) => List[Int] + +// Internal Type structure +TypeRef( + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) + args = List( + TypeRef( + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) + args = List( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + TypeRef( + TypeSymbol(final abstract class Boolean extends AnyVal) + ) + ) + ) + TypeRef( + TypeSymbol( + sealed abstract class List[+A] extends AbstractSeq[A] with LinearSeq[A] with Product with GenericTraversableTemplate[A,List] with LinearSeqOptimized[A,List[A]] with Serializable + + ) + args = List( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) + ) + ) +) + +scala> :type -v def f[T >: Null, U <: String](x: T, y: U) = Set(x, y) +// Type signature +[T >: Null, U <: String](x: T, y: U)scala.collection.immutable.Set[Any] + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T >: Null), TypeParam(U <: String)) + resultType = MethodType( + params = List(TermSymbol(x: T), TermSymbol(y: U)) + resultType = TypeRef( + TypeSymbol( + abstract trait Set[A] extends Iterable[A] with Set[A] with GenericSetTemplate[A,scala.collection.immutable.Set] with SetLike[A,scala.collection.immutable.Set[A]] with Parallelizable[A,scala.collection.parallel.immutable.ParSet[A]] + + ) + args = List(TypeRef(TypeSymbol(abstract class Any extends ))) + ) + ) +) + +scala> :type -v def x = 1 ; def bar[T >: Null <: AnyRef](xyz: T) = 5 +// Type signature +=> Int [T >: Null <: AnyRef](xyz: T)Int + +// Internal Type structure +OverloadedType( + alts = List( + NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) + PolyType( + typeParams = List(TypeParam(T >: Null <: AnyRef)) + resultType = MethodType( + params = List(TermSymbol(xyz: T)) + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) + ) + ) +) + +scala> :type -v Nil.combinations _ +// Type signature +Int => Iterator[List[Nothing]] + +// Internal Type structure +TypeRef( + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) + args = List( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + TypeRef( + TypeSymbol( + abstract trait Iterator[+A] extends TraversableOnce[A] + ) + args = List( + TypeRef( + TypeSymbol( + sealed abstract class List[+A] extends AbstractSeq[A] with LinearSeq[A] with Product with GenericTraversableTemplate[A,List] with LinearSeqOptimized[A,List[A]] with Serializable + + ) + args = List( + TypeRef( + TypeSymbol(final abstract class Nothing extends Any) + ) + ) + ) + ) + ) + ) +) + +scala> :type -v def f[T <: AnyVal] = List[T]().combinations _ +// Type signature +[T <: AnyVal]=> Int => Iterator[List[T]] + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T <: AnyVal)) + resultType = NullaryMethodType( + TypeRef( + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) + args = List( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + TypeRef( + TypeSymbol( + abstract trait Iterator[+A] extends TraversableOnce[A] + ) + args = List( + TypeRef( + TypeSymbol( + sealed abstract class List[+A] extends AbstractSeq[A] with LinearSeq[A] with Product with GenericTraversableTemplate[A,List] with LinearSeqOptimized[A,List[A]] with Serializable + + ) + args = List(TypeParamTypeRef(TypeParam(T <: AnyVal))) + ) + ) + ) + ) + ) + ) +) + +scala> :type -v def f[T, U >: T](x: T, y: List[U]) = x :: y +// Type signature +[T, U >: T](x: T, y: List[U])List[U] + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T), TypeParam(U >: T)) + resultType = MethodType( + params = List(TermSymbol(x: T), TermSymbol(y: List[U])) + resultType = TypeRef( + TypeSymbol( + sealed abstract class List[+A] extends AbstractSeq[A] with LinearSeq[A] with Product with GenericTraversableTemplate[A,List] with LinearSeqOptimized[A,List[A]] with Serializable + + ) + args = List(TypeParamTypeRef(TypeParam(U >: T))) + ) + ) +) + +scala> + +scala> // SI-7132 - :type doesn't understand Unit + +scala> :type () +Unit + +scala> :type println("side effect!") +Unit + +scala> :quit diff --git a/tests/pending/run/repl-colon-type.scala b/tests/pending/run/repl-colon-type.scala new file mode 100644 index 000000000000..8cf81a6afe0b --- /dev/null +++ b/tests/pending/run/repl-colon-type.scala @@ -0,0 +1,35 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |:type List[1, 2, 3] + |:type List(1, 2, 3) + |:type def foo[T](x: T) = List(x) + |:type val bar = List(Set(1)) + |:type lazy val bar = Set(Set(1)) + |:type def f[T >: Null, U <: String](x: T, y: U) = Set(x, y) + |:type def x = 1 ; def bar[T >: Null <: AnyRef](xyz: T) = 5 + | + |:type 5 + |:type val f = 5 + |:type lazy val f = 5 + |:type protected lazy val f = 5 + |:type def f = 5 + |:type def f() = 5 + | + |:type def g[T](xs: Set[_ <: T]) = Some(xs.head) + | + |// verbose! + |:type -v List(1,2,3) filter _ + |:type -v def f[T >: Null, U <: String](x: T, y: U) = Set(x, y) + |:type -v def x = 1 ; def bar[T >: Null <: AnyRef](xyz: T) = 5 + |:type -v Nil.combinations _ + |:type -v def f[T <: AnyVal] = List[T]().combinations _ + |:type -v def f[T, U >: T](x: T, y: List[U]) = x :: y + | + |// SI-7132 - :type doesn't understand Unit + |:type () + |:type println("side effect!") + """.stripMargin +} + diff --git a/tests/pending/run/repl-empty-package.check b/tests/pending/run/repl-empty-package.check new file mode 100644 index 000000000000..d3b75f685eeb --- /dev/null +++ b/tests/pending/run/repl-empty-package.check @@ -0,0 +1,7 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> println(Bippy.bippy) +bippy! + +scala> :quit diff --git a/tests/pending/run/repl-empty-package/s_1.scala b/tests/pending/run/repl-empty-package/s_1.scala new file mode 100644 index 000000000000..b59d16b338e5 --- /dev/null +++ b/tests/pending/run/repl-empty-package/s_1.scala @@ -0,0 +1,3 @@ +object Bippy { + def bippy = "bippy!" +} diff --git a/tests/pending/run/repl-empty-package/s_2.scala b/tests/pending/run/repl-empty-package/s_2.scala new file mode 100644 index 000000000000..512e6dd38212 --- /dev/null +++ b/tests/pending/run/repl-empty-package/s_2.scala @@ -0,0 +1,5 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = "println(Bippy.bippy)" +} diff --git a/tests/pending/run/repl-javap-app.check b/tests/pending/run/repl-javap-app.check new file mode 100644 index 000000000000..eb3718f44b0f --- /dev/null +++ b/tests/pending/run/repl-javap-app.check @@ -0,0 +1,63 @@ +#partest java6 +Welcome to Scala +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :javap -app MyApp$ +public final void delayedEndpoint$MyApp$1(); + Code: + Stack=2, Locals=1, Args_size=1 + 0: getstatic #XX; //Field scala/Console$.MODULE$:Lscala/Console$; + 3: ldc #XX; //String Hello, delayed world. + 5: invokevirtual #XX; //Method scala/Console$.println:(Ljava/lang/Object;)V + 8: return + LocalVariableTable: + Start Length Slot Name Signature + 0 9 0 this LMyApp$; + +scala> :quit +#partest java7 +Welcome to Scala +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :javap -app MyApp$ + public final void delayedEndpoint$MyApp$1(); + flags: ACC_PUBLIC, ACC_FINAL + Code: + stack=2, locals=1, args_size=1 + 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$; + 3: ldc #XX // String Hello, delayed world. + 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V + 8: return + LocalVariableTable: + Start Length Slot Name Signature + 0 9 0 this LMyApp$; + LineNumberTable: + line 5: 0 +} + +scala> :quit +#partest java8 +Welcome to Scala +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :javap -app MyApp$ + public final void delayedEndpoint$MyApp$1(); + descriptor: ()V + flags: ACC_PUBLIC, ACC_FINAL + Code: + stack=2, locals=1, args_size=1 + 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$; + 3: ldc #XX // String Hello, delayed world. + 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V + 8: return + LocalVariableTable: + Start Length Slot Name Signature + 0 9 0 this LMyApp$; + LineNumberTable: + line 5: 0 +} + +scala> :quit diff --git a/tests/pending/run/repl-javap-app.scala b/tests/pending/run/repl-javap-app.scala new file mode 100644 index 000000000000..73fc82ece554 --- /dev/null +++ b/tests/pending/run/repl-javap-app.scala @@ -0,0 +1,21 @@ + +import scala.tools.partest.ReplTest + +object MyApp extends dotty.runtime.LegacyApp { + Console println "Hello, delayed world." +} + +object Test extends ReplTest { + def code = ":javap -app MyApp$" + + override def welcoming = true + + // The constant pool indices are not the same for GenASM / GenBCode, so + // replacing the exact numbers by XX. + lazy val hasConstantPoolRef = """(.*)(#\d\d)(.*)""".r + + override def normalize(s: String) = s match { + case hasConstantPoolRef(start, ref, end) => start + "#XX" + end + case _ => super.normalize(s) + } +} diff --git a/tests/pending/run/repl-javap-def.scala b/tests/pending/run/repl-javap-def.scala new file mode 100644 index 000000000000..dbd769613aaa --- /dev/null +++ b/tests/pending/run/repl-javap-def.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |def f = 7 + |:javap -public -raw f + """.stripMargin + + // it should find f wrapped in repl skins. replstiltskin. + override def yah(res: Seq[String]) = { + // replstiltskin: what be my name? + val keywords = List("public", "class", "line") + def isLineClass(s: String) = keywords forall (s contains _) + def filtered = res filter isLineClass + 1 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-fun.scala b/tests/pending/run/repl-javap-fun.scala new file mode 100644 index 000000000000..5c9a6b769166 --- /dev/null +++ b/tests/pending/run/repl-javap-fun.scala @@ -0,0 +1,16 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |object Betty { + | List(1,2,3) filter (_ % 2 != 0) map (_ * 2) + |} + |:javap -fun Betty + """.stripMargin + + // two anonfuns of Betty + override def yah(res: Seq[String]) = { + def filtered = res filter (_ contains "public final class Betty") + 2 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-lambdas.scala b/tests/pending/run/repl-javap-lambdas.scala new file mode 100644 index 000000000000..15e5bf687757 --- /dev/null +++ b/tests/pending/run/repl-javap-lambdas.scala @@ -0,0 +1,23 @@ +import scala.tools.partest.JavapTest +import scala.tools.nsc.Settings + +// see repl-javap-memfun.java for the complementary version +object Test extends JavapTest { + override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "method" ; s } + def code = """ + |object Betty { + | List(1,2,3) count (_ % 2 != 0) + | def f = List(1,2,3) filter (_ % 2 != 0) map (_ * 2) + | def g = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) map (_ + 1) + |} + |:javap -fun Betty#g + """.stripMargin + + // three anonfuns of Betty#g + override def yah(res: Seq[String]) = { + import PartialFunction.{ cond => when } + val r = """\s*private static final .* \$anonfun\$\d+\(.*""".r + def filtered = res filter (when(_) { case r(_*) => true }) + 3 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-mem.scala b/tests/pending/run/repl-javap-mem.scala new file mode 100644 index 000000000000..8db30e835ca8 --- /dev/null +++ b/tests/pending/run/repl-javap-mem.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |object Betty { + | val ds = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) + | def m(vs: List[Int]) = vs filter (_ % 2 != 0) map (_ * 2) + |} + |:javap Betty#m + """.stripMargin + + // filter for requested method member + override def yah(res: Seq[String]) = { + // cheaply, methods end in arg list + val p = """.*m\(.*\);""".r + def filtered = res filter (_ match { case p() => true case _ => false }) + 1 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-memfun.scala b/tests/pending/run/repl-javap-memfun.scala new file mode 100644 index 000000000000..d10ebcb399e1 --- /dev/null +++ b/tests/pending/run/repl-javap-memfun.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.JavapTest +import scala.tools.nsc.Settings + +// see repl-javap-lambdas.scala for the complementary version +object Test extends JavapTest { + // asserting the default + override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "inline" ; s } + def code = """ + |object Betty { + | List(1,2,3) count (_ % 2 != 0) + | def f = List(1,2,3) filter (_ % 2 != 0) map (_ * 2) + | def g = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) map (_ + 1) + |} + |:javap -fun Betty#g + """.stripMargin + + // three anonfuns of Betty#g + override def yah(res: Seq[String]) = { + def filtered = res filter (_ contains "public final class Betty") + 3 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-more-fun.scala b/tests/pending/run/repl-javap-more-fun.scala new file mode 100644 index 000000000000..e603faf75a8c --- /dev/null +++ b/tests/pending/run/repl-javap-more-fun.scala @@ -0,0 +1,17 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |object Betty { + | val ds = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) + | def m(vs: List[Int]) = vs filter (_ % 2 != 0) map (_ * 2) + |} + |:javap -fun Betty + """.stripMargin + + // two anonfuns of Betty + override def yah(res: Seq[String]) = { + def filtered = res filter (_ contains "public final class Betty") + 4 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-outdir-funs.flags b/tests/pending/run/repl-javap-outdir-funs.flags new file mode 100644 index 000000000000..ac96850b69b5 --- /dev/null +++ b/tests/pending/run/repl-javap-outdir-funs.flags @@ -0,0 +1 @@ +-Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/repl-javap-outdir-funs/foo_1.scala b/tests/pending/run/repl-javap-outdir-funs/foo_1.scala new file mode 100644 index 000000000000..9b98e94733ec --- /dev/null +++ b/tests/pending/run/repl-javap-outdir-funs/foo_1.scala @@ -0,0 +1,6 @@ + +package disktest + +class Foo { + def m(vs: List[Int]) = vs map (_ + 1) +} diff --git a/tests/pending/run/repl-javap-outdir-funs/run-repl_7.scala b/tests/pending/run/repl-javap-outdir-funs/run-repl_7.scala new file mode 100644 index 000000000000..af9651a8a30a --- /dev/null +++ b/tests/pending/run/repl-javap-outdir-funs/run-repl_7.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + // note the '-fun': it makes :javap search for some anonfun. + // for that reason, this test has a flags file that forces delambdafy:inline (doesn't allow :method) + def code = """ + |:javap -fun disktest/Foo.class + """.stripMargin + + override def yah(res: Seq[String]) = + // It's currently unknown why this test fails on Avian with + // “Failed: No anonfuns found.”, skip it for now. See SI-7630. + if (scala.tools.partest.utils.Properties.isAvian) + true + else { + val r = "public final class disktest.Foo.*extends scala.runtime.AbstractFunction1".r + def filtered = res filter (r.findFirstIn(_).nonEmpty) + 1 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap-outdir/foo_1.scala b/tests/pending/run/repl-javap-outdir/foo_1.scala new file mode 100644 index 000000000000..9b98e94733ec --- /dev/null +++ b/tests/pending/run/repl-javap-outdir/foo_1.scala @@ -0,0 +1,6 @@ + +package disktest + +class Foo { + def m(vs: List[Int]) = vs map (_ + 1) +} diff --git a/tests/pending/run/repl-javap-outdir/run-repl_7.scala b/tests/pending/run/repl-javap-outdir/run-repl_7.scala new file mode 100644 index 000000000000..dc2c5719ffdc --- /dev/null +++ b/tests/pending/run/repl-javap-outdir/run-repl_7.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |:javap disktest/Foo.class + """.stripMargin + + override def yah(res: Seq[String]) = { + def filtered = res filter (_ contains "public class disktest.Foo") + 1 == filtered.size + } +} diff --git a/tests/pending/run/repl-javap.scala b/tests/pending/run/repl-javap.scala new file mode 100644 index 000000000000..7a19852d4e6a --- /dev/null +++ b/tests/pending/run/repl-javap.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |case class Betty(i: Int) { def next = Betty(i+1) } + |:javap Betty + """.stripMargin + + override def yah(res: Seq[String]) = { + def filtered = res filter (_ contains "public class Betty") + 1 == filtered.size + } +} diff --git a/tests/pending/run/repl-out-dir.check b/tests/pending/run/repl-out-dir.check new file mode 100644 index 000000000000..c354492898ab --- /dev/null +++ b/tests/pending/run/repl-out-dir.check @@ -0,0 +1,49 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> case class Bippy(x: Int) +defined class Bippy + +scala> val x = Bippy(1) +x: Bippy = Bippy(1) + +scala> $intp.showDirectory +repl-out-dir-run.obj + $line1 + $eval$.class + $eval.class + $line2 + $eval$.class + $eval.class + $read$$iw$$iw$.class + $read$$iw$.class + $read$.class + $read.class + $line3 + $eval$.class + $eval.class + $read$$iw$$iw$.class + $read$$iw$$iw$Bippy$.class + $read$$iw$$iw$Bippy.class + $read$$iw$.class + $read$.class + $read.class + $line4 + $eval$.class + $eval.class + $read$$iw$$iw$.class + $read$$iw$.class + $read$.class + $read.class + $line5 + $eval$.class + $eval.class + $read$$iw$$iw$.class + $read$$iw$.class + $read$.class + $read.class + $repl_$init.class + Test$.class + Test.class + +scala> :quit diff --git a/tests/pending/run/repl-out-dir.scala b/tests/pending/run/repl-out-dir.scala new file mode 100644 index 000000000000..33c823aa2d78 --- /dev/null +++ b/tests/pending/run/repl-out-dir.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest +import scala.tools.nsc.Settings + +object Test extends ReplTest { + override def extraSettings = s"-Yrepl-outdir ${testOutput.path}" + + def code = s""" +case class Bippy(x: Int) +val x = Bippy(1) +$$intp.showDirectory + """ + +} diff --git a/tests/pending/run/repl-parens.check b/tests/pending/run/repl-parens.check new file mode 100644 index 000000000000..74d15ff93c04 --- /dev/null +++ b/tests/pending/run/repl-parens.check @@ -0,0 +1,84 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> (2) +res0: Int = 2 + +scala> (2 + 2) +res1: Int = 4 + +scala> ((2 + 2)) +res2: Int = 4 + +scala> ((2 + 2)) +res3: Int = 4 + +scala> ( (2 + 2)) +res4: Int = 4 + +scala> ( (2 + 2 ) ) +res5: Int = 4 + +scala> 5 ; ( (2 + 2 ) ) ; ((5)) +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ +res6: Int = 5 + +scala> (((2 + 2)), ((2 + 2))) +res7: (Int, Int) = (4,4) + +scala> (((2 + 2)), ((2 + 2)), 2) +res8: (Int, Int, Int) = (4,4,2) + +scala> (((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString) +res9: String = 4423 + +scala> + +scala> 55 ; ((2 + 2)) ; (1, 2, 3) +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ +res10: (Int, Int, Int) = (1,2,3) + +scala> 55 ; (x: Int) => x + 1 ; () => ((5)) +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; (x: Int) => x + 1 ;; + ^ +res11: () => Int = + +scala> + +scala> () => 5 +res12: () => Int = + +scala> 55 ; () => 5 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ;; + ^ +res13: () => Int = + +scala> () => { class X ; new X } +res14: () => AnyRef = + +scala> + +scala> def foo(x: Int)(y: Int)(z: Int) = x+y+z +foo: (x: Int)(y: Int)(z: Int)Int + +scala> foo(5)(10)(15)+foo(5)(10)(15) +res15: Int = 60 + +scala> + +scala> List(1) ++ List('a') +res16: List[AnyVal] = List(1, a) + +scala> :quit diff --git a/tests/pending/run/repl-parens.scala b/tests/pending/run/repl-parens.scala new file mode 100644 index 000000000000..e25933b1a287 --- /dev/null +++ b/tests/pending/run/repl-parens.scala @@ -0,0 +1,29 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +(2) +(2 + 2) +((2 + 2)) + ((2 + 2)) + ( (2 + 2)) + ( (2 + 2 ) ) +5 ; ( (2 + 2 ) ) ; ((5)) +(((2 + 2)), ((2 + 2))) +(((2 + 2)), ((2 + 2)), 2) +(((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString) + +55 ; ((2 + 2)) ; (1, 2, 3) +55 ; (x: Int) => x + 1 ; () => ((5)) + +() => 5 +55 ; () => 5 +() => { class X ; new X } + +def foo(x: Int)(y: Int)(z: Int) = x+y+z +foo(5)(10)(15)+foo(5)(10)(15) + +List(1) ++ List('a') + + """.trim +} diff --git a/tests/pending/run/repl-paste-2.check b/tests/pending/run/repl-paste-2.check new file mode 100644 index 000000000000..6ea8e2f419b2 --- /dev/null +++ b/tests/pending/run/repl-paste-2.check @@ -0,0 +1,61 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> scala> 999l + +// Detected repl transcript paste: ctrl-D to finish. + +res4: Int = 0123 + +scala> 123 +res5: Int = 123 + +scala> 567 +res6: Int = 567 + +scala> res5 + res6 +res7: Int = 690 + +scala> val x = dingus +:7: error: not found: value dingus + val x = dingus + ^ + +scala> val x = "dingus" +x: java.lang.String = dingus + +scala> x.length +res9: Int = 6 + +scala> x.length + res5 +res10: Int = 12 +// Replaying 8 commands from transcript. + +scala> 999l +res0: Long = 999 + +scala> val res5 = { 123 } +res5: Int = 123 + +scala> val res6 = { 567 } +res6: Int = 567 + +scala> res5 + res6 +res1: Int = 690 + +scala> val x = dingus +:7: error: not found: value dingus + val x = dingus + ^ + +scala> val x = "dingus" +x: String = dingus + +scala> x.length +res2: Int = 6 + +scala> x.length + res5 +res3: Int = 129 + + +scala> :quit diff --git a/tests/pending/run/repl-paste-2.scala b/tests/pending/run/repl-paste-2.scala new file mode 100644 index 000000000000..65f9b25175a2 --- /dev/null +++ b/tests/pending/run/repl-paste-2.scala @@ -0,0 +1,31 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +scala> 999l +res4: Int = 0123 + +scala> 123 +res5: Int = 123 + +scala> 567 +res6: Int = 567 + +scala> res5 + res6 +res7: Int = 690 + +scala> val x = dingus +:7: error: not found: value dingus + val x = dingus + ^ + +scala> val x = "dingus" +x: java.lang.String = dingus + +scala> x.length +res9: Int = 6 + +scala> x.length + res5 +res10: Int = 12 + """ +} \ No newline at end of file diff --git a/tests/pending/run/repl-paste-3.check b/tests/pending/run/repl-paste-3.check new file mode 100644 index 000000000000..23e402852fca --- /dev/null +++ b/tests/pending/run/repl-paste-3.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> println(3) +3 + +scala> List(1,2) +res1: List[Int] = List(1, 2) + +scala> :quit diff --git a/tests/pending/run/repl-paste-3.scala b/tests/pending/run/repl-paste-3.scala new file mode 100644 index 000000000000..3f26799ccb39 --- /dev/null +++ b/tests/pending/run/repl-paste-3.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +println(3) + List(1,2) + """ +} \ No newline at end of file diff --git a/tests/pending/run/repl-paste-4.pastie b/tests/pending/run/repl-paste-4.pastie new file mode 100644 index 000000000000..853a66f6a4e0 --- /dev/null +++ b/tests/pending/run/repl-paste-4.pastie @@ -0,0 +1,4 @@ + +// if we are truly companions, I can see your foo +class Foo { private val foo = 7 } +object Foo { def apply(f: Foo) = f.foo } diff --git a/tests/pending/run/repl-paste-4.scala b/tests/pending/run/repl-paste-4.scala new file mode 100644 index 000000000000..cb0a6aa7682e --- /dev/null +++ b/tests/pending/run/repl-paste-4.scala @@ -0,0 +1,20 @@ + +import scala.tools.partest.SessionTest + +object Test extends SessionTest { + def session = +s"""|Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> :paste $pastie + |Pasting file $pastie... + |defined class Foo + |defined object Foo + | + |scala> Foo(new Foo) + |res0: Int = 7 + | + |scala> :quit""" + def pastie = testPath changeExtension "pastie" +} + diff --git a/tests/pending/run/repl-paste-raw.pastie b/tests/pending/run/repl-paste-raw.pastie new file mode 100644 index 000000000000..f13b4bcf8bdb --- /dev/null +++ b/tests/pending/run/repl-paste-raw.pastie @@ -0,0 +1,8 @@ + +// a raw paste is not a script +// hence it can be packaged + +package brown_paper + +// these are a few of my favorite things +case class Gift (hasString: Boolean) diff --git a/tests/pending/run/repl-paste-raw.scala b/tests/pending/run/repl-paste-raw.scala new file mode 100644 index 000000000000..3b41254e9664 --- /dev/null +++ b/tests/pending/run/repl-paste-raw.scala @@ -0,0 +1,20 @@ + +import scala.tools.partest.SessionTest + +object Test extends SessionTest { + def session = +s"""|Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> :paste -raw $pastie + |Pasting file $pastie... + | + |scala> val favoriteThing = brown_paper.Gift(true) + |favoriteThing: brown_paper.Gift = Gift(true) + | + |scala> favoriteThing.hasString + |res0: Boolean = true + | + |scala> :quit""" + def pastie = testPath changeExtension "pastie" +} diff --git a/tests/pending/run/repl-paste.check b/tests/pending/run/repl-paste.check new file mode 100644 index 000000000000..171447214f21 --- /dev/null +++ b/tests/pending/run/repl-paste.check @@ -0,0 +1,26 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :paste +// Entering paste mode (ctrl-D to finish) + + +class Dingus +{ + private val x = 5 + def y = Dingus.x * 2 +} +object Dingus +{ + private val x = 55 +} + +val x = (new Dingus).y + +// Exiting paste mode, now interpreting. + +defined class Dingus +defined object Dingus +x: Int = 110 + +scala> :quit diff --git a/tests/pending/run/repl-paste.scala b/tests/pending/run/repl-paste.scala new file mode 100644 index 000000000000..5495505353b9 --- /dev/null +++ b/tests/pending/run/repl-paste.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = ":paste\n" + ( + """ +class Dingus +{ + private val x = 5 + def y = Dingus.x * 2 +} +object Dingus +{ + private val x = 55 +} + +val x = (new Dingus).y + """ + ) +} \ No newline at end of file diff --git a/tests/pending/run/repl-power.check b/tests/pending/run/repl-power.check new file mode 100644 index 000000000000..e2318c93f2ca --- /dev/null +++ b/tests/pending/run/repl-power.check @@ -0,0 +1,30 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> // guarding against "error: reference to global is ambiguous" + +scala> global.emptyValDef // "it is imported twice in the same scope by ..." +warning: there was one deprecation warning; re-run with -deprecation for details +res0: $r.global.noSelfType.type = private val _ = _ + +scala> val tp = ArrayClass[scala.util.Random] // magic with tags +warning: there was one feature warning; re-run with -feature for details +tp: $r.global.Type = Array[scala.util.Random] + +scala> tp.memberType(Array_apply) // evidence +res1: $r.global.Type = (i: Int)scala.util.Random + +scala> val m = LIT(10) // treedsl +m: $r.treedsl.global.Literal = 10 + +scala> typed(m).tpe // typed is in scope +res2: $r.treedsl.global.Type = Int(10) + +scala> :quit diff --git a/tests/pending/run/repl-power.scala b/tests/pending/run/repl-power.scala new file mode 100644 index 000000000000..4dfeb3788519 --- /dev/null +++ b/tests/pending/run/repl-power.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +:power +// guarding against "error: reference to global is ambiguous" +global.emptyValDef // "it is imported twice in the same scope by ..." +val tp = ArrayClass[scala.util.Random] // magic with tags +tp.memberType(Array_apply) // evidence +val m = LIT(10) // treedsl +typed(m).tpe // typed is in scope + """.trim +} diff --git a/tests/pending/run/repl-reset.check b/tests/pending/run/repl-reset.check new file mode 100644 index 000000000000..cd7893bbc3ac --- /dev/null +++ b/tests/pending/run/repl-reset.check @@ -0,0 +1,57 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val x1 = 1 +x1: Int = 1 + +scala> val x2 = 2 +x2: Int = 2 + +scala> val x3 = 3 +x3: Int = 3 + +scala> case class BippyBungus() +defined class BippyBungus + +scala> x1 + x2 + x3 +res0: Int = 6 + +scala> :reset +Resetting interpreter state. +Forgetting this session history: + +val x1 = 1 +val x2 = 2 +val x3 = 3 +case class BippyBungus() +x1 + x2 + x3 + +Forgetting all expression results and named terms: $intp, BippyBungus, x1, x2, x3 +Forgetting defined types: BippyBungus + +scala> x1 + x2 + x3 +:8: error: not found: value x1 + x1 + x2 + x3 + ^ +:8: error: not found: value x2 + x1 + x2 + x3 + ^ +:8: error: not found: value x3 + x1 + x2 + x3 + ^ + +scala> val x1 = 4 +x1: Int = 4 + +scala> new BippyBungus +:8: error: not found: type BippyBungus + new BippyBungus + ^ + +scala> class BippyBungus() { def f = 5 } +defined class BippyBungus + +scala> { new BippyBungus ; x1 } +res2: Int = 4 + +scala> :quit diff --git a/tests/pending/run/repl-reset.scala b/tests/pending/run/repl-reset.scala new file mode 100644 index 000000000000..ad1602b17e75 --- /dev/null +++ b/tests/pending/run/repl-reset.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |val x1 = 1 + |val x2 = 2 + |val x3 = 3 + |case class BippyBungus() + |x1 + x2 + x3 + |:reset + |x1 + x2 + x3 + |val x1 = 4 + |new BippyBungus + |class BippyBungus() { def f = 5 } + |{ new BippyBungus ; x1 } + """.stripMargin + + // would be nice if we could count on javap being present + // but no + // + // |:javap BippyBungus +} diff --git a/tests/pending/run/repl-save.check b/tests/pending/run/repl-save.check new file mode 100644 index 000000000000..5f928688d083 --- /dev/null +++ b/tests/pending/run/repl-save.check @@ -0,0 +1,3 @@ +val i = 7 +val j = 8 +i * j diff --git a/tests/pending/run/repl-save.scala b/tests/pending/run/repl-save.scala new file mode 100644 index 000000000000..c98e6aebc374 --- /dev/null +++ b/tests/pending/run/repl-save.scala @@ -0,0 +1,25 @@ +import scala.tools.partest.SessionTest + +object Test extends SessionTest { + def session = +s"""|Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> val i = 7 + |i: Int = 7 + | + |scala> val j = 8 + |j: Int = 8 + | + |scala> i * j + |res0: Int = 56 + | + |scala> :save $saveto + | + |scala> :quit""" + def saveto = testOutput / "session.repl" + override def show() = { + super.show() + Console print saveto.toFile.slurp + } +} diff --git a/tests/pending/run/repl-term-macros.check b/tests/pending/run/repl-term-macros.check new file mode 100644 index 000000000000..2cd0b93cd04c --- /dev/null +++ b/tests/pending/run/repl-term-macros.check @@ -0,0 +1,40 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.macros.blackbox.Context +import scala.reflect.macros.blackbox.Context + +scala> import language.experimental.macros +import language.experimental.macros + +scala> + +scala> def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } +impl1: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit] + +scala> def foo1: Unit = macro impl1 +defined term macro foo1: Unit + +scala> foo1 + +scala> + +scala> def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } +impl2: (c: scala.reflect.macros.blackbox.Context)()c.Expr[Unit] + +scala> def foo2(): Unit = macro impl2 +defined term macro foo2: ()Unit + +scala> foo2() + +scala> + +scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } +impl3: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit] + +scala> def foo3(x: Int)(y: Int): Unit = macro impl3 +defined term macro foo3: (x: Int)(y: Int)Unit + +scala> foo3(2)(3) + +scala> :quit diff --git a/tests/pending/run/repl-term-macros.scala b/tests/pending/run/repl-term-macros.scala new file mode 100644 index 000000000000..32892b73145a --- /dev/null +++ b/tests/pending/run/repl-term-macros.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } +def foo1: Unit = macro impl1 +foo1 + +def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") } +def foo2(): Unit = macro impl2 +foo2() + +def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") } +def foo3(x: Int)(y: Int): Unit = macro impl3 +foo3(2)(3) + """ +} \ No newline at end of file diff --git a/tests/pending/run/repl-transcript.check b/tests/pending/run/repl-transcript.check new file mode 100644 index 000000000000..b0f106387b55 --- /dev/null +++ b/tests/pending/run/repl-transcript.check @@ -0,0 +1,38 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> scala> class Bippity + +// Detected repl transcript paste: ctrl-D to finish. + +defined class Bippity + +scala> def f = new Bippity +f: Bippity + +scala> 123 +res5: Int = 123 + +scala> 1 to 100 map (_ + 1) +res6: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) + +scala> res6.sum + res5 +// Replaying 5 commands from transcript. + +scala> class Bippity +defined class Bippity + +scala> def f = new Bippity +f: Bippity + +scala> val res5 = { 123 } +res5: Int = 123 + +scala> val res6 = { 1 to 100 map (_ + 1) } +res6: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) + +scala> res6.sum + res5 +res0: Int = 5273 + + +scala> :quit diff --git a/tests/pending/run/repl-transcript.scala b/tests/pending/run/repl-transcript.scala new file mode 100644 index 000000000000..b39279aea3ad --- /dev/null +++ b/tests/pending/run/repl-transcript.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +scala> class Bippity +defined class Bippity + +scala> def f = new Bippity +f: Bippity + +scala> 123 +res5: Int = 123 + +scala> 1 to 100 map (_ + 1) +res6: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) + +scala> res6.sum + res5 + """ +} + diff --git a/tests/pending/run/repl-trim-stack-trace.scala b/tests/pending/run/repl-trim-stack-trace.scala new file mode 100644 index 000000000000..a53ce3b3e4e9 --- /dev/null +++ b/tests/pending/run/repl-trim-stack-trace.scala @@ -0,0 +1,45 @@ + +import scala.tools.partest.{ SessionTest, Welcoming } + +// SI-7740 +object Test extends SessionTest with Welcoming { + def session = +"""Welcome to Scala +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def f = throw new Exception("Uh-oh") +f: Nothing + +scala> f +java.lang.Exception: Uh-oh + at .f(:7) + ... 69 elided + +scala> def f = throw new Exception("") +f: Nothing + +scala> f +java.lang.Exception: + at .f(:7) + ... 69 elided + +scala> def f = throw new Exception +f: Nothing + +scala> f +java.lang.Exception + at .f(:7) + ... 69 elided + +scala> :quit""" + + // normalize the "elided" lines because the frame count depends on test context + lazy val elided = """(\s+\.{3} )\d+( elided)""".r + override def normalize(line: String) = line match { + case welcome(w) => w + case elided(ellipsis, suffix) => s"$ellipsis???$suffix" + case s => s + } + override def expected = super.expected map normalize +} diff --git a/tests/pending/run/repl-type-verbose.check b/tests/pending/run/repl-type-verbose.check new file mode 100644 index 000000000000..6f6b47b86dda --- /dev/null +++ b/tests/pending/run/repl-type-verbose.check @@ -0,0 +1,190 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> // verbose! + +scala> :type -v def f = 5 +// Type signature +=> Int + +// Internal Type structure +NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) +) + +scala> :type -v def f() = 5 +// Type signature +()Int + +// Internal Type structure +NullaryMethodType( + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) +) + +scala> :type -v def f[T] = 5 +// Type signature +[T]=> Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T)) + resultType = NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) +) + +scala> :type -v def f[T >: Null] = 5 +// Type signature +[T >: Null]=> Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T >: Null)) + resultType = NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) +) + +scala> :type -v def f[T <: String] = 5 +// Type signature +[T <: String]=> Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T <: String)) + resultType = NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) +) + +scala> :type -v def f[T]() = 5 +// Type signature +[T]()Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T)) + resultType = NullaryMethodType( + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) +) + +scala> :type -v def f[T, U]() = 5 +// Type signature +[T, U]()Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T), TypeParam(U)) + resultType = NullaryMethodType( + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) +) + +scala> :type -v def f[T, U]()() = 5 +// Type signature +[T, U]()()Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T), TypeParam(U)) + resultType = NullaryMethodType( + resultType = NullaryMethodType( + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) + ) +) + +scala> :type -v def f[T, U <: T] = 5 +// Type signature +[T, U <: T]=> Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T), TypeParam(U <: T)) + resultType = NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) +) + +scala> :type -v def f[T, U <: T](x: T)(y: U) = 5 +// Type signature +[T, U <: T](x: T)(y: U)Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T), TypeParam(U <: T)) + resultType = MethodType( + params = List(TermSymbol(x: T)) + resultType = MethodType( + params = List(TermSymbol(y: U)) + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) + ) +) + +scala> :type -v def f[T: Ordering] = 5 +// Type signature +[T](implicit evidence$1: Ordering[T])Int + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T)) + resultType = MethodType( + params = List(TermSymbol(implicit evidence$1: Ordering[T])) + resultType = TypeRef( + TypeSymbol(final abstract class Int extends AnyVal) + ) + ) +) + +scala> :type -v def f[T: Ordering] = implicitly[Ordering[T]] +// Type signature +[T](implicit evidence$1: Ordering[T])Ordering[T] + +// Internal Type structure +PolyType( + typeParams = List(TypeParam(T)) + resultType = MethodType( + params = List(TermSymbol(implicit evidence$1: Ordering[T])) + resultType = AliasTypeRef( + Alias(type Ordering[T] = scala.math.Ordering[T]) + args = List(TypeParamTypeRef(TypeParam(T))) + normalize = TypeRef( + TypeSymbol( + abstract trait Ordering[T] extends Comparator[T] with PartialOrdering[T] with Serializable + + ) + args = List(TypeParamTypeRef(TypeParam(T))) + ) + ) + ) +) + +scala> :type -v def f[T <: { type Bippy = List[Int] ; def g(): Bippy }] = 5 +// Type signature +[T <: AnyRef{type Bippy = List[Int]; def g(): this.Bippy}]=> Int + +// Internal Type structure +PolyType( + typeParams = List( + TypeParam( + T <: AnyRef{type Bippy = List[Int]; def g(): this.Bippy} + ) + ) + resultType = NullaryMethodType( + TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) + ) +) + +scala> :quit diff --git a/tests/pending/run/repl-type-verbose.scala b/tests/pending/run/repl-type-verbose.scala new file mode 100644 index 000000000000..10c390550af4 --- /dev/null +++ b/tests/pending/run/repl-type-verbose.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |// verbose! + |:type -v def f = 5 + |:type -v def f() = 5 + |:type -v def f[T] = 5 + |:type -v def f[T >: Null] = 5 + |:type -v def f[T <: String] = 5 + |:type -v def f[T]() = 5 + |:type -v def f[T, U]() = 5 + |:type -v def f[T, U]()() = 5 + |:type -v def f[T, U <: T] = 5 + |:type -v def f[T, U <: T](x: T)(y: U) = 5 + |:type -v def f[T: Ordering] = 5 + |:type -v def f[T: Ordering] = implicitly[Ordering[T]] + |:type -v def f[T <: { type Bippy = List[Int] ; def g(): Bippy }] = 5 + """.stripMargin +} diff --git a/tests/pending/run/resetattrs-this.check b/tests/pending/run/resetattrs-this.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/resetattrs-this.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/resetattrs-this.scala b/tests/pending/run/resetattrs-this.scala new file mode 100644 index 000000000000..1c4c288da841 --- /dev/null +++ b/tests/pending/run/resetattrs-this.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val tree = Select(This(cm.staticPackage("scala").moduleClass), TermName("Predef")) + val ttree = tb.typecheck(tree) + val rttree = tb.untypecheck(ttree) + println(tb.eval(rttree) == Predef) +} diff --git a/tests/pending/run/retclosure.check b/tests/pending/run/retclosure.check new file mode 100644 index 000000000000..94c4971e4a42 --- /dev/null +++ b/tests/pending/run/retclosure.check @@ -0,0 +1 @@ +check failed: some problem diff --git a/tests/pending/run/retclosure.scala b/tests/pending/run/retclosure.scala new file mode 100644 index 000000000000..0f4b823c3e08 --- /dev/null +++ b/tests/pending/run/retclosure.scala @@ -0,0 +1,23 @@ +/* Test return expressions inside closures. + * + * See bug#834 */ + +object Test { + def response: String = { + def check: Option[String] = { + val closure: String=>Nothing = + p => return Some("some problem") // should return from check + + closure("whatever") + } + + check match { + case Some(problem) => "check failed: " + problem + case None => "ok" + } + } + + def main(args: Array[String]): Unit = { + Console.println(response) + } +} diff --git a/tests/pending/run/retsynch.check b/tests/pending/run/retsynch.check new file mode 100644 index 000000000000..8c40598f939b --- /dev/null +++ b/tests/pending/run/retsynch.check @@ -0,0 +1 @@ +abs(-5) = 5 diff --git a/tests/pending/run/retsynch.scala b/tests/pending/run/retsynch.scala new file mode 100644 index 000000000000..7735df7d9630 --- /dev/null +++ b/tests/pending/run/retsynch.scala @@ -0,0 +1,11 @@ +object Test { + def abs(x: Int): Int = synchronized { + if (x > 0) + return x + return -x + } + + def main(args: Array[String]) = { + Console.println("abs(-5) = " + abs(-5)) + } +} diff --git a/tests/pending/run/richWrapperEquals.scala b/tests/pending/run/richWrapperEquals.scala new file mode 100644 index 000000000000..4a43617cde10 --- /dev/null +++ b/tests/pending/run/richWrapperEquals.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + assert(5 == (5: java.lang.Integer)) + assert((5: java.lang.Integer) == 5) + } +} diff --git a/tests/pending/run/richs.check b/tests/pending/run/richs.check new file mode 100644 index 000000000000..cf265ae00738 --- /dev/null +++ b/tests/pending/run/richs.check @@ -0,0 +1,79 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details + +RichCharTest1: +true +true +true +true + +RichIntTest: +10 +11 +12 +13 +0 +0 +10000 +10 +20 +10001 +ffffffff + +RichStringTest1: +s1: abc +s2: abc\txyz\n +s3: abc + xyz +s4: abc + |xyz +s5: abc + #xyz + +RichStringTest2: +s1: abc +s2: abc\txyz\n +s3: abc + xyz +s4: abc + |xyz +s5: abc + #xyz + +RichStringTest3: +s1: abc +s2: abc\txyz\n +s3: abc + xyz +s4: abc + |xyz +s5: abc + #xyz + +RichStringTest4: +s1: abc +s2: abc\txyz\n +s3: abc + xyz +s4: abc +xyz +s5: abc + #xyz + +RichStringTest5: +s1: abc + xyz +s2: abc + xyz +s3: abc + xyz +s4: abc + |xyz +s5: abc +xyz +List(a, b, c, d) +List(a, b, c, d) +List(a, b, c, d) +List(a, b, c, d) +List(a, b, c, d) +List(a, b, c, d) +List(a, b, c, d) diff --git a/tests/pending/run/richs.scala b/tests/pending/run/richs.scala new file mode 100644 index 000000000000..ea870b9c4565 --- /dev/null +++ b/tests/pending/run/richs.scala @@ -0,0 +1,139 @@ +trait RichTest { + val s1 = """abc""" + val s2 = """abc\txyz\n""" + val s3 = """abc + xyz""" + val s4 = """abc + |xyz""" + val s5 = """abc + #xyz""" + def getObjectName: String = { + val cn = this.getClass().getName() + cn.substring(0, cn.length-1) + } + def length[A](it: Iterator[A]) = it.toList.length + def length[A](it: Iterable[A]) = it.toList.length + def run: Unit +} +object RichCharTest1 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + println('\40'.isWhitespace) + println('\011'.isWhitespace) + println('1'.asDigit == 1) + println('A'.asDigit == 10) + } +} +// object RichCharTest2 extends RichTest { +// case class C(s: String) { +// private val it = s.iterator +// private var c: Char = _ +// def ch(): Char = c +// def nextch(): Unit = { c = if (it.hasNext) it.next else ';' } +// def err(msg: String) = println(msg) +// nextch() +// } +// def run { +// println("\n" + getObjectName + ":") +// val c1 = C("x4A;") +// val s1 = xml.Utility.parseCharRef(c1.ch, c1.nextch, c1.err) +// val c2 = C("74;") +// val s2 = xml.Utility.parseCharRef(c2.ch, c2.nextch, c2.err) +// println(s1 == s2) +// } +// } +object RichIntTest extends RichTest { + private val n = 10 + private val m = -2 + def run: Unit = { + println("\n" + getObjectName + ":") + println(length(0 until n)) + println(length(0 to n)) + println(length(m until n)) + println(length(m to n)) + println(length(n until m)) + println(length(n to m)) + + println(16.toBinaryString) // should be "10000" + println(16.toHexString) // should be "10" + println(16.toOctalString) // should be "20" + + println(65537.toHexString) // should be "10001" + println((-1).toHexString) // should be "ffffffff" + } +} +object RichStringTest1 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + println("s1: " + s1) + println("s2: " + s2) + println("s3: " + s3) + println("s4: " + s4) + println("s5: " + s5) + } +} +object RichStringTest2 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + Console.print("s1: "); s1.lines foreach println + Console.print("s2: "); s2.lines foreach println + Console.print("s3: "); s3.lines foreach println + Console.print("s4: "); s4.lines foreach println + Console.print("s5: "); s5.lines foreach println + } +} +object RichStringTest3 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + println("s1: " + s1.stripLineEnd) + println("s2: " + s2.stripLineEnd) + println("s3: " + s3.stripLineEnd) + println("s4: " + s4.stripLineEnd) + println("s5: " + s5.stripLineEnd) + } +} +object RichStringTest4 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + println("s1: " + s1.stripMargin) + println("s2: " + s2.stripMargin) + println("s3: " + s3.stripMargin) + println("s4: " + s4.stripMargin) + println("s5: " + s5.stripMargin) + } +} +object RichStringTest5 extends RichTest { + def run: Unit = { + println("\n" + getObjectName + ":") + println("s1: " + s3.stripMargin('#')) + println("s2: " + s3.stripMargin('#')) + println("s3: " + s3.stripMargin('#')) + println("s4: " + s4.stripMargin('#')) + println("s5: " + s5.stripMargin('#')) + } +} +object RichStringTest6 extends RichTest { + def run: Unit = { + println("a:b:c:d".split(':').toList) + println("a.b.c.d".split('.').toList) + println("a$b$c$d".split('$').toList) + println("a^b^c^d".split('^').toList) + println("a\\b\\c\\d".split('\\').toList) + println("a:b:c.d".split(Array(':', '.')).toList) + println("a:b.c$d".split(Array(':', '.', '$')).toList) + } +} +/** xxx */ +object Test { + def main(args: Array[String]): Unit = { + RichCharTest1.run + //RichCharTest2.run + RichIntTest.run + RichStringTest1.run + RichStringTest2.run + RichStringTest3.run + RichStringTest4.run + RichStringTest5.run + RichStringTest6.run + } +} diff --git a/tests/pending/run/run-bug4840.check b/tests/pending/run/run-bug4840.check new file mode 100644 index 000000000000..cdfc1f911f0c --- /dev/null +++ b/tests/pending/run/run-bug4840.check @@ -0,0 +1,2 @@ +Some(5) +Some(Some(Some(5))) diff --git a/tests/pending/run/run-bug4840.flags b/tests/pending/run/run-bug4840.flags new file mode 100644 index 000000000000..eb4d19bcb91a --- /dev/null +++ b/tests/pending/run/run-bug4840.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file diff --git a/tests/pending/run/run-bug4840.scala b/tests/pending/run/run-bug4840.scala new file mode 100644 index 000000000000..dda280fd177d --- /dev/null +++ b/tests/pending/run/run-bug4840.scala @@ -0,0 +1,30 @@ +object Test { + def g(x: Boolean): Option[String] = if (x) Some("booya") else None + + def f1() = { + for (x <- g(true)) yield { + g(false) match { + case Some(_) => sys.error("") + case None => 5 + } + } + } + + def f2() = { + for (x <- g(true) ; y <- g(true) ; z <- g(true)) yield { + for (x <- g(true) ; y <- g(true) ; z <- g(true)) yield { + g(true) map { _ => + (null: Any) match { + case Some(x: Int) => x + case _ => 5 + } + } + } + } + } + + def main(args: Array[String]): Unit = { + println(f1()) + println(f2()) + } +} diff --git a/tests/pending/run/runtime-richChar.check b/tests/pending/run/runtime-richChar.check new file mode 100644 index 000000000000..8d7a00858536 --- /dev/null +++ b/tests/pending/run/runtime-richChar.check @@ -0,0 +1,10 @@ +'a' to 'c' ok +'a' until 'c' ok +'a' to 'b' ok +'a' until 'b' ok +'a' to 'a' ok +'a' until 'a' ok +'b' to 'a' ok +'b' until 'a' ok +'c' to 'a' ok +'c' until 'a' ok diff --git a/tests/pending/run/runtime-richChar.scala b/tests/pending/run/runtime-richChar.scala new file mode 100644 index 000000000000..0368368bf6e5 --- /dev/null +++ b/tests/pending/run/runtime-richChar.scala @@ -0,0 +1,25 @@ +object Test extends dotty.runtime.LegacyApp { + def testSeq(name: String, expected: Seq[Char], got: Seq[Char]): Unit = { + if (expected.toList == got.toList) + println(name + " ok") + else + println(name + " failed: " + expected + " differs from " + got) + } + + testSeq("'a' to 'c'", List('a', 'b', 'c'), 'a' to 'c') + testSeq("'a' until 'c'", List('a', 'b'), 'a' until 'c') + + testSeq("'a' to 'b'", List('a', 'b'), 'a' to 'b') + testSeq("'a' until 'b'", List('a'), 'a' until 'b') + + testSeq("'a' to 'a'", List('a'), 'a' to 'a') + testSeq("'a' until 'a'", List(), 'a' until 'a') + + testSeq("'b' to 'a'", List(), 'b' to 'a') + testSeq("'b' until 'a'", List(), 'b' until 'a') + + testSeq("'c' to 'a'", List(), 'c' to 'a') + testSeq("'c' until 'a'", List(), 'c' until 'a') +} + +// vim: set ts=2 sw=2 et: diff --git a/tests/pending/run/runtime.check b/tests/pending/run/runtime.check new file mode 100644 index 000000000000..d613c9bd42c6 --- /dev/null +++ b/tests/pending/run/runtime.check @@ -0,0 +1,70 @@ +runtime.scala:141: warning: comparing values of types Null and Null using `eq' will always yield true + check(true , null eq null, null ne null); + ^ +runtime.scala:141: warning: comparing values of types Null and Null using `ne' will always yield false + check(true , null eq null, null ne null); + ^ +<<< Test0 +[false,true] +[0,1,2] +[3,4,5] +[a,b,c] +[6,7,8] +[9,10,11] +[12.0,13.0] +[14.0,15.0] +[string] +>>> Test0 + +<<< Test1 +10 +14 +15 +16 +20 +23 +24 +25 +26 +>>> Test1 + +<<< Test2 +A +M0 +N0 + +A +N0 +M0 + +A +M0 +M1 +N0 + +A +N0 +N1 +M0 + +>>> Test2 + +<<< Test3 +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +Ok +>>> Test3 + diff --git a/tests/pending/run/runtime.scala b/tests/pending/run/runtime.scala new file mode 100644 index 000000000000..89348b294db8 --- /dev/null +++ b/tests/pending/run/runtime.scala @@ -0,0 +1,199 @@ +//############################################################################ +// Run Time Bugs & Test Cases +//############################################################################ + +//############################################################################ +// Test 0 - Array creation + +object Test0Test { + def println[A](xs: Array[A]): Unit = { + var i = 0; + Console.print("["); + while (i < xs.length) { + if (i > 0) Console.print(","); + Console.print(xs(i)); + i = i + 1; + } + Console.print("]"); + Console.println; + } + + def test(args: Array[String]): Unit = { + val zs: Array[Boolean] = Array(false, true); + val bs: Array[Byte ] = Array(0, 1, 2); + val ss: Array[Short ] = Array(3, 4, 5); + val cs: Array[Char ] = Array('a', 'b', 'c'); + val is: Array[Int ] = Array(6, 7, 8); + val ls: Array[Long ] = Array(9l, 10l, 11l); + val fs: Array[Float ] = Array(12.0f, 13.0f); + val ds: Array[Double ] = Array(14.0d, 15.0d); + val os: Array[AnyRef ] = Array("string"); + println(zs); + println(bs); + println(ss); + println(cs); + println(is); + println(ls); + println(fs); + println(ds); + println(os); + } +} + +//############################################################################ +// Test 1 - Block Qualifiers + +package test1.bar { + + object System { + val out: PrintStream = new PrintStream(); + } + + class PrintStream() { + def println(): Unit = { + Console.println; + } + } + +} + +object Test1Test { + + def test(args: Array[String]): Unit = { + {Console.print(10)}; Console.println; + // {System.out.print(11); java}.lang.System.out.println(); + // {System.out.print(12); java.lang}.System.out.println(); + // {System.out.print(13); java.lang.System}.out.println(); + {Console.print(14); Console}.println; + {Console.print(15); (() => Console.println):(() => Unit)} apply (); + {Console.print(16); Console.println}; + + {Console.print(20)}; test1.bar.System.out.println(); + // {System.out.print(21); test1}.bar.System.out.println(); + // {System.out.print(22); test1.bar}.System.out.println(); + {Console.print(23); test1.bar.System}.out.println(); + {Console.print(24); test1.bar.System.out}.println(); + {Console.print(25); test1.bar.System.out.println:(() => Unit)} apply (); + {Console.print(26); test1.bar.System.out.println()}; + } + +} + +//############################################################################ +// Test 2 - Super Calls with Mixins + +package test2 { + + class A { + def run = Console.println("A"); + } + + trait M0 extends A { + override def run = { super.run; Console.println("M0"); } + } + + class M1 extends M0 { + override def run = { super.run; Console.println("M1"); } + } + + trait N0 extends A { + override def run = { super.run; Console.println("N0"); } + } + + class N1 extends N0 { + override def run = { super.run; Console.println("N1"); } + } + + object M0N0 extends M0 with N0; + object N0M0 extends N0 with M0; + object M1N0 extends M1 with N0; + object N1M0 extends N1 with M0; + +} + +object Test2Test { + def test(args: Array[String]): Unit = { + test2.M0N0.run; Console.println; + test2.N0M0.run; Console.println; + test2.M1N0.run; Console.println; + test2.N1M0.run; Console.println; + } +} + +//############################################################################ +// Test 3 - Methods eq and ne + +object Test3Test { + + class Foo { override def equals(that: Any) = sys.error("abort"); } + + def check(expected: Boolean, actual1: Boolean, actual2: Boolean): Unit = + Console.println( + if ((actual1 == expected) && (actual2 == !expected)) "Ok" else "KO: " + + "expected: " + expected + " - " + (!expected) + ", " + + "found: " + actual1 + " - " + actual1); + + def test(args: Array[String]): Unit = { + val foo1: AnyRef = null; + val foo2: AnyRef = new Foo(); + val foo3: AnyRef = new Foo(); + + check(true , null eq null, null ne null); + check(true , null eq foo1, null ne foo1); + check(false, null eq foo2, null ne foo2); + check(false, null eq foo3, null ne foo3); + + check(true , foo1 eq null, foo1 ne null); + check(true , foo1 eq foo1, foo1 ne foo1); + check(false, foo1 eq foo2, foo1 ne foo2); + check(false, foo1 eq foo3, foo1 ne foo3); + + check(false, foo2 eq null, foo2 ne null); + check(false, foo2 eq foo1, foo2 ne foo1); + check(true , foo2 eq foo2, foo2 ne foo2); + check(false, foo2 eq foo3, foo2 ne foo3); + + check(false, foo3 eq null, foo3 ne null); + check(false, foo3 eq foo1, foo3 ne foo1); + check(false, foo3 eq foo2, foo3 ne foo2); + check(true , foo3 eq foo3, foo3 ne foo3); + } + +} + +//############################################################################ +// Main + +object Test { + var errors: Int = 0; + def test(name: String, test: => Unit): Unit = { + Console.println("<<< " + name); + try { + test; + } catch { + case exception: Throwable => { + //val name: String = Thread.currentThread().getName(); + Console.print("Exception in thread \"" + name + "\" " + exception); + Console.println; + errors = errors + 1; + } + } + Console.println(">>> " + name); + Console.println; + } + + def main(args: Array[String]): Unit = { + + test("Test0" , Test0Test.test(args)); + test("Test1" , Test1Test.test(args)); + test("Test2" , Test2Test.test(args)); + test("Test3" , Test3Test.test(args)); + + if (errors > 0) { + Console.println; + Console.println(errors + " error" + (if (errors > 1) "s" else "")); + } + } +} + +//############################################################################ diff --git a/tests/pending/run/runtimeEval1.check b/tests/pending/run/runtimeEval1.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/runtimeEval1.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/runtimeEval1.scala b/tests/pending/run/runtimeEval1.scala new file mode 100644 index 000000000000..0202dfd06322 --- /dev/null +++ b/tests/pending/run/runtimeEval1.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val x = 2 + println(x) + }.eval +} diff --git a/tests/pending/run/runtimeEval2.check b/tests/pending/run/runtimeEval2.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/runtimeEval2.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/runtimeEval2.scala b/tests/pending/run/runtimeEval2.scala new file mode 100644 index 000000000000..2708f9dbc9d6 --- /dev/null +++ b/tests/pending/run/runtimeEval2.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val x = 2 + val outer = reify{reify{x}} + println(outer.eval.eval) +} diff --git a/tests/pending/run/sammy_java8.flags b/tests/pending/run/sammy_java8.flags new file mode 100644 index 000000000000..48fd867160ba --- /dev/null +++ b/tests/pending/run/sammy_java8.flags @@ -0,0 +1 @@ +-Xexperimental diff --git a/tests/pending/run/sammy_java8.scala b/tests/pending/run/sammy_java8.scala new file mode 100644 index 000000000000..db9df7f5febf --- /dev/null +++ b/tests/pending/run/sammy_java8.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ + +// java8 version of sammy_poly.scala +object Test extends CompilerTest { + import global._ + + override lazy val units: List[CompilationUnit] = { + global.settings.Xexperimental.value = true + + // This test itself does not depend on JDK8. + javaCompilationUnits(global)(samSource) ++ + compilationUnits(global)(useSamSource) + } + + private def samSource = """ +// trait F[T, U] { def apply(x: T): U } +public interface F { + U apply(T t); + default void yadayada() { + throw new UnsupportedOperationException("yadayada"); + } +} + """ + + private def useSamSource = """ +class T { + def app[T, U](x: T)(f: F[T, U]): U = f(x) + app(1)(x => List(x)) +} + """ + + // We're only checking we can compile it. + def check(source: String, unit: global.CompilationUnit): Unit = () +} diff --git a/tests/pending/run/sammy_repeated.check b/tests/pending/run/sammy_repeated.check new file mode 100644 index 000000000000..1cff0f067c46 --- /dev/null +++ b/tests/pending/run/sammy_repeated.check @@ -0,0 +1 @@ +WrappedArray(1) diff --git a/tests/pending/run/sammy_repeated.flags b/tests/pending/run/sammy_repeated.flags new file mode 100644 index 000000000000..e1b37447c953 --- /dev/null +++ b/tests/pending/run/sammy_repeated.flags @@ -0,0 +1 @@ +-Xexperimental \ No newline at end of file diff --git a/tests/pending/run/sammy_repeated.scala b/tests/pending/run/sammy_repeated.scala new file mode 100644 index 000000000000..c24dc41909f3 --- /dev/null +++ b/tests/pending/run/sammy_repeated.scala @@ -0,0 +1,8 @@ +trait RepeatedSink { def accept(a: Any*): Unit } + +object Test { + def main(args: Array[String]): Unit = { + val f: RepeatedSink = (a) => println(a) + f.accept(1) + } +} \ No newline at end of file diff --git a/tests/pending/run/scan.scala b/tests/pending/run/scan.scala new file mode 100644 index 000000000000..a43da3387b3e --- /dev/null +++ b/tests/pending/run/scan.scala @@ -0,0 +1,23 @@ + + + + +object Test { + + def main(args: Array[String]): Unit = { + val lst = List(1, 2, 3, 4, 5) + + assert(lst.scanLeft(0)(_ + _) == List(0, 1, 3, 6, 10, 15)) + assert(lst.scanRight(0)(_ + _) == List(15, 14, 12, 9, 5, 0)) + + val emp = List[Int]() + assert(emp.scanLeft(0)(_ + _) == List(0)) + assert(emp.scanRight(0)(_ + _) == List(0)) + + val stream = Stream(1, 2, 3, 4, 5) + assert(stream.scanLeft(0)(_ + _) == Stream(0, 1, 3, 6, 10, 15)) + + assert(Stream.from(1).scanLeft(0)(_ + _).take(5) == Stream(0, 1, 3, 6, 10)) + } + +} diff --git a/tests/pending/run/search.check b/tests/pending/run/search.check new file mode 100644 index 000000000000..e0c55043e3ec --- /dev/null +++ b/tests/pending/run/search.check @@ -0,0 +1,6 @@ +Found(2) +Found(4) +InsertionPoint(10) +Found(2) +Found(4) +InsertionPoint(10) diff --git a/tests/pending/run/search.scala b/tests/pending/run/search.scala new file mode 100644 index 000000000000..611245b7a365 --- /dev/null +++ b/tests/pending/run/search.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.collection.{LinearSeq, IndexedSeq} + import scala.collection.Searching.search + + val ls = LinearSeq(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13) + println(ls.search(3)) + println(ls.search(5, 3, 8)) + println(ls.search(12)) + + val is = IndexedSeq(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13) + println(is.search(3)) + println(is.search(5, 3, 8)) + println(is.search(12)) +} diff --git a/tests/pending/run/seqlike-kmp.check b/tests/pending/run/seqlike-kmp.check new file mode 100644 index 000000000000..6040710c7c2d --- /dev/null +++ b/tests/pending/run/seqlike-kmp.check @@ -0,0 +1,90 @@ +indexOfSlice + (97) with idx >= -1 = 97 + (97) with idx >= 0 = 97 + (97) with idx >= 1 = 97 + (97) with idx >= 2 = 97 + (97) with idx >= 97 = 97 + (97) with idx >= 98 = -1 + (97) with idx >= 99 = -1 + (97) with idx >= 100 = -1 +lastIndexOfSlice + (97) with idx <= -1 = -1 + (97) with idx <= 0 = -1 + (97) with idx <= 1 = -1 + (97) with idx <= 2 = -1 + (97) with idx <= 97 = 97 + (97) with idx <= 98 = 97 + (97) with idx <= 99 = 97 + (97) with idx <= 100 = 97 +indexOfSlice + (97, 98) with idx >= -1 = 97 + (97, 98) with idx >= 0 = 97 + (97, 98) with idx >= 1 = 97 + (97, 98) with idx >= 2 = 97 + (97, 98) with idx >= 97 = 97 + (97, 98) with idx >= 98 = -1 + (97, 98) with idx >= 99 = -1 + (97, 98) with idx >= 100 = -1 +lastIndexOfSlice + (97, 98) with idx <= -1 = -1 + (97, 98) with idx <= 0 = -1 + (97, 98) with idx <= 1 = -1 + (97, 98) with idx <= 2 = -1 + (97, 98) with idx <= 97 = 97 + (97, 98) with idx <= 98 = 97 + (97, 98) with idx <= 99 = 97 + (97, 98) with idx <= 100 = 97 +indexOfSlice + (97, 98, 99) with idx >= -1 = 97 + (97, 98, 99) with idx >= 0 = 97 + (97, 98, 99) with idx >= 1 = 97 + (97, 98, 99) with idx >= 2 = 97 + (97, 98, 99) with idx >= 97 = 97 + (97, 98, 99) with idx >= 98 = -1 + (97, 98, 99) with idx >= 99 = -1 + (97, 98, 99) with idx >= 100 = -1 +lastIndexOfSlice + (97, 98, 99) with idx <= -1 = -1 + (97, 98, 99) with idx <= 0 = -1 + (97, 98, 99) with idx <= 1 = -1 + (97, 98, 99) with idx <= 2 = -1 + (97, 98, 99) with idx <= 97 = 97 + (97, 98, 99) with idx <= 98 = 97 + (97, 98, 99) with idx <= 99 = 97 + (97, 98, 99) with idx <= 100 = 97 +indexOfSlice + (98, 99) with idx >= -1 = 98 + (98, 99) with idx >= 0 = 98 + (98, 99) with idx >= 1 = 98 + (98, 99) with idx >= 2 = 98 + (98, 99) with idx >= 97 = 98 + (98, 99) with idx >= 98 = 98 + (98, 99) with idx >= 99 = -1 + (98, 99) with idx >= 100 = -1 +lastIndexOfSlice + (98, 99) with idx <= -1 = -1 + (98, 99) with idx <= 0 = -1 + (98, 99) with idx <= 1 = -1 + (98, 99) with idx <= 2 = -1 + (98, 99) with idx <= 97 = -1 + (98, 99) with idx <= 98 = 98 + (98, 99) with idx <= 99 = 98 + (98, 99) with idx <= 100 = 98 +indexOfSlice + (99) with idx >= -1 = 99 + (99) with idx >= 0 = 99 + (99) with idx >= 1 = 99 + (99) with idx >= 2 = 99 + (99) with idx >= 97 = 99 + (99) with idx >= 98 = 99 + (99) with idx >= 99 = 99 + (99) with idx >= 100 = -1 +lastIndexOfSlice + (99) with idx <= -1 = -1 + (99) with idx <= 0 = -1 + (99) with idx <= 1 = -1 + (99) with idx <= 2 = -1 + (99) with idx <= 97 = -1 + (99) with idx <= 98 = -1 + (99) with idx <= 99 = 99 + (99) with idx <= 100 = 99 diff --git a/tests/pending/run/seqlike-kmp.scala b/tests/pending/run/seqlike-kmp.scala new file mode 100644 index 000000000000..af39fda9af80 --- /dev/null +++ b/tests/pending/run/seqlike-kmp.scala @@ -0,0 +1,32 @@ +object Test { + val source = 0 to 99 + val idxes = (-1 to 2) ++ (97 to 100) + def str(xs: Seq[Int]) = xs.mkString("(", ", ", ")") + + def f(tgt: Seq[Int]) = { + println("indexOfSlice") + // the first index `>= from` such that... + for (x <- idxes) { + val res = source.indexOfSlice(tgt, x) + println(" %s with idx >= %d = %d".format(str(tgt), x, res)) + } + // the last index `<= end` such that... + println("lastIndexOfSlice") + for (x <- idxes) { + val res = source.lastIndexOfSlice(tgt, x) + println(" %s with idx <= %d = %d".format(str(tgt), x, res)) + } + } + + def g(idx: Int, len: Int) = { + f(source.slice(idx, idx + len)) + } + + def main(args: Array[String]): Unit = { + g(97, 1) + g(97, 2) + g(97, 3) + g(98, 2) + g(99, 1) + } +} diff --git a/tests/pending/run/sequenceComparisons.scala b/tests/pending/run/sequenceComparisons.scala new file mode 100644 index 000000000000..27d995477b2c --- /dev/null +++ b/tests/pending/run/sequenceComparisons.scala @@ -0,0 +1,121 @@ +import scala.collection.{ mutable, immutable } +import collection.{ Seq, Traversable } + +object Test { + // TODO: + // + // SeqProxy + // SeqForwarder + // the commented out ones in seqMakers + + val seqMakers = List[List[Int] => Seq[Int]]( + // scala.Array(_: _*), + mutable.ArrayBuffer(_: _*), + // mutable.ArrayStack(_: _*), + mutable.Buffer(_: _*), + mutable.LinearSeq(_: _*), + // null on Nil + // mutable.LinkedList(_: _*), + mutable.ListBuffer(_: _*), + // mutable.PriorityQueue(_: _*), + // immutable.Queue(_: _*), + // mutable.Queue(_: _*), + immutable.Seq(_: _*), + mutable.Seq(_: _*), + immutable.Stack(_: _*), + // mutable.Stack(_: _*), + immutable.IndexedSeq(_: _*), // was Vector + //mutable.Vector(_: _*), + immutable.List(_: _*), + immutable.Stream(_: _*) + ) + + abstract class Data[T] { + val seq: Seq[T] + private def seqList = seq.toList + // _1 is inputs which must be true, _2 which must be false + type Inputs = (List[List[T]], List[List[T]]) + case class Method( + f: (Seq[T], Seq[T]) => Boolean, + inputs: Inputs, + descr: String + ) { + def trueList = inputs._1 + def falseList = inputs._2 + } + + lazy val eqeq = Method(_ == _, (List(seqList), List(Nil, seqList drop 1, seqList ::: seqList)), "%s == %s") + + val startsWithInputs: Inputs + lazy val startsWith = Method(_ startsWith _, startsWithInputs, "%s startsWith %s") + + val endsWithInputs: Inputs + lazy val endsWith = Method(_ endsWith _, endsWithInputs, "%s endsWith %s") + + val indexOfSliceInputs: Inputs + private def subseqTest(s1: Seq[T], s2: Seq[T]) = (s1 indexOfSlice s2) != -1 + lazy val indexOfSlice = Method(subseqTest _, indexOfSliceInputs, "(%s indexOfSlice %s) != -1") + + val sameElementsInputs: Inputs + lazy val sameElements = Method(_ sameElements _, sameElementsInputs, "%s sameElements %s") + + def methodList = List(eqeq, startsWith, endsWith, indexOfSlice, sameElements) + } + + object test1 extends Data[Int] { + val seq = List(1,2,3,4,5) + + val startsWithInputs = ( + List(Nil, List(1), List(1,2), seq), + List(List(1,2,3,4,6), seq ::: List(5), List(0)) + ) + + val endsWithInputs = ( + List(Nil, List(5), List(4,5), seq), + List(0 :: seq, List(5,2,3,4,5), List(3,4), List(5,6)) + ) + + val indexOfSliceInputs = ( + List(Nil, List(1), List(3), List(5), List(1,2), List(2,3,4), List(4,5), seq), + List(List(1,2,3,5), List(6), List(5,4,3,2,1), List(2,1)) + ) + + val sameElementsInputs = ( + List(List(1,2,3,4,5)), + List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq.reverse) + ) + } + + val failures = new mutable.ListBuffer[String] + var testCount = 0 + + def assertOne(op1: Any, op2: Any, res: Boolean, str: String): Unit = { + testCount += 1 + val resStr = str.format(op1, op2) + // println(resStr) + if (!res) + failures += ("FAIL: " + resStr) + // assert(res, resStr) + } + + def runSeqs() = { + for (s1f <- seqMakers ; s2f <- seqMakers ; testData <- List(test1)) { + import testData._ + val scrut = s1f(seq) + + for (Method(f, (trueList, falseList), descr) <- methodList) { + for (s <- trueList; rhs = s2f(s)) + assertOne(scrut, rhs, f(scrut, rhs), descr) + + for (s <- falseList; rhs = s2f(s)) + assertOne(scrut, rhs, !f(scrut, rhs), "!(" + descr + ")") + } + } + } + + def main(args: Array[String]): Unit = { + runSeqs() + + assert(failures.isEmpty, failures mkString "\n") + } +} diff --git a/tests/pending/run/serialize-stream.check b/tests/pending/run/serialize-stream.check new file mode 100644 index 000000000000..e2a9f57aa776 --- /dev/null +++ b/tests/pending/run/serialize-stream.check @@ -0,0 +1,6 @@ +Stream(1, ?) +List(1, 2, 3) +Stream(1, ?) +List(1) +Stream() +List() diff --git a/tests/pending/run/serialize-stream.scala b/tests/pending/run/serialize-stream.scala new file mode 100644 index 000000000000..fc84d610af6b --- /dev/null +++ b/tests/pending/run/serialize-stream.scala @@ -0,0 +1,20 @@ + + +object Test { + def ser[T](s: Stream[T]): Unit = { + val bos = new java.io.ByteArrayOutputStream() + val oos = new java.io.ObjectOutputStream(bos) + oos.writeObject(s) + + val ois = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bos.toByteArray)) + val obj = ois.readObject() + println(obj) + println(obj.asInstanceOf[Seq[T]].toList) + } + + def main(args: Array[String]): Unit = { + ser(Stream(1, 2, 3)) + ser(Stream(1)) + ser(Stream()) + } +} diff --git a/tests/pending/run/settings-parse.check b/tests/pending/run/settings-parse.check new file mode 100644 index 000000000000..18145c9100fe --- /dev/null +++ b/tests/pending/run/settings-parse.check @@ -0,0 +1,566 @@ +0) List(-cp, ) ==> Settings { + -d = . + -classpath = "" +} + +1) List(-cp, , ) ==> Settings { + -d = . + -classpath = "" +} + +2) List(, -cp, ) ==> Settings { + -d = . + -classpath = "" +} + +3) List(-cp, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +4) List(-cp, , , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +5) List(-cp, , -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +6) List(, -cp, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +7) List(-cp, , -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +8) List(-cp, , , -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +9) List(-cp, , -deprecation, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +10) List(-cp, , -deprecation, foo.scala, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +11) List(, -cp, , -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +12) List(-cp, , foo.scala) ==> Settings { + -d = . + -classpath = "" +} + +13) List(-cp, , , foo.scala) ==> Settings { + -d = . + -classpath = "" +} + +14) List(-cp, , foo.scala, ) ==> Settings { + -d = . + -classpath = "" +} + +15) List(, -cp, , foo.scala) ==> Settings { + -d = . + -classpath = "" +} + +16) List(-cp, , foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +17) List(-cp, , , foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +18) List(-cp, , foo.scala, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +19) List(-cp, , foo.scala, -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +20) List(, -cp, , foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +21) List(-deprecation, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +22) List(, -deprecation, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +23) List(-deprecation, -cp, , ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +24) List(-deprecation, , -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +25) List(-deprecation, -cp, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +26) List(, -deprecation, -cp, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +27) List(-deprecation, -cp, , , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +28) List(-deprecation, -cp, , foo.scala, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +29) List(-deprecation, , -cp, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +30) List(-deprecation, foo.scala, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +31) List(, -deprecation, foo.scala, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +32) List(-deprecation, , foo.scala, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +33) List(-deprecation, foo.scala, -cp, , ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +34) List(-deprecation, foo.scala, , -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +35) List(foo.scala, -cp, ) ==> Settings { + -d = . + -classpath = "" +} + +36) List(, foo.scala, -cp, ) ==> Settings { + -d = . + -classpath = "" +} + +37) List(foo.scala, -cp, , ) ==> Settings { + -d = . + -classpath = "" +} + +38) List(foo.scala, , -cp, ) ==> Settings { + -d = . + -classpath = "" +} + +39) List(foo.scala, -cp, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +40) List(, foo.scala, -cp, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +41) List(foo.scala, -cp, , , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +42) List(foo.scala, -cp, , -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +43) List(foo.scala, , -cp, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +44) List(foo.scala, -deprecation, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +45) List(, foo.scala, -deprecation, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +46) List(foo.scala, , -deprecation, -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +47) List(foo.scala, -deprecation, -cp, , ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +48) List(foo.scala, -deprecation, , -cp, ) ==> Settings { + -d = . + -deprecation = true + -classpath = "" +} + +0) List(-cp, /tmp:/bippy) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +1) List(-cp, /tmp:/bippy, ) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +2) List(, -cp, /tmp:/bippy) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +3) List(-cp, /tmp:/bippy, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +4) List(-cp, /tmp:/bippy, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +5) List(-cp, /tmp:/bippy, -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +6) List(, -cp, /tmp:/bippy, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +7) List(-cp, /tmp:/bippy, -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +8) List(-cp, /tmp:/bippy, , -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +9) List(-cp, /tmp:/bippy, -deprecation, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +10) List(-cp, /tmp:/bippy, -deprecation, foo.scala, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +11) List(, -cp, /tmp:/bippy, -deprecation, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +12) List(-cp, /tmp:/bippy, foo.scala) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +13) List(-cp, /tmp:/bippy, , foo.scala) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +14) List(-cp, /tmp:/bippy, foo.scala, ) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +15) List(, -cp, /tmp:/bippy, foo.scala) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +16) List(-cp, /tmp:/bippy, foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +17) List(-cp, /tmp:/bippy, , foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +18) List(-cp, /tmp:/bippy, foo.scala, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +19) List(-cp, /tmp:/bippy, foo.scala, -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +20) List(, -cp, /tmp:/bippy, foo.scala, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +21) List(-deprecation, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +22) List(, -deprecation, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +23) List(-deprecation, -cp, /tmp:/bippy, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +24) List(-deprecation, , -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +25) List(-deprecation, -cp, /tmp:/bippy, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +26) List(, -deprecation, -cp, /tmp:/bippy, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +27) List(-deprecation, -cp, /tmp:/bippy, , foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +28) List(-deprecation, -cp, /tmp:/bippy, foo.scala, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +29) List(-deprecation, , -cp, /tmp:/bippy, foo.scala) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +30) List(-deprecation, foo.scala, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +31) List(, -deprecation, foo.scala, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +32) List(-deprecation, , foo.scala, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +33) List(-deprecation, foo.scala, -cp, /tmp:/bippy, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +34) List(-deprecation, foo.scala, , -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +35) List(foo.scala, -cp, /tmp:/bippy) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +36) List(, foo.scala, -cp, /tmp:/bippy) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +37) List(foo.scala, -cp, /tmp:/bippy, ) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +38) List(foo.scala, , -cp, /tmp:/bippy) ==> Settings { + -d = . + -classpath = /tmp:/bippy +} + +39) List(foo.scala, -cp, /tmp:/bippy, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +40) List(, foo.scala, -cp, /tmp:/bippy, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +41) List(foo.scala, -cp, /tmp:/bippy, , -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +42) List(foo.scala, -cp, /tmp:/bippy, -deprecation, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +43) List(foo.scala, , -cp, /tmp:/bippy, -deprecation) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +44) List(foo.scala, -deprecation, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +45) List(, foo.scala, -deprecation, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +46) List(foo.scala, , -deprecation, -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +47) List(foo.scala, -deprecation, -cp, /tmp:/bippy, ) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + +48) List(foo.scala, -deprecation, , -cp, /tmp:/bippy) ==> Settings { + -d = . + -deprecation = true + -classpath = /tmp:/bippy +} + diff --git a/tests/pending/run/settings-parse.scala b/tests/pending/run/settings-parse.scala new file mode 100644 index 000000000000..2754feb97208 --- /dev/null +++ b/tests/pending/run/settings-parse.scala @@ -0,0 +1,29 @@ + +import scala.language.postfixOps +import scala.tools.nsc._ + +object Test { + val tokens = List("", "-deprecation", "foo.scala") + val subsets = tokens.toSet.subsets.toList + val permutations0 = subsets.flatMap(_.toList.permutations).distinct + + def runWithCp(cp: String) = { + val permutations = permutations0 flatMap ("-cp CPTOKEN" :: _ permutations) + + for ((p, i) <- permutations.distinct.sortBy(_ mkString "").zipWithIndex) { + val args = p flatMap (_ split "\\s+") map (x => if (x == "CPTOKEN") cp else x) + val s = new settings.MutableSettings(println) + val (ok, residual) = s.processArguments(args, processAll = true) + + val expected = args filter (_ == "foo.scala") + assert(residual == expected, residual) + assert(ok, args) + println(s"$i) $args ==> $s") + } + } + + def main(args0: Array[String]): Unit = { + runWithCp("") + runWithCp("/tmp:/bippy") + } +} diff --git a/tests/pending/run/shortClass.check b/tests/pending/run/shortClass.check new file mode 100644 index 000000000000..fbdb725ccaa0 --- /dev/null +++ b/tests/pending/run/shortClass.check @@ -0,0 +1,10 @@ +bippity.bop.Foo +bippity.bop.Foo$Bar +bippity.bop.Foo$Bar$ +Test$$anon$1 +Test$$anon$2 +Foo +Bar +Bar$ +Foo with DingDongBippy +Bar with DingDongBippy diff --git a/tests/pending/run/shortClass.scala b/tests/pending/run/shortClass.scala new file mode 100644 index 000000000000..b7bb0168963a --- /dev/null +++ b/tests/pending/run/shortClass.scala @@ -0,0 +1,24 @@ +import scala.reflect.internal.util._ + +package bippity { + trait DingDongBippy + + package bop { + class Foo { + class Bar + object Bar + } + } +} + +object Test { + import bippity._ + import bop._ + + def main(args: Array[String]): Unit = { + val f = new Foo + val instances = List(f, new f.Bar, f.Bar, new Foo with DingDongBippy, new f.Bar with DingDongBippy) + instances map (_.getClass.getName) foreach println + instances map shortClassOfInstance foreach println + } +} diff --git a/tests/pending/run/showdecl.check b/tests/pending/run/showdecl.check new file mode 100644 index 000000000000..b8d7f94c57f7 --- /dev/null +++ b/tests/pending/run/showdecl.check @@ -0,0 +1,34 @@ +compile-time +uninitialized D: class D extends +initialized D: class D extends C +uninitialized x: val x: +initialized x: val x: Int +uninitialized y: lazy val y: +initialized y: lazy val y: Int +uninitialized z: def z: +initialized z: def z: Int +uninitialized t: def t: +initialized t: def t[T <: Int](x: D)(y: x.W): Int +uninitialized W: type W = String +initialized W: type W = String +uninitialized C: class C extends +initialized C: class C extends D +uninitialized O: object O +initialized O: object O +runtime +autoinitialized D: class D extends C +autoinitialized D: class D extends C +autoinitialized x: val x: Int +autoinitialized x: val x: Int +autoinitialized y: lazy val y: Int +autoinitialized y: lazy val y: Int +autoinitialized z: def z: Int +autoinitialized z: def z: Int +autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int +autoinitialized t: def t[T <: Int](x: D)(y: x.W): Int +autoinitialized W: type W = String +autoinitialized W: type W = String +autoinitialized C: class C extends D +autoinitialized C: class C extends D +autoinitialized O: object O +autoinitialized O: object O diff --git a/tests/pending/run/showdecl/Macros_1.scala b/tests/pending/run/showdecl/Macros_1.scala new file mode 100644 index 000000000000..c68dd275defd --- /dev/null +++ b/tests/pending/run/showdecl/Macros_1.scala @@ -0,0 +1,30 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: Symbol): Unit = { + println(s"uninitialized ${sym.name}: ${showDecl(sym)}") + sym.info + println(s"initialized ${sym.name}: ${showDecl(sym)}") + } + + println("compile-time") + test(c.mirror.staticClass("D")) + test(c.mirror.staticClass("D").info.member(TermName("x"))) + test(c.mirror.staticClass("D").info.member(TermName("y"))) + test(c.mirror.staticClass("D").info.member(TermName("z"))) + test(c.mirror.staticClass("D").info.member(TermName("t"))) + test(c.mirror.staticClass("D").info.member(TypeName("W"))) + test(c.mirror.staticClass("D").info.member(TypeName("C"))) + test(c.mirror.staticClass("D").info.member(TermName("O"))) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/showdecl/Test_2.scala b/tests/pending/run/showdecl/Test_2.scala new file mode 100644 index 000000000000..fc212ab05470 --- /dev/null +++ b/tests/pending/run/showdecl/Test_2.scala @@ -0,0 +1,32 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: Symbol): Unit = { + println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") + sym.info + println(s"autoinitialized ${sym.name}: ${showDecl(sym)}") + } + + Macros.foo + println("runtime") + test(symbolOf[D]) + test(typeOf[D].member(TermName("x"))) + test(typeOf[D].member(TermName("y"))) + test(typeOf[D].member(TermName("z"))) + test(typeOf[D].member(TermName("t"))) + test(typeOf[D].member(TypeName("W"))) + test(typeOf[D].member(TypeName("C"))) + test(typeOf[D].member(TermName("O"))) +} + +class C +class D extends C { + val x = 2 + lazy val y = 3 + var z = 4 + def t[T <: Int](x: D)(y: x.W) = 5 + type W = String + class C extends D + object O extends C +} diff --git a/tests/pending/run/showraw_aliases.check b/tests/pending/run/showraw_aliases.check new file mode 100644 index 000000000000..d6a198b1cb26 --- /dev/null +++ b/tests/pending/run/showraw_aliases.check @@ -0,0 +1,2 @@ +Block(List(Import(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), List(ImportSelector(TermName("universe"), , TermName("ru"), )))), Select(Select(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), scala.reflect.runtime.package), [TermName("universe") aka TermName("ru")])) +Block(List(Import(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), List(ImportSelector(TermName("universe"), , TermName("ru"), )))), Select(Select(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), scala.reflect.runtime.package#), [TermName("universe")# aka TermName("ru")])) diff --git a/tests/pending/run/showraw_aliases.scala b/tests/pending/run/showraw_aliases.scala new file mode 100644 index 000000000000..fa41b57837c7 --- /dev/null +++ b/tests/pending/run/showraw_aliases.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree = tb.parse(""" + import scala.reflect.runtime.{universe => ru} + ru + """) + val ttree = tb.typecheck(tree) + + def stabilizeIds(s: String) = """#\d+""".r.replaceAllIn(s, "#") + def stabilizePositions(s: String) = """\d+""".r.replaceAllIn(s, "") + def stabilize(s: String) = stabilizePositions(stabilizeIds(s)) + println(stabilize(showRaw(ttree))) + println(stabilize(showRaw(ttree, printIds = true))) +} diff --git a/tests/pending/run/showraw_mods.check b/tests/pending/run/showraw_mods.check new file mode 100644 index 000000000000..4d3416042229 --- /dev/null +++ b/tests/pending/run/showraw_mods.check @@ -0,0 +1 @@ +Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(()))) diff --git a/tests/pending/run/showraw_mods.scala b/tests/pending/run/showraw_mods.scala new file mode 100644 index 000000000000..872685c37ec9 --- /dev/null +++ b/tests/pending/run/showraw_mods.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{trait C { private[this] val x = 2; var y = x; lazy val z = y }} + println(showRaw(tree.tree)) +} diff --git a/tests/pending/run/showraw_nosymbol.check b/tests/pending/run/showraw_nosymbol.check new file mode 100644 index 000000000000..c54fe7471735 --- /dev/null +++ b/tests/pending/run/showraw_nosymbol.check @@ -0,0 +1 @@ +NoSymbol diff --git a/tests/pending/run/showraw_nosymbol.scala b/tests/pending/run/showraw_nosymbol.scala new file mode 100644 index 000000000000..191647583276 --- /dev/null +++ b/tests/pending/run/showraw_nosymbol.scala @@ -0,0 +1,5 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(showRaw(NoSymbol)) +} diff --git a/tests/pending/run/showraw_tree.check b/tests/pending/run/showraw_tree.check new file mode 100644 index 000000000000..d8cb1fde026f --- /dev/null +++ b/tests/pending/run/showraw_tree.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree.scala b/tests/pending/run/showraw_tree.scala new file mode 100644 index 000000000000..fbd4c1dfaa25 --- /dev/null +++ b/tests/pending/run/showraw_tree.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree)) + println(showRaw(tree2.tree)) +} diff --git a/tests/pending/run/showraw_tree_ids.check b/tests/pending/run/showraw_tree_ids.check new file mode 100644 index 000000000000..d7a7aa5959ad --- /dev/null +++ b/tests/pending/run/showraw_tree_ids.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#), List(Select(Ident(scala.Predef#), TypeName("String")), Select(Ident(scala.Predef#), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_ids.scala b/tests/pending/run/showraw_tree_ids.scala new file mode 100644 index 000000000000..739ea55b5f6c --- /dev/null +++ b/tests/pending/run/showraw_tree_ids.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tree1.tree, printIds = true))) + println(stabilize(showRaw(tree2.tree, printIds = true))) +} diff --git a/tests/pending/run/showraw_tree_kinds.check b/tests/pending/run/showraw_tree_kinds.check new file mode 100644 index 000000000000..85939b02f03e --- /dev/null +++ b/tests/pending/run/showraw_tree_kinds.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#CLS), List(Select(Ident(scala.Predef#MOD), TypeName("String")), Select(Ident(scala.Predef#MOD), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_kinds.scala b/tests/pending/run/showraw_tree_kinds.scala new file mode 100644 index 000000000000..0891015ac552 --- /dev/null +++ b/tests/pending/run/showraw_tree_kinds.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree, printKinds = true)) + println(showRaw(tree2.tree, printKinds = true)) +} diff --git a/tests/pending/run/showraw_tree_types_ids.check b/tests/pending/run/showraw_tree_types_ids.check new file mode 100644 index 000000000000..75347463cbc6 --- /dev/null +++ b/tests/pending/run/showraw_tree_types_ids.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) +[1] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) +[3] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List()) +[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) +[5] SingleType(ThisType(scala#), scala.Predef#) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap#), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef#), TypeName("String")#)))))), termNames.CONSTRUCTOR#), List()) +[4] TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()) +[5] SingleType(ThisType(scala#), scala.Predef#) +[6] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List()), TypeRef(SingleType(ThisType(scala#), scala.Predef#), TypeName("String")#, List())))) +[8] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List()) diff --git a/tests/pending/run/showraw_tree_types_ids.scala b/tests/pending/run/showraw_tree_types_ids.scala new file mode 100644 index 000000000000..30f51c549b97 --- /dev/null +++ b/tests/pending/run/showraw_tree_types_ids.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printTypes = true))) + println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printTypes = true))) +} diff --git a/tests/pending/run/showraw_tree_types_typed.check b/tests/pending/run/showraw_tree_types_typed.check new file mode 100644 index 000000000000..de691e369eed --- /dev/null +++ b/tests/pending/run/showraw_tree_types_typed.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) +[3] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List()) +[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) +[5] SingleType(ThisType(scala), scala.Predef) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef), TypeName("String"))))))), termNames.CONSTRUCTOR), List()) +[4] TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) +[5] SingleType(ThisType(scala), scala.Predef) +[6] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()), TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())))) +[8] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List()) diff --git a/tests/pending/run/showraw_tree_types_typed.scala b/tests/pending/run/showraw_tree_types_typed.scala new file mode 100644 index 000000000000..e24eac9f83c3 --- /dev/null +++ b/tests/pending/run/showraw_tree_types_typed.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tb.typecheck(tree1.tree), printTypes = true)) + println(showRaw(tb.typecheck(tree2.tree), printTypes = true)) +} diff --git a/tests/pending/run/showraw_tree_types_untyped.check b/tests/pending/run/showraw_tree_types_untyped.check new file mode 100644 index 000000000000..d8cb1fde026f --- /dev/null +++ b/tests/pending/run/showraw_tree_types_untyped.check @@ -0,0 +1,2 @@ +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Select(Ident(scala.Predef), TypeName("String")), Select(Ident(scala.Predef), TypeName("String"))))), termNames.CONSTRUCTOR), List()) diff --git a/tests/pending/run/showraw_tree_types_untyped.scala b/tests/pending/run/showraw_tree_types_untyped.scala new file mode 100644 index 000000000000..87dfd72420e6 --- /dev/null +++ b/tests/pending/run/showraw_tree_types_untyped.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + println(showRaw(tree1.tree, printTypes = true)) + println(showRaw(tree2.tree, printTypes = true)) +} diff --git a/tests/pending/run/showraw_tree_ultimate.check b/tests/pending/run/showraw_tree_ultimate.check new file mode 100644 index 000000000000..81efcc05abd7 --- /dev/null +++ b/tests/pending/run/showraw_tree_ultimate.check @@ -0,0 +1,12 @@ +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##PCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) +[3] TypeRef(ThisType(scala.collection.immutable##PKC), scala.collection.immutable.HashMap##CLS, List()) +[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) +[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) +Apply[6](Select[7](New[6](TypeTree[6]().setOriginal(AppliedTypeTree(Ident[8](scala.collection.mutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)), TypeTree[4]().setOriginal(Select[4](Ident[5](scala.Predef##MOD), TypeName("String")##TPE)))))), termNames.CONSTRUCTOR##CTOR), List()) +[4] TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()) +[5] SingleType(ThisType(scala##PKC), scala.Predef##MOD) +[6] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()))) +[7] MethodType(List(), TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List(TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List()), TypeRef(SingleType(ThisType(scala##PKC), scala.Predef##MOD), TypeName("String")##TPE, List())))) +[8] TypeRef(ThisType(scala.collection.mutable##PKC), scala.collection.mutable.HashMap##CLS, List()) diff --git a/tests/pending/run/showraw_tree_ultimate.scala b/tests/pending/run/showraw_tree_ultimate.scala new file mode 100644 index 000000000000..0a97622ad84d --- /dev/null +++ b/tests/pending/run/showraw_tree_ultimate.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = runtimeMirror(getClass.getClassLoader).mkToolBox() + val tree1 = reify(new collection.immutable.HashMap[String, String]) + val tree2 = reify(new collection.mutable.HashMap[String, String]) + def stabilize(s: String) = """#\d+""".r.replaceAllIn(s, "#") + println(stabilize(showRaw(tb.typecheck(tree1.tree), printIds = true, printKinds = true, printTypes = true))) + println(stabilize(showRaw(tb.typecheck(tree2.tree), printIds = true, printKinds = true, printTypes = true))) +} diff --git a/tests/pending/run/shutdownhooks.check b/tests/pending/run/shutdownhooks.check new file mode 100644 index 000000000000..29956956e30c --- /dev/null +++ b/tests/pending/run/shutdownhooks.check @@ -0,0 +1,3 @@ +Fooblitzky! +main#shutdown. +Test#shutdown. diff --git a/tests/pending/run/shutdownhooks.scala b/tests/pending/run/shutdownhooks.scala new file mode 100644 index 000000000000..5f512a391ab3 --- /dev/null +++ b/tests/pending/run/shutdownhooks.scala @@ -0,0 +1,37 @@ +object Test { + scala.sys.addShutdownHook { + Thread.sleep(1000) + println("Test#shutdown.") + } + + def daemon() = { + val t = new Thread { + override def run(): Unit = { + Thread.sleep(10000) + println("Hallelujah!") // should not see this + } + } + t.setDaemon(true) + t.start() + t + } + + def nonDaemon() = { + val t = new Thread { + override def run(): Unit = { + Thread.sleep(100) + println("Fooblitzky!") + } + } + t.start() + t + } + + def main(args: Array[String]): Unit = { + daemon() + nonDaemon() + scala.sys.addShutdownHook { + println("main#shutdown.") + } + } +} diff --git a/tests/pending/run/slice-strings.scala b/tests/pending/run/slice-strings.scala new file mode 100644 index 000000000000..129314387ae1 --- /dev/null +++ b/tests/pending/run/slice-strings.scala @@ -0,0 +1,19 @@ +object Test { + def cmp(x1: String) = { + val x2 = x1.toList + + -10 to 10 foreach { i => + assert(x1.take(i) == x2.take(i).mkString) + assert(x1.drop(i) == x2.drop(i).mkString) + assert(x1.takeRight(i) == x2.takeRight(i).mkString) + assert(x1.dropRight(i) == x2.dropRight(i).mkString) + } + for (idx1 <- -3 to 3 ; idx2 <- -3 to 3) { + assert(x1.slice(idx1, idx2) == x2.slice(idx1, idx2).mkString) + } + } + + def main(args: Array[String]): Unit = { + cmp("abcde") + } +} diff --git a/tests/pending/run/slices.check b/tests/pending/run/slices.check new file mode 100644 index 000000000000..c7af9db46677 --- /dev/null +++ b/tests/pending/run/slices.check @@ -0,0 +1,34 @@ +List(2) +List() +List(1) +List() +List(1, 2) + +List(1, 2, 3) +List(1, 2, 3) +List(1, 2) +List() +List() + +List(4) +List() +List() +List() +List() + +Array(2) +Array() +Array(1) +Array() +Array(1, 2) + +Array(1, 2, 3) +Array(1, 2, 3) +Array(1, 2) +Array() + +Array(4) +Array() +Array() +Array() + diff --git a/tests/pending/run/slices.scala b/tests/pending/run/slices.scala new file mode 100644 index 000000000000..1ffedaea0795 --- /dev/null +++ b/tests/pending/run/slices.scala @@ -0,0 +1,49 @@ + +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + + // lists + println(List(1, 2, 3, 4).slice(1, 2)) + println(List(1, 2, 3, 4).slice(2, 1)) + println(List(1, 2, 3, 4).slice(-1, 1)) + println(List(1, 2, 3, 4).slice(1, -1)) + println(List(1, 2, 3, 4).slice(-2, 2)) + println + + println(List(1, 2, 3, 4) take 3) + println(List(1, 2, 3) take 3) + println(List(1, 2) take 3) + println((List(): List[Int]) take 3) + println(List[Nothing]() take 3) + println + + println(List(1, 2, 3, 4) drop 3) + println(List(1, 2, 3) drop 3) + println(List(1, 2) drop 3) + println((List(): List[Int]) drop 3) + println(List[Nothing]() drop 3) + println + + // arrays + println(Array(1, 2, 3, 4).slice(1, 2).deep) + println(Array(1, 2, 3, 4).slice(2, 1).deep) + println(Array(1, 2, 3, 4).slice(-1, 1).deep) + println(Array(1, 2, 3, 4).slice(1, -1).deep) + println(Array(1, 2, 3, 4).slice(-2, 2).deep) + println + + println(Array(1, 2, 3, 4) take 3 deep) + println(Array(1, 2, 3) take 3 deep) + println(Array(1, 2) take 3 deep) + println((Array(): Array[Int]) take 3 deep) +// println(Array[Nothing]() take 3) // contrib #757 + println + + println(Array(1, 2, 3, 4) drop 3 deep) + println(Array(1, 2, 3) drop 3 deep) + println(Array(1, 2) drop 3 deep) + println((Array(): Array[Int]) drop 3 deep) +// println(Array[Nothing]() drop 3) + println +} diff --git a/tests/pending/run/sm-interpolator.scala b/tests/pending/run/sm-interpolator.scala new file mode 100644 index 000000000000..e4bec7afb02e --- /dev/null +++ b/tests/pending/run/sm-interpolator.scala @@ -0,0 +1,41 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.internal.util.StringContextStripMarginOps + def check(actual: Any, expected: Any) = if (actual != expected) sys.error(s"\nexpected:\n$expected\n\nactual:\n$actual") + + val bar = "|\n ||" + + check( + sm"""|ab + |de + |${bar} | ${1}""", + "ab\nde\n|\n || | 1") + + check( + sm"|", + "") + + check( + sm"${0}", + "0") + + check( + sm"${0}", + "0") + + check( + sm"""${0}|${1} + |""", + "0|1\n") + + check( + sm""" ||""", + "|") + + check( + sm""" ${" "} ||""", + " ||") + + check( + sm"\n", + raw"\n".stripMargin) +} diff --git a/tests/pending/run/sort.check b/tests/pending/run/sort.check new file mode 100644 index 000000000000..e06a4f666fdf --- /dev/null +++ b/tests/pending/run/sort.check @@ -0,0 +1,6 @@ +100000 +List(1, 2, 3, 5, 10) +List(10, 5, 3, 2, 1) +List(10) +List(9, 10) +List() diff --git a/tests/pending/run/sort.scala b/tests/pending/run/sort.scala new file mode 100644 index 000000000000..c38b8fbde7c7 --- /dev/null +++ b/tests/pending/run/sort.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + println((1 to 100000).toList.sortWith(_<_).length) + println(List(1, 5, 10, 3, 2).toList.sortWith(_<_)) + println(List(1, 5, 10, 3, 2).toList.sortWith(_>_)) + println(List(10).toList.sortWith(_<_)) + println(List(10,9).toList.sortWith(_<_)) + println(List[Int]().toList.sortWith(_<_)) +} + diff --git a/tests/pending/run/spec-nlreturn.check b/tests/pending/run/spec-nlreturn.check new file mode 100644 index 000000000000..26cff0736032 --- /dev/null +++ b/tests/pending/run/spec-nlreturn.check @@ -0,0 +1,2 @@ +scala.runtime.NonLocalReturnControl$mcI$sp +16 diff --git a/tests/pending/run/spec-nlreturn.scala b/tests/pending/run/spec-nlreturn.scala new file mode 100644 index 000000000000..5ab1747856d8 --- /dev/null +++ b/tests/pending/run/spec-nlreturn.scala @@ -0,0 +1,17 @@ + +object Test { + def f(): Int = { + try { + val g = (1 to 10 map { i => return 16 ; i }).sum + g + } + catch { case x: runtime.NonLocalReturnControl[_] => + println(x.getClass.getName) + x.value.asInstanceOf[Int] + } + } + + def main(args: Array[String]): Unit = { + println(f()) + } +} diff --git a/tests/pending/run/spec-self.check b/tests/pending/run/spec-self.check new file mode 100644 index 000000000000..e981f45c92bf --- /dev/null +++ b/tests/pending/run/spec-self.check @@ -0,0 +1,2 @@ +5.0 +5.0 diff --git a/tests/pending/run/spec-self.scala b/tests/pending/run/spec-self.scala new file mode 100644 index 000000000000..1c95e0a820fd --- /dev/null +++ b/tests/pending/run/spec-self.scala @@ -0,0 +1,14 @@ +class Foo0 extends (() => Double) { + def apply() = 5.0d +} + +class Foo1 extends (Double => Double) { + def apply(x: Double) = x +} + +object Test { + def main(args: Array[String]): Unit = { + println((new Foo0)()) + println((new Foo1)(5.0d)) + } +} diff --git a/tests/pending/run/static-module-method.check b/tests/pending/run/static-module-method.check new file mode 100644 index 000000000000..ce013625030b --- /dev/null +++ b/tests/pending/run/static-module-method.check @@ -0,0 +1 @@ +hello diff --git a/tests/pending/run/static-module-method.scala b/tests/pending/run/static-module-method.scala new file mode 100644 index 000000000000..3e3b3cc07ae6 --- /dev/null +++ b/tests/pending/run/static-module-method.scala @@ -0,0 +1,14 @@ +// During development of delayed delambdafy there was a problem where +// GenASM would eliminate a loadmodule for all methods defined within that module +// even if those methods were static. This test would thus fail +// with a verify error under -Ydelambdafy:method + +object Test { + def moduleMethod(x: String) = x + + def map(x: String, f: String => String) = f(x) + + def main(args: Array[String]): Unit = { + println(map("hello", Test.moduleMethod)) + } +} diff --git a/tests/pending/run/stream-stack-overflow-filter-map.scala b/tests/pending/run/stream-stack-overflow-filter-map.scala new file mode 100644 index 000000000000..22db619a31ad --- /dev/null +++ b/tests/pending/run/stream-stack-overflow-filter-map.scala @@ -0,0 +1,44 @@ +import collection.generic.{FilterMonadic, CanBuildFrom} + +object Test extends dotty.runtime.LegacyApp { + def mapSucc[Repr, That](s: FilterMonadic[Int, Repr])(implicit cbf: CanBuildFrom[Repr, Int, That]) = s map (_ + 1) + def flatMapId[T, Repr, That](s: FilterMonadic[T, Repr])(implicit cbf: CanBuildFrom[Repr, T, That]) = s flatMap (Seq(_)) + + def testStreamPred(s: Stream[Int])(p: Int => Boolean): Unit = { + val res1 = s withFilter p + val res2 = s filter p + + val expected = s.toSeq filter p + + val fMapped1 = flatMapId(res1) + val fMapped2 = flatMapId(res2) + assert(fMapped1 == fMapped2) + assert(fMapped1.toSeq == expected) + + val mapped1 = mapSucc(res1) + val mapped2 = mapSucc(res2) + assert(mapped1 == mapped2) + assert(mapped1.toSeq == (expected map (_ + 1))) + + assert((res1 map identity).toSeq == res2.toSeq) + } + + def testStream(s: Stream[Int]): Unit = { + testStreamPred(s)(_ => false) + testStreamPred(s)(_ => true) + testStreamPred(s)(_ % 2 == 0) + testStreamPred(s)(_ % 3 == 0) + } + + //Reduced version of the test case - either invocation used to cause a stack + //overflow before commit 80b3f433e5536d086806fa108ccdfacf10719cc2. + val resFMap = (1 to 10000).toStream withFilter (_ => false) flatMap (Seq(_)) + val resMap = (1 to 10000).toStream withFilter (_ => false) map (_ + 1) + + //Complete test case for withFilter + map/flatMap, as requested by @axel22. + for (j <- (0 to 3) :+ 10000) { + val stream = (1 to j).toStream + assert(stream.toSeq == (1 to j).toSeq) + testStream(stream) + } +} diff --git a/tests/pending/run/streamWithFilter.check b/tests/pending/run/streamWithFilter.check new file mode 100644 index 000000000000..6b0e91a1474d --- /dev/null +++ b/tests/pending/run/streamWithFilter.check @@ -0,0 +1,5 @@ +15 +30 +45 +60 +75 diff --git a/tests/pending/run/streamWithFilter.scala b/tests/pending/run/streamWithFilter.scala new file mode 100644 index 000000000000..cb919d4f5568 --- /dev/null +++ b/tests/pending/run/streamWithFilter.scala @@ -0,0 +1,11 @@ +object Test { + val nums = Stream.from(1) + def isFizz(x: Int) = x % 3 == 0 + def isBuzz(x: Int) = x % 5 == 0 + // next line will run forever if withFilter isn't doing its thing. + val fizzbuzzes = for (n <- nums ; if isFizz(n) ; if isBuzz(n)) yield n + + def main(args: Array[String]): Unit = { + fizzbuzzes take 5 foreach println + } +} diff --git a/tests/pending/run/stream_flatmap_odds.check b/tests/pending/run/stream_flatmap_odds.check new file mode 100644 index 000000000000..2b945e7c6492 --- /dev/null +++ b/tests/pending/run/stream_flatmap_odds.check @@ -0,0 +1 @@ +Stream(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83) diff --git a/tests/pending/run/stream_flatmap_odds.scala b/tests/pending/run/stream_flatmap_odds.scala new file mode 100644 index 000000000000..9e12e6dfad77 --- /dev/null +++ b/tests/pending/run/stream_flatmap_odds.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + lazy val odds: Stream[Int] = Stream(1) append ( odds flatMap {x => Stream(x + 2)} ) + Console println (odds take 42).force +} diff --git a/tests/pending/run/stream_length.check b/tests/pending/run/stream_length.check new file mode 100644 index 000000000000..e4350aa741ca --- /dev/null +++ b/tests/pending/run/stream_length.check @@ -0,0 +1,5 @@ +#partest !avian +Length: 970299 +#partest avian +!!!TEST SKIPPED!!! +See SI-7600 for further information. diff --git a/tests/pending/run/stream_length.scala b/tests/pending/run/stream_length.scala new file mode 100644 index 000000000000..33929f4b5737 --- /dev/null +++ b/tests/pending/run/stream_length.scala @@ -0,0 +1,19 @@ + + +object Test { + def walk(depth: Int, bias: String): Stream[String] = { + if (depth == 0) + Stream(bias) + else { + (Stream.iterate(1, 99)(_+1).map((x: Int) => walk(depth-1, bias + x))).flatten + } + } + + def main(args: Array[String]) { + if (scala.tools.partest.utils.Properties.isAvian) { + println("!!!TEST SKIPPED!!!") + println("See SI-7600 for further information.") + } else + println("Length: " + walk(3, "---").length) + } +} diff --git a/tests/pending/run/streams.check b/tests/pending/run/streams.check new file mode 100644 index 000000000000..db6d2eebab87 --- /dev/null +++ b/tests/pending/run/streams.check @@ -0,0 +1,39 @@ +Stream() +Stream() +true +true +true + +Array(1) +Stream(1, ?) +Stream(1, ?) +Stream() +Stream() +Stream(1) +Stream() +true +true +true +true + +Array(1, 2) +Stream(2) +Stream() +Stream(1, 2) +Stream() +true +true +true +true +true + +999 +512 +100000 +Stream(100001, ?) +Stream(100001, ?) +true +true +705082704 + +true diff --git a/tests/pending/run/streams.scala b/tests/pending/run/streams.scala new file mode 100644 index 000000000000..0576607d4795 --- /dev/null +++ b/tests/pending/run/streams.scala @@ -0,0 +1,66 @@ +object Test extends dotty.runtime.LegacyApp { + val s0: Stream[Int] = Stream.empty + println(s0.take(1)) + println(s0.takeWhile(_ > 0)) + println(s0.lengthCompare(-5) > 0) + println(s0.lengthCompare(0) == 0) + println(s0.lengthCompare(5) < 0) + println + + val s1 = Stream.cons(1, Stream.empty) + println(s1.toArray.deep) + println(s1.take(1)) + println(s1.take(2)) + println(s1.drop(1)) + println(s1.drop(2)) + println(s1.drop(-1)) + println(s1.dropWhile(_ > 0)) + println(s1.lengthCompare(-5) > 0) + println(s1.lengthCompare(0) > 0) + println(s1.lengthCompare(1) == 0) + println(s1.lengthCompare(5) < 0) + println + + val s2 = s1.append(Stream.cons(2, Stream.empty)) + println(s2.toArray.deep) + println(s2.drop(1)) + println(s2.drop(2)) + println(s2.drop(-1)) + println(s2.dropWhile(_ > 0)) + println(s2.lengthCompare(-5) > 0) + println(s2.lengthCompare(0) > 0) + println(s2.lengthCompare(1) > 0) + println(s2.lengthCompare(2) == 0) + println(s2.lengthCompare(5) < 0) + println + + val s3 = Stream.range(1, 1000) //100000 (ticket #153: Stackoverflow) + println(s3.length) + + // ticket #153 + def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None + println(s3.flatMap(powers).reverse.head) + + // large enough to generate StackOverflows (on most systems) + // unless the following methods are tail call optimized. + val size = 100000 + + // test tail recursive methods + println(Stream.from(1).take(size).last) + println(Stream.from(1).drop(size)) + println(Stream.from(1).filter(_ > size).take(5)) + println(Stream.from(1).take(size).forall(_ >= 0)) + println(Stream.from(1).exists(_ > size)) + Stream.from(1).take(size).foreach( x => () ) + println(Stream.from(1).take(size).foldLeft(0)(_ + _)) + val arr = new Array[Int](size) + Stream.from(1).take(size).copyToArray(arr, 0) + + println + + // ticket #6415 + lazy val x = { println("evaluated"); 1 } + val s4 = 0 #:: x #:: Stream.empty + + println(s4.isDefinedAt(0)) +} diff --git a/tests/pending/run/string-extractor.check b/tests/pending/run/string-extractor.check new file mode 100644 index 000000000000..47f3722c86d8 --- /dev/null +++ b/tests/pending/run/string-extractor.check @@ -0,0 +1,9 @@ +by +BY +oTheClown +nope +1: ob +2: obby +2: OBBY +3: BOBO +3: TomTomTheClown diff --git a/tests/pending/run/string-extractor.scala b/tests/pending/run/string-extractor.scala new file mode 100644 index 000000000000..7ab2c2eaab29 --- /dev/null +++ b/tests/pending/run/string-extractor.scala @@ -0,0 +1,60 @@ +final class StringExtract(val s: String) extends AnyVal { + def isEmpty = (s eq null) || (s == "") + def get = this + def length = s.length + def lengthCompare(n: Int) = s.length compare n + def apply(idx: Int): Char = s charAt idx + def head: Char = s charAt 0 + def tail: String = s drop 1 + def drop(n: Int): StringExtract = new StringExtract(s drop n) + + override def toString = s +} + +final class ThreeStringExtract(val s: String) extends AnyVal { + def isEmpty = (s eq null) || (s == "") + def get: (List[Int], Double, ThreeStringExtract) = ((s.length :: Nil, s.length.toDouble, this)) + def length = s.length + def lengthCompare(n: Int) = s.length compare n + def apply(idx: Int): Char = s charAt idx + def head: Char = s charAt 0 + def tail: String = s drop 1 + def drop(n: Int): ThreeStringExtract = new ThreeStringExtract(s drop n) + + override def toString = s +} + + +object Bippy { + def unapplySeq(x: Any): StringExtract = new StringExtract("" + x) +} +object TripleBippy { + def unapplySeq(x: Any): ThreeStringExtract = new ThreeStringExtract("" + x) +} + +object Test { + def f(x: Any) = x match { + case Bippy('B' | 'b', 'O' | 'o', 'B' | 'b', xs : _*) => xs + case _ => "nope" + } + + def g(x: Any): String = x match { + case TripleBippy(3 :: Nil, 3.0, 'b', chars : _*) => "1: " + chars + case TripleBippy(5 :: Nil, 5.0, 'b' | 'B', chars : _*) => "2: " + chars + case TripleBippy(_, _, chars : _*) => "3: " + chars + case _ => "nope" + } + + def main(args: Array[String]): Unit = { + println(f("Bobby")) + println(f("BOBBY")) + println(f("BoBoTheClown")) + println(f("TomTomTheClown")) + + println(g("bob")) + println(g("bobby")) + println(g("BOBBY")) + println(g("BOBO")) + println(g("TomTomTheClown")) + } +} diff --git a/tests/pending/run/stringbuilder-drop.scala b/tests/pending/run/stringbuilder-drop.scala new file mode 100644 index 000000000000..422fb2bc7cca --- /dev/null +++ b/tests/pending/run/stringbuilder-drop.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val s = (new StringBuilder ++= "hello world") dropRight 1 + assert("" + s == "hello worl") + } +} + diff --git a/tests/pending/run/stringbuilder.scala b/tests/pending/run/stringbuilder.scala new file mode 100644 index 000000000000..8448aad54889 --- /dev/null +++ b/tests/pending/run/stringbuilder.scala @@ -0,0 +1,43 @@ + +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val str = "ABCDEFGHIJKLMABCDEFGHIJKLM" + val surrogateStr = "an old Turkic letter: \uD803\uDC22" + + type SB = { + def indexOf(str: String): Int + def indexOf(str: String, fromIndex: Int): Int + def lastIndexOf(str: String): Int + def lastIndexOf(str: String, fromIndex: Int): Int + } + + import scala.collection.mutable.{ StringBuilder => ScalaStringBuilder } + import java.lang.{ StringBuilder => JavaStringBuilder } + + val sbScala = new ScalaStringBuilder() append str + val sbJava = new JavaStringBuilder() append str + val sbs: List[SB] = List[SB](sbScala, sbJava) + + def sameAnswers(f: (SB) => Int) = assert(f(sbScala) == f(sbJava)) + + sameAnswers(_.indexOf("")) + sameAnswers(_.indexOf("G")) + sameAnswers(_.indexOf("ABC")) + sameAnswers(_.indexOf("KLM")) + sameAnswers(_.indexOf("QZV")) + sameAnswers(_.indexOf("LMABC")) + sameAnswers(_.lastIndexOf("")) + sameAnswers(_.lastIndexOf("M")) + sameAnswers(_.lastIndexOf("ABCDEFG")) + sameAnswers(_.lastIndexOf("KLM")) + sameAnswers(_.lastIndexOf("QZV")) + sameAnswers(_.lastIndexOf("GHI", 22)) + sameAnswers(_.lastIndexOf("KLM", 22)) + + // testing that the "reverse" implementation avoids reversing surrogate pairs + val jsb = new JavaStringBuilder(surrogateStr).reverse + val ssb = new ScalaStringBuilder(surrogateStr).reverseContents + + assert(jsb.toString == ssb.toString) +} diff --git a/tests/pending/run/stringinterpolation_macro-run.check b/tests/pending/run/stringinterpolation_macro-run.check new file mode 100644 index 000000000000..c7f46bac87a8 --- /dev/null +++ b/tests/pending/run/stringinterpolation_macro-run.check @@ -0,0 +1,71 @@ +false +false +true +false +true +FALSE +FALSE +TRUE +FALSE +TRUE +true +false +null +0 +80000000 +4c01926 +NULL +4C01926 +null +NULL +Scala +SCALA +5 +x +x +x +x +x +x +x +x +x +x +x +x +S +120 +120 +120 +120 +120 +120 +120 +120 +120 +120 +120 +120 + 0X4 +She is 4 feet tall. +120 +42 +3.400000e+00 +3.400000e+00 +3.400000e+00 +3.400000e+00 +3.400000e+00 +3.400000e+00 +3.000000e+00 +3.000000e+00 +05/26/12 +05/26/12 +05/26/12 +05/26/12 +% + mind +------ +matter + +7 7 9 +7 9 9 diff --git a/tests/pending/run/stringinterpolation_macro-run.scala b/tests/pending/run/stringinterpolation_macro-run.scala new file mode 100644 index 000000000000..9af8d80feeb9 --- /dev/null +++ b/tests/pending/run/stringinterpolation_macro-run.scala @@ -0,0 +1,122 @@ +/* + * filter: inliner warnings; re-run with -Yinline-warnings for details + */ +object Test extends dotty.runtime.LegacyApp { + +// 'b' / 'B' (category: general) +// ----------------------------- +println(f"${null}%b") +println(f"${false}%b") +println(f"${true}%b") +println(f"${new java.lang.Boolean(false)}%b") +println(f"${new java.lang.Boolean(true)}%b") + +println(f"${null}%B") +println(f"${false}%B") +println(f"${true}%B") +println(f"${new java.lang.Boolean(false)}%B") +println(f"${new java.lang.Boolean(true)}%B") + +implicit val stringToBoolean: String => Boolean = java.lang.Boolean.parseBoolean(_: String) +println(f"${"true"}%b") +println(f"${"false"}%b") + +// 'h' | 'H' (category: general) +// ----------------------------- +println(f"${null}%h") +println(f"${0.0}%h") +println(f"${-0.0}%h") +println(f"${"Scala"}%h") + +println(f"${null}%H") +println(f"${"Scala"}%H") + +// 's' | 'S' (category: general) +// ----------------------------- +println(f"${null}%s") +println(f"${null}%S") +println(f"${"Scala"}%s") +println(f"${"Scala"}%S") +println(f"${5}") + +// 'c' | 'C' (category: character) +// ------------------------------- +println(f"${120:Char}%c") +println(f"${120:Byte}%c") +println(f"${120:Short}%c") +println(f"${120:Int}%c") +println(f"${new java.lang.Character('x')}%c") +println(f"${new java.lang.Byte(120:Byte)}%c") +println(f"${new java.lang.Short(120:Short)}%c") +println(f"${new java.lang.Integer(120)}%c") + +println(f"${'x' : java.lang.Character}%c") +println(f"${(120:Byte) : java.lang.Byte}%c") +println(f"${(120:Short) : java.lang.Short}%c") +println(f"${120 : java.lang.Integer}%c") + +implicit val stringToChar: String => Char = (x: String) => x(0) +println(f"${"Scala"}%c") + +// 'd' | 'o' | 'x' | 'X' (category: integral) +// ------------------------------------------ +println(f"${120:Byte}%d") +println(f"${120:Short}%d") +println(f"${120:Int}%d") +println(f"${120:Long}%d") +println(f"${new java.lang.Byte(120:Byte)}%d") +println(f"${new java.lang.Short(120:Short)}%d") +println(f"${new java.lang.Integer(120)}%d") +println(f"${new java.lang.Long(120)}%d") +println(f"${120 : java.lang.Integer}%d") +println(f"${120 : java.lang.Long}%d") +println(f"${BigInt(120)}%d") +println(f"${new java.math.BigInteger("120")}%d") +println(f"${4}%#10X") + +locally { + val fff = new java.util.Formattable { + def formatTo(f: java.util.Formatter, g: Int, w: Int, p: Int) = f.format("4") + } + println(f"She is ${fff}%#s feet tall.") +} + +{ + implicit val strToShort: String => Short = (s: String) => java.lang.Short.parseShort(s) + println(f"${"120"}%d") + implicit val strToInt: String => Int = (s: String) => 42 + println(f"${"120"}%d") +} + +// 'e' | 'E' | 'g' | 'G' | 'f' | 'a' | 'A' (category: floating point) +// ------------------------------------------------------------------ +println(f"${3.4f}%e") +println(f"${3.4}%e") +println(f"${3.4f : java.lang.Float}%e") +println(f"${3.4 : java.lang.Double}%e") +println(f"${BigDecimal(3.4)}%e") +println(f"${new java.math.BigDecimal(3.4)}%e") +println(f"${3}%e") +println(f"${3L}%e") + +// 't' | 'T' (category: date/time) +// ------------------------------- +import java.util.Calendar +import java.util.Locale +val c = Calendar.getInstance(Locale.US) +c.set(2012, Calendar.MAY, 26) +println(f"${c}%TD") +println(f"${c.getTime}%TD") +println(f"${c.getTime.getTime}%TD") + +implicit val strToDate: String => java.util.Calendar = (x: String) => c +println(f"""${"1234"}%TD""") + + +// literals and arg indexes +println(f"%%") +println(f" mind%n------%nmatter%n") +println(f"${7}%d %T, v:T): T = f(v) + var v = 4 + var w = 11 + val x = t1 + val y: Tata = null + def z(t: Tata) = () + } + + type rt = Object { + val a: Int; + val c: String; + def d(x: AnyRef): AnyRef + def e(x: Tata): Tata + def f(x: Int): Int; + def h(x: Unit): AnyRef; + def i(x: Array[Int]): Int + def j(x: Array[AnyRef]): AnyRef + def k(x: Array[Char]): Char + def l(x: Array[Unit]): Unit + def m(x: Array[String]): String + def n(x: Array[Tata]): Tata + def o: Array[Int] + def p: Array[AnyRef] + def q: Array[Char] + def r: Array[Unit] + def s: Array[String] + def t: Array[Tata] + def u[T](f: T=>T, v:T): T + var v: Int + val y: Tata + } + + def l (r: rt): Unit = { + println(" 1. " + r.c) + println(" 2. " + r.a + 1) + println(" 3. " + r.d(o1)) + println(" 4. " + r.e(t1)) + println(" 5. " + (r.f(4) + 1)) + println(" 6. " + r.f(4) + 1) + println(" 7. " + r.f(r.a)) + println(" 8. " + r.v) + r.v = r.v + 1 + println("10. " + r.v) + println("11. " + r.h(())) + println("12. " + r.i(Array(1, 2, 3))) + println("13. " + r.j(Array(o1, o2))) + println("14. " + r.k(Array('1', '2'))) + println("15. " + r.l(Array((), ()))) + println("16. " + r.m(Array("one", "two"))) + println("17. " + r.n(Array(t1, t2))) + println("18. " + (r.o(0) + 1)) + println("19. " + (r.p(0).hashCode() > 0)) + println("20. " + r.q(0)) + println("21. " + r.r(0)) + println("22. " + r.m(r.s)) + println("23. " + r.t(0).tatMe) + println("24. " + r.u[Int](_+1,0)) + println("25. " + r.y) + println("26. " + r.e(null)) + } + + /*def ma[T](r: Object{def e(x: T): T; val x: T}) { + println("30. " + r.e(r.x)) // static error + }*/ + + def mb(r: Object { def e[T](x: T): T }): Unit = { + println("31. " + r.e[Int](4)) // while this is ok + } + + def m1(r: Object { def z(x: Tata): Unit }): Unit = { + println("32. " + r.z(new Titi)) // while this is ok + } + + def m2[T](r: Object { def e(x: Tata): T; val x: Tata }): Unit = { + println("33. " + r.e(r.x)) // and this too + } + + class Rec3[T] { + def e(x: T): T = x + } + + def m3[T](r: Rec3[T], x: T): Unit = { + println("33. " + r.e(x)) // and this too + } + + Rec.g(11) + + this.l(Rec) + this.mb(new Object{def e[T](x: T): T = x}) + this.m1(Rec) + this.m2[Tata](Rec) + this.m3[Tata](new Rec3[Tata], t1) +} + +object test2 { + class C extends { def f(): Unit = { println("1") } } + val x1 = new C + x1.f() + + abstract class D extends { def f(): Unit } + val x2 = new D { def f(): Unit = { println("2") } } + x2.f() + + val x3 = new { def f(): Unit = { println("3") } } + def run(x: { def f(): Unit }): Unit = { x.f() } + run(x3) + + type T = { def f(): Unit } + val x4 = new AnyRef { def f(): Unit = { println("4") } } // ok! + //val x4 = new T { def f() { println("4") } } // error! (bug #1241) + x4.f() + + val x5: T = new { def f(): Unit = { println("5") } } + x5.f() +} + +object test3 { + + case class Exc() extends Exception + + object Rec { + def f = throw Exc() + } + + def m(r: { def f: Nothing }) = + try { + r.f + } + catch { + case e: Exc => println("caught") + case e: Throwable => println(e) + } + + m(Rec) + +} + +object test4 { + + class A + + val aar = Array(new A, new A, new A) + val nar = Array(1, 2) + + def f(p: {def size: Int}) = println(p.size) + //def g[T <: {def size: Int}](p: T) = println(p.size) // open issue + //def h[T <% {def size: Int}](p: T) = println(p.size) // open issue + + f(aar) + f(nar) + + //g(aar) + //g(nar) + + //h(aar) + //h(nar) + +} + +object Test extends dotty.runtime.LegacyApp { + test1 + test2 + test3 + test4 +} diff --git a/tests/pending/run/synchronized.check b/tests/pending/run/synchronized.check new file mode 100644 index 000000000000..eab191b4ed5e --- /dev/null +++ b/tests/pending/run/synchronized.check @@ -0,0 +1,129 @@ +warning: there were 14 inliner warnings; re-run with -Yinline-warnings for details + .|. c1.f1: OK + .|. c1.fi: OK + .|... c1.fv: OK + .|... c1.ff: OK + .|. c1.fl: OK + .|... c1.fo: OK + |.. c1.g1: OK + |.. c1.gi: OK + |.... c1.gv: OK + |..... c1.gf: OK + .|... c1.c.f1: OK + .|... c1.c.fi: OK + .|..... c1.c.fv: OK + .|..... c1.c.ff: OK + .|... c1.c.fl: OK + .|..... c1.c.fo: OK + .|... c1.c.fn: OK + |.... c1.c.g1: OK + |.... c1.c.gi: OK + |...... c1.c.gv: OK + |...... c1.c.gf: OK + .|... c1.O.f1: OK + .|... c1.O.fi: OK + .|..... c1.O.fv: OK + .|..... c1.O.ff: OK + .|... c1.O.fl: OK + .|..... c1.O.fo: OK + .|... c1.O.fn: OK + |.... c1.O.g1: OK + |.... c1.O.gi: OK + |...... c1.O.gv: OK + |...... c1.O.gf: OK + .|. O1.f1: OK + .|. O1.fi: OK + .|... O1.fv: OK + .|... O1.ff: OK + .|. O1.fl: OK + .|... O1.fo: OK + |.. O1.g1: OK + |.. O1.gi: OK + |.... O1.gv: OK + |.... O1.gf: OK + .|... O1.c.f1: OK + .|... O1.c.fi: OK + .|..... O1.c.fv: OK + .|..... O1.c.ff: OK + .|... O1.c.fl: OK + .|..... O1.c.fo: OK + .|... O1.c.fn: OK + |.... O1.c.g1: OK + |.... O1.c.gi: OK + |...... O1.c.gv: OK + |...... O1.c.gf: OK + .|... O1.O.f1: OK + .|... O1.O.fi: OK + .|..... O1.O.fv: OK + .|..... O1.O.ff: OK + .|... O1.O.fl: OK + .|..... O1.O.fo: OK + .|... O1.O.fn: OK + |.... O1.O.g1: OK + |.... O1.O.gi: OK + |...... O1.O.gv: OK + |...... O1.O.gf: OK + .|..... c2.f1: OK + .|..... c2.fi: OK + .|....... c2.fv: OK + .|....... c2.ff: OK + .|..... c2.fl: OK + .|....... c2.fo: OK + |....... c2.g1: OK + |....... c2.gi: OK + |......... c2.gv: OK + |......... c2.gf: OK + .|........ c2.c.f1: OK + .|........ c2.c.fi: OK + .|.......... c2.c.fv: OK + .|.......... c2.c.ff: OK + .|........ c2.c.fl: OK + .|.......... c2.c.fo: OK + .|....... c2.c.fn: OK + |......... c2.c.g1: OK + |......... c2.c.gi: OK + |........... c2.c.gv: OK + |........... c2.c.gf: OK + .|........ c2.O.f1: OK + .|........ c2.O.fi: OK + .|.......... c2.O.fv: OK + .|.......... c2.O.ff: OK + .|........ c2.O.fl: OK + .|.......... c2.O.fo: OK + .|....... c2.O.fn: OK + |......... c2.O.g1: OK + |......... c2.O.gi: OK + |........... c2.O.gv: OK + |........... c2.O.gf: OK + .|..... O2.f1: OK + .|..... O2.fi: OK + .|....... O2.fv: OK + .|....... O2.ff: OK + .|..... O2.fl: OK + .|....... O2.fo: OK + |....... O2.g1: OK + |....... O2.gi: OK + |......... O2.gv: OK + |......... O2.gf: OK + .|........ O2.c.f1: OK + .|........ O2.c.fi: OK + .|.......... O2.c.fv: OK + .|.......... O2.c.ff: OK + .|........ O2.c.fl: OK + .|.......... O2.c.fo: OK + .|....... O2.c.fn: OK + |......... O2.c.g1: OK + |......... O2.c.gi: OK + |........... O2.c.gv: OK + |........... O2.c.gf: OK + .|........ O2.O.f1: OK + .|........ O2.O.fi: OK + .|.......... O2.O.fv: OK + .|.......... O2.O.ff: OK + .|........ O2.O.fl: OK + .|.......... O2.O.fo: OK + .|....... O2.O.fn: OK + |......... O2.O.g1: OK + |......... O2.O.gi: OK + |........... O2.O.gv: OK + |........... O2.O.gf: OK diff --git a/tests/pending/run/synchronized.flags b/tests/pending/run/synchronized.flags new file mode 100644 index 000000000000..49d036a8879c --- /dev/null +++ b/tests/pending/run/synchronized.flags @@ -0,0 +1 @@ +-optimize diff --git a/tests/pending/run/synchronized.scala b/tests/pending/run/synchronized.scala new file mode 100644 index 000000000000..c387dc7c97bd --- /dev/null +++ b/tests/pending/run/synchronized.scala @@ -0,0 +1,449 @@ +import java.lang.Thread.holdsLock +import scala.collection.mutable.StringBuilder + +object Util { + def checkLocks(held: AnyRef*)(notHeld: AnyRef*) = { + val sb = new StringBuilder + for (lock <- held) { + sb.append(if (holdsLock(lock)) '.' else '!') + } + print("%5s|" format sb) + + sb.clear() + for (lock <- notHeld) { + sb.append(if (holdsLock(lock)) '!' else '.') + } + print("%-15s " format sb) + + (held forall holdsLock) && !(notHeld exists holdsLock) + } +} + +class C1 { + import Util._ + + val lock = new AnyRef + + def f1 = synchronized { checkLocks(this)(this.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass) + @inline final def gi = checkLocks()(this, this.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(C1.this, gfv, gfv.getClass, lock, lock.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass) + glv + } + + class C { + def f1 = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass, fv, fv.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, C1.this, C1.this.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, C1.this, C1.this.getClass) } + def fn = C1.this.synchronized { checkLocks(C1.this)(C1.this.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + @inline final def gi = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, C1.this, C1.this.getClass, gv, gv.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, C1.this, C1.this.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + glv + } + } + val c = new C + + object O { + def f1 = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, C1.this, C1.this.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(lock.getClass, ffv, ffv.getClass, C1.this, C1.this.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, C1.this, C1.this.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, C1.this, C1.this.getClass) } + def fn = C1.this.synchronized { checkLocks(C1.this)(C1.this.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + @inline final def gi = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, C1.this, C1.this.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(lock, lock.getClass, gfv, gfv.getClass, C1.this, C1.this.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, C1.this, C1.this.getClass) + glv + } + } +} + +object O1 { + import Util._ + + val lock = new AnyRef + + def f1 = synchronized { checkLocks(this)(this.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass) + @inline final def gi = checkLocks()(this, this.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass) + glv + } + + class C { + def f1 = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, O1, O1.getClass, fv, fv.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, O1, O1.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, O1, O1.getClass) } + def fn = O1.synchronized { checkLocks(O1)(O1.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass, O1, O1.getClass) + @inline final def gi = checkLocks()(this, this.getClass, O1, O1.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, O1, O1.getClass, gv, gv.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, O1, O1.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, O1, O1.getClass) + glv + } + } + val c = new C + + object O { + def f1 = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, O1, O1.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(lock.getClass, ffv, ffv.getClass, O1, O1.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, O1, O1.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, O1, O1.getClass) } + def fn = O1.synchronized { checkLocks(O1)(O1.getClass, this, this.getClass) } + + def g1 = checkLocks()(this, this.getClass, O1, O1.getClass) + @inline final def gi = checkLocks()(this, this.getClass, O1, O1.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, O1, O1.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(lock, lock.getClass, gfv, gfv.getClass, O1, O1.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, O1, O1.getClass) + glv + } + } +} + +trait T { + import Util._ + + val Tclass = Class.forName("T$class") + + val lock = new AnyRef + + def f1 = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + + def g1 = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + @inline final def gi = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) + glv + } + + class C { + def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, fv, fv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(ffv, ffv.getClass, lock.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + + def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, T.this, T.this.getClass, gv, gv.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(gfv, gfv.getClass, lock, lock.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + glv + } + } + val c = new C + + object O { + def f1 = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + @inline final def fi = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + val fv: () => Boolean = () => synchronized { checkLocks(this)(this.getClass, fv, fv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + def ff = { + lazy val ffv: AnyRef => Boolean = lock => synchronized { checkLocks(lock)(lock.getClass, ffv, ffv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + ffv(this) + } + def fl = { + lazy val flv = synchronized { checkLocks(this)(this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + flv + } + def fo = lock.synchronized { checkLocks(lock)(lock.getClass, this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) } + def fn = T.this.synchronized { checkLocks(T.this)(T.this.getClass, this, this.getClass, classOf[T], Tclass, classOf[C2], O2.getClass) } + + def g1 = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + @inline final def gi = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + val gv: () => Boolean = () => checkLocks()(this, this.getClass, gv, gv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + def gf = { + lazy val gfv: AnyRef => Boolean = lock => checkLocks()(lock, lock.getClass, gfv, gfv.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + gfv(this) + } + def gl = { + lazy val glv = checkLocks()(this, this.getClass, T.this, T.this.getClass, classOf[T], Tclass, classOf[C2], O2, O2.getClass) + glv + } + } +} + +class C2 extends T +object O2 extends T + +object Test extends dotty.runtime.LegacyApp { + def check(name: String, result: Boolean): Unit = { + println("%-10s %s" format (name +":", if (result) "OK" else "FAILED")) + } + + val c1 = new C1 + check("c1.f1", c1.f1) + check("c1.fi", c1.fi) + check("c1.fv", c1.fv()) + check("c1.ff", c1.ff) + check("c1.fl", c1.fl) + check("c1.fo", c1.fo) + check("c1.g1", c1.g1) + check("c1.gi", c1.gi) + check("c1.gv", c1.gv()) + check("c1.gf", c1.gf) +// check("c1.gl", c1.gl) // FIXME *.gl are failing because of the issue described in SUGGEST-11 + + check("c1.c.f1", c1.c.f1) + check("c1.c.fi", c1.c.fi) + check("c1.c.fv", c1.c.fv()) + check("c1.c.ff", c1.c.ff) + check("c1.c.fl", c1.c.fl) + check("c1.c.fo", c1.c.fo) + check("c1.c.fn", c1.c.fn) + check("c1.c.g1", c1.c.g1) + check("c1.c.gi", c1.c.gi) + check("c1.c.gv", c1.c.gv()) + check("c1.c.gf", c1.c.gf) +// check("c1.c.gl", c1.c.gl) + + check("c1.O.f1", c1.O.f1) + check("c1.O.fi", c1.O.fi) + check("c1.O.fv", c1.O.fv()) + check("c1.O.ff", c1.O.ff) + check("c1.O.fl", c1.O.fl) + check("c1.O.fo", c1.O.fo) + check("c1.O.fn", c1.O.fn) + check("c1.O.g1", c1.O.g1) + check("c1.O.gi", c1.O.gi) + check("c1.O.gv", c1.O.gv()) + check("c1.O.gf", c1.O.gf) +// check("c1.O.gl", c1.O.gl) + + check("O1.f1", O1.f1) + check("O1.fi", O1.fi) + check("O1.fv", O1.fv()) + check("O1.ff", O1.ff) + check("O1.fl", O1.fl) + check("O1.fo", O1.fo) + check("O1.g1", O1.g1) + check("O1.gi", O1.gi) + check("O1.gv", O1.gv()) + check("O1.gf", O1.gf) +// check("O1.gl", O1.gl) + + check("O1.c.f1", O1.c.f1) + check("O1.c.fi", O1.c.fi) + check("O1.c.fv", O1.c.fv()) + check("O1.c.ff", O1.c.ff) + check("O1.c.fl", O1.c.fl) + check("O1.c.fo", O1.c.fo) + check("O1.c.fn", O1.c.fn) + check("O1.c.g1", O1.c.g1) + check("O1.c.gi", O1.c.gi) + check("O1.c.gv", O1.c.gv()) + check("O1.c.gf", O1.c.gf) +// check("O1.c.gl", O1.c.gl) + + check("O1.O.f1", O1.O.f1) + check("O1.O.fi", O1.O.fi) + check("O1.O.fv", O1.O.fv()) + check("O1.O.ff", O1.O.ff) + check("O1.O.fl", O1.O.fl) + check("O1.O.fo", O1.O.fo) + check("O1.O.fn", O1.O.fn) + check("O1.O.g1", O1.O.g1) + check("O1.O.gi", O1.O.gi) + check("O1.O.gv", O1.O.gv()) + check("O1.O.gf", O1.O.gf) +// check("O1.O.gl", O1.O.gl) + + val c2 = new C2 + check("c2.f1", c2.f1) + check("c2.fi", c2.fi) + check("c2.fv", c2.fv()) + check("c2.ff", c2.ff) + check("c2.fl", c2.fl) + check("c2.fo", c2.fo) + check("c2.g1", c2.g1) + check("c2.gi", c2.gi) + check("c2.gv", c2.gv()) + check("c2.gf", c2.gf) +// check("c2.gl", c2.gl) + + check("c2.c.f1", c2.c.f1) + check("c2.c.fi", c2.c.fi) + check("c2.c.fv", c2.c.fv()) + check("c2.c.ff", c2.c.ff) + check("c2.c.fl", c2.c.fl) + check("c2.c.fo", c2.c.fo) + check("c2.c.fn", c2.c.fn) + check("c2.c.g1", c2.c.g1) + check("c2.c.gi", c2.c.gi) + check("c2.c.gv", c2.c.gv()) + check("c2.c.gf", c2.c.gf) +// check("c2.c.gl", c2.c.gl) + + check("c2.O.f1", c2.O.f1) + check("c2.O.fi", c2.O.fi) + check("c2.O.fv", c2.O.fv()) + check("c2.O.ff", c2.O.ff) + check("c2.O.fl", c2.O.fl) + check("c2.O.fo", c2.O.fo) + check("c2.O.fn", c2.O.fn) + check("c2.O.g1", c2.O.g1) + check("c2.O.gi", c2.O.gi) + check("c2.O.gv", c2.O.gv()) + check("c2.O.gf", c2.O.gf) +// check("c2.O.gl", c2.O.gl) + + check("O2.f1", O2.f1) + check("O2.fi", O2.fi) + check("O2.fv", O2.fv()) + check("O2.ff", O2.ff) + check("O2.fl", O2.fl) + check("O2.fo", O2.fo) + check("O2.g1", O2.g1) + check("O2.gi", O2.gi) + check("O2.gv", O2.gv()) + check("O2.gf", O2.gf) +// check("O2.gl", O2.gl) + + check("O2.c.f1", O2.c.f1) + check("O2.c.fi", O2.c.fi) + check("O2.c.fv", O2.c.fv()) + check("O2.c.ff", O2.c.ff) + check("O2.c.fl", O2.c.fl) + check("O2.c.fo", O2.c.fo) + check("O2.c.fn", O2.c.fn) + check("O2.c.g1", O2.c.g1) + check("O2.c.gi", O2.c.gi) + check("O2.c.gv", O2.c.gv()) + check("O2.c.gf", O2.c.gf) +// check("O2.c.gl", O2.c.gl) + + check("O2.O.f1", O2.O.f1) + check("O2.O.fi", O2.O.fi) + check("O2.O.fv", O2.O.fv()) + check("O2.O.ff", O2.O.ff) + check("O2.O.fl", O2.O.fl) + check("O2.O.fo", O2.O.fo) + check("O2.O.fn", O2.O.fn) + check("O2.O.g1", O2.O.g1) + check("O2.O.gi", O2.O.gi) + check("O2.O.gv", O2.O.gv()) + check("O2.O.gf", O2.O.gf) +// check("O2.O.gl", O2.O.gl) +} diff --git a/tests/pending/run/sysprops.scala b/tests/pending/run/sysprops.scala new file mode 100644 index 000000000000..bdad677221d3 --- /dev/null +++ b/tests/pending/run/sysprops.scala @@ -0,0 +1,50 @@ +import sys._ + +/** Basic sys.Prop test. */ +object Test { + val key = "ding.dong.doobie" + + def bool() = { + val prop = BooleanProp.valueIsTrue(key) + assert(prop.key == key) + + prop.clear() + assert(!prop.value) + assert(!prop.isSet) + assert(prop.get != null) + + prop set "dingus" + assert(prop.get == "dingus") + assert(!prop.value) + prop set "true" + assert(prop.value) + prop.toggle() + assert(!prop.value) + prop.enable() + assert(prop.value) + prop.disable() + assert(!prop.value) + } + def int() = { + val prop = Prop[Int](key) + prop.clear() + assert(prop.value == 0) + prop.set("523") + assert(prop.value == 523) + prop.set("DingusInt") + + try { println(prop.value) ; assert(false, "should not get here") } + catch { case _: Exception => () } + } + def double() = { + val prop = Prop[Double](key) + prop.set("55.0") + assert(prop.value == 55.0) + } + + def main(args: Array[String]): Unit = { + bool() + int() + double() + } +} diff --git a/tests/pending/run/t0005.check b/tests/pending/run/t0005.check new file mode 100644 index 000000000000..1e8b31496214 --- /dev/null +++ b/tests/pending/run/t0005.check @@ -0,0 +1 @@ +6 diff --git a/tests/pending/run/t0005.scala b/tests/pending/run/t0005.scala new file mode 100644 index 000000000000..38c24745fe16 --- /dev/null +++ b/tests/pending/run/t0005.scala @@ -0,0 +1,47 @@ +object A1 { + object A2 { + class X { def unapply(v : Int) = Some(v + 1) } + } +} + +object B1 { + object B2 { + val q = new A1.A2.X + } +} + +object Test { + def main(args: Array[String]): Unit = { + import B1.B2.q + val res = 5 match { case q(x) => x } + println(res) + } +} + + + +/* +compiler crash: + +object A1 { + object A2 { + class X { def unapply(v : Int) = Some(v + 1) } + } +} + +object B1 { + object B2 { + val q = new A1.A2.X + } +} + +object C { + def main(args: Array[String]) { + //import B1.B2.q + val q = new A1.A2.X + val res = 5 match { case q(x) => x } + println(res) + } +} + +*/ diff --git a/tests/pending/run/t0017.check b/tests/pending/run/t0017.check new file mode 100644 index 000000000000..3a72142467e5 --- /dev/null +++ b/tests/pending/run/t0017.check @@ -0,0 +1 @@ +Array(ArraySeq(1, 3), ArraySeq(2, 4)) diff --git a/tests/pending/run/t0017.scala b/tests/pending/run/t0017.scala new file mode 100644 index 000000000000..1c4fb2e6832c --- /dev/null +++ b/tests/pending/run/t0017.scala @@ -0,0 +1,17 @@ +object Test extends dotty.runtime.LegacyApp { + +def transpose[A](arr: Array[Array[A]]) = { + for (i <- Array.range(0, arr(0).length)) yield + for (row <- arr) yield row(i) +} + +var my_arr = Array(Array(1,2),Array(3,4)) + +for (i <- Array.range(0, my_arr(0).length)) yield + for (row <- my_arr) yield row(i) + +val transposed = transpose(my_arr) + +println(transposed.deep.toString) + +} diff --git a/tests/pending/run/t0042.check b/tests/pending/run/t0042.check new file mode 100644 index 000000000000..aeb2d5e2398d --- /dev/null +++ b/tests/pending/run/t0042.check @@ -0,0 +1 @@ +Some(1) diff --git a/tests/pending/run/t0042.scala b/tests/pending/run/t0042.scala new file mode 100644 index 000000000000..57c8563f0fbf --- /dev/null +++ b/tests/pending/run/t0042.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + def getClause[T](clauses: List[T]): Option[T] = { + for (c <- clauses) { + return Some(c) + } + return None + } + println(getClause(List(1, 2, 3))) +} diff --git a/tests/pending/run/t0048.check b/tests/pending/run/t0048.check new file mode 100644 index 000000000000..1e8b31496214 --- /dev/null +++ b/tests/pending/run/t0048.check @@ -0,0 +1 @@ +6 diff --git a/tests/pending/run/t0048.scala b/tests/pending/run/t0048.scala new file mode 100644 index 000000000000..c1fcc6ddcb89 --- /dev/null +++ b/tests/pending/run/t0048.scala @@ -0,0 +1,13 @@ +object A1 { + object A2 { + class X { def unapply(v : Int) = Some(v + 1) } + } +} + +object Test { + def main(args: Array[String]): Unit = { + val q = new A1.A2.X + val res = 5 match { case q(x) => x } + println(res) + } +} diff --git a/tests/pending/run/t0091.check b/tests/pending/run/t0091.check new file mode 100644 index 000000000000..fd3c81a4d763 --- /dev/null +++ b/tests/pending/run/t0091.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/pending/run/t0091.scala b/tests/pending/run/t0091.scala new file mode 100644 index 000000000000..45235eb77b31 --- /dev/null +++ b/tests/pending/run/t0091.scala @@ -0,0 +1,16 @@ +trait A { def x : Int } +trait B { val m : A } +object C extends B { + object m extends A { def x = 5 } +} +object Test { + // The type annotation here is necessary, otherwise + // the compiler would reference C$m$ directly. + def o1 : B = C + def o2 = C + + def main(argv : Array[String]) : Unit = { + println(o1.m.x) + println(o2.m.x) + } +} diff --git a/tests/pending/run/t0325.check b/tests/pending/run/t0325.check new file mode 100644 index 000000000000..85fe91dac6df --- /dev/null +++ b/tests/pending/run/t0325.check @@ -0,0 +1,35 @@ +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) + +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) + +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) + +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) +List(a, b) diff --git a/tests/pending/run/t0325.scala b/tests/pending/run/t0325.scala new file mode 100644 index 000000000000..ea6180306f0e --- /dev/null +++ b/tests/pending/run/t0325.scala @@ -0,0 +1,53 @@ +case class RS(self: String) { + + // NB. "\\Q" + '\\' + "\\E" works on Java 1.5 and newer, but not on Java 1.4 + private def escape(ch: Char): String = ch match { + case '\\' => "\\\\" + case _ => "\\Q"+ch+"\\E" + } + + def split(separator: Char): Array[String] = self.split(escape(separator)) + + def split(separators: Array[Char]): Array[String] = { + val re = separators.foldLeft("[")(_+escape(_)) + "]" + self.split(re) + } +} + +object Test { + def expect = List("a","b") + def test(f: => Array[String], which: String): Unit = { + try { + val ret = f.toList + if (ret != expect) + println(which + " returned " + ret + " when expecting " + expect) + else + println(ret) + } catch { + case e: Throwable => println(which + " failed with " + e.getClass) + } + } + + def main(args: Array[String]): Unit = { + val badChars = "?*{+([\\^.$" + + for (c <- badChars) + test(("a"+c+"b").split(c),"RichString split('"+ c + "')") + println + + for (c <- badChars) + test(RS("a"+c+"b").split(c),"RS split('"+ c + "')") + println + + val badCases = List( + ']' -> "x]", '&' -> "&&",'\\' -> "\\x", '[' -> "[x", + '^' -> "^x", '-' -> "x-z" + ) + for ((c,str) <- badCases) + test(("a"+c+"b").split(str.toArray),"RichString split(\""+ str + "\")") + println + + for ((c,str) <- badCases) + test(RS("a"+c+"b").split(str.toArray),"RS split(\""+ str + "\")") + } +} diff --git a/tests/pending/run/t0412.check b/tests/pending/run/t0412.check new file mode 100644 index 000000000000..c7141ddbd9f4 --- /dev/null +++ b/tests/pending/run/t0412.check @@ -0,0 +1,2 @@ +class java.util.ArrayList +class java.util.ArrayList diff --git a/tests/pending/run/t0412.scala b/tests/pending/run/t0412.scala new file mode 100644 index 000000000000..ffd4f56bf9b9 --- /dev/null +++ b/tests/pending/run/t0412.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(classOf[java.util.ArrayList[_]]) + println(classOf[java.util.ArrayList[T] forSome { type T }]) +} diff --git a/tests/pending/run/t0421-new.check b/tests/pending/run/t0421-new.check new file mode 100644 index 000000000000..cdcf042f1985 --- /dev/null +++ b/tests/pending/run/t0421-new.check @@ -0,0 +1,3 @@ +[Array(0, 1),Array(2, 3),Array(4, 5)] +[Array(31.0)] +[Array(24.0, 32.0)] diff --git a/tests/pending/run/t0421-new.scala b/tests/pending/run/t0421-new.scala new file mode 100644 index 000000000000..96d39534c259 --- /dev/null +++ b/tests/pending/run/t0421-new.scala @@ -0,0 +1,32 @@ +import scala.reflect.{ClassTag, classTag} + +// ticket #421 +object Test extends dotty.runtime.LegacyApp { + + def transpose[A: ClassTag](xss: Array[Array[A]]) = { + for (i <- Array.range(0, xss(0).length)) yield + for (xs <- xss) yield xs(i) + } + + def scalprod(xs: Array[Double], ys: Array[Double]) = { + var acc = 0.0 + for ((x, y) <- xs zip ys) acc = acc + x * y + acc + } + + def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = { + val ysst = transpose(yss) + val ysst1: Array[Array[Double]] = yss.transpose + assert(ysst.deep == ysst1.deep) + for (xs <- xss) yield + for (yst <- ysst) yield + scalprod(xs, yst) + } + + val a1 = Array(Array(0, 2, 4), Array(1, 3, 5)) + println(transpose(a1).deep.mkString("[", ",", "]")) + + println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]")) + + println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]")) +} diff --git a/tests/pending/run/t0421-old.check b/tests/pending/run/t0421-old.check new file mode 100644 index 000000000000..cdcf042f1985 --- /dev/null +++ b/tests/pending/run/t0421-old.check @@ -0,0 +1,3 @@ +[Array(0, 1),Array(2, 3),Array(4, 5)] +[Array(31.0)] +[Array(24.0, 32.0)] diff --git a/tests/pending/run/t0421-old.scala b/tests/pending/run/t0421-old.scala new file mode 100644 index 000000000000..99ec3567b9ef --- /dev/null +++ b/tests/pending/run/t0421-old.scala @@ -0,0 +1,32 @@ +// ticket #421 + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + + def transpose[A: ClassManifest](xss: Array[Array[A]]) = { + for (i <- Array.range(0, xss(0).length)) yield + for (xs <- xss) yield xs(i) + } + + def scalprod(xs: Array[Double], ys: Array[Double]) = { + var acc = 0.0 + for ((x, y) <- xs zip ys) acc = acc + x * y + acc + } + + def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = { + val ysst = transpose(yss) + val ysst1: Array[Array[Double]] = yss.transpose + assert(ysst.deep == ysst1.deep) + for (xs <- xss) yield + for (yst <- ysst) yield + scalprod(xs, yst) + } + + val a1 = Array(Array(0, 2, 4), Array(1, 3, 5)) + println(transpose(a1).deep.mkString("[", ",", "]")) + + println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]")) + + println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]")) +} diff --git a/tests/pending/run/t0432.scala b/tests/pending/run/t0432.scala new file mode 100644 index 000000000000..10f64e31da95 --- /dev/null +++ b/tests/pending/run/t0432.scala @@ -0,0 +1,18 @@ + +import scala.language.reflectiveCalls + +object Test { + type valueType = { def value: this.type } + + class StringValue(x: String) { + def value: this.type = this + } + + def m(x: valueType) = x.value + + val s = new StringValue("hei") + + def main(args: Array[String]): Unit = { + m(s) + } +} diff --git a/tests/pending/run/t0508.check b/tests/pending/run/t0508.check new file mode 100644 index 000000000000..52b543586fb2 --- /dev/null +++ b/tests/pending/run/t0508.check @@ -0,0 +1 @@ +(first: this might be fun, second: 10) diff --git a/tests/pending/run/t0508.scala b/tests/pending/run/t0508.scala new file mode 100644 index 000000000000..10fc0bfb461f --- /dev/null +++ b/tests/pending/run/t0508.scala @@ -0,0 +1,13 @@ +object Test extends dotty.runtime.LegacyApp { + + case class Foo(s: String, n: Int) + + def foo[A, B, C](unapply1: A => Option[(B, C)], v: A) = { + unapply1(v) match { + case Some((fst, snd)) => println("first: " + fst, " second: " + snd) + case _ => println(":(") + } + } + + foo(Foo.unapply, Foo("this might be fun", 10)) +} diff --git a/tests/pending/run/t0528.check b/tests/pending/run/t0528.check new file mode 100644 index 000000000000..4512e423297e --- /dev/null +++ b/tests/pending/run/t0528.check @@ -0,0 +1 @@ +Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) diff --git a/tests/pending/run/t0528.scala b/tests/pending/run/t0528.scala new file mode 100644 index 000000000000..ab0eea55d3ec --- /dev/null +++ b/tests/pending/run/t0528.scala @@ -0,0 +1,16 @@ + +import scala.language.{ existentials } +trait Sequ[A] { + def toArray: Array[T forSome { type T <: A }] +} + +class RichStr extends Sequ[Char] { + // override to a primitive array + def toArray: Array[Char] = Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') +} + +object Test extends dotty.runtime.LegacyApp { + val x: RichStr = new RichStr + + println((x: Sequ[Char]).toArray.deep) // calling through the bridge misses unboxing +} diff --git a/tests/pending/run/t0607.check b/tests/pending/run/t0607.check new file mode 100644 index 000000000000..a9057ea659c0 --- /dev/null +++ b/tests/pending/run/t0607.check @@ -0,0 +1,2 @@ +A() +B() diff --git a/tests/pending/run/t0607.scala b/tests/pending/run/t0607.scala new file mode 100644 index 000000000000..8f9e29533c83 --- /dev/null +++ b/tests/pending/run/t0607.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + case class A() + class B extends A() { override def toString() = "B()" } + println(A()) + println(new B()) +} + diff --git a/tests/pending/run/t0631.check b/tests/pending/run/t0631.check new file mode 100644 index 000000000000..0a7d5e499740 --- /dev/null +++ b/tests/pending/run/t0631.check @@ -0,0 +1,3 @@ +Foo.equals called +false +true diff --git a/tests/pending/run/t0631.scala b/tests/pending/run/t0631.scala new file mode 100644 index 000000000000..2767b4bf06c2 --- /dev/null +++ b/tests/pending/run/t0631.scala @@ -0,0 +1,16 @@ +object Test extends dotty.runtime.LegacyApp { + class Foo { + override def equals(that: Any) = { + println("Foo.equals called") + super.equals(that) + } + } + + println(new Foo == new Foo) + + case class Bar(x: Foo) + val b = new Bar(new Foo) + + // this should not call Foo.equals, but simply compare object identiy of b + println(b == b) +} diff --git a/tests/pending/run/t0668.scala b/tests/pending/run/t0668.scala new file mode 100644 index 000000000000..f97c360e59a3 --- /dev/null +++ b/tests/pending/run/t0668.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val ints: Array[Int] = Array(1, 2, 3) + ints.toArray +} + diff --git a/tests/pending/run/t0677-new.scala b/tests/pending/run/t0677-new.scala new file mode 100644 index 000000000000..8aee295c3bea --- /dev/null +++ b/tests/pending/run/t0677-new.scala @@ -0,0 +1,10 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + class X[T: ClassTag] { + val a = Array.ofDim[T](3, 4) + } + val x = new X[String] + x.a(1)(2) = "hello" + assert(x.a(1)(2) == "hello") +} diff --git a/tests/pending/run/t0677-old.scala b/tests/pending/run/t0677-old.scala new file mode 100644 index 000000000000..fde0aac9fd73 --- /dev/null +++ b/tests/pending/run/t0677-old.scala @@ -0,0 +1,11 @@ + + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + class X[T: ClassManifest] { + val a = Array.ofDim[T](3, 4) + } + val x = new X[String] + x.a(1)(2) = "hello" + assert(x.a(1)(2) == "hello") +} diff --git a/tests/pending/run/t0807.check b/tests/pending/run/t0807.check new file mode 100644 index 000000000000..c862cba6b49f --- /dev/null +++ b/tests/pending/run/t0807.check @@ -0,0 +1 @@ +early diff --git a/tests/pending/run/t0807.scala b/tests/pending/run/t0807.scala new file mode 100644 index 000000000000..1b5bc91c51c7 --- /dev/null +++ b/tests/pending/run/t0807.scala @@ -0,0 +1,5 @@ +trait A +trait B extends A { val x = println("early") } +object Test extends dotty.runtime.LegacyApp { + new B {} +} diff --git a/tests/pending/run/t0883.check b/tests/pending/run/t0883.check new file mode 100644 index 000000000000..2c94e4837100 --- /dev/null +++ b/tests/pending/run/t0883.check @@ -0,0 +1,2 @@ +OK +OK diff --git a/tests/pending/run/t0883.scala b/tests/pending/run/t0883.scala new file mode 100644 index 000000000000..fb46f423eaef --- /dev/null +++ b/tests/pending/run/t0883.scala @@ -0,0 +1,14 @@ +object Foo { def apply(x: String) = new Foo(x) } +class Foo(name: String) +case object Bar extends Foo("Bar") +case class Baz() extends Foo("Baz") +object Test extends dotty.runtime.LegacyApp { + Foo("Bar") match { + case Bar => println("What?") + case _ => println("OK") + } + Foo("Baz") match { + case Baz() => println("What?") + case _ => println("OK") + } +} diff --git a/tests/pending/run/t0911.scala b/tests/pending/run/t0911.scala new file mode 100644 index 000000000000..a0b5597d5c23 --- /dev/null +++ b/tests/pending/run/t0911.scala @@ -0,0 +1,12 @@ +class Foo(val bar : () => String); + +class IP extends Foo(() => baz) { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val baz = "bar" +// END copied early initializers +}; + +object Test extends dotty.runtime.LegacyApp{ + (new IP).bar(); +} diff --git a/tests/pending/run/t0936.scala b/tests/pending/run/t0936.scala new file mode 100644 index 000000000000..7cb00b9499e6 --- /dev/null +++ b/tests/pending/run/t0936.scala @@ -0,0 +1,17 @@ +object Test extends dotty.runtime.LegacyApp { + def foo = { + + abstract class MouseEventType { def x: String } + case object Clicked extends MouseEventType { + def x = "Clicked" + } + + trait MouseHandler { + def mouseClicked() = handleEvent(Clicked); + def handleEvent(t : MouseEventType) = t.x + } + (new MouseHandler {}).handleEvent(Clicked) + } + assert(foo == "Clicked") +} + diff --git a/tests/pending/run/t1005.check b/tests/pending/run/t1005.check new file mode 100644 index 000000000000..6ec092909077 --- /dev/null +++ b/tests/pending/run/t1005.check @@ -0,0 +1,2 @@ +Halp! +Halp! diff --git a/tests/pending/run/t1005.scala b/tests/pending/run/t1005.scala new file mode 100644 index 000000000000..562e2e4c6d50 --- /dev/null +++ b/tests/pending/run/t1005.scala @@ -0,0 +1,20 @@ +import scala.language.postfixOps +object Test +{ + class Foo[T](x : Array[AnyRef]) { def bar = x.asInstanceOf[Array[T]] } + class Bar[T](x : Array[T]) { def bar = x.asInstanceOf[Array[AnyRef]] } + + object FromMono{ + def mainer(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar + } + + object FromPoly{ + def mainer(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar + } + + def main(args: Array[String]): Unit = { + println(FromMono mainer null mkString) + println(FromPoly mainer null mkString) + } +} + diff --git a/tests/pending/run/t102.check b/tests/pending/run/t102.check new file mode 100644 index 000000000000..315f21037d32 --- /dev/null +++ b/tests/pending/run/t102.check @@ -0,0 +1,2 @@ +(5,5) +(10,10) diff --git a/tests/pending/run/t102.scala b/tests/pending/run/t102.scala new file mode 100644 index 000000000000..6517d8a5314a --- /dev/null +++ b/tests/pending/run/t102.scala @@ -0,0 +1,24 @@ +trait Foo { + type Arg + type Prod + def makeProd(a: Arg): Prod +} + +object Test { + def f1(x: Foo)(y: x.Arg) = x.makeProd(y) + + case class f2[T <: Foo](x: T) { + def apply(y: x.Arg) = x.makeProd(y) + } + + val myFoo = new Foo { + type Arg = Int + type Prod = (Int, Int) + def makeProd(i: Int) = (i, i) + } + + def main(args: Array[String]): Unit = { + println(f1(myFoo)(5)) + println(f2(myFoo)(10)) + } +} diff --git a/tests/pending/run/t1042.check b/tests/pending/run/t1042.check new file mode 100644 index 000000000000..223b7836fb19 --- /dev/null +++ b/tests/pending/run/t1042.check @@ -0,0 +1 @@ +B diff --git a/tests/pending/run/t1042.scala b/tests/pending/run/t1042.scala new file mode 100644 index 000000000000..cbe00f91dd0b --- /dev/null +++ b/tests/pending/run/t1042.scala @@ -0,0 +1,14 @@ +abstract class A { + override def toString(): String // crucial + + def toString(sb: StringBuilder): StringBuilder // crucial +} + +case class B() extends A { + // overloaded version is implemented, causing toString not to be implemented? + def toString(sb: StringBuilder): StringBuilder = sys.error("") +} + +object Test extends dotty.runtime.LegacyApp { + Console.println(B) +} diff --git a/tests/pending/run/t1044.scala b/tests/pending/run/t1044.scala new file mode 100644 index 000000000000..227f6de2731b --- /dev/null +++ b/tests/pending/run/t1044.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val ducks = Array[AnyRef]("Huey", "Dewey", "Louie"); + ducks.iterator.asInstanceOf[Iterator[String]] +} diff --git a/tests/pending/run/t1048.check b/tests/pending/run/t1048.check new file mode 100644 index 000000000000..f1e5eeed2d93 --- /dev/null +++ b/tests/pending/run/t1048.check @@ -0,0 +1,2 @@ +3 +2 diff --git a/tests/pending/run/t1048.scala b/tests/pending/run/t1048.scala new file mode 100644 index 000000000000..5eaeaa25c6c3 --- /dev/null +++ b/tests/pending/run/t1048.scala @@ -0,0 +1,21 @@ +final case class W[A](v: A) + +object E { + def unapply(w: W[Any]): Option[Any] = None +} + +object Bug { + def bug[A](e: Either[W[_], A]) = e match { + case Left(E(x)) => 1 + case Right(x) => 2 + case _ => 3 + } +} + +object Test { + def main(args: Array[String]): Unit = { + println(Bug.bug(Left(W(5)))) + println(Bug.bug(Right(5))) + } +} + diff --git a/tests/pending/run/t107.check b/tests/pending/run/t107.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t107.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t107.scala b/tests/pending/run/t107.scala new file mode 100644 index 000000000000..2cd4c98208e4 --- /dev/null +++ b/tests/pending/run/t107.scala @@ -0,0 +1,8 @@ +object Test { + def main(args : Array[String]) : Unit = { + var hash : Long = 0 + val bytes = Array(1.toByte, 2.toByte, 3.toByte) + hash += bytes(0) + Console.println(hash) + } +} diff --git a/tests/pending/run/t1074.check b/tests/pending/run/t1074.check new file mode 100644 index 000000000000..ccf1cb1551cc --- /dev/null +++ b/tests/pending/run/t1074.check @@ -0,0 +1,3 @@ +q0 = Set(kl, jk, cd, fg, ef, gh, a, de, hj, b, lm, mn) +q1 = Set() 0 +q2 = Set() 0 diff --git a/tests/pending/run/t1074.scala b/tests/pending/run/t1074.scala new file mode 100644 index 000000000000..a95f9eedbc9c --- /dev/null +++ b/tests/pending/run/t1074.scala @@ -0,0 +1,14 @@ +import scala.collection.immutable._ +object Test { + def main(args : Array[String]) : Unit = { + var words = "a" :: "b" :: "cd" :: "de" :: "fg" :: "ef" :: + "gh" :: "jk" :: "hj" :: "kl" :: "lm" :: "mn" :: Nil + val q0:Set[String] = + new HashSet[String]() ++ words + val q1 = q0.filter(w => false) + val q2 = q1.filter(w => false) + Console.println("q0 = " + q0) + Console.println("q1 = " + q1+" "+q1.size) + Console.println("q2 = " + q2+" "+q2.size) + } +} diff --git a/tests/pending/run/t1110.scala b/tests/pending/run/t1110.scala new file mode 100644 index 000000000000..964df7590e3c --- /dev/null +++ b/tests/pending/run/t1110.scala @@ -0,0 +1,15 @@ + + +import scala.language.{ reflectiveCalls } + +class Stuff { + def zoop(p: Any{def &(q: Int): Int}) = p & 7 + def floop = new { def & = "Hello" } + + assert((floop.&) == "Hello") + assert(zoop(10) == 2) +} + +object Test extends dotty.runtime.LegacyApp { + new Stuff +} diff --git a/tests/pending/run/t1141.check b/tests/pending/run/t1141.check new file mode 100644 index 000000000000..7262160d1de2 --- /dev/null +++ b/tests/pending/run/t1141.check @@ -0,0 +1,2 @@ +var +args diff --git a/tests/pending/run/t1141.scala b/tests/pending/run/t1141.scala new file mode 100644 index 000000000000..ad22d26c0754 --- /dev/null +++ b/tests/pending/run/t1141.scala @@ -0,0 +1,11 @@ + + +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val foo = new { + def apply(args : String*) = args foreach println + } + + foo("var", "args") +} diff --git a/tests/pending/run/t1167.check b/tests/pending/run/t1167.check new file mode 100644 index 000000000000..06fedebe7110 --- /dev/null +++ b/tests/pending/run/t1167.check @@ -0,0 +1,3 @@ +anon$1 +anon$2 +$anonfun$testFunc$1 diff --git a/tests/pending/run/t1167.flags b/tests/pending/run/t1167.flags new file mode 100644 index 000000000000..ac96850b69b5 --- /dev/null +++ b/tests/pending/run/t1167.flags @@ -0,0 +1 @@ +-Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/t1167.scala b/tests/pending/run/t1167.scala new file mode 100644 index 000000000000..8b8976b5f32d --- /dev/null +++ b/tests/pending/run/t1167.scala @@ -0,0 +1,32 @@ +/** Tests for compatible InnerClasses attribute between trait and + * impl classes, as well as anonymous classes. + */ + +trait Test1 { + def testFunc(i:Int): Unit = { + (i:Int) => i + 5 + } +} + +/* getName + * Returns the binary name of the class if this class object represents a + * reference type that is not an array type. + * getSimpleName + * Returns the simple name of the underlying class as given in the source + * code. Returns an empty string if the underlying class is anonymous. + */ +abstract class Foo { + override def toString = getClass.getSimpleName + + abstract class Bar { + override def toString = getClass.getSimpleName + } +} + +object Test extends dotty.runtime.LegacyApp { + val foo = new Foo {} + val bar = new foo.Bar {} + println(foo) + println(bar) + println(Class.forName("Test1$$anonfun$testFunc$1").getSimpleName) +} diff --git a/tests/pending/run/t1192.check b/tests/pending/run/t1192.check new file mode 100644 index 000000000000..57234e1d8a7e --- /dev/null +++ b/tests/pending/run/t1192.check @@ -0,0 +1,2 @@ +Array(1, 2) +Array(3, 4) diff --git a/tests/pending/run/t1192.scala b/tests/pending/run/t1192.scala new file mode 100644 index 000000000000..073d346859c1 --- /dev/null +++ b/tests/pending/run/t1192.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + val v1: Array[Array[Int]] = Array(Array(1, 2), Array(3, 4)) + def f[T](w: Array[Array[T]]): Unit = { + for (r <- w) println(r.deep.toString) + } + f(v1) +} diff --git a/tests/pending/run/t1195-new.check b/tests/pending/run/t1195-new.check new file mode 100644 index 000000000000..0a3f434d6236 --- /dev/null +++ b/tests/pending/run/t1195-new.check @@ -0,0 +1,6 @@ +Bar.type, underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton +Bar, underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int} +Product with Serializable, underlying = Product with Serializable +Bar.type, underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton +Bar, underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int} +Product with Serializable, underlying = Product with Serializable diff --git a/tests/pending/run/t1195-new.scala b/tests/pending/run/t1195-new.scala new file mode 100644 index 000000000000..fcb80082a221 --- /dev/null +++ b/tests/pending/run/t1195-new.scala @@ -0,0 +1,30 @@ + +import scala.language.{ existentials } +import scala.reflect.runtime.universe._ + +object Test { + def f() = { case class Bar(x: Int); Bar } + def g() = { case class Bar(x: Int); Bar(5) } + def h() = { case object Bar ; Bar } + + val f1 = f() + val g1 = g() + val h1 = h() + + def m[T: WeakTypeTag](x: T) = println(weakTypeOf[T] + ", underlying = " + weakTypeOf[T].typeSymbol.info) + + def main(args: Array[String]): Unit = { + m(f) + m(g) + m(h) + m(f1) + m(g1) + m(h1) + } +} + +class A1[T] { + class B1[U] { + def f = { case class D(x: Int) extends A1[String] ; new D(5) } + } +} diff --git a/tests/pending/run/t1195-old.check b/tests/pending/run/t1195-old.check new file mode 100644 index 000000000000..d023bc91f707 --- /dev/null +++ b/tests/pending/run/t1195-old.check @@ -0,0 +1,6 @@ +_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with scala.Product with scala.Serializable +Object with scala.Product with scala.Serializable +_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with scala.Product with scala.Serializable +Object with scala.Product with scala.Serializable diff --git a/tests/pending/run/t1195-old.scala b/tests/pending/run/t1195-old.scala new file mode 100644 index 000000000000..f80734c22868 --- /dev/null +++ b/tests/pending/run/t1195-old.scala @@ -0,0 +1,29 @@ + +import scala.language.{ existentials } + +object Test { + def f() = { case class Bar(x: Int); Bar } + def g() = { case class Bar(x: Int); Bar(5) } + def h() = { case object Bar ; Bar } + + val f1 = f() + val g1 = g() + val h1 = h() + + def m[T: Manifest](x: T) = println(manifest[T]) + + def main(args: Array[String]): Unit = { + m(f) + m(g) + m(h) + m(f1) + m(g1) + m(h1) + } +} + +class A1[T] { + class B1[U] { + def f = { case class D(x: Int) extends A1[String] ; new D(5) } + } +} diff --git a/tests/pending/run/t1220.scala b/tests/pending/run/t1220.scala new file mode 100644 index 000000000000..3f70107ce4b3 --- /dev/null +++ b/tests/pending/run/t1220.scala @@ -0,0 +1,15 @@ +object Test extends dotty.runtime.LegacyApp { + + class QSRichIterable[A](self: Iterable[A]) { + def filterMap[R](f: PartialFunction[A,R]) = + self filter (f.isDefinedAt) map f + } + + object Un { + def unapply(i: Int): Option[Int] = Some(i) + } + + val richIter = new QSRichIterable(List(0, 1, 2, 3, 4)) + + assert((richIter filterMap {case Un(3) => 7}) == List(7)) +} diff --git a/tests/pending/run/t1247.check b/tests/pending/run/t1247.check new file mode 100644 index 000000000000..ce123032fdaf --- /dev/null +++ b/tests/pending/run/t1247.check @@ -0,0 +1 @@ +Is same closure class: true is same closure: true diff --git a/tests/pending/run/t1247.scala b/tests/pending/run/t1247.scala new file mode 100644 index 000000000000..f9f5c853b7e8 --- /dev/null +++ b/tests/pending/run/t1247.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + val f = () => 5 + def test(g: => Int): Unit = { + val gFunc = g _ + val isSameClosureClass = gFunc.getClass == f.getClass + val isSame = gFunc eq f + println("Is same closure class: "+isSameClosureClass+" is same closure: "+isSame) + } + + test(f()) +} diff --git a/tests/pending/run/t1300.check b/tests/pending/run/t1300.check new file mode 100644 index 000000000000..0f29a1fef55f --- /dev/null +++ b/tests/pending/run/t1300.check @@ -0,0 +1 @@ +abcdabcdabcd diff --git a/tests/pending/run/t1300.scala b/tests/pending/run/t1300.scala new file mode 100644 index 000000000000..8ba13fae1446 --- /dev/null +++ b/tests/pending/run/t1300.scala @@ -0,0 +1,13 @@ +object Test extends dotty.runtime.LegacyApp +{ + val a1 = Array(0,1,2,3).toArray[Any] +// val a1 = x1.toArray[Any] + val a2 = Array('a','b','c','d').toArray[Any] + val a3 = Array("e","f","g","h").toArray[Any] + + Array.copy(a3, 0, a1, 0, 4) + Array.copy(a2, 0, a3, 0, 4) + Array.copy(a2, 0, a1, 0, 4) + + println(a1.mkString + a2.mkString + a3.mkString) +} diff --git a/tests/pending/run/t1309.scala b/tests/pending/run/t1309.scala new file mode 100644 index 000000000000..84963549a27e --- /dev/null +++ b/tests/pending/run/t1309.scala @@ -0,0 +1,7 @@ +object Test { + def f(ras: => IndexedSeq[Byte]): IndexedSeq[Byte] = ras + + def main(args: Array[String]): Unit = { + f(new Array[Byte](0)) + } +} diff --git a/tests/pending/run/t1323.check b/tests/pending/run/t1323.check new file mode 100644 index 000000000000..0d540f71b5dd --- /dev/null +++ b/tests/pending/run/t1323.check @@ -0,0 +1,18 @@ + 1:-1 + 2:0 + 3:1 + 4:2 + 5:-1 + 6:-1 + 7:-1 + 8:-1 + 9:-1 +10:0 +11:-1 +12:-1 +13:-1 +14:0 +15:0 +16:-1 +17:-1 +18:3 diff --git a/tests/pending/run/t1323.scala b/tests/pending/run/t1323.scala new file mode 100644 index 000000000000..68692d92a6d4 --- /dev/null +++ b/tests/pending/run/t1323.scala @@ -0,0 +1,25 @@ +object Test extends dotty.runtime.LegacyApp { + println(" 1:" + List(1,2,3,4).indexOfSlice(List(0,1))) // -1 + println(" 2:" + List(1,2,3,4).indexOfSlice(List(1,2))) // 0 + println(" 3:" + List(1,2,3,4).indexOfSlice(List(2,3))) // 1 + println(" 4:" + List(1,2,3,4).indexOfSlice(List(3,4))) // 2 + println(" 5:" + List(1,2,3,4).indexOfSlice(List(4,5))) // -1 + println(" 6:" + List(1,2,3,4).indexOfSlice(List(2,4))) // -1 + println(" 7:" + List(1,2,3,4).indexOfSlice(List(4,3))) // -1 + println(" 8:" + List(1,2,3,4).indexOfSlice(List(1,3))) // -1 + println(" 9:" + List(1,2,3,4).indexOfSlice(List(1,3))) // -1 + println("10:" + List(1,2,3,4).indexOfSlice(List(1,2,3,4))) // 0 + println("11:" + List(1,2,3,4).indexOfSlice(List(4,3,2,1))) // -1 + println("12:" + List(1,2,3,4).indexOfSlice(List(1,2,3,4,5))) // -1 + println("13:" + List(1,2,3,4).indexOfSlice(List(5,4,3,2,1))) // -1 + println("14:" + List(1,2,3,4).indexOfSlice(List())) // 0 + println("15:" + List().indexOfSlice(List())) // 0 + println("16:" + List().indexOfSlice(List(1,2,3,4))) // -1 + + // Do some testing with infinite sequences + def from(n: Int): Stream[Int] = Stream.cons(n, from(n + 1)) + + println("17:" + List(1,2,3,4).indexOfSlice(from(1))) // -1 + println("18:" + from(1).indexOfSlice(List(4,5,6))) // 3 +} + diff --git a/tests/pending/run/t1333.check b/tests/pending/run/t1333.check new file mode 100644 index 000000000000..6303af7f1c4e --- /dev/null +++ b/tests/pending/run/t1333.check @@ -0,0 +1,3 @@ +10 +-10 +-1 diff --git a/tests/pending/run/t1333.scala b/tests/pending/run/t1333.scala new file mode 100644 index 000000000000..1696629cbb72 --- /dev/null +++ b/tests/pending/run/t1333.scala @@ -0,0 +1,14 @@ +object Test { + case class A(x: Int)(y: Int)(z: String) + + def f(x: Any) = x match { + case A(x) => x + case _ => -1 + } + + def main(args: Array[String]): Unit = { + println(f(A(10)(20)("abc"))) + println(f(A(-10)(20)("abc"))) + println(f(List(1))) + } +} diff --git a/tests/pending/run/t1360.check b/tests/pending/run/t1360.check new file mode 100644 index 000000000000..8417e208ae7f --- /dev/null +++ b/tests/pending/run/t1360.check @@ -0,0 +1,2 @@ +[one, two] +[1, 2, 3] diff --git a/tests/pending/run/t1360.scala b/tests/pending/run/t1360.scala new file mode 100644 index 000000000000..959c1cd2ff01 --- /dev/null +++ b/tests/pending/run/t1360.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val seq: Seq[String] = List("one", "two") + println(java.util.Arrays.asList(seq: _*)) + println(java.util.Arrays.asList(Seq(1,2,3): _*)) + } +} diff --git a/tests/pending/run/t1368.check b/tests/pending/run/t1368.check new file mode 100644 index 000000000000..581e8a403996 --- /dev/null +++ b/tests/pending/run/t1368.check @@ -0,0 +1,3 @@ +t1368.scala:7: warning: Reference to uninitialized value blurp + def go3 = (new AnyRef with Happy with Sad { override val status = blurp ; val blurp = "happysad" }).status + ^ diff --git a/tests/pending/run/t1368.scala b/tests/pending/run/t1368.scala new file mode 100644 index 000000000000..7ec3605e84b2 --- /dev/null +++ b/tests/pending/run/t1368.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + trait Happy { val status = "happy" } + trait Sad { val status = "sad" } + + def go1 = (new AnyRef with Happy with Sad { override val status = "happysad" }).status + def go2 = (new AnyRef with Happy with Sad { val blurp = "happysad" ; override val status = blurp }).status + def go3 = (new AnyRef with Happy with Sad { override val status = blurp ; val blurp = "happysad" }).status +} + diff --git a/tests/pending/run/t1373.scala b/tests/pending/run/t1373.scala new file mode 100644 index 000000000000..9a873f0ed518 --- /dev/null +++ b/tests/pending/run/t1373.scala @@ -0,0 +1,6 @@ +// Testing whether case class params come back in the right order. +object Test extends dotty.runtime.LegacyApp { + case class Foo(private val a: String, b: String, private val c: String, d: String, private val e: String) + val x = Foo("a", "b", "c", "d", "e") + assert(x.toString == """Foo(a,b,c,d,e)""") +} diff --git a/tests/pending/run/t1423.check b/tests/pending/run/t1423.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t1423.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t1423.scala b/tests/pending/run/t1423.scala new file mode 100644 index 000000000000..d8b0898273dc --- /dev/null +++ b/tests/pending/run/t1423.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp{ + val x = 1 match { + case 0xFFFFFFFF00000001L => println("Oops, overflow!"); + case 2L => println(2); + case 1L => println(1); + case _ => println("????"); + } +} diff --git a/tests/pending/run/t1427.check b/tests/pending/run/t1427.check new file mode 100644 index 000000000000..11a3d2f4a980 --- /dev/null +++ b/tests/pending/run/t1427.check @@ -0,0 +1,3 @@ +t1427.scala:6: warning: abstract type X in type pattern Bob[_[_] <: Any] is unchecked since it is eliminated by erasure + case x: (Bob[X] forSome { type X[_] }) => true + ^ diff --git a/tests/pending/run/t1427.scala b/tests/pending/run/t1427.scala new file mode 100644 index 000000000000..4784fad8ba52 --- /dev/null +++ b/tests/pending/run/t1427.scala @@ -0,0 +1,18 @@ + +import scala.language.{ higherKinds } + +class Bob[K[_]] { + def foo(other: Any) = other match { + case x: (Bob[_[_] <: Any]) => true + case _ => false + } +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new Bob[List] + val results = List(x, new Bob[Set], 55) map (x foo _) + + assert(results == List(true, true, false)) + } +} diff --git a/tests/pending/run/t1430.check b/tests/pending/run/t1430.check new file mode 100644 index 000000000000..a68818270123 --- /dev/null +++ b/tests/pending/run/t1430.check @@ -0,0 +1 @@ +Baz diff --git a/tests/pending/run/t1430/Bar_1.java b/tests/pending/run/t1430/Bar_1.java new file mode 100644 index 000000000000..e49b6becb208 --- /dev/null +++ b/tests/pending/run/t1430/Bar_1.java @@ -0,0 +1,8 @@ +package j; + +interface Foo { + public void foo(); +} +public interface Bar_1 extends Foo { + public void bar(); +} diff --git a/tests/pending/run/t1430/Test_2.scala b/tests/pending/run/t1430/Test_2.scala new file mode 100644 index 000000000000..278d9c7fd34b --- /dev/null +++ b/tests/pending/run/t1430/Test_2.scala @@ -0,0 +1,16 @@ +package s { + object Boop extends j.Bar_1 { + def foo() {} + def bar() {} + } + class Baz(x: j.Bar_1) { + x.foo + override def toString = "Baz" + } +} + +object Test { + def main(args: Array[String]): Unit = { + println(new s.Baz(s.Boop)) + } +} diff --git a/tests/pending/run/t1434.scala b/tests/pending/run/t1434.scala new file mode 100644 index 000000000000..63bd88ec9083 --- /dev/null +++ b/tests/pending/run/t1434.scala @@ -0,0 +1,15 @@ +object Test { + class A[T] { val op = null } + class B extends A[Any] + class C extends B + + def f(o: AnyRef) = o match { + case a: A[_] if(a.op != null) => "with op" + case c: C => "C" + case b: B => "B" + } + + def main(args: Array[String]) = { + assert("C" == f(new C)) + } +} diff --git a/tests/pending/run/t1466.scala b/tests/pending/run/t1466.scala new file mode 100644 index 000000000000..cacadd53e892 --- /dev/null +++ b/tests/pending/run/t1466.scala @@ -0,0 +1,11 @@ +object IOvervalueMyPrivacy { + private[this] var i = 0 + def go = { + List(1,2,3).foreach(i += _) + i + } +} + +object Test extends dotty.runtime.LegacyApp { + assert(IOvervalueMyPrivacy.go == 6) +} diff --git a/tests/pending/run/t1500.check b/tests/pending/run/t1500.check new file mode 100644 index 000000000000..94a169333ba2 --- /dev/null +++ b/tests/pending/run/t1500.check @@ -0,0 +1,3 @@ +defined class posingAs +resolve: [A, B](x: A @posingAs[B])B +x: Any = 7 diff --git a/tests/pending/run/t1500.scala b/tests/pending/run/t1500.scala new file mode 100644 index 000000000000..743a9216727c --- /dev/null +++ b/tests/pending/run/t1500.scala @@ -0,0 +1,46 @@ +import scala.tools.nsc._ + +object Test { + + /** + * Type inference overlooks constraints posed by type parameters in annotations on types. + */ + + val testCode = """ + + class posingAs[A] extends annotation.TypeConstraint + + def resolve[A,B](x: A @posingAs[B]): B = x.asInstanceOf[B] + + val x = resolve(7: @posingAs[Any]) + + """ + + def main(args: Array[String]): Unit = { + + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + val tool = new interpreter.IMain(settings) + val global = tool.global + + import global._ + import definitions._ + + object checker extends AnnotationChecker { + + /** Check annotations to decide whether tpe1 <:< tpe2 */ + def annotationsConform(tpe1: Type, tpe2: Type): Boolean = { + + tpe1.annotations.forall(a1 => tpe2.annotations.forall(a2 => a1.atp <:< a2.atp)) + + } + } + + global.addAnnotationChecker(checker) + + tool.interpret(testCode) + + } + +} + diff --git a/tests/pending/run/t1501.check b/tests/pending/run/t1501.check new file mode 100644 index 000000000000..f0fa9112a57c --- /dev/null +++ b/tests/pending/run/t1501.check @@ -0,0 +1,3 @@ +defined class xyz +loopWhile: [T](cond: => Boolean)(body: => Unit @xyz[T])Unit @xyz[T] +test: ()Unit @xyz[Int] diff --git a/tests/pending/run/t1501.scala b/tests/pending/run/t1501.scala new file mode 100644 index 000000000000..7a9a695d883d --- /dev/null +++ b/tests/pending/run/t1501.scala @@ -0,0 +1,56 @@ +import scala.tools.nsc._ + +object Test { + + /** + * ... + */ + + val testCode = """ + + class xyz[A] extends annotation.TypeConstraint + + def loopWhile[T](cond: =>Boolean)(body: =>(Unit @xyz[T])): Unit @ xyz[T] = {{ + if (cond) {{ + body + loopWhile[T](cond)(body) + }} + }} + + def test() = {{ + var x = 7 + loopWhile(x != 0) {{ + x = x - 1 + (): @xyz[Int] + }} + }} + + """ + + def main(args: Array[String]): Unit = { + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + val tool = new interpreter.IMain(settings) + val global = tool.global + + import global._ + import definitions._ + + object checker extends AnnotationChecker { + + /** Check annotations to decide whether tpe1 <:< tpe2 */ + def annotationsConform(tpe1: Type, tpe2: Type): Boolean = { + + tpe1.annotations.forall(a1 => tpe2.annotations.forall(a2 => a1.atp <:< a2.atp)) + + } + } + + global.addAnnotationChecker(checker) + + tool.interpret(testCode) + + } + +} + diff --git a/tests/pending/run/t1503.check b/tests/pending/run/t1503.check new file mode 100644 index 000000000000..43eceb022956 --- /dev/null +++ b/tests/pending/run/t1503.check @@ -0,0 +1 @@ +whoops diff --git a/tests/pending/run/t1503.scala b/tests/pending/run/t1503.scala new file mode 100644 index 000000000000..123265059f10 --- /dev/null +++ b/tests/pending/run/t1503.scala @@ -0,0 +1,20 @@ +object Whatever { + override def equals(x: Any) = true +} + +object Test extends dotty.runtime.LegacyApp { + // this should make it abundantly clear Any is the best return type we can guarantee + def matchWhatever(x: Any): Any = x match { case n @ Whatever => n } + // when left to its own devices, and not under -Xfuture, the return type is Whatever.type + def matchWhateverCCE(x: Any) = x match { case n @ Whatever => n } + + // just to exercise it a bit + assert(matchWhatever(1) == 1) + assert(matchWhatever("1") == "1") + + try { + matchWhateverCCE("1"): Whatever.type + } catch { + case _: ClassCastException => println("whoops") + } +} diff --git a/tests/pending/run/t1503_future.flags b/tests/pending/run/t1503_future.flags new file mode 100644 index 000000000000..112fc720a057 --- /dev/null +++ b/tests/pending/run/t1503_future.flags @@ -0,0 +1 @@ +-Xfuture \ No newline at end of file diff --git a/tests/pending/run/t1503_future.scala b/tests/pending/run/t1503_future.scala new file mode 100644 index 000000000000..356f640b17f2 --- /dev/null +++ b/tests/pending/run/t1503_future.scala @@ -0,0 +1,17 @@ +object Whatever { + override def equals(x: Any) = true +} + +object Test extends dotty.runtime.LegacyApp { + // this should make it abundantly clear Any is the best return type we can guarantee + def matchWhatever(x: Any): Any = x match { case n @ Whatever => n } + // when left to its own devices, and not under -Xfuture, the return type is Whatever.type + def matchWhateverCCE(x: Any) = x match { case n @ Whatever => n } + + // just to exercise it a bit + assert(matchWhatever(1) == 1) + assert(matchWhatever("1") == "1") + + assert(matchWhateverCCE(1) == 1) + assert(matchWhateverCCE("1") == "1") +} diff --git a/tests/pending/run/t1505.scala b/tests/pending/run/t1505.scala new file mode 100644 index 000000000000..8131d03df6a5 --- /dev/null +++ b/tests/pending/run/t1505.scala @@ -0,0 +1,22 @@ +object Q extends Enumeration { + val A = Value("A") + val B = Value("B") + val C = Value("C") +} + +object R extends Enumeration { + val A, B, C = Value +} + +object Test extends dotty.runtime.LegacyApp { + assert(Q(0) == Q.withName("A")) + assert(Q.C == Q.withName("C")) + + assert(R(0) == R.withName("A")) + assert(R.C == R.withName("C")) + + var failed = false + try { Q.withName("x") } catch { case _: NoSuchElementException => failed = true } + assert(failed) + +} diff --git a/tests/pending/run/t1524.check b/tests/pending/run/t1524.check new file mode 100644 index 000000000000..e79c5e8f9644 --- /dev/null +++ b/tests/pending/run/t1524.check @@ -0,0 +1 @@ +initial diff --git a/tests/pending/run/t1524.scala b/tests/pending/run/t1524.scala new file mode 100644 index 000000000000..d28d56efbdd1 --- /dev/null +++ b/tests/pending/run/t1524.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + + val buf = new scala.collection.mutable.ArrayBuffer[String](0) + buf += "initial" + buf += "second" + println(buf.head) +} diff --git a/tests/pending/run/t153.check b/tests/pending/run/t153.check new file mode 100644 index 000000000000..648a6de7c307 --- /dev/null +++ b/tests/pending/run/t153.check @@ -0,0 +1 @@ +Stream(262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1) diff --git a/tests/pending/run/t153.scala b/tests/pending/run/t153.scala new file mode 100644 index 000000000000..610a9d6df26e --- /dev/null +++ b/tests/pending/run/t153.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + def powers(x: Int) = if ((x&(x-1))==0) Some(x) else None + val res = (Stream.range(1, 500000) flatMap powers).reverse + println((res take 42).force) +} diff --git a/tests/pending/run/t1535.check b/tests/pending/run/t1535.check new file mode 100644 index 000000000000..458a9ef080d7 --- /dev/null +++ b/tests/pending/run/t1535.check @@ -0,0 +1,2 @@ +42 +true diff --git a/tests/pending/run/t1535.scala b/tests/pending/run/t1535.scala new file mode 100644 index 000000000000..853a31cacb3e --- /dev/null +++ b/tests/pending/run/t1535.scala @@ -0,0 +1,15 @@ +class ASTNode { + lazy val x = 42 +} + +class BlockStmt extends ASTNode + +class ClassDecl extends BlockStmt { + lazy val y = true +} + +object Test extends dotty.runtime.LegacyApp { + val n = new ClassDecl () + println (n.x) + println (n.y) +} diff --git a/tests/pending/run/t1537.check b/tests/pending/run/t1537.check new file mode 100644 index 000000000000..0be5d980da45 --- /dev/null +++ b/tests/pending/run/t1537.check @@ -0,0 +1,2 @@ +true +true \ No newline at end of file diff --git a/tests/pending/run/t1537.scala b/tests/pending/run/t1537.scala new file mode 100644 index 000000000000..1dce50199096 --- /dev/null +++ b/tests/pending/run/t1537.scala @@ -0,0 +1,18 @@ +trait Syntax { + object Foo +} + +trait Evaluation { + val syntax: Syntax + + def equalInTrait = this.syntax.Foo == this.syntax.Foo +} + +object Test extends Evaluation with App { + object syntax extends Syntax + + def equalInObject = this.syntax.Foo == this.syntax.Foo + + println(equalInTrait) + println(equalInObject) +} diff --git a/tests/pending/run/t1591.check b/tests/pending/run/t1591.check new file mode 100644 index 000000000000..48082f72f087 --- /dev/null +++ b/tests/pending/run/t1591.check @@ -0,0 +1 @@ +12 diff --git a/tests/pending/run/t1591.scala b/tests/pending/run/t1591.scala new file mode 100644 index 000000000000..78efb695acba --- /dev/null +++ b/tests/pending/run/t1591.scala @@ -0,0 +1,14 @@ +abstract class A { + + lazy val lazyBar = bar + + object bar { + val foo = 12 + } + +} + +object Test extends dotty.runtime.LegacyApp { + val a = new A{} + println(a.lazyBar.foo) +} diff --git a/tests/pending/run/t1618.scala b/tests/pending/run/t1618.scala new file mode 100644 index 000000000000..248af9b4fb6b --- /dev/null +++ b/tests/pending/run/t1618.scala @@ -0,0 +1,11 @@ + +object Test extends dotty.runtime.LegacyApp { + import scala.tools.nsc.io._ + + val dir: VirtualDirectory = new VirtualDirectory("foo", None) + dir.subdirectoryNamed("foo") + assert(dir.lookupName("foo", true) != null) + +} + + diff --git a/tests/pending/run/t1672.scala b/tests/pending/run/t1672.scala new file mode 100644 index 000000000000..510530ab4000 --- /dev/null +++ b/tests/pending/run/t1672.scala @@ -0,0 +1,28 @@ +object Test { + @annotation.tailrec + def bar(i : Int) : Int = { + if (i == 0) 0 + else try { + throw new RuntimeException + } catch { + case _: Throwable => bar(i - 1) + } + } + + @annotation.tailrec + def nestedTry1(i : Int) : Int = { + if (i == 0) 0 + else try { + throw new RuntimeException + } catch { + case _: Throwable => + try { ??? } catch { case _: Throwable => nestedTry1(i - 1) } + } + } + + def main(args: Array[String]): Unit = { + assert(bar(2) == 0) + + assert(nestedTry1(2) == 0) + } +} diff --git a/tests/pending/run/t1697.scala b/tests/pending/run/t1697.scala new file mode 100644 index 000000000000..39dcdd732451 --- /dev/null +++ b/tests/pending/run/t1697.scala @@ -0,0 +1,19 @@ +class Term +case class Num(n: Int) extends Term +case class Add(x: Term, y: Term) extends Term + +object Value { + def unapply(term: Any): Boolean = true +} + +object Test { + def main(args: Array[String]): Unit = { + val term = Add(Num(1), Add(Num(2), Num(3))) + val res = term match { + case Add(Num(x), Num(y)) => "Add(Num, Num)" + case Add(Value(), y) => "Add(Value, ?)" + case _ => "?" + } + assert(res == "Add(Value, ?)") + } +} diff --git a/tests/pending/run/t1718.check b/tests/pending/run/t1718.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/t1718.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/t1718.scala b/tests/pending/run/t1718.scala new file mode 100644 index 000000000000..e6f52025448a --- /dev/null +++ b/tests/pending/run/t1718.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp{ + def matchesNull[T](mightBeNull: Array[T]): Boolean = mightBeNull match { + case null => true + case x => false + } + + val nullArray: Array[String] = null + println(matchesNull(nullArray)) +} + diff --git a/tests/pending/run/t1747.scala b/tests/pending/run/t1747.scala new file mode 100644 index 000000000000..f2b51a2537a8 --- /dev/null +++ b/tests/pending/run/t1747.scala @@ -0,0 +1,6 @@ +object Foo extends Foo { + def f: Unit = {} +} +class Foo + +object Test extends dotty.runtime.LegacyApp { Foo } diff --git a/tests/pending/run/t1766.scala b/tests/pending/run/t1766.scala new file mode 100644 index 000000000000..150cf149544c --- /dev/null +++ b/tests/pending/run/t1766.scala @@ -0,0 +1,19 @@ + +import scala.language.{ reflectiveCalls } + +object Test extends dotty.runtime.LegacyApp { + + class C(s: String) { + + def this(i: Int) = this("bar") + + def f = { + val v: { def n: Int } = new { val n = 3 } + v.n + } + + } + + new C("foo").f + +} diff --git a/tests/pending/run/t1829.scala b/tests/pending/run/t1829.scala new file mode 100644 index 000000000000..b51055a5a29f --- /dev/null +++ b/tests/pending/run/t1829.scala @@ -0,0 +1,12 @@ +object Test{ + def main(args : Array[String]): Unit = { + import scala.collection.immutable._ + assert(IntMap.empty == HashMap.empty); + assert(HashMap.empty == IntMap.empty); + assert(LongMap.empty == HashMap.empty); + assert(HashMap.empty == LongMap.empty); + assert(IntMap.empty == LongMap.empty); + assert(IntMap(1 -> 2) == HashMap(1 -> 2)); + assert(LongMap(1L -> 2) == HashMap(1L -> 2)); + } +} diff --git a/tests/pending/run/t1909.check b/tests/pending/run/t1909.check new file mode 100644 index 000000000000..7d25be60fd59 --- /dev/null +++ b/tests/pending/run/t1909.check @@ -0,0 +1,3 @@ +t1909.scala:7: warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled. + def this(p: String) = this(try 0) + ^ diff --git a/tests/pending/run/t1909.scala b/tests/pending/run/t1909.scala new file mode 100644 index 000000000000..20236775520e --- /dev/null +++ b/tests/pending/run/t1909.scala @@ -0,0 +1,12 @@ +// Until #1909 is fixed, if this compiles the bytecode +// will trigger a VerifyError. This liftings and the one +// in 1909b.scala actually happen in two different places +// (uncurry and lambdalifter.) +class Ticket1909 { + def this(value: Int) = this() + def this(p: String) = this(try 0) +} + +object Test extends dotty.runtime.LegacyApp { + new Ticket1909("") +} diff --git a/tests/pending/run/t1909b.scala b/tests/pending/run/t1909b.scala new file mode 100644 index 000000000000..b4bb9a1e0967 --- /dev/null +++ b/tests/pending/run/t1909b.scala @@ -0,0 +1,9 @@ +class Ticket1909 (x: Int) { + def this() = this({ + def bar() = 5 + bar + }) +} +object Test extends dotty.runtime.LegacyApp { + new Ticket1909() +} diff --git a/tests/pending/run/t1909c.scala b/tests/pending/run/t1909c.scala new file mode 100644 index 000000000000..50e06b39e1bc --- /dev/null +++ b/tests/pending/run/t1909c.scala @@ -0,0 +1,9 @@ +class Base(a: Any) + +// java.lang.VerifyError: (class: Sub, method: signature: ()V) Expecting to find object/array on stack +// at Test$.(t1909c.scala) +class Sub() extends Base({ def bippy = 5; bippy }) + +object Test extends dotty.runtime.LegacyApp { + new Sub() +} diff --git a/tests/pending/run/t1939.scala b/tests/pending/run/t1939.scala new file mode 100644 index 000000000000..620c5b76f733 --- /dev/null +++ b/tests/pending/run/t1939.scala @@ -0,0 +1,34 @@ +class Module {} + +abstract class T { + type moduleType <: Module + def module: moduleType +} + +final class T1(val module: Module) extends T { + type moduleType = Module +} + +final class T2(_module: Module) extends T { + type moduleType = Module + + def module = _module +} + +object Test extends dotty.runtime.LegacyApp { + + type mType = Module + + type tType = T { type moduleType <: mType } + // type tType = T { type moduleType <: Module } // runs successfully + // type tType = T // runs successfully + + def f(ts: List[tType]): Unit = { + + for (t <- ts; m = t.module) {} + ts.map(t => t.module).foreach { _ => () } + // ts.map(t => (t : T).module).foreach { _ => () } // runs successfully + } + + f(new T1(new Module) :: new T2(new Module) :: Nil) +} diff --git a/tests/pending/run/t1987.check b/tests/pending/run/t1987.check new file mode 100644 index 000000000000..d2102a4a183f --- /dev/null +++ b/tests/pending/run/t1987.check @@ -0,0 +1,16 @@ +long +long +double +double +long +long +double +double +long +long +double +double +long +long +double +double diff --git a/tests/pending/run/t1987.flags b/tests/pending/run/t1987.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/t1987.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t1987.scala b/tests/pending/run/t1987.scala new file mode 100644 index 000000000000..f5abc262cc9f --- /dev/null +++ b/tests/pending/run/t1987.scala @@ -0,0 +1,62 @@ +// a.scala +// Fri Jan 13 11:31:47 PST 2012 + +package foo { + package object bar { + def duh(n: Long) = println("long") + def duh(n: Double) = println("double") + + def duh2(n: Double) = println("double") + def duh2(n: Long) = println("long") + } + package bar { + object Main { + def main(args:Array[String]): Unit = { + duh(33L) + bip.bar.duh(33L) + duh(33d) + bip.bar.duh(33d) + + duh2(33L) + bip.bar.duh2(33L) + duh2(33d) + bip.bar.duh2(33d) + } + } + } +} + +package bip { + trait Duh { + def duh(n: Long) = println("long") + def duh(n: Double) = println("double") + } + trait Duh2 { + def duh2(n: Double) = println("double") + def duh2(n: Long) = println("long") + } + + package object bar extends Duh with Duh2 { } + package bar { + object Main { + def main(args:Array[String]): Unit = { + duh(33L) + bip.bar.duh(33L) + duh(33d) + bip.bar.duh(33d) + + duh2(33L) + bip.bar.duh2(33L) + duh2(33d) + bip.bar.duh2(33d) + } + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + foo.bar.Main.main(null) + bip.bar.Main.main(null) + } +} diff --git a/tests/pending/run/t1987b.check b/tests/pending/run/t1987b.check new file mode 100644 index 000000000000..68d4b10e1204 --- /dev/null +++ b/tests/pending/run/t1987b.check @@ -0,0 +1 @@ +ok! diff --git a/tests/pending/run/t1987b/PullIteratees.scala b/tests/pending/run/t1987b/PullIteratees.scala new file mode 100644 index 000000000000..a5a3e65d8f08 --- /dev/null +++ b/tests/pending/run/t1987b/PullIteratees.scala @@ -0,0 +1,17 @@ +package scales.xml + +trait PullType +class QName +trait RetUrn[T] + +/** + * Iteratees related to pull parsing + */ +trait PullIteratees { + /** + * Without the overload it doesn't trigger the CCE, even though its + * not used + */ + def iterate(path: List[QName], xml: String): RetUrn[String] = null + def iterate(path: List[QName], xml: Iterator[PullType]): RetUrn[String] = null +} diff --git a/tests/pending/run/t1987b/a.scala b/tests/pending/run/t1987b/a.scala new file mode 100644 index 000000000000..c1be5fe3e08c --- /dev/null +++ b/tests/pending/run/t1987b/a.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + scales.xml.CCE_Test.main(args) + println("ok!") + } +} diff --git a/tests/pending/run/t1987b/cce_test.scala b/tests/pending/run/t1987b/cce_test.scala new file mode 100644 index 000000000000..4f9acf02644a --- /dev/null +++ b/tests/pending/run/t1987b/cce_test.scala @@ -0,0 +1,15 @@ +package scales.xml +//import scales.xml._ // using another pacakge and importing doesn't CCE + +object CCE_Test { + def main(args: Array[String]): Unit = { + // without the import it doesn't trigger the CCE + import scaley.funny._ + + val pull = null.asInstanceOf[Iterator[PullType]] + val LogEntries = null.asInstanceOf[List[QName]] + // fully qualify with scales.xml. and it won't trigger it + iterate(LogEntries, + pull) + } +} diff --git a/tests/pending/run/t1987b/pkg1.scala b/tests/pending/run/t1987b/pkg1.scala new file mode 100644 index 000000000000..6e749fc6b33d --- /dev/null +++ b/tests/pending/run/t1987b/pkg1.scala @@ -0,0 +1,4 @@ +package scaley + +package object funny { +} diff --git a/tests/pending/run/t1987b/pkg2.scala b/tests/pending/run/t1987b/pkg2.scala new file mode 100644 index 000000000000..38056a199edf --- /dev/null +++ b/tests/pending/run/t1987b/pkg2.scala @@ -0,0 +1,3 @@ +package scales + +package object xml extends PullIteratees diff --git a/tests/pending/run/t1994.scala b/tests/pending/run/t1994.scala new file mode 100644 index 000000000000..0b463e3444d0 --- /dev/null +++ b/tests/pending/run/t1994.scala @@ -0,0 +1,20 @@ +class A { + protected def x = 0 + protected[A] def y = 0 +} + +class B extends A { + override def x = 1 + def superY = super[A].y + override def y = 1 +} + + +object Test { + def main(args: Array[String]): Unit = { + val b = new B + assert(b.x == 1) + assert(b.y == 1) + assert(b.superY == 0) + } +} diff --git a/tests/pending/run/t2005.scala b/tests/pending/run/t2005.scala new file mode 100644 index 000000000000..342a4dad07f4 --- /dev/null +++ b/tests/pending/run/t2005.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]): Unit = { + val a = Array.ofDim[Int](2,2) + test(a) + } + def test[A](t: Array[Array[A]]): Unit = { + val tmp = t(0) + t(1) = tmp + } +} diff --git a/tests/pending/run/t2027.check b/tests/pending/run/t2027.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t2027.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t2027.scala b/tests/pending/run/t2027.scala new file mode 100644 index 000000000000..96012d90fa3b --- /dev/null +++ b/tests/pending/run/t2027.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + def fibs: Stream[Int] = Stream.cons(0, Stream.cons(1, fibs.zip(fibs.tail).map(p => p._1 + p._2))) + println(fibs(2)) // stack overflow + } +} diff --git a/tests/pending/run/t2029.check b/tests/pending/run/t2029.check new file mode 100644 index 000000000000..57b610ccc5d7 --- /dev/null +++ b/tests/pending/run/t2029.check @@ -0,0 +1,3 @@ +1,2,3,4,5 +4,3,2 +true diff --git a/tests/pending/run/t2029.scala b/tests/pending/run/t2029.scala new file mode 100644 index 000000000000..d4ab0f02b67f --- /dev/null +++ b/tests/pending/run/t2029.scala @@ -0,0 +1,16 @@ +object Test{ + def main(args : Array[String]): Unit = { + import scala.collection.immutable.TreeSet; + + val mainSet = TreeSet(1 to 5 :_*) + + var compareCalled = false; + val smallerSet = TreeSet(2 to 4 :_*)(Ordering[Int].reverse) + + println(mainSet.mkString(",")) + println(smallerSet.mkString(",")) + println(smallerSet.subsetOf(mainSet)); + } + + +} diff --git a/tests/pending/run/t2030.check b/tests/pending/run/t2030.check new file mode 100644 index 000000000000..5923569f4f58 --- /dev/null +++ b/tests/pending/run/t2030.check @@ -0,0 +1,2 @@ +true +class scala.collection.immutable.TreeSet \ No newline at end of file diff --git a/tests/pending/run/t2030.scala b/tests/pending/run/t2030.scala new file mode 100644 index 000000000000..cbd62babae03 --- /dev/null +++ b/tests/pending/run/t2030.scala @@ -0,0 +1,8 @@ +import scala.collection.immutable._ + +object Test extends dotty.runtime.LegacyApp { + val res0 = TreeSet(1, 2, 3, 4, 5, 6) + val res1 = res0.map(x => x) + println(res0.toList == res1.toList) + println(res1.getClass) +} diff --git a/tests/pending/run/t2074_2.check b/tests/pending/run/t2074_2.check new file mode 100644 index 000000000000..0876ef7d034b --- /dev/null +++ b/tests/pending/run/t2074_2.check @@ -0,0 +1,3 @@ +SeqView(...) +SeqView(...) +SeqViewZ(...) diff --git a/tests/pending/run/t2074_2.scala b/tests/pending/run/t2074_2.scala new file mode 100644 index 000000000000..4624170f8961 --- /dev/null +++ b/tests/pending/run/t2074_2.scala @@ -0,0 +1,22 @@ +// replaced all occurrences of 'Vector' with 'IndexedSeq' +import scala.collection.immutable.IndexedSeq +import scala.collection.SeqView + +object Test { + val funWithCCE = List.range(1,11).view.patch(5, List(100,101), 2) + + val v = new SeqView[Int, IndexedSeq[Int]] { + def underlying = IndexedSeq(1,2,3) + def apply(idx: Int) = underlying(idx) + def length = underlying.length + def iterator = underlying.iterator + } + val w = IndexedSeq(1, 2, 3).view + + def main(args: Array[String]): Unit = { + println(v) + println(w) + println(go) + } + def go = v zip v +} diff --git a/tests/pending/run/t2075.scala b/tests/pending/run/t2075.scala new file mode 100644 index 000000000000..e81fb201c640 --- /dev/null +++ b/tests/pending/run/t2075.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + var tm = new scala.collection.immutable.TreeMap[Int,Int] + for (i <- 0 to 100) + tm = tm.insert(i, i) + + tm.keySet.filter(_ < 40) +} diff --git a/tests/pending/run/t2087-and-2400.scala b/tests/pending/run/t2087-and-2400.scala new file mode 100644 index 000000000000..19a5df26e301 --- /dev/null +++ b/tests/pending/run/t2087-and-2400.scala @@ -0,0 +1,20 @@ +object Test +{ + def negativeCharMaker = new (Short => Char) { def apply(x: Short) = x.toChar } + def main(args: Array[String]): Unit = { + // throws exception if -100 gets to Character.valueOf + val x = negativeCharMaker(-100) + + // chars are unsigned, they should never be equal to negative values + assert((-100).toShort != (-100).toChar) + assert((-100).toChar != (-100).toShort) + assert((-100).toChar != (-100).toByte) + assert((-100).toByte != (-100).toChar) + + // BoxesRunTime must agree as well + assert(((-100).toShort: Any) != (-100).toChar) + assert(((-100).toChar: Any) != (-100).toShort) + assert(((-100).toChar: Any) != (-100).toByte) + assert(((-100).toByte: Any) != (-100).toChar) + } +} diff --git a/tests/pending/run/t2106.check b/tests/pending/run/t2106.check new file mode 100644 index 000000000000..f8f625ff46fc --- /dev/null +++ b/tests/pending/run/t2106.check @@ -0,0 +1,6 @@ +t2106.scala:7: warning: Could not inline required method foo because access level required by callee not matched by caller. + def main(args: Array[String]): Unit = x.foo + ^ +t2106.scala:7: warning: At the end of the day, could not inline @inline-marked method foo + def main(args: Array[String]): Unit = x.foo + ^ diff --git a/tests/pending/run/t2106.flags b/tests/pending/run/t2106.flags new file mode 100644 index 000000000000..00d3643fd4a1 --- /dev/null +++ b/tests/pending/run/t2106.flags @@ -0,0 +1 @@ +-optimise -Yinline-warnings diff --git a/tests/pending/run/t2106.scala b/tests/pending/run/t2106.scala new file mode 100644 index 000000000000..55b89da80568 --- /dev/null +++ b/tests/pending/run/t2106.scala @@ -0,0 +1,8 @@ +class A extends Cloneable { + @inline final def foo = clone() +} + +object Test { + val x = new A + def main(args: Array[String]): Unit = x.foo +} diff --git a/tests/pending/run/t2111.check b/tests/pending/run/t2111.check new file mode 100644 index 000000000000..0fc64f38edbb --- /dev/null +++ b/tests/pending/run/t2111.check @@ -0,0 +1,6 @@ +Red +Green +Blue +Blue +Green +Red diff --git a/tests/pending/run/t2111.scala b/tests/pending/run/t2111.scala new file mode 100644 index 000000000000..4482b36c11d5 --- /dev/null +++ b/tests/pending/run/t2111.scala @@ -0,0 +1,20 @@ + +object Test extends dotty.runtime.LegacyApp { + + object Color extends Enumeration { + val Red, Green, Blue = Value + } + + class MyColor extends Enumeration { + val Red, Green, Blue = Value + } + + println(Color.Red) + println(Color.Green) + println(Color.Blue) + val col = new MyColor + println(col.Blue) + println(col.Green) + println(col.Red) + +} diff --git a/tests/pending/run/t2127.scala b/tests/pending/run/t2127.scala new file mode 100755 index 000000000000..d913ca1d1350 --- /dev/null +++ b/tests/pending/run/t2127.scala @@ -0,0 +1,32 @@ +// Seems to be fixed in trunk + +// As discussed here: http://www.nabble.com/Companion-object-constructor-visibility-td24342096.html + +//Simplified example: + + class Test private (val value : Int) + + abstract class Bar(val ctor : (Int) => Test) + + object Test extends Bar(new Test(_)) { //<--- ILLEGAL ACCESS + def main(args: Array[String]): Unit = {} + } + +//however the following is legal: +/* + class Foo private (val value : Int) + + abstract class Bar{ + + var ctor : (Int) => Foo + + } + + object Foo extends Bar{ + + ctor = new Foo(_) //<--- Legal access + + } + +The constructor invocation of Bar is done within the scope of object Foo's constructor, and therefor the private constructor of Foo should be visible and accessible. +*/ diff --git a/tests/pending/run/t2147.check b/tests/pending/run/t2147.check new file mode 100644 index 000000000000..47e320610e71 --- /dev/null +++ b/tests/pending/run/t2147.check @@ -0,0 +1,2 @@ +11 +11 diff --git a/tests/pending/run/t2147.scala b/tests/pending/run/t2147.scala new file mode 100644 index 000000000000..ff5b71feee98 --- /dev/null +++ b/tests/pending/run/t2147.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + val s: Seq[Int] = Stream.from(1) + val res0 = s.map(a => 2).head + val res1 = Stream.from(1).flatMap(a => List(1)).head + + println((for{a <- Stream.from(1); b <- 1 to 5; if a > 10} yield a).head) + println((for{a <- Stream.from(1); b <- 1 to a; if a > 10} yield a).head) +} diff --git a/tests/pending/run/t216.check b/tests/pending/run/t216.check new file mode 100644 index 000000000000..d86bac9de59a --- /dev/null +++ b/tests/pending/run/t216.check @@ -0,0 +1 @@ +OK diff --git a/tests/pending/run/t216.scala b/tests/pending/run/t216.scala new file mode 100644 index 000000000000..56efb450283f --- /dev/null +++ b/tests/pending/run/t216.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + object m { + val f = { x: Unit => () } + Console.println("OK") + } + m; +} diff --git a/tests/pending/run/t2162.check b/tests/pending/run/t2162.check new file mode 100644 index 000000000000..87729eb41a88 --- /dev/null +++ b/tests/pending/run/t2162.check @@ -0,0 +1,2 @@ +B.foo[Bar] +A.foo[Bar] diff --git a/tests/pending/run/t2162.scala b/tests/pending/run/t2162.scala new file mode 100644 index 000000000000..c2b6600eb3d1 --- /dev/null +++ b/tests/pending/run/t2162.scala @@ -0,0 +1,19 @@ +class Foo(x: Int) +class Bar extends Foo(1) + +trait A { + def foo[T <: Foo]: Unit +} +class B extends A { + def foo[Bar]: Unit = { println("B.foo[Bar]") } +} +object Test { + val x = new B + val y = new A { + def foo[Bar]: Unit = { println("A.foo[Bar]") } + } + def main(args: Array[String]): Unit = { + x.foo // ok + y.foo // java.lang.AssertionError: assertion failed (Erasure.scala:441 in r18338)) + } +} diff --git a/tests/pending/run/t2175.scala b/tests/pending/run/t2175.scala new file mode 100644 index 000000000000..7885882d3044 --- /dev/null +++ b/tests/pending/run/t2175.scala @@ -0,0 +1,20 @@ +case class Property[T](private var t: T) { + var beforeChanges: List[(T, T) => Unit] = Nil + var afterChanges: List[T => Unit] = Nil + def apply = t + def update(t2: T) = { + beforeChanges foreach (_(t, t2)) + t = t2 + afterChanges foreach (_(t2)) + } +} + +object Test +{ + def main(args: Array[String]): Unit = { + val x = Property(10) + x update 25 + assert(x.apply == 25) + } +} + diff --git a/tests/pending/run/t2176.check b/tests/pending/run/t2176.check new file mode 100644 index 000000000000..2298e8b6e914 --- /dev/null +++ b/tests/pending/run/t2176.check @@ -0,0 +1 @@ +Stream(1) diff --git a/tests/pending/run/t2176.scala b/tests/pending/run/t2176.scala new file mode 100644 index 000000000000..8e2c583f1df2 --- /dev/null +++ b/tests/pending/run/t2176.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val res0 = Stream.cons(1, Stream.cons( { println("ouch"); 2 }, Stream.empty)) + println(res0.take(1).force) +} diff --git a/tests/pending/run/t2177.check b/tests/pending/run/t2177.check new file mode 100644 index 000000000000..e56e15bb7ddb --- /dev/null +++ b/tests/pending/run/t2177.check @@ -0,0 +1 @@ +12345 diff --git a/tests/pending/run/t2177.scala b/tests/pending/run/t2177.scala new file mode 100644 index 000000000000..4485cfb8611f --- /dev/null +++ b/tests/pending/run/t2177.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Stream.from(1).take(5).mkString) +} diff --git a/tests/pending/run/t2212.check b/tests/pending/run/t2212.check new file mode 100644 index 000000000000..1465f1341aa2 --- /dev/null +++ b/tests/pending/run/t2212.check @@ -0,0 +1,4 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details +LinkedList(1) +LinkedList(1) +true diff --git a/tests/pending/run/t2212.scala b/tests/pending/run/t2212.scala new file mode 100644 index 000000000000..78fbfbe25590 --- /dev/null +++ b/tests/pending/run/t2212.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]): Unit = { + import collection.mutable._ + val x4 = LinkedList[Int](1) + println(x4) + val y4 = LinkedList[Int](1) + println(y4) + println(x4 equals y4) // or (y4 equals x4) + } +} diff --git a/tests/pending/run/t2236-new.scala b/tests/pending/run/t2236-new.scala new file mode 100644 index 000000000000..dc441318f8bb --- /dev/null +++ b/tests/pending/run/t2236-new.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ + +class T[A](implicit val m:TypeTag[A]) +class Foo +class Bar extends T[Foo] +object Test extends dotty.runtime.LegacyApp { + new Bar +} + +object EvidenceTest { + trait E[T] + trait A[T] { implicit val e: E[T] = null } + class B[T : E] extends A[T] { override val e = null } + + def f[T]: Unit = { + implicit val e: E[T] = null + new B[T]{} + } +} diff --git a/tests/pending/run/t2236-old.scala b/tests/pending/run/t2236-old.scala new file mode 100644 index 000000000000..aa28062059a6 --- /dev/null +++ b/tests/pending/run/t2236-old.scala @@ -0,0 +1,17 @@ +class T[A](implicit val m:Manifest[A]) +class Foo +class Bar extends T[Foo] +object Test extends dotty.runtime.LegacyApp { + new Bar +} + +object EvidenceTest { + trait E[T] + trait A[T] { implicit val e: E[T] = null } + class B[T : E] extends A[T] { override val e = null } + + def f[T]: Unit = { + implicit val e: E[T] = null + new B[T]{} + } +} diff --git a/tests/pending/run/t2241.scala b/tests/pending/run/t2241.scala new file mode 100644 index 000000000000..4801749f8bdb --- /dev/null +++ b/tests/pending/run/t2241.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + def f(a:Array[Int]) = a match { + case Array(1, _*) => "yes" + case _ => "no" + } + assert(f(null) == "no") +} diff --git a/tests/pending/run/t2250.scala b/tests/pending/run/t2250.scala new file mode 100644 index 000000000000..1ed333792ae9 --- /dev/null +++ b/tests/pending/run/t2250.scala @@ -0,0 +1,12 @@ +object Test { + def main(args: Array[String]): Unit = { + val a: Array[String] = "goobledy bing, goobledy bling, wikka wokka wup.".split("") + val b = java.util.Arrays.asList(a: _*) + java.util.Collections.shuffle(b) + + // we'll say rather unlikely a.sameElements(b) unless + // they are pointing to the same array + import scala.collection.JavaConversions._ + assert(a sameElements b) + } +} diff --git a/tests/pending/run/t2251.check b/tests/pending/run/t2251.check new file mode 100644 index 000000000000..55ad2a58571e --- /dev/null +++ b/tests/pending/run/t2251.check @@ -0,0 +1 @@ +Set(List(List(C), Stream(D, ?))) diff --git a/tests/pending/run/t2251.flags b/tests/pending/run/t2251.flags new file mode 100644 index 000000000000..19243266d108 --- /dev/null +++ b/tests/pending/run/t2251.flags @@ -0,0 +1 @@ +-Xstrict-inference \ No newline at end of file diff --git a/tests/pending/run/t2251.scala b/tests/pending/run/t2251.scala new file mode 100644 index 000000000000..00c5619b499a --- /dev/null +++ b/tests/pending/run/t2251.scala @@ -0,0 +1,19 @@ +class A +trait B[T <: B[T]] extends A +class C extends B[C] { override def toString = "C" } +class D extends B[D] { override def toString = "D" } + +class E { + val ys = List(List(new C), Stream(new D)) +} + +object Test { + def trav = List(List(), Stream()) + + def main(args: Array[String]): Unit = { + val f = (new E).ys _ + var xs: Set[List[_ <: Seq[B[_]]]] = Set() + xs += f() + println(xs) + } +} diff --git a/tests/pending/run/t2251b.check b/tests/pending/run/t2251b.check new file mode 100644 index 000000000000..4231fc6ea680 --- /dev/null +++ b/tests/pending/run/t2251b.check @@ -0,0 +1,11 @@ +TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with java.io.Serializable]] +TypeTag[List[scala.collection.immutable.Iterable[B[_ >: F with E with D with C <: B[_ >: F with E with D with C <: A]]] with F with Int => Any]] +TypeTag[List[scala.collection.immutable.Seq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]] +TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]] +TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]] +TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]] +TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] +TypeTag[List[scala.collection.Map[_ >: F with C <: B[_ >: F with C <: B[_ >: F with C <: A]], B[_ >: G with D <: B[_ >: G with D <: A]]]]] +TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with java.io.Serializable]] +TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] +TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] diff --git a/tests/pending/run/t2251b.flags b/tests/pending/run/t2251b.flags new file mode 100644 index 000000000000..19243266d108 --- /dev/null +++ b/tests/pending/run/t2251b.flags @@ -0,0 +1 @@ +-Xstrict-inference \ No newline at end of file diff --git a/tests/pending/run/t2251b.scala b/tests/pending/run/t2251b.scala new file mode 100644 index 000000000000..b67b3aec1eb3 --- /dev/null +++ b/tests/pending/run/t2251b.scala @@ -0,0 +1,48 @@ +class A +trait B[T <: B[T]] extends A +class B1[T <: B1[T]] extends B[T] +class C extends B[C] { override def toString = "C" } +class D extends B[D] { override def toString = "D" } +class E extends B[E] { override def toString = "E" } +class F extends B[F] { override def toString = "F" } +class G extends B1[G] { override def toString = "G" } + +object Test { + import scala.collection.{ mutable, immutable } + import scala.collection.immutable.{ Vector } + import scala.reflect.runtime.universe._ + def what[T: TypeTag](x: T) = println(typeTag[T]) + + def main(args: Array[String]): Unit = { + what(List(List(new C), Stream(new D))) + what(List(List(new C), Stream(new D), Vector(new E), Set(new F))) + what(List(immutable.Vector(new C), Stream(new D))) + what(List(collection.Set(new F), mutable.Set(new G))) + what(List(collection.Set(new F), immutable.Set(new G))) + what(List(mutable.Set(new F), immutable.Set(new G))) + what(List(mutable.Seq(new F), immutable.Seq(new G))) + what(List(mutable.Map(new C -> new D), immutable.Map(new F -> new G))) + what(List(mutable.MutableList(new F), immutable.List(new G))) + what(List(mutable.Seq(new F), collection.Seq(new G))) + what(List(mutable.LinearSeq(new F), collection.IndexedSeq(new G))) + } +} + + +// class D extends B[D] { override def toString = "D" } + + +// class E { +// val ys = List(List(new C), Stream(new D)) +// } + +// object Test { +// def trav = List(List(), Stream()) + +// def main(args: Array[String]): Unit = { +// val f = (new E).ys _ +// var xs: Set[List[_ <: Seq[B[_]]]] = Set() +// xs += f() +// println(xs) +// } +// } diff --git a/tests/pending/run/t2255.check b/tests/pending/run/t2255.check new file mode 100644 index 000000000000..dda391b36dff --- /dev/null +++ b/tests/pending/run/t2255.check @@ -0,0 +1 @@ +List(1, 2, 3, 1, 2, 3) diff --git a/tests/pending/run/t2255.scala b/tests/pending/run/t2255.scala new file mode 100644 index 000000000000..64dec8cae8a5 --- /dev/null +++ b/tests/pending/run/t2255.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Stream.continually(Stream(1, 2, 3)).flatten.take(6).toList) +} diff --git a/tests/pending/run/t2296c.check b/tests/pending/run/t2296c.check new file mode 100644 index 000000000000..076e9180a8a2 --- /dev/null +++ b/tests/pending/run/t2296c.check @@ -0,0 +1 @@ +RUNNING ACTION diff --git a/tests/pending/run/t2296c/Action.java b/tests/pending/run/t2296c/Action.java new file mode 100644 index 000000000000..4a6b69a5b8e2 --- /dev/null +++ b/tests/pending/run/t2296c/Action.java @@ -0,0 +1,21 @@ +package bug.action; + +import bug.Global; + +public abstract class Action { + protected Global m_glob; + + public Action(Global glob0) { + m_glob = glob0; + } + + public Action() { + this(null); + } + + public abstract void run(int v); + + public void setGlobal(Global g) { + m_glob = g; + } +} diff --git a/tests/pending/run/t2296c/Display.java b/tests/pending/run/t2296c/Display.java new file mode 100644 index 000000000000..7f7e6a73d034 --- /dev/null +++ b/tests/pending/run/t2296c/Display.java @@ -0,0 +1,9 @@ +package bug; + +public class Display { + protected Global m_glob; + + public void start() { + m_glob.runActions(); + } +} diff --git a/tests/pending/run/t2296c/Global.java b/tests/pending/run/t2296c/Global.java new file mode 100644 index 000000000000..7e5a762de2ba --- /dev/null +++ b/tests/pending/run/t2296c/Global.java @@ -0,0 +1,29 @@ +package bug; + +import bug.action.Action; +import java.util.List; +import java.util.LinkedList; + +public class Global { + public int items() { + return 0; + } + + public int items(int i) { + return i + ls.size(); + } + + private List ls = new LinkedList(); + + public void putAction(Action a) { + a.setGlobal(this); + ls.add(a); + } + + public void runActions() { + for (Action action: ls) { + System.out.println("RUNNING ACTION"); + action.run(0); + } + } +} diff --git a/tests/pending/run/t2296c/ScalaActivity.scala b/tests/pending/run/t2296c/ScalaActivity.scala new file mode 100644 index 000000000000..aa7648a944c2 --- /dev/null +++ b/tests/pending/run/t2296c/ScalaActivity.scala @@ -0,0 +1,18 @@ +package test + +import bug.Display +import bug.action.Action + +abstract class Outer extends Display { + + def init() { + m_glob.putAction(ScalaActivity) + } + + object ScalaActivity extends Action { + def run(v: Int) { + val testSet = List(1,2,3) + testSet.map(p => m_glob.items(p)) // crash with illegal access + } + } +} diff --git a/tests/pending/run/t2296c/Test.scala b/tests/pending/run/t2296c/Test.scala new file mode 100644 index 000000000000..1132bebebbd4 --- /dev/null +++ b/tests/pending/run/t2296c/Test.scala @@ -0,0 +1,15 @@ +package test + +import bug.Global + +object Test { + def main(args: Array[String]) { + val m = new Main() + m.init() + m.start() + } +} + +class Main extends Outer { + m_glob = new Global() +} diff --git a/tests/pending/run/t2296c/a.scala b/tests/pending/run/t2296c/a.scala new file mode 100644 index 000000000000..fae32f4ec422 --- /dev/null +++ b/tests/pending/run/t2296c/a.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + test.Test main args + } +} diff --git a/tests/pending/run/t2308a.check b/tests/pending/run/t2308a.check new file mode 100644 index 000000000000..888240c7027c --- /dev/null +++ b/tests/pending/run/t2308a.check @@ -0,0 +1 @@ +interface Test$T diff --git a/tests/pending/run/t2308a.scala b/tests/pending/run/t2308a.scala new file mode 100644 index 000000000000..d1144db37d17 --- /dev/null +++ b/tests/pending/run/t2308a.scala @@ -0,0 +1,9 @@ + +import scala.language.{ higherKinds } +object Test { + trait T[M[_]] + + def f1 = classOf[T[X] forSome { type X[_] } ] + + def main(args: Array[String]): Unit = println(f1) +} diff --git a/tests/pending/run/t2316_run.scala b/tests/pending/run/t2316_run.scala new file mode 100644 index 000000000000..a2adad415fa0 --- /dev/null +++ b/tests/pending/run/t2316_run.scala @@ -0,0 +1,32 @@ +case class T1(source: String) + +object T1 { + implicit def T1FromT2(implicit t2: T2): T1 = new T1(t2.source) +} + +case class T2(source: String) + +object A { + def requireT1(implicit t1: T1) = t1 + + object B1 { + implicit val t2_b1: T2 = new T2("from B1") + requireT1 + } + + object B2 { + def t1 = { + implicit val t2_b2: T2 = new T2("from B2") + // Implicits.cacheResult returns T1.T1FromT2(t2_b1) here, which is bogus. Even though T1.T1FromT2 was found + // outside of the scope of A.B1, this implicit expression should _not_ be cached, as it includes the bound + // variable t2_b1 from this scope. + requireT1 + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + assert(A.B2.t1.source == "from B2") + } +} diff --git a/tests/pending/run/t2318.check b/tests/pending/run/t2318.check new file mode 100644 index 000000000000..a486f1ac4719 --- /dev/null +++ b/tests/pending/run/t2318.check @@ -0,0 +1,2 @@ +bar +bar diff --git a/tests/pending/run/t2318.scala b/tests/pending/run/t2318.scala new file mode 100644 index 000000000000..90059799e2d5 --- /dev/null +++ b/tests/pending/run/t2318.scala @@ -0,0 +1,41 @@ +import java.security._ + +import scala.language.{ reflectiveCalls } + +object Test { + trait Bar { def bar: Unit } + + object Mgr extends SecurityManager { + override def checkPermission(perm: Permission) = perm match { + case _: java.lang.RuntimePermission => () + case _: java.io.FilePermission => () + case x: java.security.SecurityPermission if x.getName contains ".networkaddress." => () // generality ftw + case x: java.util.PropertyPermission if x.getName == "sun.net.inetaddr.ttl" => () + case _ => super.checkPermission(perm) + } + } + + def t1() = { + val p = Runtime.getRuntime().exec("ls"); + type Destroyable = { def destroy() : Unit } + def doDestroy( obj : Destroyable ) : Unit = obj.destroy(); + doDestroy( p ); + } + def t2() = { + System.setSecurityManager(Mgr) + + val b = new Bar { def bar = println("bar") } + b.bar + + val structural = b.asInstanceOf[{ def bar: Unit }] + structural.bar + } + + def main(args: Array[String]): Unit = { + // figuring this will otherwise break on windows + try t1() + catch { case _: java.io.IOException => () } + + t2() + } +} diff --git a/tests/pending/run/t2333.scala b/tests/pending/run/t2333.scala new file mode 100644 index 000000000000..de405a8edc2a --- /dev/null +++ b/tests/pending/run/t2333.scala @@ -0,0 +1,16 @@ +class A { + def whatever(): Unit = { + lazy val a = 1 + lazy val b = try { 2 } catch { case _: Throwable => 0 } + a + b + + } +} + +object Test { + def main(a: Array[String]): Unit = { + val a = new A + a.whatever + } +} diff --git a/tests/pending/run/t2337.check b/tests/pending/run/t2337.check new file mode 100644 index 000000000000..18f1f66fc371 --- /dev/null +++ b/tests/pending/run/t2337.check @@ -0,0 +1,4 @@ +(Both Int,-1,-1) +(Both Float,1,1) +(Float then Int,0,0) +(Int then Float,0,0) diff --git a/tests/pending/run/t2337.scala b/tests/pending/run/t2337.scala new file mode 100644 index 000000000000..edb574cba4de --- /dev/null +++ b/tests/pending/run/t2337.scala @@ -0,0 +1,21 @@ + +object Test { + + def compare(first: Any, second: Any): Any = { + (first, second) match { + case (k: Int, o: Int) => k compare o + //why the next case matches (Float, Int) but does not match (Int, Float) ??? + case (k: Number, o: Number) => k.doubleValue() compare o.doubleValue() + case _ => "BOGON" + // throw new Exception("Unsupported compare " + first + "; " + second) + } + } + + def main(args: Array[String]): Unit = { + println("Both Int", -1, compare(0, 1)) + println("Both Float", 1, compare(1.0, 0.0)) + println("Float then Int", 0, compare(10.0, 10)) + println("Int then Float", 0, compare(10, 10.0)) //this fails with an exception + } +} + diff --git a/tests/pending/run/t2378.scala b/tests/pending/run/t2378.scala new file mode 100644 index 000000000000..f696a78b4cdd --- /dev/null +++ b/tests/pending/run/t2378.scala @@ -0,0 +1,9 @@ +object Test +{ + val f1 = -0.0 + val f2 = -(0.0) + def main(args: Array[String]): Unit = { + assert(f1.toString startsWith "-") + assert(f2.toString startsWith "-") + } +} diff --git a/tests/pending/run/t2386-new.check b/tests/pending/run/t2386-new.check new file mode 100644 index 000000000000..8ed0ffd7d8c3 --- /dev/null +++ b/tests/pending/run/t2386-new.check @@ -0,0 +1,2 @@ +a(0) = Array(1, 2) +a(1) = Array("a", "b") diff --git a/tests/pending/run/t2386-new.scala b/tests/pending/run/t2386-new.scala new file mode 100644 index 000000000000..8edefaada540 --- /dev/null +++ b/tests/pending/run/t2386-new.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val a = Array(Array(1, 2), Array("a","b")) + println("a(0) = Array(" + (a(0) mkString ", ") + ")") + println("a(1) = Array(" + (a(1) map (s => "\"" + s + "\"") mkString ", ") + ")") +} diff --git a/tests/pending/run/t2417.check b/tests/pending/run/t2417.check new file mode 100644 index 000000000000..36c954be24b1 --- /dev/null +++ b/tests/pending/run/t2417.check @@ -0,0 +1,12 @@ +testing small Map that doesn't promote to HashMap... + +testing single-threaded HashMap use... + +testing HashMap.size from multiple threads... + +testing small Set that doesn't promote to HashSet... + +testing single-threaded HashSet use... + +testing HashSet.size from multiple threads... + diff --git a/tests/pending/run/t2417.scala b/tests/pending/run/t2417.scala new file mode 100644 index 000000000000..80105f72b53c --- /dev/null +++ b/tests/pending/run/t2417.scala @@ -0,0 +1,77 @@ +// #2417 +object Test { + + def parallel(numThreads: Int)(block: => Unit): Unit = { + var failure: Throwable = null + val threads = Array.tabulate(numThreads)(i => new Thread { + override def run: Unit = { + try { + block + } catch { + case x: Throwable => failure = x + } + } + }) + for (t <- threads) t.start + for (t <- threads) t.join + if (failure != null) println("FAILURE: " + failure) + } + + def testSet(initialSize: Int, numThreads: Int, passes: Int): Unit = { + val orig = Set.empty ++ (1 to initialSize) + parallel(numThreads) { + for (pass <- 0 until passes) { + var s = orig + for (e <- (initialSize to 1 by -1)) { + s -= e + val obs = s.size + if (obs != e - 1) { + throw new Exception("removed e=" + e + ", size was " + obs + ", s=" + s) + } + } + } + } + } + + def testMap(initialSize: Int, numThreads: Int, passes: Int): Unit = { + val orig = Map.empty ++ ((1 to initialSize) map ((_,"v"))) + parallel(numThreads) { + for (pass <- 0 until passes) { + var m = orig + for (e <- (initialSize to 1 by -1)) { + m -= e + val obs = m.size + if (obs != e - 1) { + throw new Exception("removed e=" + e + ", size was " + obs + ", m=" + m) + } + } + } + } + } + + def main(args: Array[String]): Unit = { + println("testing small Map that doesn't promote to HashMap...") + testMap(4, 2, 1000000) + println() + + println("testing single-threaded HashMap use...") + testMap(5, 1, 1000000) + println() + + println("testing HashMap.size from multiple threads...") + testMap(5, 2, 1000000) + println() + + println("testing small Set that doesn't promote to HashSet...") + testSet(4, 2, 1000000) + println() + + println("testing single-threaded HashSet use...") + testSet(5, 1, 1000000) + println() + + println("testing HashSet.size from multiple threads...") + testSet(5, 2, 1000000) + println() + } +} diff --git a/tests/pending/run/t2418.check b/tests/pending/run/t2418.check new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/tests/pending/run/t2418.check @@ -0,0 +1 @@ +10 diff --git a/tests/pending/run/t2418.scala b/tests/pending/run/t2418.scala new file mode 100644 index 000000000000..f330bef60a1f --- /dev/null +++ b/tests/pending/run/t2418.scala @@ -0,0 +1,10 @@ +class Foo { + @volatile final var x=10 + override def toString = "" + x +} + +object Test { + def main(args: Array[String]): Unit = { + println((new Foo)) + } +} diff --git a/tests/pending/run/t2446.check b/tests/pending/run/t2446.check new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/tests/pending/run/t2446.check @@ -0,0 +1 @@ +3 diff --git a/tests/pending/run/t2446.scala b/tests/pending/run/t2446.scala new file mode 100644 index 000000000000..29494ab3e732 --- /dev/null +++ b/tests/pending/run/t2446.scala @@ -0,0 +1,9 @@ +object Test { + def main(args : Array[String]) : Unit = { + val arr = new Array[Int](10000) + arr(5000) = 1 + arr (9000) = 2 + val sum = arr.reduceRight(_ + _) + println(sum) + } +} diff --git a/tests/pending/run/t2464/Annotated.java b/tests/pending/run/t2464/Annotated.java new file mode 100644 index 000000000000..d022f9852c37 --- /dev/null +++ b/tests/pending/run/t2464/Annotated.java @@ -0,0 +1,5 @@ +package test; + +@Connect(loadStyle = Connect.LoadStyle.EAGER) +public class Annotated { +} diff --git a/tests/pending/run/t2464/Connect.java b/tests/pending/run/t2464/Connect.java new file mode 100644 index 000000000000..59349f94c842 --- /dev/null +++ b/tests/pending/run/t2464/Connect.java @@ -0,0 +1,20 @@ +package test; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Connect { + + LoadStyle loadStyle() default LoadStyle.EAGER; + + public enum LoadStyle { + EAGER, + DEFERRED, + LAZY + } +} diff --git a/tests/pending/run/t2464/Test.scala b/tests/pending/run/t2464/Test.scala new file mode 100644 index 000000000000..90e1a03c174a --- /dev/null +++ b/tests/pending/run/t2464/Test.scala @@ -0,0 +1,35 @@ +import scala.reflect.io.Streamable +import scala.tools.asm.{ClassWriter, ClassReader} +import scala.tools.asm.tree.ClassNode +import scala.tools.partest._ +import scala.tools.partest.BytecodeTest.modifyClassFile +import java.io.{FileOutputStream, FileInputStream, File} + +object Test extends DirectTest { + 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 = """ + object O { + new test.Annotated + } + """ + + def show(): Unit = { + compileCode(app) + modifyClassFile(new File(testOutput.toFile, "test/Annotated.class")) { + (cn: ClassNode) => + // As investigated https://issues.scala-lang.org/browse/SI-2464?focusedCommentId=64521&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-64521 + // classfiles in the wild sometimes lack the required InnerClass attribute for nested enums that + // are referenced in an annotation. I don't know what compiler or bytecode processor leaves things + // that way, but this test makes sure we don't crash. + cn.innerClasses.clear() + cn + } + compileCode(app) + } +} diff --git a/tests/pending/run/t2488.check b/tests/pending/run/t2488.check new file mode 100644 index 000000000000..1af4bf8965c0 --- /dev/null +++ b/tests/pending/run/t2488.check @@ -0,0 +1,4 @@ +1 +1 +1 +2 diff --git a/tests/pending/run/t2488.scala b/tests/pending/run/t2488.scala new file mode 100644 index 000000000000..c4cd0f60c1d8 --- /dev/null +++ b/tests/pending/run/t2488.scala @@ -0,0 +1,11 @@ +class C { + def f(a:Int, b:Int) = 1 + def f() = 2 +} +object Test extends dotty.runtime.LegacyApp { + val c = new C() + println(c.f(a = 1,2)) + println(c.f(a = 1, b = 2)) + println(c.f(b = 2, a = 1)) + println(c.f()) +} diff --git a/tests/pending/run/t2503.scala b/tests/pending/run/t2503.scala new file mode 100755 index 000000000000..d0983f2ca20e --- /dev/null +++ b/tests/pending/run/t2503.scala @@ -0,0 +1,19 @@ +import scala.collection.mutable._ + +trait SB[A] extends Buffer[A] { + + import collection.Traversable + + abstract override def insertAll(n: Int, iter: Traversable[A]): Unit = synchronized { + super.insertAll(n, iter) + } + + abstract override def update(n: Int, newelem: A): Unit = synchronized { + super.update(n, newelem) + } +} + +object Test extends dotty.runtime.LegacyApp { + new ArrayBuffer[Int] with SB[Int] +} + diff --git a/tests/pending/run/t2512.scala b/tests/pending/run/t2512.scala new file mode 100644 index 000000000000..8166839a9abd --- /dev/null +++ b/tests/pending/run/t2512.scala @@ -0,0 +1,13 @@ +import scala.tools.nsc.util.HashSet + +object Test { + val runs = 10000 + class Bop + + def main(args: Array[String]): Unit = { + val set: HashSet[Bop] = HashSet("Bop", 16) + (1 to runs).toList foreach (_ => set addEntry new Bop) + + assert(runs == set.size && set.size == set.iterator.length) + } +} diff --git a/tests/pending/run/t2514.scala b/tests/pending/run/t2514.scala new file mode 100644 index 000000000000..89ee0b86e08f --- /dev/null +++ b/tests/pending/run/t2514.scala @@ -0,0 +1,19 @@ + + +import scala.language.{ implicitConversions, postfixOps, reflectiveCalls } + +object Test +{ + implicit def x[A](a: A): AnyRef{def xx: A} = new { def xx = a } + + def main(args: Array[String]): Unit = { + val r1 = 12 xx; + val r2 = 12.xx + val r3 = 12.`xx` + val r4 = 12.xx + 12.xx + val r5 = 12.`xx` + 12.xx + val r6 = 12.3.`xx` + 12.xx + + assert(r5 == 24) + } +} diff --git a/tests/pending/run/t2524.scala b/tests/pending/run/t2524.scala new file mode 100644 index 000000000000..e806b8c3518b --- /dev/null +++ b/tests/pending/run/t2524.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]): Unit = { + val m = new collection.mutable.HashMap[String, String] { + override def initialSize = 0 + } + m.toString + m("key") = "value" + assert(m("key") == "value") + } +} diff --git a/tests/pending/run/t2526.scala b/tests/pending/run/t2526.scala new file mode 100644 index 000000000000..4d567bbbf44a --- /dev/null +++ b/tests/pending/run/t2526.scala @@ -0,0 +1,53 @@ +/** + * Checks that various foreach methods overridden in mutable.HashMap as part of ticket #2526 + * still work correctly. + */ +object Test { + import collection._ + + def main(args: Array[String]): Unit = { + val m = new mutable.HashMap[String, String] + + /* Use non hash-based structure for verification */ + val keys = List("a", "b", "c", "d", "e") + val valueSuffix = "value" + val values = keys.map(_ + valueSuffix) + val entries = keys.zip(values) + + for (k <- keys) m(k) = k + valueSuffix + + assertForeach(keys, m.keySet.iterator) + assertForeach(keys, m.keysIterator) + assertForeach(keys, m.keySet) + + assertForeach(values, m.values.iterator) + assertForeach(values, m.valuesIterator) + + assertForeach(entries, m) + } + + /* Checks foreach of `actual` goes over all the elements in `expected` */ + private def assertForeach[E](expected: Traversable[E], actual: Iterator[E]): Unit = { + val notYetFound = new mutable.ArrayBuffer[E]() ++= expected + actual.foreach { e => + assert(notYetFound.contains(e)) + notYetFound -= e + } + assert(notYetFound.size == 0, "mutable.HashMap.foreach should have iterated over: " + notYetFound) + } + + /* + * Checks foreach of `actual` goes over all the elements in `expected` + * We duplicate the method above because there is no common inteface between Traversable and + * Iterator and we want to avoid converting between collections to ensure that we test what + * we mean to test. + */ + private def assertForeach[E](expected: Traversable[E], actual: Traversable[E]): Unit = { + val notYetFound = new mutable.ArrayBuffer[E]() ++= expected + actual.foreach { e => + assert(notYetFound.contains(e)) + notYetFound -= e + } + assert(notYetFound.size == 0, "mutable.HashMap.foreach should have iterated over: " + notYetFound) + } +} diff --git a/tests/pending/run/t2544.check b/tests/pending/run/t2544.check new file mode 100644 index 000000000000..d19538dca3a9 --- /dev/null +++ b/tests/pending/run/t2544.check @@ -0,0 +1,10 @@ +2 +2 +3 +3 +-1 +-1 +1 +1 +0 +0 diff --git a/tests/pending/run/t2544.scala b/tests/pending/run/t2544.scala new file mode 100644 index 000000000000..6bee2f108230 --- /dev/null +++ b/tests/pending/run/t2544.scala @@ -0,0 +1,25 @@ +object Test { + object Foo extends Seq[Int] { + def apply(i: Int) = i + def length = 5 + def iterator = Iterator(0,1,2,3,4) + } + def lengthEquiv(result: Int) = println( + if (result < 0) -1 + else if (result == 0) 0 + else 1 + ) + + def main(args: Array[String]) = { + println(Foo indexWhere(_ >= 2,1)) + println(Foo.toList indexWhere(_ >= 2,1)) + println(Foo segmentLength(_ <= 3,1)) + println(Foo.toList segmentLength(_ <= 3,1)) + lengthEquiv(Foo lengthCompare 7) + lengthEquiv(Foo.toList lengthCompare 7) + lengthEquiv(Foo lengthCompare 2) + lengthEquiv(Foo.toList lengthCompare 2) + lengthEquiv(Foo lengthCompare 5) + lengthEquiv(Foo.toList lengthCompare 5) + } +} diff --git a/tests/pending/run/t2552.check b/tests/pending/run/t2552.check new file mode 100644 index 000000000000..1deeae772fe4 --- /dev/null +++ b/tests/pending/run/t2552.check @@ -0,0 +1,48 @@ +p(0) +0 +p(1) +1 +p(2) +2 +p(3) +3 +p(4) +4 +p(5) +5 +p(6) +6 +p(7) +7 +p(8) +8 +p(9) +9 +p(10) +p(0) +true +true +0 +p(1) +true +1 +p(2) +false +false +p(0) +true +true +0 +p(1) +p(2) +2 +p(3) +p(4) +4 +p(5) +p(6) +6 +p(7) +p(8) +8 +p(9) diff --git a/tests/pending/run/t2552.scala b/tests/pending/run/t2552.scala new file mode 100644 index 000000000000..27a6606cab80 --- /dev/null +++ b/tests/pending/run/t2552.scala @@ -0,0 +1,34 @@ +object Test extends dotty.runtime.LegacyApp { + def testTakeWhile = { + val numbers = Iterator.range(0, 50) + val zeroTo9 = numbers.takeWhile(x => { println("p(" + x + ")"); x < 10 } ) + + zeroTo9.foreach(println _) + + val zeroTo1 = Iterator.range(0, 20).takeWhile(x => { println("p(" + x + ")"); x < 2 } ) + + println(zeroTo1.hasNext) + println(zeroTo1.hasNext) + println(zeroTo1.next) + println(zeroTo1.hasNext) + println(zeroTo1.next) + println(zeroTo1.hasNext) + println(zeroTo1.hasNext) + } + + def testFilter = { + val predicate = (x: Int) => { println("p(" + x + ")"); x % 2 == 0 } + + val evens = Iterator.range(0, 10).filter(predicate) + + println(evens.hasNext) + println(evens.hasNext) + println(evens.next) + + evens.foreach(println _) + } + + testTakeWhile + testFilter +} + diff --git a/tests/pending/run/t2577.check b/tests/pending/run/t2577.check new file mode 100644 index 000000000000..4a584e498926 --- /dev/null +++ b/tests/pending/run/t2577.check @@ -0,0 +1 @@ +Nothing diff --git a/tests/pending/run/t2577.scala b/tests/pending/run/t2577.scala new file mode 100644 index 000000000000..6d836a3996ab --- /dev/null +++ b/tests/pending/run/t2577.scala @@ -0,0 +1,17 @@ +case class annot[T]() extends scala.annotation.StaticAnnotation + +// type inference should infer @annot[Nothing] instead of @annot[T] +// note the T is not in scope here! +class Foo[@annot U] + +object Test { + import scala.reflect.runtime.universe._ + val x = new Foo + + def main(args: Array[String]): Unit = { + val targ = typeOf[x.type].widen match { + case TypeRef(_, _, arg :: _) => arg + } + println(targ) + } +} diff --git a/tests/pending/run/t2594_tcpoly.scala b/tests/pending/run/t2594_tcpoly.scala new file mode 100644 index 000000000000..789833bc003f --- /dev/null +++ b/tests/pending/run/t2594_tcpoly.scala @@ -0,0 +1,21 @@ + +import scala.language.{ higherKinds } + +trait Monad[M[_]] { + def foo[A](a: M[A]): M[A] +} + +class Bar[A, B] +class Bar1[A] { type And[B] = Bar[A, B] } + +object Test { + // the combination of partial applications and anonymous class is essential to reproduce the bug + // problem: missing bridge method + // --> abstractmethoderror `Main$$anon$1.foo(Ljava/lang/Object;)Ljava/lang/Object;` + // the anonymous class only gets `public Bar foo(Bar a)` + def BarMonad[X] = new Monad[Bar1[X]#And] { + def foo[A](a: Bar[X, A]) = a + } + + def main(as: Array[String]): Unit = { BarMonad[Int] foo (new Bar[Int, Int]) } +} diff --git a/tests/pending/run/t261.check b/tests/pending/run/t261.check new file mode 100644 index 000000000000..35d242ba79ae --- /dev/null +++ b/tests/pending/run/t261.check @@ -0,0 +1,2 @@ +A +B diff --git a/tests/pending/run/t261.scala b/tests/pending/run/t261.scala new file mode 100644 index 000000000000..4e1aa9ff990e --- /dev/null +++ b/tests/pending/run/t261.scala @@ -0,0 +1,11 @@ +trait A { val foo: String = "A" } +trait B { + private val foo: String = "B" + def f = println(foo) +} +object Test extends A with B { + def main(args: Array[String]) = { + println(foo) + f + } +} diff --git a/tests/pending/run/t2636.scala b/tests/pending/run/t2636.scala new file mode 100644 index 000000000000..2f55c8ad5a69 --- /dev/null +++ b/tests/pending/run/t2636.scala @@ -0,0 +1,38 @@ + +import scala.language.{ reflectiveCalls } + +object Test +{ + type Foo = { def update(x: Int, value: String): Unit } + type Foo2 = { def update(x: Int, value: String): Int } + type Foo3 = { def update(x: Int, value: String): Array[Int] } + + def alen() = { + type L1 = { def length: Int } + def len(p: L1) = p.length + val x: L1 = Array(1,2,3) + len(x) + } + + type A1 = { def apply(x: Int): String } + def arrApply(a: A1, x: Int) = a(x) + + def main(args: Array[String]): Unit = { + val arr = new Array[String](3) + val p1: Foo = arr + def a1 = p1(0) = "b" + + val p2: Foo2 = new { def update(x: Int, value: String) = { p1(1) = "o" ; 1 } } + def a2 = p2(0) = "c" + + val p3: Foo3 = new { def update(x: Int, value: String) = { p1(2) = "b" ; Array(1) } } + def a3 = p3(10) = "hi mom" + + a1 ; a2 ; a3 ; + + assert(arr.mkString == "bob") + assert(alen() == 3) + assert(arrApply(arr, 1) == "o") + assert(arrApply(new { def apply(x: Int) = "tom" }, -100) == "tom") + } +} diff --git a/tests/pending/run/t266.scala b/tests/pending/run/t266.scala new file mode 100644 index 000000000000..ea5f63c29314 --- /dev/null +++ b/tests/pending/run/t266.scala @@ -0,0 +1,23 @@ +// #266, yee ha + +trait O { + self: Test.type => + + Nil foreach identity + + def f = (1 to 10).toList map identity +} + +object Test extends O { + def main(args: Array[String]): Unit = { + assert(f.sum == 55) + } +} + +// Don't lose this part, it's what (formerly) crashes. +// For some reason the one actually mixed in does not. +object Pip + +trait P { self: Pip.type => + Nil foreach identity +} diff --git a/tests/pending/run/t2754.scala b/tests/pending/run/t2754.scala new file mode 100644 index 000000000000..8817b62c7808 --- /dev/null +++ b/tests/pending/run/t2754.scala @@ -0,0 +1,39 @@ +object Test { + def main(args: Array[String]): Unit = { + val v: FooBarPlus[Int] = new FooBarPlusImpl() + v.foo += 10 + } +} + +trait Foo[P] { + def foo: P +} + +trait FooBar[P] extends Foo[P] { + def bar: P +} + +trait FooBarPlus[P] extends FooBar[P] { + override def foo: P + override def bar: P + + def foo_=(x: P): Unit + def bar_=(x: P): Unit +} + +class FooImpl extends Foo[Int] { + def foo = 1 +} + +class FooBarImpl extends FooImpl with FooBar[Int] { + protected var f = 0 + protected var b = 0 + + override def foo = f + def bar = b +} + +class FooBarPlusImpl extends FooBarImpl with FooBarPlus[Int] { + def foo_=(x: Int): Unit = { f = x } + def bar_=(x: Int): Unit = { b = x } +} diff --git a/tests/pending/run/t2755.check b/tests/pending/run/t2755.check new file mode 100644 index 000000000000..4905c0052ddd --- /dev/null +++ b/tests/pending/run/t2755.check @@ -0,0 +1,21 @@ +1 +2 +3 +4 +5 +6 +7 +1 +2 +3 +4 +5 +6 +7 +1 +2 +3 +4 +5 +6 +7 diff --git a/tests/pending/run/t2755.scala b/tests/pending/run/t2755.scala new file mode 100644 index 000000000000..8d10b567346b --- /dev/null +++ b/tests/pending/run/t2755.scala @@ -0,0 +1,58 @@ +// Test cases: the only place we can cut and paste without crying +// ourself to sleep. +object Test { + def f1(a: Any) = a match { + case x: Array[Int] => x(0) + case x: Array[Double] => 2 + case x: Array[Float] => x.sum.toInt + case x: Array[String] => x.size + case x: Array[AnyRef] => 5 + case x: Array[_] => 6 + case _ => 7 + } + def f2(a: Array[_]) = a match { + case x: Array[Int] => x(0) + case x: Array[Double] => 2 + case x: Array[Float] => x.sum.toInt + case x: Array[String] => x.size + case x: Array[AnyRef] => 5 + case x: Array[_] => 6 + case _ => 7 + } + def f3[T](a: Array[T]) = a match { + case x: Array[Int] => x(0) + case x: Array[Double] => 2 + case x: Array[Float] => x.sum.toInt + case x: Array[String] => x.size + case x: Array[AnyRef] => 5 + case x: Array[_] => 6 + case _ => 7 + } + + + def main(args: Array[String]): Unit = { + println(f1(Array(1, 2, 3))) + println(f1(Array(1.0, -2.0, 3.0, 1.0))) + println(f1(Array(1.0f, 2.0f, 3.0f, -3.0f))) + println(f1((1 to 4).toArray map (_.toString))) + println(f1(new Array[Any](10))) // should match as Array[AnyRef] + println(f1(Array(1L))) + println(f1(null)) + + println(f2(Array(1, 2, 3))) + println(f2(Array(1.0, -2.0, 3.0, 1.0))) + println(f2(Array(1.0f, 2.0f, 3.0f, -3.0f))) + println(f2((1 to 4).toArray map (_.toString))) + println(f2(new Array[Any](10))) // should match as Array[AnyRef] + println(f2(Array(1L))) + println(f2(null)) + + println(f3(Array(1, 2, 3))) + println(f3(Array(1.0, -2.0, 3.0, 1.0))) + println(f3(Array(1.0f, 2.0f, 3.0f, -3.0f))) + println(f3((1 to 4).toArray map (_.toString))) + println(f3(new Array[Any](10))) // should match as Array[AnyRef] + println(f3(Array(1L))) + println(f3(null)) + } +} diff --git a/tests/pending/run/t2788.check b/tests/pending/run/t2788.check new file mode 100644 index 000000000000..684f5f616c07 --- /dev/null +++ b/tests/pending/run/t2788.check @@ -0,0 +1 @@ +List(1, 2) \ No newline at end of file diff --git a/tests/pending/run/t2788.scala b/tests/pending/run/t2788.scala new file mode 100644 index 000000000000..61344029dfe1 --- /dev/null +++ b/tests/pending/run/t2788.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Array(Some(1), None, Some(2)).flatten.toList) +} diff --git a/tests/pending/run/t2800.check b/tests/pending/run/t2800.check new file mode 100644 index 000000000000..546ee5241304 --- /dev/null +++ b/tests/pending/run/t2800.check @@ -0,0 +1,14 @@ +false +false +List() +false +false +false +false +Vector(1) +false +false +true +false +false +false diff --git a/tests/pending/run/t2800.scala b/tests/pending/run/t2800.scala new file mode 100644 index 000000000000..0d289384294a --- /dev/null +++ b/tests/pending/run/t2800.scala @@ -0,0 +1,36 @@ +object Test { + def f1 = ("": Any) match { case List(x : _*) => x ; case _ => false } + def f2 = (5: Any) match { case List(x : _*) => x ; case _ => false } + def f3 = (Nil: Any) match { case List(x : _*) => x ; case _ => false } + def f4 = (Array(1): Any) match { case List(x : _*) => x ; case _ => false } + + def f5 = ("": Any) match { case Array(x : _*) => x ; case _ => false } + def f6 = (5: Any) match { case Array(x : _*) => x ; case _ => false } + def f7 = (Nil: Any) match { case Array(x : _*) => x ; case _ => false } + def f8 = (Array(1): Any) match { case Array(x : _*) => x ; case _ => false } + + def f9 = ("": Any) match { case x @ List(_*) => x ; case _ => false } + def f10 = ("": Any) match { case List(_*) => true ; case _ => false } + def f11 = (Nil: Any) match { case List(_*) => true ; case _ => false } + def f12 = ("": Any) match { case x @ Array(_*) => x ; case _ => false } + def f13 = ("": Any) match { case Array(_*) => true ; case _ => false } + def f14 = (Nil: Any) match { case Array(_*) => true ; case _ => false } + + + def main(args: Array[String]): Unit = { + println(f1) + println(f2) + println(f3) + println(f4) + println(f5) + println(f6) + println(f7) + println(f8) + println(f9) + println(f10) + println(f11) + println(f12) + println(f13) + println(f14) + } +} diff --git a/tests/pending/run/t2813.2.scala b/tests/pending/run/t2813.2.scala new file mode 100644 index 000000000000..d228eed90c21 --- /dev/null +++ b/tests/pending/run/t2813.2.scala @@ -0,0 +1,39 @@ +import java.util.LinkedList +import collection.JavaConversions._ + +object Test extends dotty.runtime.LegacyApp { + def assertListEquals[A](expected: List[A], actual: Seq[A]): Unit = { + assert(expected.sameElements(actual), + "Expected list to contain " + expected.mkString("[", ", ", "]") + + ", but was " + actual.mkString("[", ", ", "]")) + } + + def addAllOfNonCollectionWrapperAtZeroOnEmptyLinkedList(): Unit = { + val l = new LinkedList[Int] + l.addAll(0, List(1, 2)) + assertListEquals(List(1, 2), l) + } + + def addAllOfNonCollectionWrapperAtZeroOnLinkedList(): Unit = { + val l = new LinkedList[Int] += 1 += 2 + l.addAll(0, List(10, 11)) + assertListEquals((List(10, 11, 1, 2)), l) + } + + def addAllOfCollectionWrapperAtZeroOnLinkedList(): Unit = { + val l = new LinkedList[Int] += 1 += 2 + l.addAll(0, new LinkedList[Int] += 10 += 11) + assertListEquals((List(10, 11, 1, 2)), l) + } + + def addAllOfCollectionWrapperAtZeroOnEmptyLinkedList(): Unit = { + val l = new LinkedList[Int] + l.addAll(0, new LinkedList[Int] += 10 += 11) + assertListEquals((List(10, 11)), l) + } + + addAllOfNonCollectionWrapperAtZeroOnEmptyLinkedList + addAllOfNonCollectionWrapperAtZeroOnLinkedList + addAllOfCollectionWrapperAtZeroOnEmptyLinkedList + addAllOfCollectionWrapperAtZeroOnLinkedList +} diff --git a/tests/pending/run/t2818.check b/tests/pending/run/t2818.check new file mode 100644 index 000000000000..31286c990b2e --- /dev/null +++ b/tests/pending/run/t2818.check @@ -0,0 +1,4 @@ +105 +499999500000 +0 +1 diff --git a/tests/pending/run/t2818.scala b/tests/pending/run/t2818.scala new file mode 100644 index 000000000000..7829b0251186 --- /dev/null +++ b/tests/pending/run/t2818.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println((List.range(1L, 15L) :\ 0L) (_ + _)) + println((List.range(1L, 1000000L) :\ 0L) (_ + _)) + println((List.fill(5)(1) :\ 1) (_ - _)) + println((List.fill(1000000)(1) :\ 1) (_ - _)) +} diff --git a/tests/pending/run/t2849.scala b/tests/pending/run/t2849.scala new file mode 100644 index 000000000000..bfc2135dabcc --- /dev/null +++ b/tests/pending/run/t2849.scala @@ -0,0 +1,48 @@ +import scala.collection.immutable.SortedSet +import scala.collection.immutable.TreeSet + +object Test { + + def main(args: Array[String]): Unit = { + ticketExample + similarExample + } + + //def freeMBytes = Runtime.getRuntime.freeMemory / 1048576 + def totalMBytes = Runtime.getRuntime.totalMemory / 1048576 + + val N = if (totalMBytes > 1000) 10000 else 4000 + val M = N / 10 + + def ticketExample: Unit = { + var big = 100000 + + var aSortedSet: SortedSet[Int] = TreeSet(big) + + for (i <- 1 until N) { + aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1)) + big -= 1 + if (i % M == 0) { + //println("big: "+big+", free memory: "+freeMBytes) + aSortedSet.until(i) + } + } + } + + def similarExample: Unit = { + var big = 100 + + var aSortedSet: SortedSet[Int] = TreeSet(big) + + for (i <- 1 until N) { + aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1)) + big + big -= 1 + if (i % M == 0) { + aSortedSet.until(i) + } + } + } + +} + + diff --git a/tests/pending/run/t2857.check b/tests/pending/run/t2857.check new file mode 100644 index 000000000000..c508d5366f70 --- /dev/null +++ b/tests/pending/run/t2857.check @@ -0,0 +1 @@ +false diff --git a/tests/pending/run/t2857.scala b/tests/pending/run/t2857.scala new file mode 100644 index 000000000000..5df2d440eac5 --- /dev/null +++ b/tests/pending/run/t2857.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + import collection.mutable._ + val m = new HashMap[Int, Set[String]] with MultiMap[Int, String] + m.addBinding(6, "Foo") + m.removeBinding(6, "Foo") + println(m.contains(6)) +} + + diff --git a/tests/pending/run/t2867.scala b/tests/pending/run/t2867.scala new file mode 100644 index 000000000000..25e55eaecddd --- /dev/null +++ b/tests/pending/run/t2867.scala @@ -0,0 +1,15 @@ +object Test { + case class A(l: List[_]*) + + def main(args: Array[String]): Unit = { + /** Kind of sneaking a slightly different test in here as well as + * testing 2867. How subversive. + */ + val xs1 = List(1, 2, 3) + val xs2 = List(1.0, 2.0, 3.0) + val xs3 = List[Any](1.0f, 2.0f, 3.0f) + val xs4 = List[Byte](1, 2, 3) + + assert(A(List(xs1, xs2)) == A(List(xs3, xs4))) + } +} diff --git a/tests/pending/run/t2873.check b/tests/pending/run/t2873.check new file mode 100644 index 000000000000..209b679c0719 --- /dev/null +++ b/tests/pending/run/t2873.check @@ -0,0 +1 @@ +RedBlack.Empty$ diff --git a/tests/pending/run/t2873.scala b/tests/pending/run/t2873.scala new file mode 100644 index 000000000000..3a3cc59b465c --- /dev/null +++ b/tests/pending/run/t2873.scala @@ -0,0 +1,10 @@ +abstract class RedBlack[A] extends Serializable { + abstract class Tree[+B] extends Serializable + case object Empty extends Tree[Nothing] +} + +object Test { + def main(args: Array[String]): Unit = { + println(classOf[RedBlack[_]].getMethod("Empty").getGenericReturnType) + } +} diff --git a/tests/pending/run/t2876.scala b/tests/pending/run/t2876.scala new file mode 100644 index 000000000000..f71879ebff41 --- /dev/null +++ b/tests/pending/run/t2876.scala @@ -0,0 +1,7 @@ +object Test +{ + def main(args: Array[String]): Unit = { + "x".view.filter(_ => true).take(1) + } +} + diff --git a/tests/pending/run/t2886.check b/tests/pending/run/t2886.check new file mode 100644 index 000000000000..61e36948bd5d --- /dev/null +++ b/tests/pending/run/t2886.check @@ -0,0 +1,5 @@ +((x: Predef.String) => { + val x$1 = x; + val x$2 = x; + Test.this.test(x$2, x$1) +}) diff --git a/tests/pending/run/t2886.scala b/tests/pending/run/t2886.scala new file mode 100644 index 000000000000..44783a5d8ef7 --- /dev/null +++ b/tests/pending/run/t2886.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test { + def test(name: String, address: String) = null + def main(args: Array[String]) = { + val tree = reify((x:String) => test(address=x,name=x)).tree + println(tree) + } +} diff --git a/tests/pending/run/t2958.scala b/tests/pending/run/t2958.scala new file mode 100644 index 000000000000..cf4867ab5b20 --- /dev/null +++ b/tests/pending/run/t2958.scala @@ -0,0 +1,16 @@ +object Test { + def f(args: Array[String]) = args match { + case Array("-p", prefix, from, to) => + prefix + from + to + + case Array(from, to) => + from + to + + case _ => + "default" + } + + def main(args: Array[String]): Unit = { + assert(f(Array("1", "2")) == "12") + } +} diff --git a/tests/pending/run/t298.check b/tests/pending/run/t298.check new file mode 100644 index 000000000000..1cd1d2266cbb --- /dev/null +++ b/tests/pending/run/t298.check @@ -0,0 +1,2 @@ +List(42, 24) +List((42,42), (24,24)) diff --git a/tests/pending/run/t298.scala b/tests/pending/run/t298.scala new file mode 100644 index 000000000000..5728bb6c92f5 --- /dev/null +++ b/tests/pending/run/t298.scala @@ -0,0 +1,17 @@ +object Test extends dotty.runtime.LegacyApp { + implicit def anyList[T]: List[T] = Nil + + implicit def intList: List[Int] = 42::24::Nil + + def foo[T](implicit x: T) = x + + val s = foo[List[Int]] + + println(s) // correct - prints "List(42, 24)" + + implicit def tupleList[T](implicit t: List[T]): List[(T,T)] = t.map(x => (x,x)) + + val t = foo[List[Tuple2[Int,Int]]] + + println(t) // incorrect - prints "List()" +} diff --git a/tests/pending/run/t3004.scala b/tests/pending/run/t3004.scala new file mode 100644 index 000000000000..a1e9c6c72fcb --- /dev/null +++ b/tests/pending/run/t3004.scala @@ -0,0 +1,14 @@ +object MyClass { + val duplicate: Int = 10 +} + +class MyClass { + private val duplicate = MyClass.duplicate +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new MyClass + () + } +} diff --git a/tests/pending/run/t3026.check b/tests/pending/run/t3026.check new file mode 100644 index 000000000000..8c29b615faee --- /dev/null +++ b/tests/pending/run/t3026.check @@ -0,0 +1,2 @@ +RED +YELLOW diff --git a/tests/pending/run/t3026.scala b/tests/pending/run/t3026.scala new file mode 100755 index 000000000000..22dde9cc03c9 --- /dev/null +++ b/tests/pending/run/t3026.scala @@ -0,0 +1,8 @@ +object Test { + abstract class Colour + case object RED extends Colour + case object YELLOW extends Colour + val items = Array(RED, YELLOW) + + def main(args: Array[String]): Unit = items foreach println +} diff --git a/tests/pending/run/t3038.check b/tests/pending/run/t3038.check new file mode 100644 index 000000000000..9a325c4c1842 --- /dev/null +++ b/tests/pending/run/t3038.check @@ -0,0 +1,19 @@ +a1 +a2 +a3 +a4 +a5 +a6 +a7 +a8 +a9 +c1 +c2 +c3 +c4 +c5 +c6 +c7 +c8 +c9 +c10 diff --git a/tests/pending/run/t3038.scala b/tests/pending/run/t3038.scala new file mode 100644 index 000000000000..6c9888c781cb --- /dev/null +++ b/tests/pending/run/t3038.scala @@ -0,0 +1,68 @@ +class A { + private lazy val a1 = "a1" + object B + private lazy val a2 = "a2" + + + @transient lazy val a3 = "a3" + @transient private lazy val a4 = "a4" + @transient lazy val a5 = "a5" + @transient private lazy val a6 = "a6" + + final val a7 = "a7" + private final val a8 = "a8" + @transient final val a9 = "a9" + + + + + def run = { + println(a1) + B + println(a2) + println(a3) + println(a4) + println(a5) + println(a6) + println(a7) + println(a8) + println(a9) + } +} + +class C extends A { + private lazy val c1 = "c1" + lazy val c2 = "c2" + + private lazy val c3 = "c3" + + @transient lazy val c4 = "c4" + @transient private lazy val c5 = "c5" + @transient lazy val c6 = "c6" + @transient private lazy val c7 = "c7" + lazy val c8 = "c8" + + final val c9 = "c9" + private final val c10 = "c10" + + + + override def run = { + super.run + println(c1) + println(c2) + println(c3) + println(c4) + println(c5) + println(c6) + println(c7) + println(c8) + println(c9) + println(c10) + } +} + +object Test extends dotty.runtime.LegacyApp { + (new C).run +} + diff --git a/tests/pending/run/t3038b.check b/tests/pending/run/t3038b.check new file mode 100644 index 000000000000..cf0389a5afee --- /dev/null +++ b/tests/pending/run/t3038b.check @@ -0,0 +1,6 @@ +1 +2 +3 +4 +5 +6 \ No newline at end of file diff --git a/tests/pending/run/t3038b.flags b/tests/pending/run/t3038b.flags new file mode 100644 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t3038b.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t3038b.scala b/tests/pending/run/t3038b.scala new file mode 100644 index 000000000000..559f754aa6de --- /dev/null +++ b/tests/pending/run/t3038b.scala @@ -0,0 +1,20 @@ +class A { + val a1 = 1 + val a2 = 2 + private val b1 = 3 + private val b2 = 4 + @transient val c1 = 5 + @transient val c2 = 6 + def run = { + println(a1) + println(a2) + println(b1) + println(b2) + println(c1) + println(c2) + } +} + +object Test extends dotty.runtime.LegacyApp { + new A().run +} diff --git a/tests/pending/run/t3038c.check b/tests/pending/run/t3038c.check new file mode 100644 index 000000000000..a7e7ae9bda1c --- /dev/null +++ b/tests/pending/run/t3038c.check @@ -0,0 +1,2 @@ +List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70) +List(71, 72, 73, 74, 75, 76, 77, 78, 79, 80) diff --git a/tests/pending/run/t3038c/A_1.scala b/tests/pending/run/t3038c/A_1.scala new file mode 100644 index 000000000000..91564e3021d6 --- /dev/null +++ b/tests/pending/run/t3038c/A_1.scala @@ -0,0 +1,83 @@ +class A { + lazy val a0 = 1 + lazy val a1 = 2 + lazy val a2 = 3 + lazy val a3 = 4 + lazy val a4 = 5 + lazy val a5 = 6 + lazy val a6 = 7 + lazy val a7 = 8 + lazy val a8 = 9 + lazy val a9 = 10 + lazy val a10 = 11 + lazy val a11 = 12 + lazy val a12 = 13 + lazy val a13 = 14 + lazy val a14 = 15 + lazy val a15 = 16 + lazy val a16 = 17 + lazy val a17 = 18 + lazy val a18 = 19 + lazy val a19 = 20 + lazy val a20 = 21 + lazy val a21 = 22 + lazy val a22 = 23 + lazy val a23 = 24 + lazy val a24 = 25 + lazy val a25 = 26 + lazy val a26 = 27 + lazy val a27 = 28 + lazy val a28 = 29 + lazy val a29 = 30 + lazy val a30 = 31 + lazy val a31 = 32 + lazy val a32 = 33 + lazy val a33 = 34 + lazy val a34 = 35 + lazy val a35 = 36 + lazy val a36 = 37 + lazy val a37 = 38 + lazy val a38 = 39 + lazy val a39 = 40 + lazy val a40 = 41 + lazy val a41 = 42 + lazy val a42 = 43 + lazy val a43 = 44 + lazy val a44 = 45 + lazy val a45 = 46 + lazy val a46 = 47 + lazy val a47 = 48 + lazy val a48 = 49 + lazy val a49 = 50 + lazy val a50 = 51 + lazy val a51 = 52 + lazy val a52 = 53 + lazy val a53 = 54 + lazy val a54 = 55 + lazy val a55 = 56 + lazy val a56 = 57 + lazy val a57 = 58 + lazy val a58 = 59 + lazy val a59 = 60 + private lazy val a60 = 61 + private lazy val a61 = 62 + private lazy val a62 = 63 + private lazy val a63 = 64 + private lazy val a64 = 65 + private lazy val a65 = 66 + private lazy val a66 = 67 + private lazy val a67 = 68 + private lazy val a68 = 69 + private lazy val a69 = 70 + + def run = { + println(List(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, + a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, + a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, + a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, + a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, + a60, a61, a62, a63, a64, a65, a66, a67, a68, a69)) + } + +} diff --git a/tests/pending/run/t3038c/B_2.scala b/tests/pending/run/t3038c/B_2.scala new file mode 100644 index 000000000000..d5b7baa1c878 --- /dev/null +++ b/tests/pending/run/t3038c/B_2.scala @@ -0,0 +1,24 @@ + +class B extends A { + lazy val b0 = 71 + lazy val b1 = 72 + lazy val b2 = 73 + lazy val b3 = 74 + lazy val b4 = 75 + lazy val b5 = 76 + lazy val b6 = 77 + lazy val b7 = 78 + lazy val b8 = 79 + lazy val b9 = 80 + override def run = { + super.run + println(List(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9)) + } + +} + +object Test { + def main(args: Array[String]): Unit = { + new B().run + } +} diff --git a/tests/pending/run/t3038d.flags b/tests/pending/run/t3038d.flags new file mode 100644 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t3038d.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t3038d.scala b/tests/pending/run/t3038d.scala new file mode 100644 index 000000000000..3dab076759cc --- /dev/null +++ b/tests/pending/run/t3038d.scala @@ -0,0 +1,58 @@ +trait Foo { + @transient protected var load = 1 + @transient protected var a = 12 + + protected def init[B](in: java.io.ObjectInputStream): Unit = { + in.defaultReadObject + load = in.readInt + val sizea = in.readInt + a = 12 + } + + protected def serializeTo(out: java.io.ObjectOutputStream): Unit = { + out.defaultWriteObject + out.writeInt(load) + out.writeInt(a) + } +} + +class Bar extends Foo with Serializable { + @transient protected var first: Any = null + def size = a + @transient var second: Any = null + + def checkMember: Unit = { if (first == null) print("") } + + private def writeObject(out: java.io.ObjectOutputStream): Unit = { + serializeTo(out) + } + + private def readObject(in: java.io.ObjectInputStream): Unit = { + first = null + init(in) + } +} + +object Test { + private def toObject[A](bytes: Array[Byte]): A = { + val in = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bytes)) + in.readObject.asInstanceOf[A] + } + + private def toBytes(o: AnyRef): Array[Byte] = { + val bos = new java.io.ByteArrayOutputStream + val out = new java.io.ObjectOutputStream(bos) + out.writeObject(o) + out.close + bos.toByteArray + } + + + def main(args: Array[String]): Unit = { + val a1 = new Bar() + val serialized:Array[Byte] = toBytes(a1) + val deserialized: Bar = toObject(serialized) + deserialized.size + deserialized.checkMember + } +} diff --git a/tests/pending/run/t3050.scala b/tests/pending/run/t3050.scala new file mode 100644 index 000000000000..160f8b664bef --- /dev/null +++ b/tests/pending/run/t3050.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + val x = + try { ("": Any) match { case List(_*) => true } } + catch { case _: Throwable => false } + + assert(!x) + } +} diff --git a/tests/pending/run/t3088.scala b/tests/pending/run/t3088.scala new file mode 100644 index 000000000000..ea820b1c9c78 --- /dev/null +++ b/tests/pending/run/t3088.scala @@ -0,0 +1,9 @@ +import collection.mutable._ + +object Test { + def main(args: Array[String]): Unit = { + val b = new ListBuffer[Int] + b += 1 + b ++= b + } +} diff --git a/tests/pending/run/t3097.check b/tests/pending/run/t3097.check new file mode 100644 index 000000000000..63695f771bb6 --- /dev/null +++ b/tests/pending/run/t3097.check @@ -0,0 +1 @@ +atomic diff --git a/tests/pending/run/t3097.scala b/tests/pending/run/t3097.scala new file mode 100644 index 000000000000..c5bac528baaa --- /dev/null +++ b/tests/pending/run/t3097.scala @@ -0,0 +1,18 @@ +sealed trait ISimpleValue + +sealed trait IListValue extends ISimpleValue +sealed trait IAtomicValue[O] extends ISimpleValue + +sealed trait IAbstractDoubleValue[O] extends IAtomicValue[O] +sealed trait IDoubleValue extends IAbstractDoubleValue[Double] + +case class ListValue(val items: List[IAtomicValue[_]]) extends IListValue +class DoubleValue(val data: Double) extends IDoubleValue + +object Test extends dotty.runtime.LegacyApp { + // match is exhaustive + (new DoubleValue(1): ISimpleValue) match { + case m: IListValue => println("list") + case a: IAtomicValue[_] => println("atomic") + } +} diff --git a/tests/pending/run/t3112.check b/tests/pending/run/t3112.check new file mode 100644 index 000000000000..a95644c82c49 --- /dev/null +++ b/tests/pending/run/t3112.check @@ -0,0 +1,4 @@ +Vector() +Vector() +Vector() +Vector() \ No newline at end of file diff --git a/tests/pending/run/t3112.scala b/tests/pending/run/t3112.scala new file mode 100644 index 000000000000..44aa9471d5a6 --- /dev/null +++ b/tests/pending/run/t3112.scala @@ -0,0 +1,11 @@ +// #3112 +object Test { + + def main(args: Array[String]): Unit = { + println((Vector() ++ (0 until 32)) take 0) // works + println((Vector() ++ (0 until 33)) take 0) // error + println((Vector() ++ (0 until 32)) takeRight 0) // works + println((Vector() ++ (0 until 33)) takeRight 0) // error + } + +} diff --git a/tests/pending/run/t3126.scala b/tests/pending/run/t3126.scala new file mode 100644 index 000000000000..36322bf89696 --- /dev/null +++ b/tests/pending/run/t3126.scala @@ -0,0 +1,9 @@ +object Test { + case class C(x: Int) + val v: Some[Int] = null + + def main(args: Array[String]): Unit = { + try C.unapply(null) catch { case _: MatchError => } + try v match { case Some(1) => } catch { case _: MatchError => } + } +} diff --git a/tests/pending/run/t3150.scala b/tests/pending/run/t3150.scala new file mode 100644 index 000000000000..034703b5f7f0 --- /dev/null +++ b/tests/pending/run/t3150.scala @@ -0,0 +1,10 @@ +object Test { + case object Bob { override def equals(other: Any) = true } + def f(x: Any) = x match { case Bob => Bob } + + def main(args: Array[String]): Unit = { + assert(f(Bob) eq Bob) + assert(f(0) eq Bob) + assert(f(Nil) eq Bob) + } +} diff --git a/tests/pending/run/t3158.check b/tests/pending/run/t3158.check new file mode 100644 index 000000000000..ab1cb284d5fc --- /dev/null +++ b/tests/pending/run/t3158.check @@ -0,0 +1 @@ +Array() diff --git a/tests/pending/run/t3158.scala b/tests/pending/run/t3158.scala new file mode 100644 index 000000000000..b9304ee445cb --- /dev/null +++ b/tests/pending/run/t3158.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + println(args.map(_ => foo _).deep) + } + + def foo(xs: String*): Unit = { + println(xs) + } +} diff --git a/tests/pending/run/t3175.check b/tests/pending/run/t3175.check new file mode 100644 index 000000000000..12246140f442 --- /dev/null +++ b/tests/pending/run/t3175.check @@ -0,0 +1,11 @@ +10 +15 +3 +3 +3 +5 +5 +5 +100 +jabooboo +hi mom diff --git a/tests/pending/run/t3175.scala b/tests/pending/run/t3175.scala new file mode 100644 index 000000000000..ea56ded229e7 --- /dev/null +++ b/tests/pending/run/t3175.scala @@ -0,0 +1,58 @@ +/** A bit down the road this test will examine + * the bytecode. + */ + +import scala.language.reflectiveCalls + +object Test { + def len(x:{ def length: Int }) = x.length + def f1(x:{ def apply(x: Int): Long }) = x(0) + def f2(x:{ def apply(x: Int): Byte }) = x(0) + def f3(x:{ def apply(x: Int): String }) = x(0).length + + def f4(x:{ def update(x: Int, y: Long): Unit }, y: Long) = x(0) = y + def f5(x:{ def update(x: Int, y: Byte): Unit }, y: Byte) = x(0) = y + def f6(x:{ def update(x: Int, y: String): Unit }, y: String) = x(0) = y + + def f7(x: { def length: Any }) = x.length + + def f8(x: { def apply(x: Int): Any }) = x(0) + def f9(x: { def apply(x: Int): Int }) = x(0) + def f10(x: { def apply(x: Int): Long }) = x(0) + + // update has some interesting special cases + def f11(x:{ def update(x: Int, y: Long): Any }, y: Long) = x(0) = y + def f12(x:{ def update(x: Int, y: String): AnyVal }, y: String) = x(0) = y + def f13(x:{ def update(x: Int, y: String): AnyRef }, y: String) = x(0) = y + + // doesn't work yet, see #3197 + // def fclone(x:{ def clone(): AnyRef }) = x.clone() + + def main(args: Array[String]): Unit = { + val longs = Array(5L) + val bytes = Array(5: Byte) + val strs = Array("abcde", "fghjij") + + println(len(Array(1,2,3)) + len(Array(4.0,5.0f)) + len(Array("abc", 5)) + len("bop")) + println(f1(longs) + f2(bytes) + f3(strs)) + + f4(longs, 1) + f5(bytes, 1) + f6(strs, "a") + + println(f1(longs) + f2(bytes) + f3(strs)) + + println(f7(Array(1,2,3))) + println(f7("def")) + + println(f8(Array(5))) + println(f9(Array(5))) + println(f10(Array(5))) + + f11(longs, 100L) + f12(strs, "jabooboo") + println(longs(0)) + println(strs(0)) + f13(new { def update(x: Int, y: String): List[Int] = { println("hi mom") ; Nil } }, "irrelevant") + } +} diff --git a/tests/pending/run/t3186.check b/tests/pending/run/t3186.check new file mode 100644 index 000000000000..c508d5366f70 --- /dev/null +++ b/tests/pending/run/t3186.check @@ -0,0 +1 @@ +false diff --git a/tests/pending/run/t3186.scala b/tests/pending/run/t3186.scala new file mode 100644 index 000000000000..e170a4d503ee --- /dev/null +++ b/tests/pending/run/t3186.scala @@ -0,0 +1,7 @@ +object Dist1 extends Enumeration { val Mile, Foot, Inch = Value } + +object Dist2 extends Enumeration { val Kilometer, Millimeter, Parsec = Value } + +object Test extends dotty.runtime.LegacyApp { + println(Dist1.Mile == Dist2.Kilometer) +} diff --git a/tests/pending/run/t3199b.check b/tests/pending/run/t3199b.check new file mode 100644 index 000000000000..b5d8bb58d9bc --- /dev/null +++ b/tests/pending/run/t3199b.check @@ -0,0 +1 @@ +[1, 2, 3] diff --git a/tests/pending/run/t3199b.scala b/tests/pending/run/t3199b.scala new file mode 100644 index 000000000000..8052ef996c70 --- /dev/null +++ b/tests/pending/run/t3199b.scala @@ -0,0 +1,11 @@ +object Test { + + def test() = { + java.util.Arrays.asList(Array(1,2,3):_*) + } + + def main(args: Array[String]): Unit = { + println(test()) + } + +} diff --git a/tests/pending/run/t3232.scala b/tests/pending/run/t3232.scala new file mode 100644 index 000000000000..900a1f5dba4c --- /dev/null +++ b/tests/pending/run/t3232.scala @@ -0,0 +1,21 @@ +object Test { + // some maximally sized ranges + val r1 = 0 until Int.MaxValue + val r2 = 1 to Int.MaxValue + val r3 = Int.MinValue to -2 + val r4 = Int.MinValue until -1 + + // some exceptional conditions + val e1 = () => (0 to Int.MaxValue).length + val e2 = () => (5 until 5).last + + def main(args: Array[String]): Unit = { + List(r1, r2, r3, r4) foreach (x => assert(x.length == Int.MaxValue)) + + // exception required + List(e1, e2) foreach { f => + try { f() ; assert(false) } + catch { case _: Throwable => () } + } + } +} diff --git a/tests/pending/run/t3235-minimal.check b/tests/pending/run/t3235-minimal.check new file mode 100644 index 000000000000..d7f716002f0c --- /dev/null +++ b/tests/pending/run/t3235-minimal.check @@ -0,0 +1,12 @@ +t3235-minimal.scala:3: warning: method round in class RichInt is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? + assert(123456789.round == 123456789) + ^ +t3235-minimal.scala:4: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? + assert(math.round(123456789) == 123456789) + ^ +t3235-minimal.scala:5: warning: method round in class RichLong is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? + assert(1234567890123456789L.round == 1234567890123456789L) + ^ +t3235-minimal.scala:6: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? + assert(math.round(1234567890123456789L) == 1234567890123456789L) + ^ diff --git a/tests/pending/run/t3235-minimal.flags b/tests/pending/run/t3235-minimal.flags new file mode 100644 index 000000000000..dcc59ebe32ef --- /dev/null +++ b/tests/pending/run/t3235-minimal.flags @@ -0,0 +1 @@ +-deprecation diff --git a/tests/pending/run/t3235-minimal.scala b/tests/pending/run/t3235-minimal.scala new file mode 100644 index 000000000000..91eb78219d8c --- /dev/null +++ b/tests/pending/run/t3235-minimal.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + assert(123456789.round == 123456789) + assert(math.round(123456789) == 123456789) + assert(1234567890123456789L.round == 1234567890123456789L) + assert(math.round(1234567890123456789L) == 1234567890123456789L) + } +} diff --git a/tests/pending/run/t3241.check b/tests/pending/run/t3241.check new file mode 100644 index 000000000000..348ebd9491ed --- /dev/null +++ b/tests/pending/run/t3241.check @@ -0,0 +1 @@ +done \ No newline at end of file diff --git a/tests/pending/run/t3241.scala b/tests/pending/run/t3241.scala new file mode 100644 index 000000000000..40097a046f42 --- /dev/null +++ b/tests/pending/run/t3241.scala @@ -0,0 +1,23 @@ +object Test { + + def main(args : Array[String]) : Unit = { + recurse(Map(1->1, 2->2, 3->3, 4->4, 5->5, 6->6, 7->7)) + recurse(Set(1,2,3,4,5,6,7)) + println("done") + } + + def recurse(map: collection.immutable.Map[Int, Int]): Unit = { + if (!map.isEmpty) { + val x = map.keys.head + recurse(map - x) + } + } + + def recurse(set: collection.immutable.Set[Int]): Unit = { + if (!set.isEmpty) { + val x = set.toStream.head + recurse(set - x) + } + } + +} diff --git a/tests/pending/run/t3242.check b/tests/pending/run/t3242.check new file mode 100644 index 000000000000..a145f6df8f7d --- /dev/null +++ b/tests/pending/run/t3242.check @@ -0,0 +1,18 @@ + append [num: 200] vec + remove [num: 200] vec + append [num: 400] vec + remove [num: 400] vec + append [num: 600] vec + remove [num: 600] vec + append [num: 800] vec + remove [num: 800] vec +>> comparison done, num: 200 + append [num: 2000] vec + remove [num: 2000] vec + append [num: 4000] vec + remove [num: 4000] vec + append [num: 6000] vec + remove [num: 6000] vec + append [num: 8000] vec + remove [num: 8000] vec +>> comparison done, num: 2000 diff --git a/tests/pending/run/t3242.scala b/tests/pending/run/t3242.scala new file mode 100644 index 000000000000..6a8ecd7a2f39 --- /dev/null +++ b/tests/pending/run/t3242.scala @@ -0,0 +1,52 @@ + +import scala.language.{ higherKinds } + +object Test { + + def benchmarkA(num: Int): Unit = { + + type A = Int + + def updateM[M[_]](ms: M[A], update: (M[A], A)=>M[A]): M[A] = { + var is = ms + for (i <- 0 until num) is = update(is, i) + is + } + + // + def vectorAppend: Vector[A] = updateM[Vector](Vector(), (as, a)=>{ + val v = (as :+ a) + //println("==>append: i: "+i1+", v: "+v) + v + }) + // this will crash, Vector bug! + def vectorRemove(vec: Vector[A]): Vector[A] = updateM[Vector](vec, (as, a)=>{ + val v = (as filterNot{ _ == a}) + //val v = (is filter{ _ != i}) + //println("==>remove: i: "+a) + v + }) + + val ct = vectorAppend + println(" append [num: "+num+"] vec") + vectorRemove(ct) + println(" remove [num: "+num+"] vec") + } // BenchmarkA + + def comparison(num: Int): Unit = { + for (i <- 1 until 5) benchmarkA(num*i) + println(">> comparison done, num: "+num); + } + + def main(args: Array[String]): Unit = { + try { + //createBenchmarkA(23).testRun + + comparison(200) // OK + comparison(2000) // this will crach + + } catch { + case e: Exception => e.printStackTrace() + } + } +} diff --git a/tests/pending/run/t3242b.scala b/tests/pending/run/t3242b.scala new file mode 100644 index 000000000000..7a296aac1556 --- /dev/null +++ b/tests/pending/run/t3242b.scala @@ -0,0 +1,17 @@ +import scala.collection.immutable._ + +object Test { + + def test(n: Int) = { + var vb = new VectorBuilder[Int] + for (i <- 0 until n) + vb += i + val v = vb.result + assert(v == (0 until n), "not same as (0 until " + n + "): " + v) + } + + def main(args: Array[String]): Unit = { + for (i <- 0 until 2000) + test(i) + } +} diff --git a/tests/pending/run/t3269.check b/tests/pending/run/t3269.check new file mode 100644 index 000000000000..c25611c15c61 --- /dev/null +++ b/tests/pending/run/t3269.check @@ -0,0 +1,2 @@ +1 +Hello diff --git a/tests/pending/run/t3269.scala b/tests/pending/run/t3269.scala new file mode 100644 index 000000000000..17e42cdb0e94 --- /dev/null +++ b/tests/pending/run/t3269.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + val it = List(1).iterator ++ { println("Hello"); Iterator.empty } + println(it.next) + it.hasNext + it.hasNext + it.hasNext + } +} diff --git a/tests/pending/run/t3273.scala b/tests/pending/run/t3273.scala new file mode 100644 index 000000000000..379a8a29c11b --- /dev/null +++ b/tests/pending/run/t3273.scala @@ -0,0 +1,10 @@ +object Test { + val num1: Stream[Int] = 1 #:: num1.map(_ + 1) + val num2: Stream[Int] = 1 #:: num2.iterator.map(_ + 1).toStream + + def main(args: Array[String]): Unit = { + val x1 = (num1 take 10).toList + val x2 = (num2 take 10).toList + assert(x1 == x2) + } +} diff --git a/tests/pending/run/t3326.check b/tests/pending/run/t3326.check new file mode 100644 index 000000000000..d0e11cebf770 --- /dev/null +++ b/tests/pending/run/t3326.check @@ -0,0 +1,8 @@ +Map(2 -> Hello, 1 -> World) +Map(5 -> Foo, 4 -> Bar) +Map(5 -> Foo, 4 -> Bar, 2 -> Hello, 1 -> World) +Map(3 -> ?, 2 -> Hello, 1 -> World) +Map(2 -> Hello, 1 -> World) +Map(5 -> Foo, 4 -> Bar) +Map(5 -> Foo, 4 -> Bar, 2 -> Hello, 1 -> World) +Map(3 -> ?, 2 -> Hello, 1 -> World) \ No newline at end of file diff --git a/tests/pending/run/t3326.scala b/tests/pending/run/t3326.scala new file mode 100644 index 000000000000..5e403794dfe8 --- /dev/null +++ b/tests/pending/run/t3326.scala @@ -0,0 +1,74 @@ + + + +import scala.math.Ordering + + + +/** The heart of the problem - we want to retain the ordering when + * using `++` on sorted maps. + * + * There are 2 `++` overloads - a generic one in traversables and + * a map-specific one in `MapLike` - which knows about the ordering. + * + * The problem here is that the expected return type for the expression + * in which `++` appears drives the decision of the overload that needs + * to be taken. + * The `collection.SortedMap` does not have `++` overridden to return + * `SortedMap`, but `immutable.Map` instead. + * This is why `collection.SortedMap` used to resort to the generic + * `TraversableLike.++` which knows nothing about the ordering. + * + * To avoid `collection.SortedMap`s resort to the more generic `TraverableLike.++`, + * we override the `MapLike.++` overload in `collection.SortedMap` to return + * the proper type `SortedMap`. + */ +object Test { + + def main(args: Array[String]): Unit = { + testCollectionSorted() + testImmutableSorted() + } + + def testCollectionSorted(): Unit = { + import collection._ + val order = implicitly[Ordering[Int]].reverse + var m1: SortedMap[Int, String] = SortedMap.empty[Int, String](order) + var m2: SortedMap[Int, String] = SortedMap.empty[Int, String](order) + + m1 += (1 -> "World") + m1 += (2 -> "Hello") + + m2 += (4 -> "Bar") + m2 += (5 -> "Foo") + + val m3: SortedMap[Int, String] = m1 ++ m2 + + println(m1) + println(m2) + println(m3) + + println(m1 + (3 -> "?")) + } + + def testImmutableSorted(): Unit = { + import collection.immutable._ + val order = implicitly[Ordering[Int]].reverse + var m1: SortedMap[Int, String] = SortedMap.empty[Int, String](order) + var m2: SortedMap[Int, String] = SortedMap.empty[Int, String](order) + + m1 += (1 -> "World") + m1 += (2 -> "Hello") + + m2 += (4 -> "Bar") + m2 += (5 -> "Foo") + + val m3: SortedMap[Int, String] = m1 ++ m2 + + println(m1) + println(m2) + println(m3) + + println(m1 + (3 -> "?")) + } +} diff --git a/tests/pending/run/t3327.check b/tests/pending/run/t3327.check new file mode 100644 index 000000000000..980a0d5f19a6 --- /dev/null +++ b/tests/pending/run/t3327.check @@ -0,0 +1 @@ +Hello World! diff --git a/tests/pending/run/t3327.scala b/tests/pending/run/t3327.scala new file mode 100644 index 000000000000..9274841d070d --- /dev/null +++ b/tests/pending/run/t3327.scala @@ -0,0 +1,8 @@ +object Test { + def main (args : Array[String]): Unit = { + val b = new StringBuilder + b.append ("Hello World!") + b.lastIndexOf ('e') + println (b.toString) + } +} diff --git a/tests/pending/run/t3346a.check b/tests/pending/run/t3346a.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t3346a.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t3346a.scala b/tests/pending/run/t3346a.scala new file mode 100644 index 000000000000..dce1267165c1 --- /dev/null +++ b/tests/pending/run/t3346a.scala @@ -0,0 +1,11 @@ +import scala.language.implicitConversions + +object Test extends dotty.runtime.LegacyApp { + class Rep[T](x : T) + + class SomeOps[T](x : Rep[T]) { def foo = 1 } + implicit def mkOps[X, T](x : X)(implicit conv: X => Rep[T]) : SomeOps[T] = new SomeOps(conv(x)) + + val a: Rep[Int] = new Rep(42) + println(a.foo) +} diff --git a/tests/pending/run/t3346d.scala b/tests/pending/run/t3346d.scala new file mode 100644 index 000000000000..6a4434a9d9e2 --- /dev/null +++ b/tests/pending/run/t3346d.scala @@ -0,0 +1,21 @@ +import scala.language.implicitConversions + +object Test extends dotty.runtime.LegacyApp { + trait TARInt + + trait Basket[A,B] { + def iAmABasket = {} + } + + trait BasketFactory[A,B] { + def create(v: A): Basket[A,B] + } + + implicit val bf: Test.BasketFactory[Int,Test.TARInt] = new BasketFactory[Int,TARInt] { + def create(v: Int): Basket[Int,TARInt] = new Basket[Int, TARInt]{} + } + + implicit def i2[A,B](a: A)(implicit bf: BasketFactory[A,B]): Basket[A,B] = bf.create(a) + + 1.iAmABasket // <-- i2 conversion not applicable +} diff --git a/tests/pending/run/t3346e.check b/tests/pending/run/t3346e.check new file mode 100644 index 000000000000..71a57ffa7062 --- /dev/null +++ b/tests/pending/run/t3346e.check @@ -0,0 +1,12 @@ +eqw +List(0, 2) +List(0, 2) +BitSet(0, 2) +Vector(113, 119, 101) +qwe +List(2, 0) +List(0!) +BitSet(0, 2) +qwe +List(2, 0) +qwe diff --git a/tests/pending/run/t3346e.scala b/tests/pending/run/t3346e.scala new file mode 100644 index 000000000000..e2b510fa02e9 --- /dev/null +++ b/tests/pending/run/t3346e.scala @@ -0,0 +1,81 @@ +import scala.language.implicitConversions +import scala.collection.generic.CanBuildFrom +import scala.math.Ordering +import collection.{TraversableLike, SeqLike} +import collection.immutable.BitSet + +class QuickSort[Coll](a: Coll) { + //should be able to sort only something with defined order (someting like a Seq) + def quickSort[T](implicit ev0: Coll => SeqLike[T, Coll], + cbf: CanBuildFrom[Coll, T, Coll], + n: Ordering[T]): Coll = { + quickSortAnything(ev0, cbf, n) + } + + //we can even sort a Set, if we really want to + def quickSortAnything[T](implicit ev0: Coll => TraversableLike[T, Coll], + cbf: CanBuildFrom[Coll, T, Coll], + n: Ordering[T]): Coll = { + import n._ + if (a.size < 2) { + a + } else { + // We pick the first value for the pivot. + val pivot = a.head + val (lower, tmp) = a.partition(_ < pivot) + val (upper, same) = tmp.partition(_ > pivot) + val b = cbf() + b.sizeHint(a.size) + b ++= new QuickSort(lower).quickSortAnything + b ++= same + b ++= new QuickSort(upper).quickSortAnything + b.result + } + } +} + +class FilterMap[Repr](a: Repr) { + def filterMap[A, B, That](f: A => Option[B])(implicit ev0: Repr => TraversableLike[A, Repr], + cbf: CanBuildFrom[Repr, B, That]): That = { + a.flatMap(e => f(e).toSeq) + } +} + +class FilterMapFixed[A, Repr <% TraversableLike[A, Repr]](a: Repr) { + def filterMap2[B, That](f: A => Option[B])(implicit cbf: CanBuildFrom[Repr, B, That]): That = { + a.flatMap(e => f(e).toSeq) + } +} + +object MyEnhancements { + implicit def toQS[Coll](a: Coll): QuickSort[Coll] = new QuickSort(a) + implicit def toFM[Coll](a: Coll): FilterMap[Coll] = new FilterMap(a) + implicit def toFM2[A, Repr <% TraversableLike[A, Repr]](a: Repr): FilterMapFixed[A,Repr] = new FilterMapFixed(a) +} + +object Test extends dotty.runtime.LegacyApp { + + import MyEnhancements._ + + println("qwe".quickSort) + println(Array(2, 0).quickSort.toList) + println(Seq(2, 0).quickSort) + //not very useful to sort a set, but just as a demonstration + println(BitSet(2, 0).quickSortAnything) + + //need to hint type inferencer, + //probably will be able to overcome after https://issues.scala-lang.org/browse/SI-4699 and + // related issues are fixed (by moving ev0 parameter from filterMap to toFM), see toFM2 + println("qwe".filterMap((c: Char) => Some(c.toInt))) + println("qwe".filterMap((c: Char) => Some(c))) + println(Array(2, 0).filterMap((c: Int) => Some(c.toInt)).toList) + println(Seq(2, 0).filterMap((c: Int) => if (c < 2) Some(c + "!") else None)) + def test(i:Int) = Option(i) + println(BitSet(2,0).filterMap(test)) + + println(toFM2("qwe").filterMap2(c => Some(c))) + println(toFM2(Array(2, 0)).filterMap2(c => Some(c.toInt)).toList) + //No implicit view available from java.lang.String => scala.collection.TraversableLike[A,java.lang.String]. :( + //Not anymore :) + println("qwe".filterMap2(c => Some(c))) +} diff --git a/tests/pending/run/t3346f.check b/tests/pending/run/t3346f.check new file mode 100644 index 000000000000..fd3c81a4d763 --- /dev/null +++ b/tests/pending/run/t3346f.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/pending/run/t3346f.scala b/tests/pending/run/t3346f.scala new file mode 100644 index 000000000000..1871b27bd469 --- /dev/null +++ b/tests/pending/run/t3346f.scala @@ -0,0 +1,15 @@ +import scala.language.implicitConversions +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + trait Foo[A] + implicit def fooString: Foo[String] = null + implicit def value[A](implicit foo: Foo[A]): Int = 5 + + println(implicitly[Int]) + + implicit def conversion[A](x: Int)(implicit foo: Foo[A]): AnyRef{def aMethod: Int} = new { + def aMethod = 5 + } + println(1.aMethod) +} diff --git a/tests/pending/run/t3346g.check b/tests/pending/run/t3346g.check new file mode 100644 index 000000000000..ce894825e0f3 --- /dev/null +++ b/tests/pending/run/t3346g.check @@ -0,0 +1 @@ +A(3,asdf) diff --git a/tests/pending/run/t3346g.scala b/tests/pending/run/t3346g.scala new file mode 100644 index 000000000000..a5b7d6bf8fbe --- /dev/null +++ b/tests/pending/run/t3346g.scala @@ -0,0 +1,9 @@ +import scala.language.implicitConversions + +case class A(b: Int, c: String) + +object Test extends dotty.runtime.LegacyApp { + implicit def s2i(s: String): Int = s.length + implicit def toA[T](t: T)(implicit f: T => Int): A = A(f(t), t.toString) + println("asdf".copy(b = 3)) +} diff --git a/tests/pending/run/t3346h.check b/tests/pending/run/t3346h.check new file mode 100644 index 000000000000..587be6b4c3f9 --- /dev/null +++ b/tests/pending/run/t3346h.check @@ -0,0 +1 @@ +x diff --git a/tests/pending/run/t3346h.scala b/tests/pending/run/t3346h.scala new file mode 100644 index 000000000000..0dc4b9f2e787 --- /dev/null +++ b/tests/pending/run/t3346h.scala @@ -0,0 +1,9 @@ +import scala.language.implicitConversions + +object Test extends dotty.runtime.LegacyApp { + trait Fundep[T, U] { def u(t: T): U } + class C { def y = "x" } + implicit val FundepStringC: Test.Fundep[String,Test.C] = new Fundep[String, C]{ def u(t: String) = new C } + implicit def foo[T, U](x: T)(implicit y: Fundep[T, U]): U = y.u(x) + println("x".y) +} diff --git a/tests/pending/run/t3346j.check b/tests/pending/run/t3346j.check new file mode 100644 index 000000000000..59e8626fc5b7 --- /dev/null +++ b/tests/pending/run/t3346j.check @@ -0,0 +1 @@ +Int diff --git a/tests/pending/run/t3346j.scala b/tests/pending/run/t3346j.scala new file mode 100644 index 000000000000..b1d1f3c2e595 --- /dev/null +++ b/tests/pending/run/t3346j.scala @@ -0,0 +1,11 @@ +import scala.language.implicitConversions +import scala.language.reflectiveCalls +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + class A[T] + class B[T] + implicit def foo[T: TypeTag](a: A[T])(implicit b: B[T]): AnyRef{def baz: reflect.runtime.universe.Type} = new { def baz = typeOf[T] } + implicit def bar[T <: Int]: B[T] = new B[T]() + println(new A[Int]().baz) +} diff --git a/tests/pending/run/t3353.check b/tests/pending/run/t3353.check new file mode 100644 index 000000000000..8b4ae1fe6994 --- /dev/null +++ b/tests/pending/run/t3353.check @@ -0,0 +1 @@ +Got: foo and None diff --git a/tests/pending/run/t3353.scala b/tests/pending/run/t3353.scala new file mode 100644 index 000000000000..472723b3c485 --- /dev/null +++ b/tests/pending/run/t3353.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + + "foo" match { + case Matcher(result) => println(result) + } + + object Matcher{ + def unapply(s: String)(implicit secondParam: Option[String] = None) = Some("Got: " + s + " and " + secondParam) + } +} diff --git a/tests/pending/run/t3361.check b/tests/pending/run/t3361.check new file mode 100644 index 000000000000..5e0a76350199 --- /dev/null +++ b/tests/pending/run/t3361.check @@ -0,0 +1 @@ +warning: there were 16 deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t3361.scala b/tests/pending/run/t3361.scala new file mode 100644 index 000000000000..e1866cd7a178 --- /dev/null +++ b/tests/pending/run/t3361.scala @@ -0,0 +1,98 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.collection.mutable.DoubleLinkedList + + empty + builder_1 + builder_2 + chaining_1 + chaining_2 + insert_1 + insert_2 + append_1 + append_2 + + def empty: Unit = { + val none = DoubleLinkedList() + require(none.size == 0) + none.foreach( _ => require(false)) + } + + def builder_1: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + require(10 == ten.size) + } + + def builder_2: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + require((ten.size*(ten.size+1))/2 == ten.reduceLeft(_ + _)) + } + + def chaining_1: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + require(ten.reverse == DoubleLinkedList((1 to 10).reverse: _*)) + } + + def chaining_2: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + require(ten == ten.reverse.reverse) + } + + def insert_1: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + ten.append(DoubleLinkedList(11)) + + // Post-insert size test + require(11 == ten.size) + // Post-insert data test + require((ten.size*(ten.size+1))/2 == ten.reduceLeft(_ + _)) + // Post-insert chaining test + require(ten == ten.reverse.reverse) + // Post-insert position test + require(ten.last == 11) + } + + def insert_2: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + try { + DoubleLinkedList().insert(ten) + } catch { + case _: IllegalArgumentException => require(true) + case _: Throwable => require(false) + } + val zero = DoubleLinkedList(0) + zero.insert(ten) + require(zero.size == 11) + require(zero.head == 0) + require(zero.last == 10) + } + + def append_1: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + val eleven = ten.append(DoubleLinkedList(11)) + // Post-append equality test + require(ten == eleven) + // Post-append size test + require(11 == ten.size) + // Post-append data test + require((ten.size*(ten.size+1))/2 == ten.reduceLeft(_ + _)) + // Post-append chaining test + require(ten == ten.reverse.reverse) + // Post-append position test + require(ten.last == 11) + } + + def append_2: Unit = { + val ten = DoubleLinkedList(1 to 10: _*) + try { + DoubleLinkedList().append(ten) + } catch { + case _: IllegalArgumentException => require(true) + case _: Throwable => require(false) + } + val zero = DoubleLinkedList(0) + zero.append(ten) + require(zero.size == 11) + require(zero.head == 0) + require(zero.last == 10) + } +} diff --git a/tests/pending/run/t3376.check b/tests/pending/run/t3376.check new file mode 100644 index 000000000000..b8fd2843f6a2 --- /dev/null +++ b/tests/pending/run/t3376.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class M[@specialized T] { override def toString = "mmm" } +defined class M + +scala> val m1 = new M[Int]() +m1: M[Int] = mmm + +scala> val m2 = new M[Float]() +m2: M[Float] = mmm + +scala> val m3 = new M[String]() +m3: M[String] = mmm + +scala> :quit diff --git a/tests/pending/run/t3376.scala b/tests/pending/run/t3376.scala new file mode 100644 index 000000000000..e2c94e5072dc --- /dev/null +++ b/tests/pending/run/t3376.scala @@ -0,0 +1,13 @@ +import scala.tools.nsc.interpreter._ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + class M[@specialized T] { } + + def code = """ + |class M[@specialized T] { override def toString = "mmm" } + |val m1 = new M[Int]() + |val m2 = new M[Float]() + |val m3 = new M[String]() + |""".stripMargin +} diff --git a/tests/pending/run/t3395.check b/tests/pending/run/t3395.check new file mode 100644 index 000000000000..5f5521fae22f --- /dev/null +++ b/tests/pending/run/t3395.check @@ -0,0 +1,2 @@ +abc +def diff --git a/tests/pending/run/t3395.scala b/tests/pending/run/t3395.scala new file mode 100644 index 000000000000..5f663d68f503 --- /dev/null +++ b/tests/pending/run/t3395.scala @@ -0,0 +1,13 @@ +object Test { + def main(args: Array[String]): Unit = { + Seq("") match { + case Seq("") => println("abc") + case Seq(_, _, x) => println(x) + } + + Seq(1, 2, "def") match { + case Seq("") => println("abc") + case Seq(_, _, x) => println(x) + } + } +} diff --git a/tests/pending/run/t3397.scala b/tests/pending/run/t3397.scala new file mode 100644 index 000000000000..2c8cbed3ab1d --- /dev/null +++ b/tests/pending/run/t3397.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val x = Seq(Set(1,2,3),Set(4,5,6),Set(7,8,9)).transpose + + () + } +} diff --git a/tests/pending/run/t3425.check b/tests/pending/run/t3425.check new file mode 100644 index 000000000000..5be779bd7499 --- /dev/null +++ b/tests/pending/run/t3425.check @@ -0,0 +1,4 @@ +123 +456 +789 +789 diff --git a/tests/pending/run/t3425.scala b/tests/pending/run/t3425.scala new file mode 100644 index 000000000000..c61d1071a52a --- /dev/null +++ b/tests/pending/run/t3425.scala @@ -0,0 +1,41 @@ +import scala.language.reflectiveCalls +object Other { + abstract class Foo { + type R1 <: { def x: Any } + type R2 <: R1 { def x: Int } + + def f(x: R2) = x.x + } + + abstract class Bar { + trait R0 { def x: Any } + type R1 <: R0 { def x: AnyVal } + type R2 <: R1 { def x: Int } + + def f(x: R2) = x.x + } +} +object Test { + trait A + trait B + def x(a: (A { val y: Int }) with B { val y: Int }) = a.y + + class C extends A with B { + val y = 456 + } + + class Bippy { def x: Int = 789 } + + def main(args: Array[String]): Unit = { + println(x(new A with B { val y = 123 })) + println(x(new C)) + + { val foo = new Other.Foo { type R1 = Bippy ; type R2 = Bippy } + println(foo.f(new Bippy)) + } + { val bar = new Other.Bar { type R1 = Bippy with R0 ; type R2 = R1 } + println(bar.f(new Bippy with bar.R0)) + } + } +} + diff --git a/tests/pending/run/t3425b.check b/tests/pending/run/t3425b.check new file mode 100644 index 000000000000..5d34c43de32b --- /dev/null +++ b/tests/pending/run/t3425b.check @@ -0,0 +1,152 @@ +==== Direct Calls ==== + +Any{val y: P} with C{val y: P} +Any{val y: P} with C{val y: Q} +Any{val y: P} with C{val y: R forSome { type R <: P with Q }} +Any{val y: Q} with C{val y: P} +Any{val y: Q} with C{val y: Q} +Any{val y: Q} with C{val y: R forSome { type R <: P with Q }} +Any{val y: R forSome { type R <: P with Q }} with C{val y: P} +Any{val y: R forSome { type R <: P with Q }} with C{val y: Q} +Any{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }} +A{val y: P} with C{val y: P} +A{val y: P} with C{val y: Q} +A{val y: P} with C{val y: R forSome { type R <: P with Q }} +A{val y: Q} with C{val y: P} +A{val y: Q} with C{val y: Q} +A{val y: Q} with C{val y: R forSome { type R <: P with Q }} +A{val y: R forSome { type R <: P with Q }} with C{val y: P} +A{val y: R forSome { type R <: P with Q }} with C{val y: Q} +A{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }} +B{val y: P} with C{val y: P} +B{val y: P} with C{val y: Q} +B{val y: P} with C{val y: R forSome { type R <: P with Q }} +B{val y: Q} with C{val y: P} +B{val y: Q} with C{val y: Q} +B{val y: Q} with C{val y: R forSome { type R <: P with Q }} +B{val y: R forSome { type R <: P with Q }} with C{val y: P} +B{val y: R forSome { type R <: P with Q }} with C{val y: Q} +B{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }} +C{val y: P} with C{val y: P} +C{val y: P} with C{val y: Q} +C{val y: P} with C{val y: R forSome { type R <: P with Q }} +C{val y: Q} with C{val y: P} +C{val y: Q} with C{val y: Q} +C{val y: Q} with C{val y: R forSome { type R <: P with Q }} +C{val y: R forSome { type R <: P with Q }} with C{val y: P} +C{val y: R forSome { type R <: P with Q }} with C{val y: Q} +C{val y: R forSome { type R <: P with Q }} with C{val y: R forSome { type R <: P with Q }} + + +==== Reflective Calls ==== + +Any{val y: P} with Any{val y: P} +Any{val y: P} with Any{val y: Q} +Any{val y: P} with Any{val y: R forSome { type R <: P with Q }} +Any{val y: P} with A{val y: P} +Any{val y: P} with A{val y: Q} +Any{val y: P} with A{val y: R forSome { type R <: P with Q }} +Any{val y: P} with B{val y: P} +Any{val y: P} with B{val y: Q} +Any{val y: P} with B{val y: R forSome { type R <: P with Q }} +Any{val y: Q} with Any{val y: P} +Any{val y: Q} with Any{val y: Q} +Any{val y: Q} with Any{val y: R forSome { type R <: P with Q }} +Any{val y: Q} with A{val y: P} +Any{val y: Q} with A{val y: Q} +Any{val y: Q} with A{val y: R forSome { type R <: P with Q }} +Any{val y: Q} with B{val y: P} +Any{val y: Q} with B{val y: Q} +Any{val y: Q} with B{val y: R forSome { type R <: P with Q }} +Any{val y: R forSome { type R <: P with Q }} with Any{val y: P} +Any{val y: R forSome { type R <: P with Q }} with Any{val y: Q} +Any{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }} +Any{val y: R forSome { type R <: P with Q }} with A{val y: P} +Any{val y: R forSome { type R <: P with Q }} with A{val y: Q} +Any{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }} +Any{val y: R forSome { type R <: P with Q }} with B{val y: P} +Any{val y: R forSome { type R <: P with Q }} with B{val y: Q} +Any{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }} +A{val y: P} with Any{val y: P} +A{val y: P} with Any{val y: Q} +A{val y: P} with Any{val y: R forSome { type R <: P with Q }} +A{val y: P} with A{val y: P} +A{val y: P} with A{val y: Q} +A{val y: P} with A{val y: R forSome { type R <: P with Q }} +A{val y: P} with B{val y: P} +A{val y: P} with B{val y: Q} +A{val y: P} with B{val y: R forSome { type R <: P with Q }} +A{val y: Q} with Any{val y: P} +A{val y: Q} with Any{val y: Q} +A{val y: Q} with Any{val y: R forSome { type R <: P with Q }} +A{val y: Q} with A{val y: P} +A{val y: Q} with A{val y: Q} +A{val y: Q} with A{val y: R forSome { type R <: P with Q }} +A{val y: Q} with B{val y: P} +A{val y: Q} with B{val y: Q} +A{val y: Q} with B{val y: R forSome { type R <: P with Q }} +A{val y: R forSome { type R <: P with Q }} with Any{val y: P} +A{val y: R forSome { type R <: P with Q }} with Any{val y: Q} +A{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }} +A{val y: R forSome { type R <: P with Q }} with A{val y: P} +A{val y: R forSome { type R <: P with Q }} with A{val y: Q} +A{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }} +A{val y: R forSome { type R <: P with Q }} with B{val y: P} +A{val y: R forSome { type R <: P with Q }} with B{val y: Q} +A{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }} +B{val y: P} with Any{val y: P} +B{val y: P} with Any{val y: Q} +B{val y: P} with Any{val y: R forSome { type R <: P with Q }} +B{val y: P} with A{val y: P} +B{val y: P} with A{val y: Q} +B{val y: P} with A{val y: R forSome { type R <: P with Q }} +B{val y: P} with B{val y: P} +B{val y: P} with B{val y: Q} +B{val y: P} with B{val y: R forSome { type R <: P with Q }} +B{val y: Q} with Any{val y: P} +B{val y: Q} with Any{val y: Q} +B{val y: Q} with Any{val y: R forSome { type R <: P with Q }} +B{val y: Q} with A{val y: P} +B{val y: Q} with A{val y: Q} +B{val y: Q} with A{val y: R forSome { type R <: P with Q }} +B{val y: Q} with B{val y: P} +B{val y: Q} with B{val y: Q} +B{val y: Q} with B{val y: R forSome { type R <: P with Q }} +B{val y: R forSome { type R <: P with Q }} with Any{val y: P} +B{val y: R forSome { type R <: P with Q }} with Any{val y: Q} +B{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }} +B{val y: R forSome { type R <: P with Q }} with A{val y: P} +B{val y: R forSome { type R <: P with Q }} with A{val y: Q} +B{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }} +B{val y: R forSome { type R <: P with Q }} with B{val y: P} +B{val y: R forSome { type R <: P with Q }} with B{val y: Q} +B{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }} +C{val y: P} with Any{val y: P} +C{val y: P} with Any{val y: Q} +C{val y: P} with Any{val y: R forSome { type R <: P with Q }} +C{val y: P} with A{val y: P} +C{val y: P} with A{val y: Q} +C{val y: P} with A{val y: R forSome { type R <: P with Q }} +C{val y: P} with B{val y: P} +C{val y: P} with B{val y: Q} +C{val y: P} with B{val y: R forSome { type R <: P with Q }} +C{val y: Q} with Any{val y: P} +C{val y: Q} with Any{val y: Q} +C{val y: Q} with Any{val y: R forSome { type R <: P with Q }} +C{val y: Q} with A{val y: P} +C{val y: Q} with A{val y: Q} +C{val y: Q} with A{val y: R forSome { type R <: P with Q }} +C{val y: Q} with B{val y: P} +C{val y: Q} with B{val y: Q} +C{val y: Q} with B{val y: R forSome { type R <: P with Q }} +C{val y: R forSome { type R <: P with Q }} with Any{val y: P} +C{val y: R forSome { type R <: P with Q }} with Any{val y: Q} +C{val y: R forSome { type R <: P with Q }} with Any{val y: R forSome { type R <: P with Q }} +C{val y: R forSome { type R <: P with Q }} with A{val y: P} +C{val y: R forSome { type R <: P with Q }} with A{val y: Q} +C{val y: R forSome { type R <: P with Q }} with A{val y: R forSome { type R <: P with Q }} +C{val y: R forSome { type R <: P with Q }} with B{val y: P} +C{val y: R forSome { type R <: P with Q }} with B{val y: Q} +C{val y: R forSome { type R <: P with Q }} with B{val y: R forSome { type R <: P with Q }} + + diff --git a/tests/pending/run/t3425b/Base_1.scala b/tests/pending/run/t3425b/Base_1.scala new file mode 100644 index 000000000000..bdbc124d2913 --- /dev/null +++ b/tests/pending/run/t3425b/Base_1.scala @@ -0,0 +1,89 @@ +trait P { def reflected: Boolean } +trait Q { def reflected: Boolean } +class PQ(val reflected: Boolean) extends P with Q { } + +trait A +trait B +trait C { val y: P } +class ABC extends A with B with C { + private def reflected = ( + Thread.currentThread.getStackTrace + takeWhile (_.getMethodName != "main") + exists (_.toString contains "sun.reflect.") + ) + lazy val y: PQ = new PQ(reflected) +} + +/*** The source used to generate the second file + Not otherwise used in the test except that compiling + it helps make sure it still compiles. + +****/ + +object Gen { + case class Tp(outer: String, elem: String) { + override def toString = s"$outer { val y: $elem }" + } + case class Pair(tp1: Tp, tp2: Tp) { + def expr = s"((new ABC): $tp)" + def tp = s"($tp1) with ($tp2)" + } + val traits = Vector("Any", "A", "B", "C") map ("%6s" format _) + val types = Vector("P", "Q", "R forSome { type R <: P with Q }") + val allTypes = for (c <- traits ; tp <- types) yield Tp(c, tp) + val pairs = allTypes flatMap (t1 => allTypes map (t2 => Pair(t1, t2))) + val indices = pairs.indices + + def aliases(idx: Int) = { + val p = pairs(idx) + import p._ + List( + s"type R1_$idx = $tp", + s"type R2_$idx = R1_$idx { val y: (${tp1.elem}) with (${tp2.elem}) }" + ) + } + + def mkMethodContent(pre: String)(f: Int => String) = + indices map (i => s"def $pre$i${f(i)}") mkString "\n " + + def content = List( + indices flatMap aliases mkString "\n ", + mkMethodContent("f")(i => s" = { val x = ${pairs(i).expr} ; x.y.reflected -> whatis(x).toString }"), + mkMethodContent("g")(i => s"""(x: R1_$i) = x.y"""), + mkMethodContent("h")(i => s"""(x: R2_$i) = x.y""") + ) mkString "\n " + + def fCalls = indices map ("f" + _) mkString ("\n ", ",\n ", "\n ") + + def main(args: Array[String]): Unit = { + // One cannot attain proper appreciation for the inadequacies of + // string interpolation without becoming one with the newline. + val nl = "\\n" + + println(s""" + |import scala.reflect.runtime.universe._ + |import scala.language._ + | + |object Test { + | def whatis[T: TypeTag](x: T) = typeOf[T] + | def sshow(label: String, xs: Traversable[Any]) { + | println("==== " + label + " ====$nl") + | xs.toList.map("" + _).sorted foreach println + | println("$nl") + | } + | + | $content + | lazy val fcalls = List($fCalls) + | + | def main(args: Array[String]) { + | sshow("Direct Calls", fcalls collect { case (false, n) => n }) + | sshow("Reflective Calls", fcalls collect { case (true, n) => n }) + | // For a good time try printing this - have to fix bugs in + | // reflection before that's going to be a good idea + | // println(typeOf[Test.type].typeSymbol.asClass.info) + | } + |} + """.stripMargin.trim + ) + } +} diff --git a/tests/pending/run/t3425b/Generated_2.scala b/tests/pending/run/t3425b/Generated_2.scala new file mode 100644 index 000000000000..8fa810416f00 --- /dev/null +++ b/tests/pending/run/t3425b/Generated_2.scala @@ -0,0 +1,1142 @@ +import scala.reflect.runtime.universe._ +import scala.language._ + +object Test { + def whatis[T: TypeTag](x: T) = typeOf[T] + def sshow(label: String, xs: Traversable[Any]): Unit = { + println("==== " + label + " ====\n") + xs.toList.map("" + _).sorted foreach println + println("\n") + } + + type R1_0 = ( Any { val y: P }) with ( Any { val y: P }) + type R2_0 = R1_0 { val y: (P) with (P) } + type R1_1 = ( Any { val y: P }) with ( Any { val y: Q }) + type R2_1 = R1_1 { val y: (P) with (Q) } + type R1_2 = ( Any { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_2 = R1_2 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_3 = ( Any { val y: P }) with ( A { val y: P }) + type R2_3 = R1_3 { val y: (P) with (P) } + type R1_4 = ( Any { val y: P }) with ( A { val y: Q }) + type R2_4 = R1_4 { val y: (P) with (Q) } + type R1_5 = ( Any { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_5 = R1_5 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_6 = ( Any { val y: P }) with ( B { val y: P }) + type R2_6 = R1_6 { val y: (P) with (P) } + type R1_7 = ( Any { val y: P }) with ( B { val y: Q }) + type R2_7 = R1_7 { val y: (P) with (Q) } + type R1_8 = ( Any { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_8 = R1_8 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_9 = ( Any { val y: P }) with ( C { val y: P }) + type R2_9 = R1_9 { val y: (P) with (P) } + type R1_10 = ( Any { val y: P }) with ( C { val y: Q }) + type R2_10 = R1_10 { val y: (P) with (Q) } + type R1_11 = ( Any { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_11 = R1_11 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_12 = ( Any { val y: Q }) with ( Any { val y: P }) + type R2_12 = R1_12 { val y: (Q) with (P) } + type R1_13 = ( Any { val y: Q }) with ( Any { val y: Q }) + type R2_13 = R1_13 { val y: (Q) with (Q) } + type R1_14 = ( Any { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_14 = R1_14 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_15 = ( Any { val y: Q }) with ( A { val y: P }) + type R2_15 = R1_15 { val y: (Q) with (P) } + type R1_16 = ( Any { val y: Q }) with ( A { val y: Q }) + type R2_16 = R1_16 { val y: (Q) with (Q) } + type R1_17 = ( Any { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_17 = R1_17 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_18 = ( Any { val y: Q }) with ( B { val y: P }) + type R2_18 = R1_18 { val y: (Q) with (P) } + type R1_19 = ( Any { val y: Q }) with ( B { val y: Q }) + type R2_19 = R1_19 { val y: (Q) with (Q) } + type R1_20 = ( Any { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_20 = R1_20 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_21 = ( Any { val y: Q }) with ( C { val y: P }) + type R2_21 = R1_21 { val y: (Q) with (P) } + type R1_22 = ( Any { val y: Q }) with ( C { val y: Q }) + type R2_22 = R1_22 { val y: (Q) with (Q) } + type R1_23 = ( Any { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_23 = R1_23 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_24 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P }) + type R2_24 = R1_24 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_25 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q }) + type R2_25 = R1_25 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_26 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_26 = R1_26 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_27 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P }) + type R2_27 = R1_27 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_28 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q }) + type R2_28 = R1_28 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_29 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_29 = R1_29 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_30 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P }) + type R2_30 = R1_30 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_31 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q }) + type R2_31 = R1_31 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_32 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_32 = R1_32 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_33 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P }) + type R2_33 = R1_33 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_34 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q }) + type R2_34 = R1_34 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_35 = ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_35 = R1_35 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_36 = ( A { val y: P }) with ( Any { val y: P }) + type R2_36 = R1_36 { val y: (P) with (P) } + type R1_37 = ( A { val y: P }) with ( Any { val y: Q }) + type R2_37 = R1_37 { val y: (P) with (Q) } + type R1_38 = ( A { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_38 = R1_38 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_39 = ( A { val y: P }) with ( A { val y: P }) + type R2_39 = R1_39 { val y: (P) with (P) } + type R1_40 = ( A { val y: P }) with ( A { val y: Q }) + type R2_40 = R1_40 { val y: (P) with (Q) } + type R1_41 = ( A { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_41 = R1_41 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_42 = ( A { val y: P }) with ( B { val y: P }) + type R2_42 = R1_42 { val y: (P) with (P) } + type R1_43 = ( A { val y: P }) with ( B { val y: Q }) + type R2_43 = R1_43 { val y: (P) with (Q) } + type R1_44 = ( A { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_44 = R1_44 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_45 = ( A { val y: P }) with ( C { val y: P }) + type R2_45 = R1_45 { val y: (P) with (P) } + type R1_46 = ( A { val y: P }) with ( C { val y: Q }) + type R2_46 = R1_46 { val y: (P) with (Q) } + type R1_47 = ( A { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_47 = R1_47 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_48 = ( A { val y: Q }) with ( Any { val y: P }) + type R2_48 = R1_48 { val y: (Q) with (P) } + type R1_49 = ( A { val y: Q }) with ( Any { val y: Q }) + type R2_49 = R1_49 { val y: (Q) with (Q) } + type R1_50 = ( A { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_50 = R1_50 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_51 = ( A { val y: Q }) with ( A { val y: P }) + type R2_51 = R1_51 { val y: (Q) with (P) } + type R1_52 = ( A { val y: Q }) with ( A { val y: Q }) + type R2_52 = R1_52 { val y: (Q) with (Q) } + type R1_53 = ( A { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_53 = R1_53 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_54 = ( A { val y: Q }) with ( B { val y: P }) + type R2_54 = R1_54 { val y: (Q) with (P) } + type R1_55 = ( A { val y: Q }) with ( B { val y: Q }) + type R2_55 = R1_55 { val y: (Q) with (Q) } + type R1_56 = ( A { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_56 = R1_56 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_57 = ( A { val y: Q }) with ( C { val y: P }) + type R2_57 = R1_57 { val y: (Q) with (P) } + type R1_58 = ( A { val y: Q }) with ( C { val y: Q }) + type R2_58 = R1_58 { val y: (Q) with (Q) } + type R1_59 = ( A { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_59 = R1_59 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_60 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P }) + type R2_60 = R1_60 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_61 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q }) + type R2_61 = R1_61 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_62 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_62 = R1_62 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_63 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P }) + type R2_63 = R1_63 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_64 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q }) + type R2_64 = R1_64 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_65 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_65 = R1_65 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_66 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P }) + type R2_66 = R1_66 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_67 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q }) + type R2_67 = R1_67 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_68 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_68 = R1_68 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_69 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P }) + type R2_69 = R1_69 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_70 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q }) + type R2_70 = R1_70 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_71 = ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_71 = R1_71 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_72 = ( B { val y: P }) with ( Any { val y: P }) + type R2_72 = R1_72 { val y: (P) with (P) } + type R1_73 = ( B { val y: P }) with ( Any { val y: Q }) + type R2_73 = R1_73 { val y: (P) with (Q) } + type R1_74 = ( B { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_74 = R1_74 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_75 = ( B { val y: P }) with ( A { val y: P }) + type R2_75 = R1_75 { val y: (P) with (P) } + type R1_76 = ( B { val y: P }) with ( A { val y: Q }) + type R2_76 = R1_76 { val y: (P) with (Q) } + type R1_77 = ( B { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_77 = R1_77 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_78 = ( B { val y: P }) with ( B { val y: P }) + type R2_78 = R1_78 { val y: (P) with (P) } + type R1_79 = ( B { val y: P }) with ( B { val y: Q }) + type R2_79 = R1_79 { val y: (P) with (Q) } + type R1_80 = ( B { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_80 = R1_80 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_81 = ( B { val y: P }) with ( C { val y: P }) + type R2_81 = R1_81 { val y: (P) with (P) } + type R1_82 = ( B { val y: P }) with ( C { val y: Q }) + type R2_82 = R1_82 { val y: (P) with (Q) } + type R1_83 = ( B { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_83 = R1_83 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_84 = ( B { val y: Q }) with ( Any { val y: P }) + type R2_84 = R1_84 { val y: (Q) with (P) } + type R1_85 = ( B { val y: Q }) with ( Any { val y: Q }) + type R2_85 = R1_85 { val y: (Q) with (Q) } + type R1_86 = ( B { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_86 = R1_86 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_87 = ( B { val y: Q }) with ( A { val y: P }) + type R2_87 = R1_87 { val y: (Q) with (P) } + type R1_88 = ( B { val y: Q }) with ( A { val y: Q }) + type R2_88 = R1_88 { val y: (Q) with (Q) } + type R1_89 = ( B { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_89 = R1_89 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_90 = ( B { val y: Q }) with ( B { val y: P }) + type R2_90 = R1_90 { val y: (Q) with (P) } + type R1_91 = ( B { val y: Q }) with ( B { val y: Q }) + type R2_91 = R1_91 { val y: (Q) with (Q) } + type R1_92 = ( B { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_92 = R1_92 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_93 = ( B { val y: Q }) with ( C { val y: P }) + type R2_93 = R1_93 { val y: (Q) with (P) } + type R1_94 = ( B { val y: Q }) with ( C { val y: Q }) + type R2_94 = R1_94 { val y: (Q) with (Q) } + type R1_95 = ( B { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_95 = R1_95 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_96 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P }) + type R2_96 = R1_96 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_97 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q }) + type R2_97 = R1_97 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_98 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_98 = R1_98 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_99 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P }) + type R2_99 = R1_99 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_100 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q }) + type R2_100 = R1_100 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_101 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_101 = R1_101 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_102 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P }) + type R2_102 = R1_102 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_103 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q }) + type R2_103 = R1_103 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_104 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_104 = R1_104 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_105 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P }) + type R2_105 = R1_105 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_106 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q }) + type R2_106 = R1_106 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_107 = ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_107 = R1_107 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_108 = ( C { val y: P }) with ( Any { val y: P }) + type R2_108 = R1_108 { val y: (P) with (P) } + type R1_109 = ( C { val y: P }) with ( Any { val y: Q }) + type R2_109 = R1_109 { val y: (P) with (Q) } + type R1_110 = ( C { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_110 = R1_110 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_111 = ( C { val y: P }) with ( A { val y: P }) + type R2_111 = R1_111 { val y: (P) with (P) } + type R1_112 = ( C { val y: P }) with ( A { val y: Q }) + type R2_112 = R1_112 { val y: (P) with (Q) } + type R1_113 = ( C { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_113 = R1_113 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_114 = ( C { val y: P }) with ( B { val y: P }) + type R2_114 = R1_114 { val y: (P) with (P) } + type R1_115 = ( C { val y: P }) with ( B { val y: Q }) + type R2_115 = R1_115 { val y: (P) with (Q) } + type R1_116 = ( C { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_116 = R1_116 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_117 = ( C { val y: P }) with ( C { val y: P }) + type R2_117 = R1_117 { val y: (P) with (P) } + type R1_118 = ( C { val y: P }) with ( C { val y: Q }) + type R2_118 = R1_118 { val y: (P) with (Q) } + type R1_119 = ( C { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_119 = R1_119 { val y: (P) with (P with R forSome { + type R <: P with Q +}) } + type R1_120 = ( C { val y: Q }) with ( Any { val y: P }) + type R2_120 = R1_120 { val y: (Q) with (P) } + type R1_121 = ( C { val y: Q }) with ( Any { val y: Q }) + type R2_121 = R1_121 { val y: (Q) with (Q) } + type R1_122 = ( C { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_122 = R1_122 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_123 = ( C { val y: Q }) with ( A { val y: P }) + type R2_123 = R1_123 { val y: (Q) with (P) } + type R1_124 = ( C { val y: Q }) with ( A { val y: Q }) + type R2_124 = R1_124 { val y: (Q) with (Q) } + type R1_125 = ( C { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_125 = R1_125 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_126 = ( C { val y: Q }) with ( B { val y: P }) + type R2_126 = R1_126 { val y: (Q) with (P) } + type R1_127 = ( C { val y: Q }) with ( B { val y: Q }) + type R2_127 = R1_127 { val y: (Q) with (Q) } + type R1_128 = ( C { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_128 = R1_128 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_129 = ( C { val y: Q }) with ( C { val y: P }) + type R2_129 = R1_129 { val y: (Q) with (P) } + type R1_130 = ( C { val y: Q }) with ( C { val y: Q }) + type R2_130 = R1_130 { val y: (Q) with (Q) } + type R1_131 = ( C { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_131 = R1_131 { val y: (Q) with (Q with R forSome { + type R <: P with Q +}) } + type R1_132 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: P }) + type R2_132 = R1_132 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_133 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q }) + type R2_133 = R1_133 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_134 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } }) + type R2_134 = R1_134 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_135 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: P }) + type R2_135 = R1_135 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_136 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: Q }) + type R2_136 = R1_136 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_137 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } }) + type R2_137 = R1_137 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_138 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: P }) + type R2_138 = R1_138 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_139 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: Q }) + type R2_139 = R1_139 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_140 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } }) + type R2_140 = R1_140 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + type R1_141 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: P }) + type R2_141 = R1_141 { val y: (R forSome { + type R <: P with Q +} with P) with (P) } + type R1_142 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: Q }) + type R2_142 = R1_142 { val y: (R forSome { + type R <: P with Q +} with Q) with (Q) } + type R1_143 = ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } }) + type R2_143 = R1_143 { val y: (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) with (R forSome { + type R <: P with Q +} with R forSome { + type R <: P with Q +}) } + def f0 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f1 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f2 = { val x = ((new ABC): ( Any { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f3 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f4 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f5 = { val x = ((new ABC): ( Any { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f6 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f7 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f8 = { val x = ((new ABC): ( Any { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f9 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f10 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f11 = { val x = ((new ABC): ( Any { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f12 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f13 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f14 = { val x = ((new ABC): ( Any { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f15 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f16 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f17 = { val x = ((new ABC): ( Any { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f18 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f19 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f20 = { val x = ((new ABC): ( Any { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f21 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f22 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f23 = { val x = ((new ABC): ( Any { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f24 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f25 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f26 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f27 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f28 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f29 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f30 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f31 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f32 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f33 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f34 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f35 = { val x = ((new ABC): ( Any { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f36 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f37 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f38 = { val x = ((new ABC): ( A { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f39 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f40 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f41 = { val x = ((new ABC): ( A { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f42 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f43 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f44 = { val x = ((new ABC): ( A { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f45 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f46 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f47 = { val x = ((new ABC): ( A { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f48 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f49 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f50 = { val x = ((new ABC): ( A { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f51 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f52 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f53 = { val x = ((new ABC): ( A { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f54 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f55 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f56 = { val x = ((new ABC): ( A { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f57 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f58 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f59 = { val x = ((new ABC): ( A { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f60 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f61 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f62 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f63 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f64 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f65 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f66 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f67 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f68 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f69 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f70 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f71 = { val x = ((new ABC): ( A { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f72 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f73 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f74 = { val x = ((new ABC): ( B { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f75 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f76 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f77 = { val x = ((new ABC): ( B { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f78 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f79 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f80 = { val x = ((new ABC): ( B { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f81 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f82 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f83 = { val x = ((new ABC): ( B { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f84 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f85 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f86 = { val x = ((new ABC): ( B { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f87 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f88 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f89 = { val x = ((new ABC): ( B { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f90 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f91 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f92 = { val x = ((new ABC): ( B { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f93 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f94 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f95 = { val x = ((new ABC): ( B { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f96 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f97 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f98 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f99 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f100 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f101 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f102 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f103 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f104 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f105 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f106 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f107 = { val x = ((new ABC): ( B { val y: val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f108 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f109 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f110 = { val x = ((new ABC): ( C { val y: P }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f111 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f112 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f113 = { val x = ((new ABC): ( C { val y: P }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f114 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f115 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f116 = { val x = ((new ABC): ( C { val y: P }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f117 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f118 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f119 = { val x = ((new ABC): ( C { val y: P }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f120 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f121 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f122 = { val x = ((new ABC): ( C { val y: Q }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f123 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f124 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f125 = { val x = ((new ABC): ( C { val y: Q }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f126 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f127 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f128 = { val x = ((new ABC): ( C { val y: Q }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f129 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f130 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f131 = { val x = ((new ABC): ( C { val y: Q }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f132 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f133 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f134 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( Any { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f135 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f136 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f137 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( A { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f138 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f139 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f140 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( B { val y: val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def f141 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: P })) ; x.y.reflected -> whatis(x).toString } + def f142 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: Q })) ; x.y.reflected -> whatis(x).toString } + def f143 = { val x = ((new ABC): ( C { val y: override val y: R forSome { type R <: P with Q } }) with ( C { val y: override val y: R forSome { type R <: P with Q } })) ; x.y.reflected -> whatis(x).toString } + def g0(x: R1_0) = x.y + def g1(x: R1_1) = x.y + def g2(x: R1_2) = x.y + def g3(x: R1_3) = x.y + def g4(x: R1_4) = x.y + def g5(x: R1_5) = x.y + def g6(x: R1_6) = x.y + def g7(x: R1_7) = x.y + def g8(x: R1_8) = x.y + def g9(x: R1_9) = x.y + def g10(x: R1_10) = x.y + def g11(x: R1_11) = x.y + def g12(x: R1_12) = x.y + def g13(x: R1_13) = x.y + def g14(x: R1_14) = x.y + def g15(x: R1_15) = x.y + def g16(x: R1_16) = x.y + def g17(x: R1_17) = x.y + def g18(x: R1_18) = x.y + def g19(x: R1_19) = x.y + def g20(x: R1_20) = x.y + def g21(x: R1_21) = x.y + def g22(x: R1_22) = x.y + def g23(x: R1_23) = x.y + def g24(x: R1_24) = x.y + def g25(x: R1_25) = x.y + def g26(x: R1_26) = x.y + def g27(x: R1_27) = x.y + def g28(x: R1_28) = x.y + def g29(x: R1_29) = x.y + def g30(x: R1_30) = x.y + def g31(x: R1_31) = x.y + def g32(x: R1_32) = x.y + def g33(x: R1_33) = x.y + def g34(x: R1_34) = x.y + def g35(x: R1_35) = x.y + def g36(x: R1_36) = x.y + def g37(x: R1_37) = x.y + def g38(x: R1_38) = x.y + def g39(x: R1_39) = x.y + def g40(x: R1_40) = x.y + def g41(x: R1_41) = x.y + def g42(x: R1_42) = x.y + def g43(x: R1_43) = x.y + def g44(x: R1_44) = x.y + def g45(x: R1_45) = x.y + def g46(x: R1_46) = x.y + def g47(x: R1_47) = x.y + def g48(x: R1_48) = x.y + def g49(x: R1_49) = x.y + def g50(x: R1_50) = x.y + def g51(x: R1_51) = x.y + def g52(x: R1_52) = x.y + def g53(x: R1_53) = x.y + def g54(x: R1_54) = x.y + def g55(x: R1_55) = x.y + def g56(x: R1_56) = x.y + def g57(x: R1_57) = x.y + def g58(x: R1_58) = x.y + def g59(x: R1_59) = x.y + def g60(x: R1_60) = x.y + def g61(x: R1_61) = x.y + def g62(x: R1_62) = x.y + def g63(x: R1_63) = x.y + def g64(x: R1_64) = x.y + def g65(x: R1_65) = x.y + def g66(x: R1_66) = x.y + def g67(x: R1_67) = x.y + def g68(x: R1_68) = x.y + def g69(x: R1_69) = x.y + def g70(x: R1_70) = x.y + def g71(x: R1_71) = x.y + def g72(x: R1_72) = x.y + def g73(x: R1_73) = x.y + def g74(x: R1_74) = x.y + def g75(x: R1_75) = x.y + def g76(x: R1_76) = x.y + def g77(x: R1_77) = x.y + def g78(x: R1_78) = x.y + def g79(x: R1_79) = x.y + def g80(x: R1_80) = x.y + def g81(x: R1_81) = x.y + def g82(x: R1_82) = x.y + def g83(x: R1_83) = x.y + def g84(x: R1_84) = x.y + def g85(x: R1_85) = x.y + def g86(x: R1_86) = x.y + def g87(x: R1_87) = x.y + def g88(x: R1_88) = x.y + def g89(x: R1_89) = x.y + def g90(x: R1_90) = x.y + def g91(x: R1_91) = x.y + def g92(x: R1_92) = x.y + def g93(x: R1_93) = x.y + def g94(x: R1_94) = x.y + def g95(x: R1_95) = x.y + def g96(x: R1_96) = x.y + def g97(x: R1_97) = x.y + def g98(x: R1_98) = x.y + def g99(x: R1_99) = x.y + def g100(x: R1_100) = x.y + def g101(x: R1_101) = x.y + def g102(x: R1_102) = x.y + def g103(x: R1_103) = x.y + def g104(x: R1_104) = x.y + def g105(x: R1_105) = x.y + def g106(x: R1_106) = x.y + def g107(x: R1_107) = x.y + def g108(x: R1_108) = x.y + def g109(x: R1_109) = x.y + def g110(x: R1_110) = x.y + def g111(x: R1_111) = x.y + def g112(x: R1_112) = x.y + def g113(x: R1_113) = x.y + def g114(x: R1_114) = x.y + def g115(x: R1_115) = x.y + def g116(x: R1_116) = x.y + def g117(x: R1_117) = x.y + def g118(x: R1_118) = x.y + def g119(x: R1_119) = x.y + def g120(x: R1_120) = x.y + def g121(x: R1_121) = x.y + def g122(x: R1_122) = x.y + def g123(x: R1_123) = x.y + def g124(x: R1_124) = x.y + def g125(x: R1_125) = x.y + def g126(x: R1_126) = x.y + def g127(x: R1_127) = x.y + def g128(x: R1_128) = x.y + def g129(x: R1_129) = x.y + def g130(x: R1_130) = x.y + def g131(x: R1_131) = x.y + def g132(x: R1_132) = x.y + def g133(x: R1_133) = x.y + def g134(x: R1_134) = x.y + def g135(x: R1_135) = x.y + def g136(x: R1_136) = x.y + def g137(x: R1_137) = x.y + def g138(x: R1_138) = x.y + def g139(x: R1_139) = x.y + def g140(x: R1_140) = x.y + def g141(x: R1_141) = x.y + def g142(x: R1_142) = x.y + def g143(x: R1_143) = x.y + def h0(x: R2_0) = x.y + def h1(x: R2_1) = x.y + def h2(x: R2_2) = x.y + def h3(x: R2_3) = x.y + def h4(x: R2_4) = x.y + def h5(x: R2_5) = x.y + def h6(x: R2_6) = x.y + def h7(x: R2_7) = x.y + def h8(x: R2_8) = x.y + def h9(x: R2_9) = x.y + def h10(x: R2_10) = x.y + def h11(x: R2_11) = x.y + def h12(x: R2_12) = x.y + def h13(x: R2_13) = x.y + def h14(x: R2_14) = x.y + def h15(x: R2_15) = x.y + def h16(x: R2_16) = x.y + def h17(x: R2_17) = x.y + def h18(x: R2_18) = x.y + def h19(x: R2_19) = x.y + def h20(x: R2_20) = x.y + def h21(x: R2_21) = x.y + def h22(x: R2_22) = x.y + def h23(x: R2_23) = x.y + def h24(x: R2_24) = x.y + def h25(x: R2_25) = x.y + def h26(x: R2_26) = x.y + def h27(x: R2_27) = x.y + def h28(x: R2_28) = x.y + def h29(x: R2_29) = x.y + def h30(x: R2_30) = x.y + def h31(x: R2_31) = x.y + def h32(x: R2_32) = x.y + def h33(x: R2_33) = x.y + def h34(x: R2_34) = x.y + def h35(x: R2_35) = x.y + def h36(x: R2_36) = x.y + def h37(x: R2_37) = x.y + def h38(x: R2_38) = x.y + def h39(x: R2_39) = x.y + def h40(x: R2_40) = x.y + def h41(x: R2_41) = x.y + def h42(x: R2_42) = x.y + def h43(x: R2_43) = x.y + def h44(x: R2_44) = x.y + def h45(x: R2_45) = x.y + def h46(x: R2_46) = x.y + def h47(x: R2_47) = x.y + def h48(x: R2_48) = x.y + def h49(x: R2_49) = x.y + def h50(x: R2_50) = x.y + def h51(x: R2_51) = x.y + def h52(x: R2_52) = x.y + def h53(x: R2_53) = x.y + def h54(x: R2_54) = x.y + def h55(x: R2_55) = x.y + def h56(x: R2_56) = x.y + def h57(x: R2_57) = x.y + def h58(x: R2_58) = x.y + def h59(x: R2_59) = x.y + def h60(x: R2_60) = x.y + def h61(x: R2_61) = x.y + def h62(x: R2_62) = x.y + def h63(x: R2_63) = x.y + def h64(x: R2_64) = x.y + def h65(x: R2_65) = x.y + def h66(x: R2_66) = x.y + def h67(x: R2_67) = x.y + def h68(x: R2_68) = x.y + def h69(x: R2_69) = x.y + def h70(x: R2_70) = x.y + def h71(x: R2_71) = x.y + def h72(x: R2_72) = x.y + def h73(x: R2_73) = x.y + def h74(x: R2_74) = x.y + def h75(x: R2_75) = x.y + def h76(x: R2_76) = x.y + def h77(x: R2_77) = x.y + def h78(x: R2_78) = x.y + def h79(x: R2_79) = x.y + def h80(x: R2_80) = x.y + def h81(x: R2_81) = x.y + def h82(x: R2_82) = x.y + def h83(x: R2_83) = x.y + def h84(x: R2_84) = x.y + def h85(x: R2_85) = x.y + def h86(x: R2_86) = x.y + def h87(x: R2_87) = x.y + def h88(x: R2_88) = x.y + def h89(x: R2_89) = x.y + def h90(x: R2_90) = x.y + def h91(x: R2_91) = x.y + def h92(x: R2_92) = x.y + def h93(x: R2_93) = x.y + def h94(x: R2_94) = x.y + def h95(x: R2_95) = x.y + def h96(x: R2_96) = x.y + def h97(x: R2_97) = x.y + def h98(x: R2_98) = x.y + def h99(x: R2_99) = x.y + def h100(x: R2_100) = x.y + def h101(x: R2_101) = x.y + def h102(x: R2_102) = x.y + def h103(x: R2_103) = x.y + def h104(x: R2_104) = x.y + def h105(x: R2_105) = x.y + def h106(x: R2_106) = x.y + def h107(x: R2_107) = x.y + def h108(x: R2_108) = x.y + def h109(x: R2_109) = x.y + def h110(x: R2_110) = x.y + def h111(x: R2_111) = x.y + def h112(x: R2_112) = x.y + def h113(x: R2_113) = x.y + def h114(x: R2_114) = x.y + def h115(x: R2_115) = x.y + def h116(x: R2_116) = x.y + def h117(x: R2_117) = x.y + def h118(x: R2_118) = x.y + def h119(x: R2_119) = x.y + def h120(x: R2_120) = x.y + def h121(x: R2_121) = x.y + def h122(x: R2_122) = x.y + def h123(x: R2_123) = x.y + def h124(x: R2_124) = x.y + def h125(x: R2_125) = x.y + def h126(x: R2_126) = x.y + def h127(x: R2_127) = x.y + def h128(x: R2_128) = x.y + def h129(x: R2_129) = x.y + def h130(x: R2_130) = x.y + def h131(x: R2_131) = x.y + def h132(x: R2_132) = x.y + def h133(x: R2_133) = x.y + def h134(x: R2_134) = x.y + def h135(x: R2_135) = x.y + def h136(x: R2_136) = x.y + def h137(x: R2_137) = x.y + def h138(x: R2_138) = x.y + def h139(x: R2_139) = x.y + def h140(x: R2_140) = x.y + def h141(x: R2_141) = x.y + def h142(x: R2_142) = x.y + def h143(x: R2_143) = x.y + lazy val fcalls = List( + f0, + f1, + f2, + f3, + f4, + f5, + f6, + f7, + f8, + f9, + f10, + f11, + f12, + f13, + f14, + f15, + f16, + f17, + f18, + f19, + f20, + f21, + f22, + f23, + f24, + f25, + f26, + f27, + f28, + f29, + f30, + f31, + f32, + f33, + f34, + f35, + f36, + f37, + f38, + f39, + f40, + f41, + f42, + f43, + f44, + f45, + f46, + f47, + f48, + f49, + f50, + f51, + f52, + f53, + f54, + f55, + f56, + f57, + f58, + f59, + f60, + f61, + f62, + f63, + f64, + f65, + f66, + f67, + f68, + f69, + f70, + f71, + f72, + f73, + f74, + f75, + f76, + f77, + f78, + f79, + f80, + f81, + f82, + f83, + f84, + f85, + f86, + f87, + f88, + f89, + f90, + f91, + f92, + f93, + f94, + f95, + f96, + f97, + f98, + f99, + f100, + f101, + f102, + f103, + f104, + f105, + f106, + f107, + f108, + f109, + f110, + f111, + f112, + f113, + f114, + f115, + f116, + f117, + f118, + f119, + f120, + f121, + f122, + f123, + f124, + f125, + f126, + f127, + f128, + f129, + f130, + f131, + f132, + f133, + f134, + f135, + f136, + f137, + f138, + f139, + f140, + f141, + f142, + f143 + ) + + def main(args: Array[String]): Unit = { + sshow("Direct Calls", fcalls collect { case (false, n) => n }) + sshow("Reflective Calls", fcalls collect { case (true, n) => n }) + // For a good time try printing this - have to fix bugs in + // reflection before that's going to be a good idea + // println(typeOf[Test.type].typeSymbol.asClass.info) + } +} diff --git a/tests/pending/run/t3452.check b/tests/pending/run/t3452.check new file mode 100644 index 000000000000..b8626c4cff28 --- /dev/null +++ b/tests/pending/run/t3452.check @@ -0,0 +1 @@ +4 diff --git a/tests/pending/run/t3452.scala b/tests/pending/run/t3452.scala new file mode 100644 index 000000000000..253fc93cfaf0 --- /dev/null +++ b/tests/pending/run/t3452.scala @@ -0,0 +1,21 @@ +trait IStringPair[T] { + def a : String + def b : String + def build(a : String, b : String) : T + def cat(that : IStringPair[T]) = build(this.a + that.a, this.b + that.b) + override def toString = a + b +} + +class StringPair(val a : String, val b : String) extends IStringPair[StringPair] { + def build(a : String, b : String) = new StringPair(a, b) + def len = a.length + b.length +} + +object Test { + def main(args: Array[String]): Unit = { + val a = new StringPair("A", "B") + val b = new StringPair("1", "2") + val c = a cat b + println(c.len) + } +} diff --git a/tests/pending/run/t3452a.check b/tests/pending/run/t3452a.check new file mode 100644 index 000000000000..9ff787eb8623 --- /dev/null +++ b/tests/pending/run/t3452a.check @@ -0,0 +1 @@ +BulkSearch.searchFor called. diff --git a/tests/pending/run/t3452a/J_2.java b/tests/pending/run/t3452a/J_2.java new file mode 100644 index 000000000000..62057ffe614d --- /dev/null +++ b/tests/pending/run/t3452a/J_2.java @@ -0,0 +1,5 @@ +public class J_2 { + public static void main(String[] args) { + BulkSearchInstance.searchFor(new UpRelation()); + } +} diff --git a/tests/pending/run/t3452a/S_1.scala b/tests/pending/run/t3452a/S_1.scala new file mode 100644 index 000000000000..791faf42fa40 --- /dev/null +++ b/tests/pending/run/t3452a/S_1.scala @@ -0,0 +1,24 @@ +abstract class BulkSearch { + type R <: Row + type Rel <: Relation [R] + type Corr <: Correspondence[R] + + def searchFor(input: Rel): Mapping[Corr] = { println("BulkSearch.searchFor called.") ; null } +} + +object BulkSearchInstance extends BulkSearch { + type R = UpRow + type Rel = UpRelation + type Corr = UpCorrespondence +} + +class Row +class UpRow extends Row + +class Relation [R <: Row] +class UpRelation extends Relation [UpRow] + +class Correspondence [R <: Row] +class UpCorrespondence extends Correspondence [UpRow] + +class Mapping[MC <: Correspondence[_]] diff --git a/tests/pending/run/t3452a/S_3.scala b/tests/pending/run/t3452a/S_3.scala new file mode 100644 index 000000000000..aaa898dcde94 --- /dev/null +++ b/tests/pending/run/t3452a/S_3.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + J_2.main(args) + } +} diff --git a/tests/pending/run/t3452b-bcode.check b/tests/pending/run/t3452b-bcode.check new file mode 100644 index 000000000000..204c3d043787 --- /dev/null +++ b/tests/pending/run/t3452b-bcode.check @@ -0,0 +1,2 @@ +Search received: test +SearchC received: test diff --git a/tests/pending/run/t3452b-bcode.flags b/tests/pending/run/t3452b-bcode.flags new file mode 100644 index 000000000000..c30091d3de5d --- /dev/null +++ b/tests/pending/run/t3452b-bcode.flags @@ -0,0 +1 @@ +-Ybackend:GenBCode diff --git a/tests/pending/run/t3452b-bcode/J_2.java b/tests/pending/run/t3452b-bcode/J_2.java new file mode 100644 index 000000000000..839f334508e7 --- /dev/null +++ b/tests/pending/run/t3452b-bcode/J_2.java @@ -0,0 +1,6 @@ +public class J_2 { + public static void j() { + StringSearch.search("test"); + StringSearch.searchC("test"); + } +} diff --git a/tests/pending/run/t3452b-bcode/S_1.scala b/tests/pending/run/t3452b-bcode/S_1.scala new file mode 100644 index 000000000000..a209f1203539 --- /dev/null +++ b/tests/pending/run/t3452b-bcode/S_1.scala @@ -0,0 +1,17 @@ +trait Search[M] { + def search(input: M): C[Int] = { + println("Search received: " + input) + null + } +} + +class SearchC[M] { + def searchC(input: M): C[Int] = { + println("SearchC received: " + input) + null + } +} + +object StringSearch extends SearchC[String] with Search[String] + +trait C[T] diff --git a/tests/pending/run/t3452b-bcode/S_3.scala b/tests/pending/run/t3452b-bcode/S_3.scala new file mode 100644 index 000000000000..102b433f478c --- /dev/null +++ b/tests/pending/run/t3452b-bcode/S_3.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + J_2.j() + } +} diff --git a/tests/pending/run/t3452b.check b/tests/pending/run/t3452b.check new file mode 100644 index 000000000000..204c3d043787 --- /dev/null +++ b/tests/pending/run/t3452b.check @@ -0,0 +1,2 @@ +Search received: test +SearchC received: test diff --git a/tests/pending/run/t3452b/J_2.java b/tests/pending/run/t3452b/J_2.java new file mode 100644 index 000000000000..839f334508e7 --- /dev/null +++ b/tests/pending/run/t3452b/J_2.java @@ -0,0 +1,6 @@ +public class J_2 { + public static void j() { + StringSearch.search("test"); + StringSearch.searchC("test"); + } +} diff --git a/tests/pending/run/t3452b/S_1.scala b/tests/pending/run/t3452b/S_1.scala new file mode 100644 index 000000000000..a209f1203539 --- /dev/null +++ b/tests/pending/run/t3452b/S_1.scala @@ -0,0 +1,17 @@ +trait Search[M] { + def search(input: M): C[Int] = { + println("Search received: " + input) + null + } +} + +class SearchC[M] { + def searchC(input: M): C[Int] = { + println("SearchC received: " + input) + null + } +} + +object StringSearch extends SearchC[String] with Search[String] + +trait C[T] diff --git a/tests/pending/run/t3452b/S_3.scala b/tests/pending/run/t3452b/S_3.scala new file mode 100644 index 000000000000..102b433f478c --- /dev/null +++ b/tests/pending/run/t3452b/S_3.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + J_2.j() + } +} diff --git a/tests/pending/run/t3452c.check b/tests/pending/run/t3452c.check new file mode 100644 index 000000000000..ab47181198de --- /dev/null +++ b/tests/pending/run/t3452c.check @@ -0,0 +1,8 @@ +3 +3 +3 +3 +3 +3 +3 +3 diff --git a/tests/pending/run/t3452c.scala b/tests/pending/run/t3452c.scala new file mode 100644 index 000000000000..2c55767abc52 --- /dev/null +++ b/tests/pending/run/t3452c.scala @@ -0,0 +1,113 @@ +trait Base[A, B, C] { + def f(x: A, y: B, z: C): Unit + def g(x: A, y: B, z: C) = f(x, y, z) + def h(x: A, y: B, z: C) = g(x, y, z) +} + +trait D1[B, C] extends Base[String, B, C] +trait D2[A, B] extends Base[A, B, String] +trait D3[A, C] extends Base[A, String, C] +trait D4[A] extends Base[A, String, String] +trait D5[B] extends Base[String, B, String] +trait D6[C] extends Base[String, String, C] +trait D7 extends Base[String, String, String] + +trait E1[B, C] extends Base[String, B, C] { def f(x: String, y: B, z: C): Unit ; override def h(x: String, y: B, z: C) = g(x, y, z) } +trait E2[A, B] extends Base[A, B, String] { def f(x: A, y: B, z: String): Unit ; override def h(x: A, y: B, z: String) = g(x, y, z) } +trait E3[A, C] extends Base[A, String, C] { def f(x: A, y: String, z: C): Unit ; override def h(x: A, y: String, z: C) = g(x, y, z) } +trait E4[A] extends Base[A, String, String] { def f(x: A, y: String, z: String): Unit ; override def h(x: A, y: String, z: String) = g(x, y, z) } +trait E5[B] extends Base[String, B, String] { def f(x: String, y: B, z: String): Unit ; override def h(x: String, y: B, z: String) = g(x, y, z) } +trait E6[C] extends Base[String, String, C] { def f(x: String, y: String, z: C): Unit ; override def h(x: String, y: String, z: C) = g(x, y, z) } +trait E7 extends Base[String, String, String] { def f(x: String, y: String, z: String): Unit ; override def h(x: String, y: String, z: String) = g(x, y, z) } + +trait F1[B, C] extends Base[String, B, C] { def f(x: String, y: B, z: C): Unit = println(x.length) } +trait F2[A, B] extends Base[A, B, String] { def f(x: A, y: B, z: String): Unit = println(z.length) } +trait F3[A, C] extends Base[A, String, C] { def f(x: A, y: String, z: C): Unit = println(y.length) } +trait F4[A] extends Base[A, String, String] { def f(x: A, y: String, z: String): Unit = println(y.length) } +trait F5[B] extends Base[String, B, String] { def f(x: String, y: B, z: String): Unit = println(x.length) } +trait F6[C] extends Base[String, String, C] { def f(x: String, y: String, z: C): Unit = println(x.length) } +trait F7 extends Base[String, String, String] { def f(x: String, y: String, z: String): Unit = println(x.length) } + +abstract class DBag extends D1[String, String] with D2[String, String] with D3[String, String] with D4[String] with D5[String] with D6[String] with D7 { + def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) +} +abstract class EBag extends E1[String, String] with E2[String, String] with E3[String, String] with E4[String] with E5[String] with E6[String] with E7 { + def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) +} +abstract class FBag extends F1[String, String] with F2[String, String] with F3[String, String] with F4[String] with F5[String] with F6[String] with F7 { + override def f(x: String, y: String, z: String) = println(x.length + y.length + z.length) +} + +abstract class GBag1[A, B] extends Base[A, B, String] with D2[A, B] { + def f(x: A, y: B, z: String) = println(z.length) +} +abstract class GBag2[A] extends GBag1[A, String] with D4[A] { + override def f(x: A, y: String, z: String) = println(z.length) +} +abstract class GBag3 extends GBag2[String] with D7 { + override def f(x: String, y: String, z: String) = println(z.length) +} +class GBag extends GBag3 with D2[String, String] with D3[String, String] with D4[String] with D5[String] with D6[String] with D7 { +} + +object Test { + def f0(x: Base[String, String, String]) = x.f("a", "b", "c") + def f1(x: D1[String, String]) = x.f("a", "b", "c") + def f2(x: D2[String, String]) = x.f("a", "b", "c") + def f3(x: D3[String, String]) = x.f("a", "b", "c") + def f4(x: D4[String]) = x.f("a", "b", "c") + def f5(x: D5[String]) = x.f("a", "b", "c") + def f6(x: D6[String]) = x.f("a", "b", "c") + def f7(x: D7) = x.f("a", "b", "c") + + def main(args: Array[String]): Unit = { + val x = new DBag { } + f0(x) + f1(x) + f2(x) + f3(x) + f4(x) + f5(x) + f6(x) + f7(x) + } +} + +object TestE { + def f0(x: Base[String, String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f1(x: E1[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f2(x: E2[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f3(x: E3[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f4(x: E4[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f5(x: E5[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f6(x: E6[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f7(x: E7) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + + def main(args: Array[String]): Unit = { + val x = new EBag { } + f0(x) + f1(x) + f2(x) + f3(x) + f4(x) + f5(x) + f6(x) + f7(x) + } +} + + +object TestG { + def f0(x: Base[String, String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f1(x: GBag1[String, String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f2(x: GBag2[String]) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + def f3(x: GBag3) = { x.f("a", "b", "c") ; x.g("a", "b", "c") ; x.h("a", "b", "c") } + + def main(args: Array[String]): Unit = { + val x = new GBag { } + f0(x) + f1(x) + f2(x) + f3(x) + } +} diff --git a/tests/pending/run/t3452d/A.scala b/tests/pending/run/t3452d/A.scala new file mode 100644 index 000000000000..67a2080d273b --- /dev/null +++ b/tests/pending/run/t3452d/A.scala @@ -0,0 +1,7 @@ +trait TraversableLike[A, Repr] { + def tail: Repr = null.asInstanceOf[Repr] +} + +abstract class AbstractTrav[A] extends TraversableLike[A, Traversable[A]] + +class C[A] extends AbstractTrav[A] diff --git a/tests/pending/run/t3452d/Test.java b/tests/pending/run/t3452d/Test.java new file mode 100644 index 000000000000..875be6176c5b --- /dev/null +++ b/tests/pending/run/t3452d/Test.java @@ -0,0 +1,12 @@ +import scala.collection.immutable.Nil; +import scala.collection.immutable.List; +import scala.collection.Traversable; + +public class Test { + public static void main(String[] args) { + C c = new C(); + // TODO add a bridge during mixin so we can expose + // sharper generic signature for `tail`. + /*Traversable*/ Object ls = c.tail(); + } +} diff --git a/tests/pending/run/t3452e/A.scala b/tests/pending/run/t3452e/A.scala new file mode 100644 index 000000000000..939172f4013c --- /dev/null +++ b/tests/pending/run/t3452e/A.scala @@ -0,0 +1,4 @@ +trait F1[T, R] { + def andThen[A](g: R => A): Int = 0 +} +class C1[TT, RR] extends F1[TT, RR] diff --git a/tests/pending/run/t3452e/B.java b/tests/pending/run/t3452e/B.java new file mode 100644 index 000000000000..0268af9987a4 --- /dev/null +++ b/tests/pending/run/t3452e/B.java @@ -0,0 +1,2 @@ +class B extends C1 { +} diff --git a/tests/pending/run/t3452e/Test.scala b/tests/pending/run/t3452e/Test.scala new file mode 100644 index 000000000000..9525c3403acd --- /dev/null +++ b/tests/pending/run/t3452e/Test.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + new B +} diff --git a/tests/pending/run/t3452f.scala b/tests/pending/run/t3452f.scala new file mode 100644 index 000000000000..af64f5c04229 --- /dev/null +++ b/tests/pending/run/t3452f.scala @@ -0,0 +1,19 @@ +import language.higherKinds + +trait GenSet[A] + +trait GenSetTemplate[A, +CC[X] <: GenSet[X]] { + def empty: CC[A] = ??? +} + +trait SetLike[A, +This <: SetLike[A, This] with Set[A]] { + def empty: This +} + +abstract class Set[A] extends GenSet[A] with SetLike[A,Set[A]] with GenSetTemplate[A,Set] + +object Test { + def main(args: Array[String]): Unit = { + locally(classOf[Set[_]]) // trigger classloading to verify class + } +} diff --git a/tests/pending/run/t3452g/A.scala b/tests/pending/run/t3452g/A.scala new file mode 100644 index 000000000000..a3f74c1e1e4c --- /dev/null +++ b/tests/pending/run/t3452g/A.scala @@ -0,0 +1,9 @@ +trait TraversableLike[A, Repr] { + def tail: Repr = null.asInstanceOf[Repr] +} + +abstract class AbstractTrav[A] extends TraversableLike[A, AbstractTrav[A]] + +object O extends AbstractTrav[String] + +class C[A] extends AbstractTrav[A] diff --git a/tests/pending/run/t3452g/Test.java b/tests/pending/run/t3452g/Test.java new file mode 100644 index 000000000000..c3b4222d1686 --- /dev/null +++ b/tests/pending/run/t3452g/Test.java @@ -0,0 +1,14 @@ + +public class Test { + public static void main(String[] args) { + // To get better types here, we would need to + // add bridge during mixin so we can expose + // a generic return type of Traversable, because the erasure + // of this (Traversable) differs from the erasure of the mixed + // method (erasure(Repr) = Object) + + Object lsSharp = O.tail(); + + Object lsSharp2 = new C().tail(); + } +} diff --git a/tests/pending/run/t3452h.scala b/tests/pending/run/t3452h.scala new file mode 100644 index 000000000000..c06ae0a0b08d --- /dev/null +++ b/tests/pending/run/t3452h.scala @@ -0,0 +1,8 @@ +class Mix___eFoo_I_wBar__f extends Foo_I_ with Bar__f { f; } +trait T +abstract class Foo_I_ { class I extends T ; def f: I ; f; } +trait Bar__f { type I>:Null<:T; def f: I = {null}; f; def gobble: I = {null}} + +object Test extends dotty.runtime.LegacyApp { + new Mix___eFoo_I_wBar__f +} diff --git a/tests/pending/run/t3487.scala b/tests/pending/run/t3487.scala new file mode 100644 index 000000000000..f2ca7359135e --- /dev/null +++ b/tests/pending/run/t3487.scala @@ -0,0 +1,15 @@ +trait Bippy { + def bippy = 5 +} + +class Test extends Bippy { + def f1 = 55 +} + +object Test extends Test { + def dingus = bippy + def main(args: Array[String]): Unit = { + assert(bippy + f1 == 110) + } + override def bippy = 55 +} diff --git a/tests/pending/run/t3488.check b/tests/pending/run/t3488.check new file mode 100644 index 000000000000..314dfc78385f --- /dev/null +++ b/tests/pending/run/t3488.check @@ -0,0 +1,8 @@ +t3488.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + println(foo { val List(_*)=List(0); 1 } ()) + ^ +t3488.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + println(foo { val List(_*)=List(0); 1 } (1)) + ^ +0 +1 diff --git a/tests/pending/run/t3488.scala b/tests/pending/run/t3488.scala new file mode 100644 index 000000000000..7208ab96cc5b --- /dev/null +++ b/tests/pending/run/t3488.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(p: => Unit)(x:Int = 0) = x + + println(foo { val List(_*)=List(0); 1 } ()) + println(foo { val List(_*)=List(0); 1 } (1)) +} diff --git a/tests/pending/run/t3493.scala b/tests/pending/run/t3493.scala new file mode 100644 index 000000000000..c13da255121c --- /dev/null +++ b/tests/pending/run/t3493.scala @@ -0,0 +1,15 @@ + + + + +object Test { + + def main(args: Array[String]): Unit = { + import scala.collection.immutable._ + val x = TreeSet("a", "b", "c", "d") + val x2 = x + "e" + assert(x2.toString == "TreeSet(a, b, c, d, e)") + assert(x2.toString == runtime.ScalaRunTime.stringOf(x2).trim) + } + +} diff --git a/tests/pending/run/t3496.scala b/tests/pending/run/t3496.scala new file mode 100644 index 000000000000..35bc5db24032 --- /dev/null +++ b/tests/pending/run/t3496.scala @@ -0,0 +1,15 @@ + + + + +// ticket #3496 +object Test { + + def main(args: Array[String]): Unit = { + val s = Stream.from(1) + s.take(5) + s.drop(5) + s.splitAt(5) + } + +} diff --git a/tests/pending/run/t3502.scala b/tests/pending/run/t3502.scala new file mode 100644 index 000000000000..2f432e4861b8 --- /dev/null +++ b/tests/pending/run/t3502.scala @@ -0,0 +1,24 @@ + + + + + +// ticket #3502 +object Test { + + object GeneratePrimeFactorsLazy extends (Int => List[Int]) { + override def apply(n:Int) = { + val s = Stream.range(2, n / 2).filter(n % _ == 0) + //val s = for (i <- Stream.range(2, n / 2); if n % i == 0) yield i + s.headOption.map(x => x :: apply(n / x)).getOrElse(List(n)) + } + } + + def main(args:Array[String]): Unit = { + // a prime number + //val num = 623456789 + val num = 2796203 + assert(GeneratePrimeFactorsLazy(num) == List(num)) + } + +} diff --git a/tests/pending/run/t3507-new.check b/tests/pending/run/t3507-new.check new file mode 100644 index 000000000000..208e09300460 --- /dev/null +++ b/tests/pending/run/t3507-new.check @@ -0,0 +1 @@ +_1.b.c.type diff --git a/tests/pending/run/t3507-new.scala b/tests/pending/run/t3507-new.scala new file mode 100644 index 000000000000..5e690524efc7 --- /dev/null +++ b/tests/pending/run/t3507-new.scala @@ -0,0 +1,19 @@ + +import scala.language.{ existentials } +import scala.reflect.runtime.universe._ + +class A { + object b { + object c + } + def m = b.c +} + +object Test extends dotty.runtime.LegacyApp { + var a: A = new A // mutable + val c /*: object _1.b.c forSome { val _1: A } */ = a.m // widening using existential + + def mani[T: TypeTag](x: T) = println(typeOf[T]) + mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier + // --> _1 is not in scope here +} diff --git a/tests/pending/run/t3508.scala b/tests/pending/run/t3508.scala new file mode 100644 index 000000000000..80ef89a61ba3 --- /dev/null +++ b/tests/pending/run/t3508.scala @@ -0,0 +1,11 @@ + + +import collection.immutable._ + + +// ticket #3508 +object Test { + def main(args: Array[String]): Unit = { + assert(Stream.tabulate(123)(_ + 1).toList == List.tabulate(123)(_ + 1)) + } +} diff --git a/tests/pending/run/t3509.flags b/tests/pending/run/t3509.flags new file mode 100644 index 000000000000..6933d924d381 --- /dev/null +++ b/tests/pending/run/t3509.flags @@ -0,0 +1 @@ +-Yinline \ No newline at end of file diff --git a/tests/pending/run/t3509.scala b/tests/pending/run/t3509.scala new file mode 100644 index 000000000000..8e1986f34f4e --- /dev/null +++ b/tests/pending/run/t3509.scala @@ -0,0 +1,9 @@ +object Test { + + class Foo(final var i:Int) + + def main(args : Array[String]) : Unit = { + val foo = new Foo(0) + foo.i += 1 + } +} diff --git a/tests/pending/run/t3511.scala b/tests/pending/run/t3511.scala new file mode 100644 index 000000000000..0df0321adb4d --- /dev/null +++ b/tests/pending/run/t3511.scala @@ -0,0 +1,36 @@ + + + +import scala.collection.immutable._ + + +// ticket #3511 +object Test { + + def main(args: Array[String]): Unit = { + assert(Stream.from(0).view.force.take(5) == List(0, 1, 2, 3, 4)) + + val s = Stream.from(0) + val smap = s.view.map(_ * 2).force.take(5) + assert(smap == List(0, 2, 4, 6, 8)) + + val sfilter = s.view.filter(_ % 2 == 0).force.take(5) + assert(sfilter == List(0, 2, 4, 6, 8)) + + val sflatmap = s.view.flatMap(n => List(n, n * 2)).force.take(6) + assert(sflatmap == List(0, 0, 1, 2, 2, 4)) + + val stakewhile = s.view.takeWhile(_ < 10).force + assert(stakewhile == List.range(0, 10)) + + val szip = s.view.zip(s.map(_ / 2)).force.take(5) + assert(szip == List((0, 0), (1, 0), (2, 1), (3, 1), (4, 2))) + + val szipall = s.view.zipAll(List(0, 1, 2), 0, 0).force.take(5) + assert(szipall == List((0, 0), (1, 1), (2, 2), (3, 0), (4, 0))) + + val spatch = s.view.patch(1, List(5, 5, 5), 5).force.take(5) + assert(spatch == List(0, 5, 5, 5, 6)) + } + +} diff --git a/tests/pending/run/t3516.check b/tests/pending/run/t3516.check new file mode 100644 index 000000000000..d0d10d82fa0d --- /dev/null +++ b/tests/pending/run/t3516.check @@ -0,0 +1,3 @@ +1 +1 +21 diff --git a/tests/pending/run/t3516.scala b/tests/pending/run/t3516.scala new file mode 100644 index 000000000000..aa302ce85ac3 --- /dev/null +++ b/tests/pending/run/t3516.scala @@ -0,0 +1,13 @@ +object Test { + def mkIterator = (1 to 5).iterator map (x => { println(x) ; x }) + def mkInfinite = Iterator continually { println(1) ; 1 } + + def main(args: Array[String]): Unit = { + // Stream is strict in its head so we should see 1 from each of them. + val s1 = mkIterator.toStream + val s2 = mkInfinite.toStream + // back and forth without slipping into nontermination. + println((Stream from 1).toIterator.drop(10).toStream.drop(10).toIterator.next) + () + } +} diff --git a/tests/pending/run/t3518.scala b/tests/pending/run/t3518.scala new file mode 100644 index 000000000000..033cc19548fb --- /dev/null +++ b/tests/pending/run/t3518.scala @@ -0,0 +1,16 @@ +object Test { + val r1 = 1.0 to 10.0 by 0.5 + val r2 = 1.0 to 1.0 by 1.0 + val r3 = 10.0 to 1.0 by -0.5 + val r4 = 1.0 until 1.0 by 1.0 + val r5 = 1 to 100 by 2 + + def main(args: Array[String]): Unit = { + assert(r3 forall (r1 contains _)) + assert(r1 forall (r3 contains _)) + assert(r2.size == 1) + assert(r4.isEmpty) + assert(List(1,3,5,97,99) forall (r5 contains _)) + assert(List(2,4,6,98,100) forall (x => !r5.contains(x))) + } +} diff --git a/tests/pending/run/t3529.scala b/tests/pending/run/t3529.scala new file mode 100644 index 000000000000..a5977d0a6c55 --- /dev/null +++ b/tests/pending/run/t3529.scala @@ -0,0 +1,15 @@ +import scala.language.postfixOps +object Test { + def main(args: Array[String]): Unit = { + assert(1 to 10 drop 10 isEmpty) + assert(1 until 10 drop 9 isEmpty) + assert(1 to 10 by 2 drop 5 isEmpty) + assert(10 to 1 by -1 drop 10 isEmpty) + assert((10 to 1 by -1 drop 9) == Seq(1)) + + assert((1 to 10 drop 9) == Seq(10)) + assert((1 until 10 drop 9) == Nil) + + assert(Stream(1 to 10).flatten.toList == Stream(1 until 11).flatten.toList) + } +} diff --git a/tests/pending/run/t3530.check b/tests/pending/run/t3530.check new file mode 100644 index 000000000000..1f906680e9ac --- /dev/null +++ b/tests/pending/run/t3530.check @@ -0,0 +1,12 @@ +two +three +list: 4 +list: 0 +list: 5 +not a list + +two +three +list: 4 +list: 0 +list: 5 diff --git a/tests/pending/run/t3530.scala b/tests/pending/run/t3530.scala new file mode 100644 index 000000000000..7fd9fc8054e1 --- /dev/null +++ b/tests/pending/run/t3530.scala @@ -0,0 +1,35 @@ +object Test { + def f(x: Any) = println(x match { + case List(_, _) => "two" + case List(_, _, _) => "three" + case xs @ List(_*) => "list: " + xs.length + case _ => "not a list" + }) + + def f2[T](x: List[T]) = println(x match { + case List(_, _) => "two" + case List(_, _, _) => "three" + case List(xs : _*) => "list: " + xs.length + // bug: the default case is marked unreachable + // case _ => "not a list" + }) + + def main(args: Array[String]): Unit = { + f(List(1, 2)) + f(List('a', 'b', 'c')) + f(List('a', 'b', 'c', 'd')) + f(Nil) + f(List(1,2,3,4,5)) + f(null) + + println + + f2(List(1, 2)) + f2(List('a', 'b', 'c')) + f2(List('a', 'b', 'c', 'd')) + f2(Nil) + f2(List(1,2,3,4,5)) + // bug: this NPEs on xs.length + // f2(null) + } +} diff --git a/tests/pending/run/t3540.scala b/tests/pending/run/t3540.scala new file mode 100644 index 000000000000..5ffacb5dff3f --- /dev/null +++ b/tests/pending/run/t3540.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + assert(List.iterate(List(1,2,3), 4)(_.tail).last.isEmpty) + assert(Stream.iterate(Stream(1,2,3), 4)(_.tail).last.isEmpty) + assert(Array.iterate(Array(1,2,3), 4)(_.tail).last.isEmpty) + } +} diff --git a/tests/pending/run/t3563.scala b/tests/pending/run/t3563.scala new file mode 100644 index 000000000000..5cc5a611ad9c --- /dev/null +++ b/tests/pending/run/t3563.scala @@ -0,0 +1,21 @@ + + + + + +// ticket #3563 +object Test { + + def main(args: Array[String]): Unit = { + var sum = 0 + val setseq = Set(1, 2, 3, 4).toSeq + setseq.map( n => { sum += n; n * n }).head + assert(sum == 10) + + sum = 0 + val mapseq = Map(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4).toSeq + mapseq.map( n => { sum += n._1; (n._1 + n._1, n._2 * n._2) }).head + assert(sum == 10) + } + +} diff --git a/tests/pending/run/t3569.check b/tests/pending/run/t3569.check new file mode 100644 index 000000000000..a9fb5ff32ed0 --- /dev/null +++ b/tests/pending/run/t3569.check @@ -0,0 +1,16 @@ +1 +private final int Test$X.val1 +private final int Test$X.val2 +private final int Test$X.val3 +private int Test$X.lval1 +private int Test$X.lval2 +private int Test$X.lval3 +private int Test$X.var1 +private int Test$X.var2 +private int Test$X.var3 +private int Test$X.x +private volatile byte Test$X.bitmap$0 +private final int Test$Y.z1 +private final int Test$Y.z2 +private int Test$Y.x +private int Test$Y.y diff --git a/tests/pending/run/t3569.flags b/tests/pending/run/t3569.flags new file mode 100644 index 000000000000..6933d924d381 --- /dev/null +++ b/tests/pending/run/t3569.flags @@ -0,0 +1 @@ +-Yinline \ No newline at end of file diff --git a/tests/pending/run/t3569.scala b/tests/pending/run/t3569.scala new file mode 100644 index 000000000000..f9a9161855c3 --- /dev/null +++ b/tests/pending/run/t3569.scala @@ -0,0 +1,33 @@ +object Test { + final val bippy1 = 1 + final lazy val bippy2 = 2 + + lazy val lv = scala.util.Random.nextInt() + + class X(final var x: Int) { + final var var1: Int = 0 + final private var var2: Int = 0 + final private[this] var var3: Int = 0 + + final val val1: Int = 1 + final private val val2: Int = 1 + final private[this] val val3: Int = 1 + + final lazy val lval1: Int = 2 + final private lazy val lval2: Int = 2 + final private[this] lazy val lval3: Int = 2 + } + case class Y(final var x: Int, final private var y: Int, final val z1: Int, final private val z2: Int) { } + + def f = new X(0).x += 1 + def main(args: Array[String]): Unit = { + f + val s = new X(0) + s.x += 1 + println(s.x) + + // under -Xcheckinit there's an additional $init$ field + (classOf[X].getDeclaredFields map ("" + _)).sorted.filter(_ != "private volatile byte Test$X.bitmap$init$0") foreach println + (classOf[Y].getDeclaredFields map ("" + _)).sorted foreach println + } +} diff --git a/tests/pending/run/t3575.check b/tests/pending/run/t3575.check new file mode 100644 index 000000000000..8b935ad4a394 --- /dev/null +++ b/tests/pending/run/t3575.check @@ -0,0 +1,20 @@ +Two +Two$mcIL$sp +Two$mcLI$sp +Two$mcII$sp +TwoLong +TwoLong$mcIL$sp +TwoLong$mcLI$sp +TwoLong$mcII$sp +TwoCool +TwoCool$mcIL$sp +TwoCool$mcLI$sp +TwoCool$mcII$sp +TwoShort +TwoShort$mcIL$sp +TwoShort$mcLI$sp +TwoShort$mcII$sp +TwoMinimal +TwoMinimal$mcIL$sp +TwoMinimal$mcLI$sp +TwoMinimal$mcII$sp diff --git a/tests/pending/run/t3575.scala b/tests/pending/run/t3575.scala new file mode 100644 index 000000000000..ef83e84f1435 --- /dev/null +++ b/tests/pending/run/t3575.scala @@ -0,0 +1,55 @@ +// This is here to tell me if the behavior changes, not because +// the output is endorsed. +case class Two[ + @specialized(Specializable.Everything) A, + @specialized(Specializable.Everything) B +](v: A, w: B) + +case class TwoLong[ + @specialized(Char, Boolean, Byte, Short, Int, Long, Float, Double, Unit, AnyRef) A, + @specialized(Char, Boolean, Byte, Short, Int, Long, Float, Double, Unit, AnyRef) B +](v: A, w: B) + +case class TwoCool[ + @specialized(Specializable.Everything) A, + @specialized(Specializable.Everything) B +](v: A, w: B) + +case class TwoShort[ + @specialized(Specializable.Everything) A, + @specialized(Specializable.Everything) B +](v: A, w: B) + +case class TwoMinimal[ + @specialized(Int, AnyRef) A, + @specialized(Int, AnyRef) B +](v: A, w: B) + +object Test { + def main(args: Array[String]): Unit = { + println(Two("Hello", "World").getClass().getName()); + println(Two(12, "Hello").getClass().getName()); + println(Two("Hello", 12).getClass().getName()); + println(Two(12, 12).getClass().getName()); + + println(TwoLong("Hello", "World").getClass().getName()); + println(TwoLong(12, "Hello").getClass().getName()); + println(TwoLong("Hello", 12).getClass().getName()); + println(TwoLong(12, 12).getClass().getName()); + + println(TwoCool("Hello", "World").getClass().getName()); + println(TwoCool(12, "Hello").getClass().getName()); + println(TwoCool("Hello", 12).getClass().getName()); + println(TwoCool(12, 12).getClass().getName()); + + println(TwoShort("Hello", "World").getClass().getName()); + println(TwoShort(12, "Hello").getClass().getName()); + println(TwoShort("Hello", 12).getClass().getName()); + println(TwoShort(12, 12).getClass().getName()); + + println(TwoMinimal("Hello", "World").getClass().getName()); + println(TwoMinimal(12, "Hello").getClass().getName()); + println(TwoMinimal("Hello", 12).getClass().getName()); + println(TwoMinimal(12, 12).getClass().getName()); + } +} diff --git a/tests/pending/run/t3580.scala b/tests/pending/run/t3580.scala new file mode 100644 index 000000000000..f91d5a24f8d7 --- /dev/null +++ b/tests/pending/run/t3580.scala @@ -0,0 +1,17 @@ + + + + + +object Test { + + class Empty extends Traversable[Nothing] { + def foreach[U](f: Nothing => U): Unit = {} + } + + def main(args: Array[String]): Unit = { + val t = new Empty + t.toStream + } + +} diff --git a/tests/pending/run/t3603.scala b/tests/pending/run/t3603.scala new file mode 100644 index 000000000000..25ca49b54143 --- /dev/null +++ b/tests/pending/run/t3603.scala @@ -0,0 +1,18 @@ + + + +object Test { + + def main(args: Array[String]): Unit = { + import collection.immutable._ + + val intmap = IntMap(1 -> 1, 2 -> 2) + val intres = intmap.map { case (a, b) => (a, b.toString) } + assert(intres.isInstanceOf[IntMap[_]]) + + val longmap = LongMap(1L -> 1, 2L -> 2) + val longres = longmap.map { case (a, b) => (a, b.toString) } + assert(longres.isInstanceOf[LongMap[_]]) + } + +} diff --git a/tests/pending/run/t3613.scala b/tests/pending/run/t3613.scala new file mode 100644 index 000000000000..1293f62c0fd4 --- /dev/null +++ b/tests/pending/run/t3613.scala @@ -0,0 +1,22 @@ +class Boopy { + private val s = new Schnuck + def observer : PartialFunction[ Any, Unit ] = s.observer + + private class Schnuck extends javax.swing.AbstractListModel { + model => + val observer : PartialFunction[ Any, Unit ] = { + case "Boopy" => fireIntervalAdded( model, 0, 1 ) + } + def getSize = 0 + def getElementAt( idx: Int ) = ??? + } + +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new Boopy + val o = x.observer + o( "Boopy" ) // --> throws runtime error + } +} diff --git a/tests/pending/run/t3616.check b/tests/pending/run/t3616.check new file mode 100644 index 000000000000..f31e21baff86 --- /dev/null +++ b/tests/pending/run/t3616.check @@ -0,0 +1 @@ +Fruit.ValueSet(A, B, C) diff --git a/tests/pending/run/t3616.scala b/tests/pending/run/t3616.scala new file mode 100644 index 000000000000..777b97f9ab66 --- /dev/null +++ b/tests/pending/run/t3616.scala @@ -0,0 +1,12 @@ +object X extends Enumeration { + val Y = Value +} +object Fruit extends Enumeration { + val x = X.Y + val A,B,C = Value +} +object Test { + def main(args: Array[String]): Unit = { + println(Fruit.values) + } +} diff --git a/tests/pending/run/t3619.scala b/tests/pending/run/t3619.scala new file mode 100644 index 000000000000..75b0d3cf7604 --- /dev/null +++ b/tests/pending/run/t3619.scala @@ -0,0 +1,34 @@ +class Dep(x: Int)(implicit val nameClash: String) + +object Test extends dotty.runtime.LegacyApp { + implicit val nameClash: String = "meh" + + def meth(implicit w: String) = 1 + + // when typing Meh's default constructor Meh.this.nameClash (inherited from Dep) + // shadows Test.nameClash, thus, when inferring the argument `w` in the call to meth, + // Test.nameClash is not eligible statically, Meh.this.nameClash is picked (which then causes the VerifyError) + // BUG: Meth.this.nameClash should not be in (the implicit) scope during the super constructor call in the first place + class Meh extends Dep(meth) + /* + class Meh extends Dep { + def this() { + this(Test.this.meth(Meh.this.nameClash))(Test.this.nameClash) + } + } + */ + + new Meh +} + + +/* + { + def this(a: String, b: Int) { + this() + } + def this(x: String) { + this(Meh.this.nameClash, 1) + } + } +*/ diff --git a/tests/pending/run/t363.check b/tests/pending/run/t363.check new file mode 100644 index 000000000000..040b97c07a7b --- /dev/null +++ b/tests/pending/run/t363.check @@ -0,0 +1 @@ +I love the smell of (Array[String])Unit in the morning. diff --git a/tests/pending/run/t363.scala b/tests/pending/run/t363.scala new file mode 100644 index 000000000000..68744ef4803c --- /dev/null +++ b/tests/pending/run/t363.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + println("I love the smell of (Array[String])Unit in the morning.") + } +} + +class Test { + def kurtz() = "We must kill them. We must incinerate them." +} diff --git a/tests/pending/run/t3645.scala b/tests/pending/run/t3645.scala new file mode 100644 index 000000000000..cada14cd1488 --- /dev/null +++ b/tests/pending/run/t3645.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val s = Stream.tabulate(5)(x => x+2) + assert( s.toList == List(2,3,4,5,6) ) + } +} diff --git a/tests/pending/run/t3647.scala b/tests/pending/run/t3647.scala new file mode 100644 index 000000000000..8202c30e7fb4 --- /dev/null +++ b/tests/pending/run/t3647.scala @@ -0,0 +1,23 @@ + + + +import collection.immutable._ + + +object Test { + def main(args: Array[String]): Unit = { + val ps = PagedSeq.fromLines(List( + "line1", + "line2", + "line3", + "line4" + ).iterator) + assert(ps.filter(_ == '\n').size == 3) + + val ps1 = PagedSeq.fromLines(List("Ok").iterator) + assert(ps1.filter(_ == '\n').size == 0) + + val eps = PagedSeq.fromLines(List().iterator) + assert(eps.filter(_ == '\n').size == 0) + } +} diff --git a/tests/pending/run/t3651.scala b/tests/pending/run/t3651.scala new file mode 100644 index 000000000000..c4c5c2ed6464 --- /dev/null +++ b/tests/pending/run/t3651.scala @@ -0,0 +1,10 @@ +class Klass[@specialized(Long) A]( val a: A ) + +class LongKlass( override val a: Long ) extends Klass[Long](a) + +object Test { + def main(args: Array[String]): Unit = { + val lk = new LongKlass(10) + val a = lk.a + } +} diff --git a/tests/pending/run/t3667.check b/tests/pending/run/t3667.check new file mode 100644 index 000000000000..6375c8899723 --- /dev/null +++ b/tests/pending/run/t3667.check @@ -0,0 +1,3 @@ +4 +2 +3 diff --git a/tests/pending/run/t3667.scala b/tests/pending/run/t3667.scala new file mode 100644 index 000000000000..fd3d6dc4d9ca --- /dev/null +++ b/tests/pending/run/t3667.scala @@ -0,0 +1,49 @@ +object Test { + def main(args: Array[String]): Unit = { + val o4 = new Outer4 + val o5 = new Outer5 + val o6 = new Outer6 + + println(4) + ser(new o4.Inner(1)) + o4.Inner + ser(new o4.Inner(1)) + + println(2) + ser(new o5.Inner(1)) + o5.Inner + ser(new o5.Inner(1)) + + println(3) + ser(new o6.Inner(1)) + o6.Inner + ser(new o6.Inner(1)) + + foo + } + + def foo: Unit = { + case class C(x: Int) + ser(new C(1)) + ser(C) + } + + def ser(o: AnyRef): Unit = { + val oos = new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream()) + oos.writeObject(o) + oos.close() + } + +} + +class Outer4 extends Serializable { + class Inner(x: Int = 1) extends Serializable +} + +class Outer5 extends Serializable { + case class Inner(x: Int = 1) +} + +class Outer6 extends Serializable { + case class Inner(x: Int) +} diff --git a/tests/pending/run/t3670.check b/tests/pending/run/t3670.check new file mode 100644 index 000000000000..bc49bb64376c --- /dev/null +++ b/tests/pending/run/t3670.check @@ -0,0 +1,5 @@ +a +b +1 +2 +42 diff --git a/tests/pending/run/t3670.scala b/tests/pending/run/t3670.scala new file mode 100644 index 000000000000..b9cee847bcdf --- /dev/null +++ b/tests/pending/run/t3670.scala @@ -0,0 +1,31 @@ +class C { + val things = List("abcs") + + if (things.length < 30) { + lazy val a = "a" + println(a) + } + if (things.length < 30) { + lazy val b = "b" + println(b) + } +} + +class M extends dotty.runtime.LegacyApp { + def foo: Unit = { + lazy val a = { + lazy val b = 1 + lazy val c = 2 + println(b) + println(c) + } + a + lazy val d = 42 + println(d) + } +} + +object Test extends dotty.runtime.LegacyApp { + new C() + new M().foo +} diff --git a/tests/pending/run/t3687.check b/tests/pending/run/t3687.check new file mode 100644 index 000000000000..0f3586264547 --- /dev/null +++ b/tests/pending/run/t3687.check @@ -0,0 +1,2 @@ +t.ValueSet(a, b) +t.ValueSet(a, b) \ No newline at end of file diff --git a/tests/pending/run/t3687.scala b/tests/pending/run/t3687.scala new file mode 100644 index 000000000000..cad30a244bdf --- /dev/null +++ b/tests/pending/run/t3687.scala @@ -0,0 +1,6 @@ +object t extends Enumeration { val a, b = Value } + +object Test extends dotty.runtime.LegacyApp { + println(t.values) + println(t.values) +} diff --git a/tests/pending/run/t3699.scala b/tests/pending/run/t3699.scala new file mode 100644 index 000000000000..f838bcb520dc --- /dev/null +++ b/tests/pending/run/t3699.scala @@ -0,0 +1,11 @@ +object Test { + def act: Int => Int = { + case _ => + lazy val (a, b) = (3,9) + a + b + } + def main(args: Array[String]) = { + assert(act(1) == 9) + } +} diff --git a/tests/pending/run/t3702.check b/tests/pending/run/t3702.check new file mode 100644 index 000000000000..31c2ac4ed193 --- /dev/null +++ b/tests/pending/run/t3702.check @@ -0,0 +1,2 @@ +() +6 diff --git a/tests/pending/run/t3702.scala b/tests/pending/run/t3702.scala new file mode 100644 index 000000000000..0cdafd90b6ba --- /dev/null +++ b/tests/pending/run/t3702.scala @@ -0,0 +1,11 @@ +object Test { + def foo(h: Any, t: List[Any]) = h match { + case 5 :: _ => () + case List(from) => from + } + + def main(args: Array[String]): Unit = { + println(foo(5 :: Nil, List(1,2,3))) + println(foo(6 :: Nil, List(1,2,3))) + } +} diff --git a/tests/pending/run/t3714.scala b/tests/pending/run/t3714.scala new file mode 100644 index 000000000000..23a1e2e49ec3 --- /dev/null +++ b/tests/pending/run/t3714.scala @@ -0,0 +1,33 @@ +trait Break { + protected val break: Int; +} + +case class BreakImpl(protected val break: Int) extends Break { } + +object Test { + // def f1(x: Break) = x match { + // case b: BreakImpl => b.break + // case b => -1 + // } + def f2(x: Break) = x match { + case BreakImpl(x) => x + case _ => -1 + } + // def f3(x: Any) = x match { + // case b: BreakImpl => b.break + // case b => -1 + // } + def f4(x: Any) = x match { + case BreakImpl(x) => x + case _ => -1 + } + + def main(args: Array[String]): Unit = { + val break = BreakImpl(22) + // assert(f1(break) == 22) + assert(f2(break) == 22) + // assert(f3(break) == 22) + assert(f4(break) == 22) + } +} + diff --git a/tests/pending/run/t3719.check b/tests/pending/run/t3719.check new file mode 100644 index 000000000000..111fc7fd6339 --- /dev/null +++ b/tests/pending/run/t3719.check @@ -0,0 +1,4 @@ +List(Mon, Tue, Wed, Thu, Fri, Sat, Sun) +Mon +Tue +Mon \ No newline at end of file diff --git a/tests/pending/run/t3719.scala b/tests/pending/run/t3719.scala new file mode 100644 index 000000000000..ce3cf5aa3f0d --- /dev/null +++ b/tests/pending/run/t3719.scala @@ -0,0 +1,35 @@ +object Days extends Enumeration { + type Day = DayValue + val Mon, Tue, Wed, Thu, Fri, Sat, Sun = new DayValue // DayValue + + protected class DayValue extends Val { + def isWeekday: Boolean = + this match { + case Sun => false + case Sat => false + case _ => true + } + } +} + +object Test extends dotty.runtime.LegacyApp { + def dayElementsShouldBeNamed(): List[String] = + Days.values.toList.sorted.map(x => x.toString) + + def nameOfMon(): String = { + import Days._ + val d: Day = Mon + d.toString + } + + def nameOfTue(): String = { + import Days._ + val d: Day = Tue + d.toString + } + + println(dayElementsShouldBeNamed()) + println(nameOfMon()) + println(nameOfTue()) + println(nameOfMon()) +} diff --git a/tests/pending/run/t3726.check b/tests/pending/run/t3726.check new file mode 100644 index 000000000000..7a5775bf344d --- /dev/null +++ b/tests/pending/run/t3726.check @@ -0,0 +1,2 @@ +hi there +5 \ No newline at end of file diff --git a/tests/pending/run/t3726.scala b/tests/pending/run/t3726.scala new file mode 100644 index 000000000000..fefc29f11190 --- /dev/null +++ b/tests/pending/run/t3726.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + def test(f: () => Int) = { + val x = f() + 5 + } + + println(test(() => { println("hi there"); 0 })) +} diff --git a/tests/pending/run/t3758-old.scala b/tests/pending/run/t3758-old.scala new file mode 100644 index 000000000000..d5e4a6cc1c32 --- /dev/null +++ b/tests/pending/run/t3758-old.scala @@ -0,0 +1,12 @@ + +@deprecated("Suppress warnings", since="2.11") +object Test { + def main(args: Array[String]): Unit = { + assert(classManifest[Array[String]].typeArguments contains classManifest[String]) + assert(classManifest[Array[Int]].typeArguments contains classManifest[Int]) + assert(classManifest[Array[Float]].typeArguments contains classManifest[Float]) + assert(manifest[Array[String]].typeArguments contains manifest[String]) + assert(manifest[Array[Int]].typeArguments contains manifest[Int]) + assert(manifest[Array[Float]].typeArguments contains manifest[Float]) + } +} diff --git a/tests/pending/run/t3760.scala b/tests/pending/run/t3760.scala new file mode 100644 index 000000000000..b78406824e80 --- /dev/null +++ b/tests/pending/run/t3760.scala @@ -0,0 +1,17 @@ +object Test { + def main(args: Array[String]): Unit = { + { + val it = Iterable(1,2).iterator + val xs = it.toList + + assert(it.isEmpty) + } + + { + val it = Iterator(1, 2) + val xs = it.toStream.toList + + assert(it.isEmpty) + } + } +} diff --git a/tests/pending/run/t3761-overload-byname.check b/tests/pending/run/t3761-overload-byname.check new file mode 100644 index 000000000000..ab7eff0d8a0a --- /dev/null +++ b/tests/pending/run/t3761-overload-byname.check @@ -0,0 +1,12 @@ +hello! +hello working world +goodnight! +goodnight moon, nobody, noises everywhere +0 +1 +0 +1 +0 +1 +0 +1 diff --git a/tests/pending/run/t3761-overload-byname.scala b/tests/pending/run/t3761-overload-byname.scala new file mode 100644 index 000000000000..3b27271f006c --- /dev/null +++ b/tests/pending/run/t3761-overload-byname.scala @@ -0,0 +1,39 @@ + +class OverTheTop { + def info0(m: String) = m + "!" + def info0(m: String, args: Any*) = m +" "+ args.mkString(" ") + + // as reported + def info1(m: =>String) = m + "!" + def info1(m: =>String, args: Any*) = m +" "+ args.mkString(", ") + + // @lrytz + def m[A](x: => Int) = 0; def m[A](x: => Int, xs: Int*) = 1 + + def m1(x: => Int, s: String) = 0 + def m1(x: => Int, s: Object) = 1 + + def m2(x: => Int, s: String) = 0 + def m2(x: => AnyVal, s: Object) = 1 + + def m3(x: => Int, s: String) = 0 + def m3(x: => Any, s: Object) = 1 +} + +object Test { + def main(args: Array[String]): Unit = { + val top = new OverTheTop + println(top.info0("hello")) + println(top.info0("hello","working","world")) + println(top.info1("goodnight")) + println(top.info1("goodnight", "moon", "nobody", "noises everywhere")) + println(top.m(17)) + println(top.m(17,19)) + println(top.m1(1, "two")) + println(top.m1(1, new Object())) + println(top.m2(1, "")) + println(top.m2(1d, "")) + println(top.m3(1, "")) + println(top.m3("", "")) + } +} diff --git a/tests/pending/run/t3763.scala b/tests/pending/run/t3763.scala new file mode 100644 index 000000000000..2fa2992a821a --- /dev/null +++ b/tests/pending/run/t3763.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + val x = Array(Array(1), List(1)) +} diff --git a/tests/pending/run/t3798.check b/tests/pending/run/t3798.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/t3798.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/t3798.scala b/tests/pending/run/t3798.scala new file mode 100644 index 000000000000..698d5a88e3e3 --- /dev/null +++ b/tests/pending/run/t3798.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]): Unit = { + val seq: MySeq[Undefined] = new MySeq[Floats](new Array[Float](10)) + println(10 == seq.array.length) + } +} + +sealed trait Undefined { type ArrayType <: Array[_] } +sealed trait Floats extends Undefined { type ArrayType = Array[Float] } +class MySeq[+T <: Undefined](val array: T#ArrayType) diff --git a/tests/pending/run/t3822.scala b/tests/pending/run/t3822.scala new file mode 100644 index 000000000000..c35804035e82 --- /dev/null +++ b/tests/pending/run/t3822.scala @@ -0,0 +1,19 @@ +import scala.collection.{ mutable, immutable, generic } +import immutable.ListSet + +object Test { + def main(args: Array[String]): Unit = { + val xs = ListSet(-100000 to 100001: _*) + + assert(xs.size == 200002) + assert(xs.sum == 100001) + + val ys = ListSet[Int]() + val ys1 = (1 to 12).grouped(3).foldLeft(ys)(_ ++ _) + val ys2 = (1 to 12).foldLeft(ys)(_ + _) + + assert(ys1 == ys2) + } +} + + diff --git a/tests/pending/run/t3829.scala b/tests/pending/run/t3829.scala new file mode 100644 index 000000000000..ec97729640a9 --- /dev/null +++ b/tests/pending/run/t3829.scala @@ -0,0 +1,40 @@ +// ticket #3829 +object Test { + import collection.{ mutable, immutable } + + def main(args: Array[String]): Unit = { + val map = immutable.Map(1 -> 2, 3 -> 4) + assert(map.get(0) == None) + + // Since r24255 defaultMap.get(x) returns None rather than + // using the default, so these mostly use apply. + val defmap = map.withDefaultValue(-1) + assert(defmap(0) == -1) + assert(defmap.size == 2) + assert(defmap.iterator.size == 2) + assert(defmap.empty(0) == -1) + assert((defmap + (2 -> 3))(0) == -1) + assert((defmap + (2 -> 3))(1) == 2) + assert((defmap + (2 -> 3))(2) == 3) + assert((defmap - 1)(0) == -1) + assert((defmap - 1)(1) == -1) + assert((defmap - 1)(3) == 4) + + val mutmap = mutable.Map(1 -> 2, 2 -> 3) + assert(mutmap.get(0) == None) + + val defmutmap = mutmap.withDefaultValue(-1) + assert(defmutmap(0) == -1) + assert(defmutmap(3) == -1) + mutmap += 3 -> 4 + assert(defmutmap(3) == 4) + assert(defmutmap(1) == 2) + mutmap -= 1 + assert(defmutmap(1) == -1) + assert(mutmap.get(1) == None) + defmutmap += 1 -> 2 + assert(defmutmap(1) == 2) + assert(mutmap(1) == 2) + } + +} diff --git a/tests/pending/run/t3832.scala b/tests/pending/run/t3832.scala new file mode 100644 index 000000000000..bc84dca227c1 --- /dev/null +++ b/tests/pending/run/t3832.scala @@ -0,0 +1,17 @@ +class t3832 { + def this(un: Int) = { + this() + def bippy = this + () + } + def this(un: Boolean) = { + this() + def boppy = () => this + () + } +} + +object Test extends dotty.runtime.LegacyApp { + new t3832(0) + new t3832(true) +} diff --git a/tests/pending/run/t3835.check b/tests/pending/run/t3835.check new file mode 100644 index 000000000000..995415951ddd --- /dev/null +++ b/tests/pending/run/t3835.check @@ -0,0 +1,2 @@ +6 +1 diff --git a/tests/pending/run/t3835.scala b/tests/pending/run/t3835.scala new file mode 100644 index 000000000000..7863916f42d3 --- /dev/null +++ b/tests/pending/run/t3835.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + // work around optimizer bug SI-5672 -- generates wrong bytecode for switches in arguments + // virtpatmat happily emits a switch for a one-case switch + // this is not the focus of this test, hence the temporary workaround + def a = (1, 2, 3) match { case (r, \u03b8, \u03c6) => r + \u03b8 + \u03c6 } + println(a) + def b = (1 match { case \u00e9 => \u00e9 }) + println(b) +} diff --git a/tests/pending/run/t3855.scala b/tests/pending/run/t3855.scala new file mode 100644 index 000000000000..d10aab538384 --- /dev/null +++ b/tests/pending/run/t3855.scala @@ -0,0 +1,18 @@ +object Test { + def byval[A](a: => A) = a + def closure[A](f: () => A) = f() + + def f1(s: String) = { + var n = try { s.toInt } catch { case _: Throwable => 1 } + byval(n) + } + def f2(s: String) = { + var n = try { s.toInt } catch { case _: Throwable => 1 } + closure(() => n) + } + + def main(args: Array[String]) = { + val sum = f1("12") + f2("the witch is dead") + assert(sum == 13) + } +} diff --git a/tests/pending/run/t3877.check b/tests/pending/run/t3877.check new file mode 100644 index 000000000000..72aa5577f651 --- /dev/null +++ b/tests/pending/run/t3877.check @@ -0,0 +1,104 @@ +test1: 3 +test1: 4 +test1: 5 +test1: 6 +test1: 7 +test1: 8 +test1: 9 +test1: 10 +test2: 3 +test2: 4 +test2: 5 +test2: 6 +test2: 7 +test2: 8 +test2: 9 +test2: 10 +test3: 3 +test3: 4 +test3: 5 +test3: 6 +test3: 7 +test3: 8 +test3: 9 +test3: 10 +test4: 3 +test4: 4 +test4: 5 +test4: 6 +test4: 7 +test4: 8 +test4: 9 +test4: 10 +test5.1: 3 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 4 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 5 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 6 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 7 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 8 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 9 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 +test5.1: 10 +test5.2: 3 +test5.2: 4 +test5.2: 5 +test5.2: 6 +test5.2: 7 +test5.2: 8 +test5.2: 9 +test5.2: 10 diff --git a/tests/pending/run/t3877.scala b/tests/pending/run/t3877.scala new file mode 100644 index 000000000000..5d8006f4fc34 --- /dev/null +++ b/tests/pending/run/t3877.scala @@ -0,0 +1,81 @@ +object Test { + val LIMIT = 10 + + def test1: Unit = { + var d = 2 + var i = 0 // avoid infinite loops + while (d < LIMIT && i < LIMIT) { + lazy val b = d + 1 + d = b + i += 1 + println("test1: " + d) + } + } + + def test2: Unit = { + var d = 2 + var i = 0 + while (true) { + lazy val b = d + 1 + d = b + i += 1 + println("test2: " + d) + + if (d >= LIMIT || i >= LIMIT) + return + } + } + + def test3: Unit = { + var d = 2 + var i = 0 + do { + lazy val b = d + 1 + d = b + i += 1 + println("test3: " + d) + } while (d < LIMIT && i < LIMIT) + } + + def test4: Unit = { + var d = 2 + var i = 0 + do { + lazy val b = d + 1 + d = b + i += 1 + println("test4: " + d) + if (d >= LIMIT || i >= LIMIT) + return + } while (true) + } + + def test5: Unit = { + var d = 2 + var i = 0 + while (d < LIMIT && i < LIMIT) { + lazy val b = d + 1 + d = b + i += 1 + println("test5.1: " + d) + + var e = 2 + var j = 0 + while (e < LIMIT && j < LIMIT) { + lazy val f = e + 1 + e = f + j += 1 + println("test5.2: " + e) + } + } + } + + + def main(args: Array[String]): Unit = { + test1 + test2 + test3 + test4 + test5 + } +} diff --git a/tests/pending/run/t3887.scala b/tests/pending/run/t3887.scala new file mode 100644 index 000000000000..88a19419eb0f --- /dev/null +++ b/tests/pending/run/t3887.scala @@ -0,0 +1,16 @@ +object Test { + def main(args: Array[String]): Unit = { + assert( matchPair(1) ) + assert( !matchPair(2) ) + } + + def matchPair(i: Int) = { + (i, "abc") match { + case this.option1 => true + case _ => false + } + } + + val option1: (Int, String) = (1, "abc") + +} diff --git a/tests/pending/run/t3888.check b/tests/pending/run/t3888.check new file mode 100644 index 000000000000..df1629dd7eb1 --- /dev/null +++ b/tests/pending/run/t3888.check @@ -0,0 +1 @@ +warning: there was one deprecation warning; re-run with -deprecation for details diff --git a/tests/pending/run/t3888.scala b/tests/pending/run/t3888.scala new file mode 100644 index 000000000000..8701b42ff0d4 --- /dev/null +++ b/tests/pending/run/t3888.scala @@ -0,0 +1,29 @@ + +// in a match, which notion of equals prevails? +// extending Tuple doesn't seem to be at issue here. +object Test { + + val T1 = new P + private[this] val T2 = T1 + + def m1 = + (1, 2) match { + case T1 => true + case _ => false + } + + def m2 = + (1, 2) match { + case T2 => true + case _ => false + } + + def main(args: Array[String]) = { + assert( m1 ) + assert( m2 ) + } +} + +class P extends Tuple2(1, 1) { + override def equals(x: Any) = true +} diff --git a/tests/pending/run/t3895.check b/tests/pending/run/t3895.check new file mode 100644 index 000000000000..3045ebf0167b --- /dev/null +++ b/tests/pending/run/t3895.check @@ -0,0 +1,2 @@ +17 +17 \ No newline at end of file diff --git a/tests/pending/run/t3895.flags b/tests/pending/run/t3895.flags new file mode 100644 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t3895.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t3895.scala b/tests/pending/run/t3895.scala new file mode 100644 index 000000000000..5f83235de409 --- /dev/null +++ b/tests/pending/run/t3895.scala @@ -0,0 +1,36 @@ +class C extends A{ + + val a = 10 + //object bb + lazy val bb = 17 + val b = 12 +} + +abstract class A{ + val a: Int + val b: Int + val c: Int = 12 +} + +class B extends A{ + + val a = 10 + //object bb + lazy val bb = 17 + val b = 12 +} + +trait T { + private final val a = false +} + +class Impl extends T + + +object Test { + def main(args: Array[String]): Unit = { + println(new B().bb) + println(new C().bb) + } +} + diff --git a/tests/pending/run/t3895b.scala b/tests/pending/run/t3895b.scala new file mode 100644 index 000000000000..1ef35521f2b7 --- /dev/null +++ b/tests/pending/run/t3895b.scala @@ -0,0 +1,27 @@ +class DryRun { + import scala.tools.nsc.{Global, Settings, CompilerCommand} + import scala.tools.nsc.reporters.ConsoleReporter + + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + val command = new CompilerCommand(List(), settings) + val reporter = new ConsoleReporter(settings, scala.Console.in, new java.io.PrintWriter(new java.io.PrintStream(scala.Console.out))) + object compiler extends Global(command.settings, reporter) { + object test1 + lazy val test2 = 1 + object test3 + } + def test: Unit = { + compiler.test1 + compiler.test2 + compiler.test3 + val run = new compiler.Run + run compile command.files + } +} + +object Test { + def main(args: Array[String]): Unit = { + new DryRun().test + } +} diff --git a/tests/pending/run/t3897.check b/tests/pending/run/t3897.check new file mode 100644 index 000000000000..244b83716ffc --- /dev/null +++ b/tests/pending/run/t3897.check @@ -0,0 +1,8 @@ +(One$$messages,scala.collection.mutable.MutableList) +(One$$messages,scala.collection.mutable.MutableList) +(messages,scala.collection.mutable.MutableList) +(messages,scala.collection.mutable.MutableList) +(One$$messages,scala.collection.mutable.MutableList) +(One$$messages,scala.collection.mutable.MutableList) +(messages,scala.collection.mutable.MutableList) +(messages,scala.collection.mutable.MutableList) diff --git a/tests/pending/run/t3897.flags b/tests/pending/run/t3897.flags new file mode 100644 index 000000000000..ac96850b69b5 --- /dev/null +++ b/tests/pending/run/t3897.flags @@ -0,0 +1 @@ +-Ydelambdafy:inline \ No newline at end of file diff --git a/tests/pending/run/t3897/J_2.java b/tests/pending/run/t3897/J_2.java new file mode 100644 index 000000000000..a4c9a98fb1af --- /dev/null +++ b/tests/pending/run/t3897/J_2.java @@ -0,0 +1,27 @@ +import java.lang.reflect.*; + +public class J_2 { + public void f1(Class clazz) { + Field[] fields = clazz.getDeclaredFields(); + for (int i = 0 ; i < fields.length; i++) { + String name = fields[i].getName(); + if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } + else System.out.println("(" + name + "," + fields[i].getGenericType() + ")"); + } + } + public void f2(Class clazz) { + Method[] methods = clazz.getDeclaredMethods(); + for (int i = 0 ; i < methods.length; i++) { + String name = methods[i].getName(); + if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } + else System.out.println("(" + name + "," + methods[i].getGenericReturnType() + ")"); + } + } + + public void javaRun() { + f1(One.class); + f2(One.class); + f1(Two.class); + f2(Two.class); + } +} \ No newline at end of file diff --git a/tests/pending/run/t3897/a_1.scala b/tests/pending/run/t3897/a_1.scala new file mode 100644 index 000000000000..4da959e2ac76 --- /dev/null +++ b/tests/pending/run/t3897/a_1.scala @@ -0,0 +1,8 @@ +class One { + private val messages = new collection.mutable.MutableList[String] + List("a") foreach { messages += _ } +} + +class Two { + private val messages = new collection.mutable.MutableList[String] +} diff --git a/tests/pending/run/t3897/a_2.scala b/tests/pending/run/t3897/a_2.scala new file mode 100644 index 000000000000..7a161fcbe45d --- /dev/null +++ b/tests/pending/run/t3897/a_2.scala @@ -0,0 +1,23 @@ +object Test { + def f1(clazz: Class[_]) = ( + clazz.getDeclaredFields.toList + . filterNot (_.getName contains "bitmap$") + . map (f => (f.getName, f.getGenericType)) + . foreach (println) + ) + def f2(clazz: Class[_]) = ( + clazz.getDeclaredMethods.toList + . filterNot (_.getName contains "bitmap$") + . map (f => (f.getName, f.getGenericReturnType)) + . foreach (println) + ) + + def main(args: Array[String]): Unit = { + f1(classOf[One]) + f2(classOf[One]) + f1(classOf[Two]) + f2(classOf[Two]) + + new J_2().javaRun + } +} diff --git a/tests/pending/run/t3923.scala b/tests/pending/run/t3923.scala new file mode 100644 index 000000000000..484095a6077f --- /dev/null +++ b/tests/pending/run/t3923.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + assert(collection.mutable.ArraySeq() == Nil) + assert(collection.mutable.ArraySeq() == Seq()) + assert(Seq() == collection.mutable.ArraySeq()) + assert(Nil == collection.mutable.ArraySeq()) + } +} diff --git a/tests/pending/run/t3932.check b/tests/pending/run/t3932.check new file mode 100644 index 000000000000..5ec39bbdeb5c --- /dev/null +++ b/tests/pending/run/t3932.check @@ -0,0 +1,6 @@ +true +true +true +true +true +true diff --git a/tests/pending/run/t3932.scala b/tests/pending/run/t3932.scala new file mode 100644 index 000000000000..f577ef8315ea --- /dev/null +++ b/tests/pending/run/t3932.scala @@ -0,0 +1,35 @@ +class Foo + +abstract class C { + val f: Foo + def g1 = (f == f) +} +object O1 extends C { + val f = new Foo() + def g2 = (f == f) +} +object O2 extends C { + object f extends Foo + def g2 = (f == f) +} + +class O3 extends C { + object f extends Foo + def g2 = (f == f) +} + + +object Test { + def main(args: Array[String]): Unit = { + println(O1.g1) + println(O1.g2) + + println(O2.g1) + println(O2.g2) + + val o3 = new O3() + println(o3.g1) + println(o3.g2) + + } +} diff --git a/tests/pending/run/t3935.scala b/tests/pending/run/t3935.scala new file mode 100644 index 000000000000..84e39571cae4 --- /dev/null +++ b/tests/pending/run/t3935.scala @@ -0,0 +1,15 @@ + + + + +object Test { + def main(args: Array[String]): Unit = { + val q = scala.collection.mutable.Queue[String]() + assert(q.length == 0) + try { + assert(q.front != null) + } catch { + case _: Throwable => + } + } +} diff --git a/tests/pending/run/t3950.check b/tests/pending/run/t3950.check new file mode 100644 index 000000000000..10f81c51addf --- /dev/null +++ b/tests/pending/run/t3950.check @@ -0,0 +1,3 @@ +minus +zero +plus \ No newline at end of file diff --git a/tests/pending/run/t3950.scala b/tests/pending/run/t3950.scala new file mode 100644 index 000000000000..4634b3bf0bbd --- /dev/null +++ b/tests/pending/run/t3950.scala @@ -0,0 +1,17 @@ + +object NegativeId extends Enumeration { + val Negative = Value(-1, "minus") + val Zero = Value(0, "zero") + val Positive = Value(1, "plus") + + def fromInt(id: Int) = values find (_.id == id) match { + case Some(v) => v + case None => null + } +} + +object Test extends dotty.runtime.LegacyApp { + println(NegativeId.fromInt(-1)) + println(NegativeId.fromInt(0)) + println(NegativeId.fromInt(1)) +} diff --git a/tests/pending/run/t3964.check b/tests/pending/run/t3964.check new file mode 100644 index 000000000000..55569e49e693 --- /dev/null +++ b/tests/pending/run/t3964.check @@ -0,0 +1,2 @@ +42 +-21 diff --git a/tests/pending/run/t3964.scala b/tests/pending/run/t3964.scala new file mode 100644 index 000000000000..9b46cdb298cc --- /dev/null +++ b/tests/pending/run/t3964.scala @@ -0,0 +1,19 @@ + +import scala.language.implicitConversions + +object Test { + class Base + object Bob extends Base + class Foo { def bippy = 42 } + class Oof { def bippy = -21 } + + // I am more specific than you + implicit def f1(x: Bob.type): Foo = new Foo + implicit def f2(x: Base): Oof = new Oof + + def main(args: Array[String]): Unit = { + // this would of course print an unambiguous 42 + println(Bob.bippy) + println((new Base).bippy) + } +} diff --git a/tests/pending/run/t3970.check b/tests/pending/run/t3970.check new file mode 100644 index 000000000000..0683a6c1a689 --- /dev/null +++ b/tests/pending/run/t3970.check @@ -0,0 +1 @@ +warning: there were 5 deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t3970.scala b/tests/pending/run/t3970.scala new file mode 100644 index 000000000000..4a1b7fd00a95 --- /dev/null +++ b/tests/pending/run/t3970.scala @@ -0,0 +1,21 @@ + + + +import collection.mutable._ + + + +object Test { + def main(args: Array[String]): Unit = { + val dl = DoubleLinkedList[Int]() + dl.remove() + + val dl2 = DoubleLinkedList[Int](1, 2, 3) + dl2.next.remove() + assert(dl2 == DoubleLinkedList(1, 3)) + + val dl3 = DoubleLinkedList[Int](1, 2, 3) + assert(dl3.drop(1) == DoubleLinkedList(2, 3)) + assert(dl3.drop(1).prev == null) + } +} diff --git a/tests/pending/run/t3980.check b/tests/pending/run/t3980.check new file mode 100644 index 000000000000..8bb03f18bb64 --- /dev/null +++ b/tests/pending/run/t3980.check @@ -0,0 +1,3 @@ +once +2 +2 diff --git a/tests/pending/run/t3980.scala b/tests/pending/run/t3980.scala new file mode 100644 index 000000000000..dbe9644ea19a --- /dev/null +++ b/tests/pending/run/t3980.scala @@ -0,0 +1,19 @@ +object A { + def run1: Unit = { + lazy val x: Unit = {(); println("once")} + x + x + } + def run2: Unit = { + lazy val y: Int = 2 + println(y) + println(y) + } +} + +object Test { + def main(args: Array[String]) = { + A.run1 + A.run2 + } +} diff --git a/tests/pending/run/t3984.scala b/tests/pending/run/t3984.scala new file mode 100644 index 000000000000..15e50b10fde5 --- /dev/null +++ b/tests/pending/run/t3984.scala @@ -0,0 +1,52 @@ +object SetBug { + import scala.collection.immutable.{ Set => ImmutSet } + import scala.collection.mutable.{ Set => MutSet } + + case class IH (i: Int, h: Int) { + override def hashCode: Int = h + } + + def run(): Unit = { + var is = ImmutSet.empty[IH] + var ms = MutSet.empty[IH] + for (ih <- List(IH(2,0),IH(0,0),IH(4,4),IH(6,4),IH(-8,1520786080))) { + is = is + ih + ms = ms + ih + } + assert(is == ms) + val x = IH(6,4) + is = is - x + ms = ms - x + assert(is == ms) + } +} + +object MapBug { + import scala.collection.immutable.{ Map => ImmutMap } + import scala.collection.mutable.{ Map => MutMap } + + case class IH (i: Int, h: Int) { + override def hashCode: Int = h + } + + def run(): Unit = { + var im = ImmutMap.empty[IH,IH] + var mm = MutMap.empty[IH,IH] + for (ih <- List(IH(2,0),IH(0,0),IH(4,4),IH(6,4),IH(-8,1520786080))) { + im = im + ((ih,ih)) + mm = mm + ((ih,ih)) + } + assert(im == mm) + val x = IH(6,4) + im = im - x + mm = mm - x + assert(im == mm) + } +} + +object Test { + def main(args: Array[String]): Unit = { + SetBug.run() + MapBug.run() + } +} diff --git a/tests/pending/run/t3989.scala b/tests/pending/run/t3989.scala new file mode 100644 index 000000000000..896283f19c0a --- /dev/null +++ b/tests/pending/run/t3989.scala @@ -0,0 +1,17 @@ + + + + + +class Foo{ override def equals(o: Any) = false; override def hashCode = 1} + +// should not result in a stack overflow +object Test { + def main(args: Array[String]): Unit = { + import collection.immutable.HashMap + var m = Map[Foo, Int]() + for (i <- 1 to 30000) m += (new Foo) -> i + assert(m.size == 30000) + m.toString + } +} diff --git a/tests/pending/run/t3994.scala b/tests/pending/run/t3994.scala new file mode 100644 index 000000000000..e9fc39f8110a --- /dev/null +++ b/tests/pending/run/t3994.scala @@ -0,0 +1,20 @@ +trait T { + trait Default { def foo = this } + object Default extends Default +} + +class Crash { // if you change this to a `trait` it keeps failing, though if it is an `object` it compiles just fine! + class Element + + /* declare this as a class, and the crash goes away */ + trait ElementOrdering extends Ordering[Element] { + def compare(a: Element, b: Element): Int = 0 + } + + implicit object ElementOrdering extends ElementOrdering +} + +object Test extends dotty.runtime.LegacyApp { + (new T {}).Default + (new Crash).ElementOrdering +} diff --git a/tests/pending/run/t3996.check b/tests/pending/run/t3996.check new file mode 100644 index 000000000000..a9ecc29fea08 --- /dev/null +++ b/tests/pending/run/t3996.check @@ -0,0 +1 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t3996.scala b/tests/pending/run/t3996.scala new file mode 100644 index 000000000000..b40b3ec111f6 --- /dev/null +++ b/tests/pending/run/t3996.scala @@ -0,0 +1,13 @@ + + + + + +// should not result in a stack overflow +object Test { + def main(args: Array[String]): Unit = { + import collection.mutable.LinkedList + val l = new LinkedList[Int]() ++ (0 until 10000) + assert(l.length == 10000) + } +} diff --git a/tests/pending/run/t4013.scala b/tests/pending/run/t4013.scala new file mode 100644 index 000000000000..98cc5e881d07 --- /dev/null +++ b/tests/pending/run/t4013.scala @@ -0,0 +1,24 @@ + + +trait Base[B] { + def data: AnyRef; +} + + +class Suba[@specialized B](override val data: Array[B]) extends Base[B] { + assert(data != null) +} + + +class Subopt[@specialized B](override val data: Option[B]) extends Base[B] { + assert(data != null) +} + + +object Test { + def main(args: Array[String]): Unit = { + val ss = new Suba[String](Array("")) + val si = new Suba[Int](Array(0)) + new Subopt[Int](Some(0)) + } +} diff --git a/tests/pending/run/t4013b.scala b/tests/pending/run/t4013b.scala new file mode 100644 index 000000000000..78f554b33a59 --- /dev/null +++ b/tests/pending/run/t4013b.scala @@ -0,0 +1,20 @@ + + +trait Base[B] { + def data: AnyRef; +} + + +class M[@specialized(Int) A] + + +class Sub3[@specialized(Int) B](override val data: M[B]) extends Base[B] { + assert(data != null) +} + + +object Test { + def main(args: Array[String]): Unit = { + new Sub3[Int](new M[Int]) + } +} diff --git a/tests/pending/run/t4013c.scala b/tests/pending/run/t4013c.scala new file mode 100644 index 000000000000..3b0d87574bc5 --- /dev/null +++ b/tests/pending/run/t4013c.scala @@ -0,0 +1,10 @@ +class Suba[@specialized(Int) B](val data: Array[B]) { + assert(data != null) +} + + +object Test { + def main(args: Array[String]): Unit = { + new Suba[Int](Array(0)) + } +} diff --git a/tests/pending/run/t4023.check b/tests/pending/run/t4023.check new file mode 100644 index 000000000000..05f867c3975b --- /dev/null +++ b/tests/pending/run/t4023.check @@ -0,0 +1,21 @@ +Try 1: (6 classes) +class Test$C$B1 +class Test$C$B2 +class Test$C$B3$ +class Test$C$B4$ +class Test$C$B5$ +class Test$C$B6$ +Try 2: (6 classes) +class Test$C$B1 +class Test$C$B2 +class Test$C$B3$ +class Test$C$B4$ +class Test$C$B5$ +class Test$C$B6$ +Try 3: (6 classes) +class Test$C$B1 +class Test$C$B2 +class Test$C$B3$ +class Test$C$B4$ +class Test$C$B5$ +class Test$C$B6$ diff --git a/tests/pending/run/t4023.scala b/tests/pending/run/t4023.scala new file mode 100644 index 000000000000..68f5ec815995 --- /dev/null +++ b/tests/pending/run/t4023.scala @@ -0,0 +1,34 @@ +object Test { + object C { + class B1 + private class B2 + object B3 + private object B4 + object B5 extends B1 + private object B6 extends B2 + + val classes1 = this.getClass.getDeclaredClasses + val classes2 = C.getClass .getDeclaredClasses + val classes3 = getClass .getDeclaredClasses + } + + // sortBy(_.getName) introduces additional classes which we don't want to see in C, + // so we call sortBy outside of C. + object TestHelper { + val valuesTry1 = C.classes1.sortBy(_.getName) + val valuesTry2 = C.classes2.sortBy(_.getName) + val valuesTry3 = C.classes3.sortBy(_.getName) + } + + def main(args: Array[String]): Unit = { + println("Try 1: (" + TestHelper.valuesTry1.length + " classes)") + TestHelper.valuesTry1.foreach(println) + println("Try 2: (" + TestHelper.valuesTry2.length + " classes)") + TestHelper.valuesTry2.foreach(println) + println("Try 3: (" + TestHelper.valuesTry3.length + " classes)") + TestHelper.valuesTry3.foreach(println) + } + + +} + diff --git a/tests/pending/run/t4024.scala b/tests/pending/run/t4024.scala new file mode 100644 index 000000000000..480934107839 --- /dev/null +++ b/tests/pending/run/t4024.scala @@ -0,0 +1,20 @@ +object Test extends dotty.runtime.LegacyApp { + + val x = "abc" + + val m = x.getClass.getMethod("toString") + + assert(m.invoke(x, (Nil: List[AnyRef]): _*) == "abc") + + Test2.main(Array()) +} + + +object Test2 { + def main(args: Array[String]): Unit = { + val x = "abc" + val m = x.getClass.getMethod("toString") + m.invoke(x, Nil: _*) + m.invoke(x, Seq(): _*) + } +} diff --git a/tests/pending/run/t4025.check b/tests/pending/run/t4025.check new file mode 100644 index 000000000000..e8c6851236f1 --- /dev/null +++ b/tests/pending/run/t4025.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class Color(val red: Int) +defined class Color + +scala> + +scala> case class Red(r:Int) extends Color(r) +defined class Red + +scala> + +scala> def f(c: Any) = c match { case Red(_) => () } +f: (c: Any)Unit + +scala> :quit diff --git a/tests/pending/run/t4025.scala b/tests/pending/run/t4025.scala new file mode 100644 index 000000000000..5db0093970b9 --- /dev/null +++ b/tests/pending/run/t4025.scala @@ -0,0 +1,12 @@ +import scala.tools.nsc.Settings +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +class Color(val red: Int) + +case class Red(r:Int) extends Color(r) + +def f(c: Any) = c match { case Red(_) => () } +""" +} diff --git a/tests/pending/run/t4027.check b/tests/pending/run/t4027.check new file mode 100644 index 000000000000..bdacfc1c065b --- /dev/null +++ b/tests/pending/run/t4027.check @@ -0,0 +1,12 @@ +Map(2 -> true, 4 -> true) +Map(1 -> false!, 2 -> true!, 3 -> false!, 4 -> true!) +Map(2 -> 4, 4 -> 4) +Map(1 -> 6, 2 -> 5, 3 -> 6, 4 -> 5) +Map() +Map(1 -> false!) +Map(2 -> true, 4 -> true) +Map(1 -> false!, 2 -> true!, 3 -> false!, 4 -> true!) +Map(2 -> 4, 4 -> 4) +Map(1 -> 6, 2 -> 5, 3 -> 6, 4 -> 5) +Map() +Map(1 -> false!) \ No newline at end of file diff --git a/tests/pending/run/t4027.scala b/tests/pending/run/t4027.scala new file mode 100644 index 000000000000..6a858afd98b5 --- /dev/null +++ b/tests/pending/run/t4027.scala @@ -0,0 +1,27 @@ + + +import collection._ + + +/** Sorted maps should have `filterKeys` and `mapValues` which return sorted maps. + * Mapping, filtering, etc. on these views should return sorted maps again. + */ +object Test extends dotty.runtime.LegacyApp { + + val sortedmap = SortedMap(1 -> false, 2 -> true, 3 -> false, 4 -> true) + println(sortedmap.filterKeys(_ % 2 == 0): SortedMap[Int, Boolean]) + println(sortedmap.mapValues(_ + "!"): SortedMap[Int, String]) + println(sortedmap.filterKeys(_ % 2 == 0).map(t => (t._1, t._2.toString.length)): SortedMap[Int, Int]) + println(sortedmap.mapValues(_ + "!").map(t => (t._1, t._2.toString.length)): SortedMap[Int, Int]) + println(sortedmap.filterKeys(_ % 2 == 0).filter(t => t._1 < 2): SortedMap[Int, Boolean]) + println(sortedmap.mapValues(_ + "!").filter(t => t._1 < 2): SortedMap[Int, String]) + + val immsortedmap = immutable.SortedMap(1 -> false, 2 -> true, 3 -> false, 4 -> true) + println(immsortedmap.filterKeys(_ % 2 == 0): immutable.SortedMap[Int, Boolean]) + println(immsortedmap.mapValues(_ + "!"): immutable.SortedMap[Int, String]) + println(immsortedmap.filterKeys(_ % 2 == 0).map(t => (t._1, t._2.toString.length)): immutable.SortedMap[Int, Int]) + println(immsortedmap.mapValues(_ + "!").map(t => (t._1, t._2.toString.length)): immutable.SortedMap[Int, Int]) + println(immsortedmap.filterKeys(_ % 2 == 0).filter(t => t._1 < 2): immutable.SortedMap[Int, Boolean]) + println(immsortedmap.mapValues(_ + "!").filter(t => t._1 < 2): immutable.SortedMap[Int, String]) + +} diff --git a/tests/pending/run/t4047.check b/tests/pending/run/t4047.check new file mode 100644 index 000000000000..3c41e6e2443d --- /dev/null +++ b/tests/pending/run/t4047.check @@ -0,0 +1,17 @@ +t4047.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + a.foo + ^ +t4047.scala:24: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + a.foo + ^ +t4047.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + b.foo + ^ +t4047.scala:27: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + b.foo + ^ +Unit: called A.foo +Unit: called B.foo +Unit: called C.foo +Unit: called D.foo +Unit: called D.foo diff --git a/tests/pending/run/t4047.scala b/tests/pending/run/t4047.scala new file mode 100644 index 000000000000..a9019d5d72cf --- /dev/null +++ b/tests/pending/run/t4047.scala @@ -0,0 +1,34 @@ +trait Foo[T] { val foo: T} + +class A extends Foo[Unit]{ + lazy val foo = println("Unit: called A.foo") +} + +class B extends Foo[Unit]{ + val foo = println("Unit: called B.foo") +} + +trait Bar[T] { def foo: T} + +class C extends Bar[Unit]{ + lazy val foo = println("Unit: called C.foo") +} + +class D extends Bar[Unit]{ + def foo = println("Unit: called D.foo") +} + +object Test extends dotty.runtime.LegacyApp { + val a: Foo[Unit] = new A + a.foo + a.foo + val b: Foo[Unit] = new B + b.foo + b.foo + val c: Bar[Unit] = new C + c.foo + c.foo + val d: Bar[Unit] = new D + d.foo + d.foo +} diff --git a/tests/pending/run/t405.scala b/tests/pending/run/t405.scala new file mode 100644 index 000000000000..a78203e3da6c --- /dev/null +++ b/tests/pending/run/t405.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val x = M; + object M; + assert(x eq M) +} diff --git a/tests/pending/run/t4054.scala b/tests/pending/run/t4054.scala new file mode 100644 index 000000000000..b57c08361573 --- /dev/null +++ b/tests/pending/run/t4054.scala @@ -0,0 +1,25 @@ + + + + + + + + +object Test { + def main(args: Array[String]): Unit = { + val it = Iterator.from(1).map(n => n * n).scanLeft(0)(_+_) + + assert(it.next == 0) + assert(it.next == 1) + assert(it.next == 5) + assert(it.next == 14) + assert(it.next == 30) + assert(it.next == 55) + assert(it.next == 91) + assert(it.next == 140) + assert(it.next == 204) + assert(it.next == 285) + assert(it.next == 385) + } +} diff --git a/tests/pending/run/t4062.check b/tests/pending/run/t4062.check new file mode 100644 index 000000000000..1d474d525571 --- /dev/null +++ b/tests/pending/run/t4062.check @@ -0,0 +1,2 @@ +false +true diff --git a/tests/pending/run/t4062.scala b/tests/pending/run/t4062.scala new file mode 100644 index 000000000000..f5478e75932e --- /dev/null +++ b/tests/pending/run/t4062.scala @@ -0,0 +1,16 @@ +class A(val f : String) + +class B(f: String) extends A(f) { + def foo(x: String) = x match { + case `f` => true + case _ => false + } +} + +object Test { + def main(args: Array[String]): Unit = { + val b = new B("abc") + println(b foo "bippy") + println(b foo "abc") + } +} diff --git a/tests/pending/run/t4072.flags b/tests/pending/run/t4072.flags new file mode 100644 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t4072.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t4072.scala b/tests/pending/run/t4072.scala new file mode 100644 index 000000000000..3b31d33cdccf --- /dev/null +++ b/tests/pending/run/t4072.scala @@ -0,0 +1,15 @@ +import scala.tools.nsc._ + +import scala.language.{ reflectiveCalls } + +object Test { + class DryRun { + val compiler = new Global(new Settings()) { + lazy val test1 = new AnyRef + } + } + + def main(args: Array[String]): Unit = { + new DryRun().compiler.test1 + } +} diff --git a/tests/pending/run/t408.scala b/tests/pending/run/t408.scala new file mode 100644 index 000000000000..9e51e881edb0 --- /dev/null +++ b/tests/pending/run/t408.scala @@ -0,0 +1,12 @@ +object Test +{ + val a = scala.collection.immutable.Set.empty ++ (0 to 100000) + val b = scala.collection.immutable.Set.empty ++ (0 to 100000) + + def main(args: Array[String]): Unit = { + a -- b + a -- b + a -- b + a -- b + } +} diff --git a/tests/pending/run/t4080.check b/tests/pending/run/t4080.check new file mode 100644 index 000000000000..462e925b7694 --- /dev/null +++ b/tests/pending/run/t4080.check @@ -0,0 +1,2 @@ +warning: there were three deprecation warnings; re-run with -deprecation for details +LinkedList(1, 0, 2, 3) diff --git a/tests/pending/run/t4080.scala b/tests/pending/run/t4080.scala new file mode 100644 index 000000000000..551738018767 --- /dev/null +++ b/tests/pending/run/t4080.scala @@ -0,0 +1,13 @@ +import scala.collection.mutable.LinkedList +import java.util.NoSuchElementException + +object Test { + def main(args: Array[String]): Unit = { + val ll = LinkedList(1, 2, 3) + ll.insert(LinkedList(0)) + println(ll) + val ll2 = LinkedList[Int]() + try println("Empty head? " + ll2.head) + catch { case _: NoSuchElementException => () } + } +} diff --git a/tests/pending/run/t4110-new.check b/tests/pending/run/t4110-new.check new file mode 100644 index 000000000000..c0f646c5f622 --- /dev/null +++ b/tests/pending/run/t4110-new.check @@ -0,0 +1,2 @@ +Test.A with Test.B +Test.A with Test.B diff --git a/tests/pending/run/t4110-new.scala b/tests/pending/run/t4110-new.scala new file mode 100644 index 000000000000..49a05dc9241d --- /dev/null +++ b/tests/pending/run/t4110-new.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + def inferredType[T : TypeTag](v : T) = println(typeOf[T]) + + trait A + trait B + + inferredType(new A with B) + + val name = new A with B + inferredType(name) +} diff --git a/tests/pending/run/t4110-old.check b/tests/pending/run/t4110-old.check new file mode 100644 index 000000000000..8b005989def3 --- /dev/null +++ b/tests/pending/run/t4110-old.check @@ -0,0 +1,2 @@ +Object with Test$A with Test$B +Object with Test$A with Test$B diff --git a/tests/pending/run/t4110-old.scala b/tests/pending/run/t4110-old.scala new file mode 100644 index 000000000000..0b16c857b487 --- /dev/null +++ b/tests/pending/run/t4110-old.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + def inferredType[T : Manifest](v : T) = println(manifest[T]) + + trait A + trait B + + inferredType(new A with B) + + val name = new A with B + inferredType(name) +} diff --git a/tests/pending/run/t4119/J.java b/tests/pending/run/t4119/J.java new file mode 100644 index 000000000000..ee65d33e22ec --- /dev/null +++ b/tests/pending/run/t4119/J.java @@ -0,0 +1,7 @@ +package foo.bar; + +public abstract class J { + protected void foo(J j) { + return; + } +} diff --git a/tests/pending/run/t4119/S.scala b/tests/pending/run/t4119/S.scala new file mode 100644 index 000000000000..d6ae5f1b8726 --- /dev/null +++ b/tests/pending/run/t4119/S.scala @@ -0,0 +1,14 @@ +class S extends foo.bar.J { + sss => + + val fn = () => { + foo(S.this) + } + fn() +} + +object Test { + def main(args: Array[String]): Unit = { + new S + } +} diff --git a/tests/pending/run/t4122.scala b/tests/pending/run/t4122.scala new file mode 100644 index 000000000000..5ff570c00966 --- /dev/null +++ b/tests/pending/run/t4122.scala @@ -0,0 +1,14 @@ +object Test { + val sw: Seq[Char] = "ab" + val sw2: Seq[Char] = Array('a', 'b') + val sw3 = Seq('a', 'b') + val sw4 = "ab".toList + val all = List(sw, sw2, sw3, sw4) + + def main(args: Array[String]): Unit = { + for (s1 <- all ; s2 <- all) { + assert(s1 == s2, s1 + " != " + s2) + assert(s1.## == s2.##, s1 + ".## != " + s2 + ".##") + } + } +} diff --git a/tests/pending/run/t4124.check b/tests/pending/run/t4124.check new file mode 100644 index 000000000000..66a0092d936d --- /dev/null +++ b/tests/pending/run/t4124.check @@ -0,0 +1,4 @@ +hi +hi +bye +bye diff --git a/tests/pending/run/t4124.scala b/tests/pending/run/t4124.scala new file mode 100644 index 000000000000..79bcf55f01b1 --- /dev/null +++ b/tests/pending/run/t4124.scala @@ -0,0 +1,24 @@ +import xml.Node + +object Test extends dotty.runtime.LegacyApp { + val body: Node = hi + println ((body: AnyRef, "foo") match { + case (node: Node, "bar") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body, "foo") match { + case (node: Node, "bar") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body: AnyRef, "foo") match { + case (node: Node, "foo") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body: AnyRef, "foo") match { + case (node: Node, "foo") => "bye" + case (ser: Serializable, "foo") => "hi" + }) +} diff --git a/tests/pending/run/t4147.scala b/tests/pending/run/t4147.scala new file mode 100644 index 000000000000..c638ab50a2b3 --- /dev/null +++ b/tests/pending/run/t4147.scala @@ -0,0 +1,36 @@ + + + +import scala.collection._ + + + +object Test { + + def main(args: Array[String]): Unit = { + checkElementsAreSorted() + checkRangedImpl() + } + + def checkElementsAreSorted(): Unit = { + val tree = mutable.SortedSet[Int]() + tree ++= List(4, 3, 1, 6, 7, 5, 2) + assert(tree == immutable.SortedSet(1, 2, 3, 4, 5, 6, 7)) + assert(tree.size == 7) + } + + def checkRangedImpl(): Unit = { + val tree = mutable.SortedSet[Int](3, 1, 6, 7, 5, 2) + val projection = tree.rangeImpl(Some(3), Some(6)) + assert(projection == immutable.SortedSet(3, 5)) + assert(projection.size == 2) + + // Let's check that modification are taken into account + tree add 4 + assert(tree == immutable.SortedSet(1, 2, 3, 4, 5, 6, 7)) + assert(projection == immutable.SortedSet(3, 4, 5)) + assert(tree.size == 7) + assert(projection.size == 3) + } + +} diff --git a/tests/pending/run/t4148.check b/tests/pending/run/t4148.check new file mode 100644 index 000000000000..544b0d19d11c --- /dev/null +++ b/tests/pending/run/t4148.check @@ -0,0 +1,3 @@ +cce1 +5 +100 diff --git a/tests/pending/run/t4148.scala b/tests/pending/run/t4148.scala new file mode 100644 index 000000000000..d543e093abde --- /dev/null +++ b/tests/pending/run/t4148.scala @@ -0,0 +1,9 @@ +object Test { + val x1 = try { "aaa".asInstanceOf[Int] } catch { case _: Throwable => "cce1" } + val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _: Throwable => "cce2" } + val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _: Throwable => "cce3" } + + def main(args: Array[String]): Unit = { + List(x1, x2, x3) foreach println + } +} diff --git a/tests/pending/run/t4171.check b/tests/pending/run/t4171.check new file mode 100644 index 000000000000..d72391a1c4f3 --- /dev/null +++ b/tests/pending/run/t4171.check @@ -0,0 +1,3 @@ +1 +5 +class Test$B$1 diff --git a/tests/pending/run/t4171.scala b/tests/pending/run/t4171.scala new file mode 100644 index 000000000000..7f6dfd48cef1 --- /dev/null +++ b/tests/pending/run/t4171.scala @@ -0,0 +1,14 @@ + +import scala.language.{ reflectiveCalls } + +object Test { + val c = { class C; new C { def foo = 1 } } + val a = { class B { def bar = 5 }; class C extends B; new C } + val e = { class A; class B extends A; classOf[B] } + + def main(args: Array[String]): Unit = { + println(c.foo) + println(a.bar) + println(e) + } +} diff --git a/tests/pending/run/t4172.check b/tests/pending/run/t4172.check new file mode 100644 index 000000000000..315c1c9dbdd5 --- /dev/null +++ b/tests/pending/run/t4172.check @@ -0,0 +1,8 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) } +warning: there was one feature warning; re-run with -feature for details +c: (C, C{def f: Int}) forSome { type C <: AnyRef } = (C,C) + +scala> :quit diff --git a/tests/pending/run/t4172.scala b/tests/pending/run/t4172.scala new file mode 100644 index 000000000000..3a08f2fecd23 --- /dev/null +++ b/tests/pending/run/t4172.scala @@ -0,0 +1,7 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) } + """ +} diff --git a/tests/pending/run/t4190.check b/tests/pending/run/t4190.check new file mode 100644 index 000000000000..b8aae0c7a1c9 --- /dev/null +++ b/tests/pending/run/t4190.check @@ -0,0 +1,3 @@ +a0 +b0 +c0 diff --git a/tests/pending/run/t4190.scala b/tests/pending/run/t4190.scala new file mode 100644 index 000000000000..0c91d62de4db --- /dev/null +++ b/tests/pending/run/t4190.scala @@ -0,0 +1,6 @@ +import collection.mutable._ + +object Test extends dotty.runtime.LegacyApp { + val x: ArrayBuffer[String] = ArrayBuffer("a", "b", "c") + x.view map (_ + "0") foreach println +} diff --git a/tests/pending/run/t4201.scala b/tests/pending/run/t4201.scala new file mode 100644 index 000000000000..f6c0acaf945b --- /dev/null +++ b/tests/pending/run/t4201.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val f = 0.0 to 1.0 by 1.0 / 3.0 + assert(f.size == 4) + } +} + diff --git a/tests/pending/run/t4216.check b/tests/pending/run/t4216.check new file mode 100644 index 000000000000..e4610e87d3be --- /dev/null +++ b/tests/pending/run/t4216.check @@ -0,0 +1,37 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.ClassTag +import scala.reflect.ClassTag + +scala> def f[A: ClassTag](a: A) = java.util.Arrays.asList(Array(a): _*) +f: [A](a: A)(implicit evidence$1: scala.reflect.ClassTag[A])java.util.List[A] + +scala> f(".") +res0: java.util.List[String] = [.] + +scala> f(0) +res1: java.util.List[Int] = [0] + +scala> def i(a: Int) = java.util.Arrays.asList(Array(a): _*) +i: (a: Int)java.util.List[Int] + +scala> i(0) +res2: java.util.List[Int] = [0] + +scala> def o(a: Any) = java.util.Arrays.asList(Array(a): _*) +o: (a: Any)java.util.List[Any] + +scala> o(".") +res3: java.util.List[Any] = [.] + +scala> class V(val a: Int) extends AnyVal +defined class V + +scala> f(new V(0)) +res4: java.util.List[V] = [V@0] + +scala> o(new V(0)) +res5: java.util.List[Any] = [V@0] + +scala> :quit diff --git a/tests/pending/run/t4216.scala b/tests/pending/run/t4216.scala new file mode 100644 index 000000000000..ecaae5bea28a --- /dev/null +++ b/tests/pending/run/t4216.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.ReplTest + +// t4216 +object Test extends ReplTest { + def code = + """ + |import scala.reflect.ClassTag + |def f[A: ClassTag](a: A) = java.util.Arrays.asList(Array(a): _*) + |f(".") + |f(0) + |def i(a: Int) = java.util.Arrays.asList(Array(a): _*) + |i(0) + |def o(a: Any) = java.util.Arrays.asList(Array(a): _*) + |o(".") + |class V(val a: Int) extends AnyVal + |f(new V(0)) + |o(new V(0)) + |""".stripMargin.trim +} diff --git a/tests/pending/run/t4238/J_1.java b/tests/pending/run/t4238/J_1.java new file mode 100644 index 000000000000..47a9c21000ab --- /dev/null +++ b/tests/pending/run/t4238/J_1.java @@ -0,0 +1,16 @@ +import scala.*; + +class J_1 { + scala.collection.mutable.HashMap map = + new scala.collection.mutable.HashMap(); + + Function1, Integer> f = + new scala.runtime.AbstractFunction1, Integer>() { + public Integer apply(Tuple2 s) { + return s._1().length(); + } + }; + + scala.collection.Seq counts = + map.groupBy(f).keys().toList(); +} diff --git a/tests/pending/run/t4238/s_2.scala b/tests/pending/run/t4238/s_2.scala new file mode 100644 index 000000000000..a6e9bd11dedc --- /dev/null +++ b/tests/pending/run/t4238/s_2.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + val x = new J_1 + } +} diff --git a/tests/pending/run/t4283.check b/tests/pending/run/t4283.check new file mode 100644 index 000000000000..0d27989761ca --- /dev/null +++ b/tests/pending/run/t4283.check @@ -0,0 +1,5 @@ +2 +2 +1 +1 +1 diff --git a/tests/pending/run/t4283/AbstractFoo.java b/tests/pending/run/t4283/AbstractFoo.java new file mode 100644 index 000000000000..0403271b7461 --- /dev/null +++ b/tests/pending/run/t4283/AbstractFoo.java @@ -0,0 +1,6 @@ +package test; + +/* package private */ class AbstractFoo { + public int t = 1; + public int f() { return 2; } +} \ No newline at end of file diff --git a/tests/pending/run/t4283/ScalaBipp.scala b/tests/pending/run/t4283/ScalaBipp.scala new file mode 100644 index 000000000000..36dea9f4de17 --- /dev/null +++ b/tests/pending/run/t4283/ScalaBipp.scala @@ -0,0 +1,5 @@ +package test + +class ScalaBipp extends AbstractFoo { + def make: Option[ScalaBipp] = Option(this) +} diff --git a/tests/pending/run/t4283/Test.scala b/tests/pending/run/t4283/Test.scala new file mode 100644 index 000000000000..af72fa62f911 --- /dev/null +++ b/tests/pending/run/t4283/Test.scala @@ -0,0 +1,16 @@ +object Test { + + def main(args: Array[String]) { + val x = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].f() + println(x) + val y = (new test.ScalaBipp).make.get.f() + println(y) + val u = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].t + println(u) + val v = (new test.ScalaBipp).make.get.t + println(v) + val sb: test.ScalaBipp = (new test.ScalaBipp).make.get + val z = sb.t + println(z) + } +} diff --git a/tests/pending/run/t4285.check b/tests/pending/run/t4285.check new file mode 100644 index 000000000000..b952cb8e1b58 --- /dev/null +++ b/tests/pending/run/t4285.check @@ -0,0 +1,13 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val x = Array(1,2,3,4,5,6,7) +x: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7) + +scala> val y = x transform (_ * 2) +y: scala.collection.mutable.WrappedArray[Int] = WrappedArray(2, 4, 6, 8, 10, 12, 14) + +scala> println(y.sum) +56 + +scala> :quit diff --git a/tests/pending/run/t4285.flags b/tests/pending/run/t4285.flags new file mode 100644 index 000000000000..eb4d19bcb91a --- /dev/null +++ b/tests/pending/run/t4285.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file diff --git a/tests/pending/run/t4285.scala b/tests/pending/run/t4285.scala new file mode 100644 index 000000000000..1d9afcaf3d30 --- /dev/null +++ b/tests/pending/run/t4285.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest +object Test extends ReplTest { + def code = """ + |val x = Array(1,2,3,4,5,6,7) + |val y = x transform (_ * 2) + |println(y.sum) + """.stripMargin +} diff --git a/tests/pending/run/t4287inferredMethodTypes.check b/tests/pending/run/t4287inferredMethodTypes.check new file mode 100644 index 000000000000..56e9c097cc12 --- /dev/null +++ b/tests/pending/run/t4287inferredMethodTypes.check @@ -0,0 +1,30 @@ +[[syntax trees at end of typer]] // newSource1.scala +[0:92]package [0:0] { + [0:21]class A extends [7:21][23]scala.AnyRef { + [8:16] private[this] val a: [8]Int = _; + <8:20>def (<8:20>a: [11] = [17:20]A.a): [7]A = <8:20>{ + <8:20><8:20><8:20>A.super.(); + <8:20>() + } + }; + [23:47]object A extends [32:47][49]scala.AnyRef { + [49]def (): [32]A.type = [49]{ + [49][49][49]A.super.(); + [32]() + }; + [36:45]private[this] val a: [40]Int = [44:45]2; + [40] def a: [40]Int = [40][40]A.this.a; + [8] def $default$1: [8]Int = [19]A.a + }; + [49:92]class B extends [57:92][65:66]A { + [65]def (): [57]B = [65]{ + [65][65][65]B.super.([65]A.$default$1); + [57]() + }; + [70:90]def ([79:80]a: [79]Int): [74]B = [84:90]{ + [84:90][84:90][84]B.this.(); + [84]() + } + } +} + diff --git a/tests/pending/run/t4287inferredMethodTypes.scala b/tests/pending/run/t4287inferredMethodTypes.scala new file mode 100644 index 000000000000..f14e672da88a --- /dev/null +++ b/tests/pending/run/t4287inferredMethodTypes.scala @@ -0,0 +1,25 @@ +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + override def extraSettings: String = + s"-usejavacp -Yinfer-argument-types -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + + override def code = """ +class A(a: Int = A.a) + +object A { + val a = 2 +} + +class B extends A { + def this(a) = this() +} + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} \ No newline at end of file diff --git a/tests/pending/run/t4288.scala b/tests/pending/run/t4288.scala new file mode 100644 index 000000000000..23319d1c275b --- /dev/null +++ b/tests/pending/run/t4288.scala @@ -0,0 +1,13 @@ +object Test { + def f1 = scala.collection.mutable.ListBuffer(1 to 9: _*).slice(-5, -1) + def f2 = List(1 to 9: _*).slice(-5, -1) + def f3 = Vector(1 to 9: _*).slice(-5, -1) + def f4 = Traversable(1 to 9: _*).slice(-5, -1) + def f5 = (1 to 9).toArray.slice(-5, -1) + def f6 = (1 to 9).toStream.slice(-5, -1) + def f7 = (1 to 9).slice(-5, -1) + + def main(args: Array[String]): Unit = { + List[Traversable[Int]](f1, f2, f3, f4, f5, f6, f7) foreach (x => assert(x.isEmpty, x)) + } +} diff --git a/tests/pending/run/t429.check b/tests/pending/run/t429.check new file mode 100644 index 000000000000..22b91b785081 --- /dev/null +++ b/tests/pending/run/t429.check @@ -0,0 +1 @@ +AyB5 diff --git a/tests/pending/run/t429.scala b/tests/pending/run/t429.scala new file mode 100644 index 000000000000..e62a6b307bc9 --- /dev/null +++ b/tests/pending/run/t429.scala @@ -0,0 +1,15 @@ +object Test { + abstract class A { + Console.print("A"); + val x: Int; + val y: Int = {Console.print("y"); x + 1} + } + class B extends A { + Console.print("B"); + lazy val z = 0; + lazy val x = 4 + z + } + def main (args: Array[String]): Unit = { + Console.print((new B).y); + } +} diff --git a/tests/pending/run/t4294.scala b/tests/pending/run/t4294.scala new file mode 100644 index 000000000000..e15c716047a0 --- /dev/null +++ b/tests/pending/run/t4294.scala @@ -0,0 +1,12 @@ +object Test { + def main(args: Array[String]) { + // Skip test on Avian, see SI-7600 for further information + if (!scala.tools.partest.utils.Properties.isAvian) + run() + } + + def run(): Unit = { + (Stream.from(1).collect{case x if x > 5000000 => x}: Stream[Int]) + assert((Stream from 1 take 10 collect { case x if x <= 3 => x*x }).sum == 14) + } +} diff --git a/tests/pending/run/t4297.scala b/tests/pending/run/t4297.scala new file mode 100644 index 000000000000..7497dfe4c236 --- /dev/null +++ b/tests/pending/run/t4297.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + def f = List(1,2,3).view + assert(f.toString == "SeqView(...)") + assert(f.mkString == "123") + } +} diff --git a/tests/pending/run/t4300.check b/tests/pending/run/t4300.check new file mode 100644 index 000000000000..f7bacac931ea --- /dev/null +++ b/tests/pending/run/t4300.check @@ -0,0 +1,4 @@ +A +A +A +A diff --git a/tests/pending/run/t4300.scala b/tests/pending/run/t4300.scala new file mode 100644 index 000000000000..243d34783022 --- /dev/null +++ b/tests/pending/run/t4300.scala @@ -0,0 +1,25 @@ + +trait A { + def f() = println("A") +} + +class B extends A { + def b() = super[A].f() + trait C { + def c() = B.super[A].f() + } + def g() = for(i <- 0 until 1) super[A].f() + def h() = for(i <- 0 until 1) B.super[A].f() + override def f() = println("B") +} + + +object Test { + def main(args : Array[String]) : Unit = { + val b = new B() + b.b() + new b.C(){}.c() + b.g() // was ClassCastException + b.h() // was ClassCastException + } +} diff --git a/tests/pending/run/t4317.check b/tests/pending/run/t4317.check new file mode 100644 index 000000000000..c6d0e511a558 --- /dev/null +++ b/tests/pending/run/t4317.check @@ -0,0 +1,3 @@ +0 +99 +33 diff --git a/tests/pending/run/t4317.flags b/tests/pending/run/t4317.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/t4317.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t4317/J_2.java b/tests/pending/run/t4317/J_2.java new file mode 100644 index 000000000000..4e81b390eb0b --- /dev/null +++ b/tests/pending/run/t4317/J_2.java @@ -0,0 +1,5 @@ +public class J_2 { + int bar1() { return S_1.foo1(String.class) ; } + int bar2() { return S_1.foo2(String.class, 0); } + int bar3() { return S_1.foo3(11, 22); } +} \ No newline at end of file diff --git a/tests/pending/run/t4317/S_1.scala b/tests/pending/run/t4317/S_1.scala new file mode 100644 index 000000000000..2756c879ebd5 --- /dev/null +++ b/tests/pending/run/t4317/S_1.scala @@ -0,0 +1,11 @@ +import language.existentials + +object S_1 { + def foo1(x: Class[_ <: AnyRef]) = 0 + def foo2(x: Class[_ <: AnyRef], y: Int) = 99 + def foo3[T](x: Int, y: Int) = x + y + def foo4a(x: Unit): Unit = () + def foo4[T](x: Unit): Unit = () + def foo5[T <: Unit](x: T): T = sys.error("") + def foo6[T](x: Class[_], y: Class[T], z: Class[_ <: T]) = ((x, y, z)) +} diff --git a/tests/pending/run/t4317/S_3.scala b/tests/pending/run/t4317/S_3.scala new file mode 100644 index 000000000000..ce8e2330e3a6 --- /dev/null +++ b/tests/pending/run/t4317/S_3.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + val j = new J_2() + println(j.bar1()) + println(j.bar2()) + println(j.bar3()) + } +} diff --git a/tests/pending/run/t4332.check b/tests/pending/run/t4332.check new file mode 100644 index 000000000000..ff9d9b86472e --- /dev/null +++ b/tests/pending/run/t4332.check @@ -0,0 +1,25 @@ + +====================================================================== +Checking scala.collection.TraversableView +====================================================================== + + +====================================================================== +Checking scala.collection.IterableView +====================================================================== + + +====================================================================== +Checking scala.collection.SeqView +====================================================================== + + +====================================================================== +Checking scala.collection.mutable.IndexedSeqView +====================================================================== + + +====================================================================== +Checking scala.collection.immutable.StreamView +====================================================================== + diff --git a/tests/pending/run/t4332.scala b/tests/pending/run/t4332.scala new file mode 100644 index 000000000000..5a67922911b7 --- /dev/null +++ b/tests/pending/run/t4332.scala @@ -0,0 +1,44 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + override def code = "" + lazy val global = newCompiler("-usejavacp") + import global._, definitions._ + + override def show() { + new global.Run() + // Once we plug all of the view gaps, the output should be empty! + checkViews() + } + + def isExempt(sym: Symbol) = { + val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform") + (exempt contains sym.name.decoded) + } + + def checkView(viewType: Type, viewLikeType: Type) { + val sep = "=" * 70 + println(s"\n$sep\nChecking ${viewType.typeSymbol.fullName}\n$sep") + val termMembers = viewType.nonPrivateMembers.toList filter (_.isTerm) map fullyInitializeSymbol + val inheritedFromGenericCollection + = termMembers filterNot (_.owner.name.decoded contains "ViewLike") filterNot (_.owner == viewType.typeSymbol) + def returnsView(sym: Symbol) = viewType.memberType(sym).finalResultType contains viewType.typeSymbol + val needOverride = inheritedFromGenericCollection filterNot isExempt filter returnsView + + val grouped = needOverride.groupBy(_.owner).toSeq.sortBy { case (owner, _) => viewType baseTypeIndex owner } + val report = grouped.map { + case (owner, syms) => s"\n$owner\n${"-" * 70}\n${syms.map(_.defString).sorted.mkString("\n")}" + }.mkString("\n") + println(report) + } + + def checkViews() { + import collection._ + checkView(typeOf[TraversableView[_, _]], typeOf[TraversableViewLike[_, _, _]]) + checkView(typeOf[IterableView[_, _]], typeOf[IterableViewLike[_, _, _]]) + checkView(typeOf[SeqView[_, _]], typeOf[SeqViewLike[_, _, _]]) + checkView(typeOf[mutable.IndexedSeqView[_, _]], typeOf[SeqViewLike[_, _, _]]) + checkView(typeOf[immutable.StreamView[_, _]], typeOf[immutable.StreamViewLike[_, _, _]]) + // Parallel views not checked, assuming we will drop them in 2.11 + } +} diff --git a/tests/pending/run/t4332b.scala b/tests/pending/run/t4332b.scala new file mode 100644 index 000000000000..a773da960d7a --- /dev/null +++ b/tests/pending/run/t4332b.scala @@ -0,0 +1,35 @@ +object Test extends dotty.runtime.LegacyApp { + def check(expected: Any, actual: Any, msg: String = "") = { + if (expected != actual) + sys.error(s"($actual != $expected) $msg") + } + val ls = List(1, 3, 2, 1) + for (N <- -1 to (ls.length + 1)) { + check(ls.takeRight(N), ls.view.takeRight(N).toList, s"takeRight($N)") + check(ls.dropRight(N), ls.view.dropRight(N).toList, s"dropRight($N)") + } + for (N <- 1 to (ls.length + 1)) { + check(ls.sliding(N).toList, ls.view.sliding(N).toList.map(_.toList), s"sliding($N)") + check(ls.sliding(N, 2).toList, ls.view.sliding(N, 2).toList.map(_.toList), s"sliding($N, 2)") + } + for (b <- List(true, false)) + check(ls.filterNot(x => true), ls.view.filterNot(x => true), s"filterNot($b)") + + check(ls.inits.toList, ls.view.inits.toList.map(_.toList), "inits") + check(ls.tails.toList, ls.view.tails.toList.map(_.toList), "tails") + + check(ls.combinations(2).toList.map(_.toList), ls.view.combinations(2).toList.map(_.toList), "combinations(2)") + check(ls.permutations.toList.map(_.toList), ls.view.permutations.toList.map(_.toList), "permutations") + + check(ls.sortBy(_ * -1), ls.view.sortBy(_ * -1).toList, "sortBy") + check(ls.sortWith((x, y) => y < x), ls.view.sortWith((x, y) => y < x).toList, "sortWith") + check(ls.sorted, ls.view.sorted.toList, "sorted") + + check(ls.distinct, ls.view.distinct.toList, "distinct") + + check(ls.tail, ls.view.tail.toList, "tail") + + import collection.mutable.Buffer + check(Buffer(1, 2, 3).tail, Buffer(1, 2, 3).view.tail.toList, "Buffer#tail") + check(Buffer(1, 2, 3).tail.length, Buffer(1, 2, 3).view.tail.length, "Buffer#tail#length") +} diff --git a/tests/pending/run/t4351.check b/tests/pending/run/t4351.check new file mode 100644 index 000000000000..cb5d407e138a --- /dev/null +++ b/tests/pending/run/t4351.check @@ -0,0 +1 @@ +runtime exception diff --git a/tests/pending/run/t4351.scala b/tests/pending/run/t4351.scala new file mode 100644 index 000000000000..d954d748b77c --- /dev/null +++ b/tests/pending/run/t4351.scala @@ -0,0 +1,21 @@ +object Test { + def main(args: Array[String]): Unit = { + try new BooleanPropImpl().value + catch { + // was: StackOverflowError + case e: RuntimeException => println("runtime exception") + } + } +} + +trait Prop[@specialized(Boolean) +T] { + def value: T +} + +class PropImpl[+T] extends Prop[T] { + def value: T = scala.sys.error("") +} + +trait BooleanProp extends Prop[Boolean] + +class BooleanPropImpl() extends PropImpl[Boolean] with BooleanProp diff --git a/tests/pending/run/t4396.check b/tests/pending/run/t4396.check new file mode 100644 index 000000000000..d38fb7fae7ec --- /dev/null +++ b/tests/pending/run/t4396.check @@ -0,0 +1,6 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +hallo +constructor +out:22 +bye +foo diff --git a/tests/pending/run/t4396.scala b/tests/pending/run/t4396.scala new file mode 100644 index 000000000000..694360101fe9 --- /dev/null +++ b/tests/pending/run/t4396.scala @@ -0,0 +1,35 @@ +// #43896 +trait M extends DelayedInit { + def delayedInit(body : => Unit): Unit = { + println("hallo") + body + println("bye") + } +} + +class C(init : Int) extends M { + def foo = init + println("constructor") + var x = init + println("out:"+x) +} + +// #4380 +object Main { + def main(argv: Array[String]): Unit = { + class Bip { + class Foo { override def toString() = "foo" } + object Main extends dotty.runtime.LegacyApp { + val cbn = new Foo() + } + Main.main(Array()) + println(Main.cbn) + } + new Bip + } +} + +object Test extends dotty.runtime.LegacyApp { + new C(22) + Main.main(Array()) +} diff --git a/tests/pending/run/t4398.scala b/tests/pending/run/t4398.scala new file mode 100644 index 000000000000..5e152f727a9f --- /dev/null +++ b/tests/pending/run/t4398.scala @@ -0,0 +1,13 @@ + + +import scala.language.{ postfixOps } + +object Test { + def main(args: Array[String]): Unit = { + val x = 1 to 10 toSet + val y = x + 5 + val z = y - 154321 + assert(x eq y) + assert(x eq z) + } +} diff --git a/tests/pending/run/t4415.scala b/tests/pending/run/t4415.scala new file mode 100644 index 000000000000..33d3908693e9 --- /dev/null +++ b/tests/pending/run/t4415.scala @@ -0,0 +1,86 @@ +/** + * Demonstration of issue with Extractors. If lines 15/16 are not present, get at runtime: + * + * Exception in thread "main" java.lang.VerifyError: (class: ExtractorIssue$$, method: convert signature: (LTopProperty;)LMyProp;) Accessing value from uninitialized register 5 + * at ExtractorIssue.main(ExtractorIssue.scala) + * at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)] + * + * If lines 15/16 are present, the compiler crashes: + * + * fatal error (server aborted): not enough arguments for method body%3: (val p: MyProp[java.lang.String])MyProp[_33]. + * Unspecified value parameter p. + */ +object Test { + + def main(args: Array[String]): Unit = { + convert(new SubclassProperty) + } + + def convert(prop: TopProperty): MyProp[_] = { + prop match { + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //case SubclassSecondMatch(p) => p // if these lines are present, the compiler crashes. If commented, unsafe byte + //case SecondMatch(p) => p // byte code is generated, which causes a java.lang.VerifyError at runtime + /////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + case SubclassMatch(p) => p + case StandardMatch(p) => p + } + } +} + +class TopProperty + +class StandardProperty extends TopProperty +class SubclassProperty extends StandardProperty + +class SecondProperty extends TopProperty +class SubclassSecondProperty extends StandardProperty + +trait MyProp[T] +case class MyPropImpl[T]() extends MyProp[T] + +object SubclassMatch { + + def unapply(prop: SubclassProperty) : Option[MyProp[String]] = { + Some(new MyPropImpl) + } + + def apply(prop: MyProp[String]) : SubclassProperty = { + new SubclassProperty() + } +} + +object StandardMatch { + + def unapply(prop: StandardProperty) : Option[MyProp[String]] = { + Some(new MyPropImpl) + } + + def apply(prop: MyProp[String]) : StandardProperty = { + new StandardProperty() + } +} + +object SubclassSecondMatch { + + def unapply(prop: SubclassSecondProperty) : Option[MyProp[BigInt]] = { + Some(new MyPropImpl) + } + + def apply(prop: MyProp[String]) : SubclassSecondProperty = { + new SubclassSecondProperty() + } +} + +object SecondMatch { + + def unapply(prop: SecondProperty) : Option[MyProp[BigInt]] = { + Some(new MyPropImpl) + } + + def apply(prop: MyProp[String]) : SecondProperty = { + new SecondProperty() + } +} diff --git a/tests/pending/run/t4426.scala b/tests/pending/run/t4426.scala new file mode 100644 index 000000000000..1cbd42da252d --- /dev/null +++ b/tests/pending/run/t4426.scala @@ -0,0 +1,24 @@ +import scala.tools.nsc._ + +object Test { + val x = { + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + + object cc extends Global(settings) { + object dummy + + override def computePluginPhases() = { + super.computePluginPhases() + assert(dummy ne null, "Dummy not initialized") + } + } + new cc.Run + () + } + + def main(args: Array[String]): Unit = { + + } +} + diff --git a/tests/pending/run/t4459.scala b/tests/pending/run/t4459.scala new file mode 100644 index 000000000000..ea3b7420b11a --- /dev/null +++ b/tests/pending/run/t4459.scala @@ -0,0 +1,12 @@ +import collection._ + +object Test { + def main(args: Array[String]): Unit = { + for (i <- 0 until 2000) { + foo((0 until 10000).toSeq.par) + } + } + + def foo(arg: GenSeq[_]): String = arg.map(x => x).mkString(",") +} + diff --git a/tests/pending/run/t4461.check b/tests/pending/run/t4461.check new file mode 100644 index 000000000000..346993af6f48 --- /dev/null +++ b/tests/pending/run/t4461.check @@ -0,0 +1,12 @@ +warning: there were four deprecation warnings; re-run with -deprecation for details +Include(End,1) +Include(End,2) +Include(End,3) +Include(End,4) +Include(End,5) +Include(End,6) +Include(End,7) +Script([1] Include(Index(7),8), [2] Include(Index(8),9), [3] Include(Index(9),10)) +Include(Start,0) +Script([1] Include(Index(0),-2), [2] Include(Index(1),-1)) +Remove(Index(0),-2) diff --git a/tests/pending/run/t4461.scala b/tests/pending/run/t4461.scala new file mode 100644 index 000000000000..0fd82265bb6e --- /dev/null +++ b/tests/pending/run/t4461.scala @@ -0,0 +1,23 @@ +import scala.collection.mutable._ +import scala.collection.script._ + + +// #4461 +object Test { + def main(args: Array[String]): Unit = { + val buf = new ArrayBuffer[Int] with ObservableBuffer[Int] + buf.subscribe(new Subscriber[Message[Int], ObservableBuffer[Int]] { + def notify(pub: ObservableBuffer[Int], event: Message[Int]) = println(event) + }) + + buf += 1 // works + buf ++= Array(2) // works + buf ++= ArrayBuffer(3, 4) // works + buf ++= List(5) // works + buf ++= collection.immutable.Vector(6, 7) // works + buf.insertAll(7, List(8, 9, 10)) + 0 +=: buf + List(-2, -1) ++=: buf + buf remove 0 + } +} diff --git a/tests/pending/run/t4482.check b/tests/pending/run/t4482.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t4482.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t4482.scala b/tests/pending/run/t4482.scala new file mode 100644 index 000000000000..392861c22ee0 --- /dev/null +++ b/tests/pending/run/t4482.scala @@ -0,0 +1,15 @@ +trait Foo { def i: Int } +trait Bar + +case class Spam(i: Int) extends Foo with Bar + +object Test { + def matchParent(p:Any) = p match { + case f:Foo if f.i == 1 => 1 + case _:Bar => 2 + case _:Foo => 3 + } + def main(args: Array[String]): Unit = { + println(matchParent(Spam(3))) + } +} diff --git a/tests/pending/run/t4535.check b/tests/pending/run/t4535.check new file mode 100644 index 000000000000..9d4ce0d5352e --- /dev/null +++ b/tests/pending/run/t4535.check @@ -0,0 +1,3 @@ +ArrayStack(1, 2, 3) +ArrayStack(1, 2, 3, 4, 5, 6) +ArrayStack(6, 5, 4, 3, 2, 1) \ No newline at end of file diff --git a/tests/pending/run/t4535.scala b/tests/pending/run/t4535.scala new file mode 100644 index 000000000000..37aacb0adcf4 --- /dev/null +++ b/tests/pending/run/t4535.scala @@ -0,0 +1,30 @@ + + +import collection._ + + +// #4535 +object Test { + + def main(args: Array[String]): Unit = { + val as = new mutable.ArrayStack[Int] + as push 1 + as push 2 + as push 3 + println(as.reverse) + + as push 4 + as push 5 + as push 6 + println(as.reverse) + + println(as map { x => x }) + + for (i <- 0 until 100) { + as push i + assert(as == as.map(x => x)) + assert(as == as.reverse.reverse) + } + } + +} diff --git a/tests/pending/run/t4536.check b/tests/pending/run/t4536.check new file mode 100644 index 000000000000..0c5a72ada74a --- /dev/null +++ b/tests/pending/run/t4536.check @@ -0,0 +1,8 @@ +cls: bar +obj: foo +obj: bar +cls: bar +obj: bar +trait: pili +trait: mili +trait: foo \ No newline at end of file diff --git a/tests/pending/run/t4536.flags b/tests/pending/run/t4536.flags new file mode 100644 index 000000000000..1141f975075d --- /dev/null +++ b/tests/pending/run/t4536.flags @@ -0,0 +1 @@ +-language:dynamics diff --git a/tests/pending/run/t4536.scala b/tests/pending/run/t4536.scala new file mode 100644 index 000000000000..6661eae6a75f --- /dev/null +++ b/tests/pending/run/t4536.scala @@ -0,0 +1,46 @@ + + + + + + +object dynamicObject extends Dynamic { + def applyDynamic(m: String)() = println("obj: " + m); + this.foo() +} + + +class dynamicClass extends Dynamic { + def applyDynamic(m: String)() = println("cls: " + m); + this.bar() + dynamicObject.bar() +} + + +abstract class dynamicAbstractClass extends Dynamic { + def applyDynamic(m: String)(args: Any*): Unit + this.pili(1, new dynamicClass, "hello"); +} + + +trait dynamicTrait extends Dynamic { + def applyDynamic(m: String)(args: Any*) = println("trait: " + m); + def two = 2 + this.mili(1,2,3) + two +} + + +object dynamicMixin extends dynamicAbstractClass with dynamicTrait { + this.foo(None) +} + + +object Test { + + def main(args: Array[String]) { + val cls = new dynamicClass + dynamicMixin + } + +} diff --git a/tests/pending/run/t4537.check b/tests/pending/run/t4537.check new file mode 100644 index 000000000000..63739ca64a57 --- /dev/null +++ b/tests/pending/run/t4537.check @@ -0,0 +1 @@ +b.Settings diff --git a/tests/pending/run/t4537/a.scala b/tests/pending/run/t4537/a.scala new file mode 100644 index 000000000000..125e223e13bb --- /dev/null +++ b/tests/pending/run/t4537/a.scala @@ -0,0 +1,5 @@ +package a + +private[a] object Settings { + val X = "a.Settings" +} diff --git a/tests/pending/run/t4537/b.scala b/tests/pending/run/t4537/b.scala new file mode 100644 index 000000000000..c709d49b04c9 --- /dev/null +++ b/tests/pending/run/t4537/b.scala @@ -0,0 +1,5 @@ +package b + +object Settings { + val Y = "b.Settings" +} diff --git a/tests/pending/run/t4537/c.scala b/tests/pending/run/t4537/c.scala new file mode 100644 index 000000000000..ee05d4bbfbc2 --- /dev/null +++ b/tests/pending/run/t4537/c.scala @@ -0,0 +1,8 @@ +package b +package c + +import a._ + +object Unambiguous { + println(Settings.Y) +} diff --git a/tests/pending/run/t4537/d.scala b/tests/pending/run/t4537/d.scala new file mode 100644 index 000000000000..be02667107a2 --- /dev/null +++ b/tests/pending/run/t4537/d.scala @@ -0,0 +1,6 @@ +import a._ +import b._ + +object Test extends dotty.runtime.LegacyApp { + println(Settings.Y) +} diff --git a/tests/pending/run/t4542.check b/tests/pending/run/t4542.check new file mode 100644 index 000000000000..f7716dc2f0c4 --- /dev/null +++ b/tests/pending/run/t4542.check @@ -0,0 +1,15 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> @deprecated("foooo", "ReplTest version 1.0-FINAL") class Foo() { + override def toString = "Bippy" +} +defined class Foo + +scala> val f = new Foo +:8: warning: class Foo is deprecated: foooo + val f = new Foo + ^ +f: Foo = Bippy + +scala> :quit diff --git a/tests/pending/run/t4542.scala b/tests/pending/run/t4542.scala new file mode 100644 index 000000000000..5d6e8fe87ce7 --- /dev/null +++ b/tests/pending/run/t4542.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def extraSettings = "-deprecation" + def code = """ + |@deprecated("foooo", "ReplTest version 1.0-FINAL") class Foo() { + | override def toString = "Bippy" + |} + |val f = new Foo + """.stripMargin +} diff --git a/tests/pending/run/t4558.scala b/tests/pending/run/t4558.scala new file mode 100644 index 000000000000..e7661421dc58 --- /dev/null +++ b/tests/pending/run/t4558.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val xs = Seq(1,2,3).view.groupBy(identity) + assert(xs.size == 3) + } +} diff --git a/tests/pending/run/t4560.check b/tests/pending/run/t4560.check new file mode 100644 index 000000000000..f8cb0833ae4f --- /dev/null +++ b/tests/pending/run/t4560.check @@ -0,0 +1,6 @@ +'Test +Success 1 +'Test +Success 2 +'Test +Success 3 diff --git a/tests/pending/run/t4560.scala b/tests/pending/run/t4560.scala new file mode 100644 index 000000000000..1008bdf7b9bd --- /dev/null +++ b/tests/pending/run/t4560.scala @@ -0,0 +1,69 @@ +// SI-4560 (and SI-4601): Reflection caches are expected in the wrong classfiles +// with various differing constellations of self-types. This leads to runtime exceptions +// when the reflection caches are accessed. This tests both reflection cache accesses +// for structural type method invocations (`y.f()`) (SI-4560) and accesses to symbols which are +// handled similarly (SI-4601) + +// TEST 1 +// self-type is other trait + + +import scala.language.{ reflectiveCalls } + +trait Aa +trait Ab + +trait B { + self: Aa with Ab => + + def y = new { def f() = println("Success 1") } + def fail() = { + println('Test) + y.f() + } +} + +object Test1 extends Aa with Ab with B + +// TEST 2 +// self-type is class + +class A2 + +trait B2 { + self: A2 => + + def y = new { def f() = println("Success 2") } + def fail() = { + println('Test) + y.f() + } +} + +object Test2 extends A2 with B2 + +// TEST 3 +// self-type is singleton type + +trait B3 { + this: Test3.type => + + def y = new { def f() = println("Success 3") } + def fail() = { + println('Test) + y.f() + } +} + +object Test3 extends B3 { + def test: Unit = { fail() } +} + +object Test { + def main(args: Array[String]): Unit = { + Test1.fail() + Test2.fail() + Test3.fail() + } +} + diff --git a/tests/pending/run/t4560b.check b/tests/pending/run/t4560b.check new file mode 100644 index 000000000000..7ee6e19b28d4 --- /dev/null +++ b/tests/pending/run/t4560b.check @@ -0,0 +1,2 @@ +23 +SUCCESS diff --git a/tests/pending/run/t4560b.scala b/tests/pending/run/t4560b.scala new file mode 100644 index 000000000000..355936ae35ea --- /dev/null +++ b/tests/pending/run/t4560b.scala @@ -0,0 +1,28 @@ +object Outer { + class Tester + private[Outer] trait B4 { _: Tester => + protected val FREQ = 23 + def fail() = { + println(FREQ) + } + } + object C4 extends Tester with B4 +} + +object Outer2 { + abstract class A5 + private[Outer2] trait C5 { + def impl(): Unit = { println("SUCCESS") } + } + trait B5 extends C5 { self: A5 => + def fail(): Unit = { impl() } + } + object Test5 extends A5 with B5 with C5 +} + +object Test { + def main(args: Array[String]): Unit = { + Outer.C4.fail() + Outer2.Test5.fail() + } +} diff --git a/tests/pending/run/t4565_1.check b/tests/pending/run/t4565_1.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/t4565_1.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/t4565_1.scala b/tests/pending/run/t4565_1.scala new file mode 100644 index 000000000000..19b26b24eb9a --- /dev/null +++ b/tests/pending/run/t4565_1.scala @@ -0,0 +1,14 @@ +trait T { + def foo = { + object A + def a(x: Any) = x == A + a(A) + } +} + +object Test { + def main(args: Array[String]): Unit = { + val t = new T{} + println(t.foo) + } +} diff --git a/tests/pending/run/t4570.check b/tests/pending/run/t4570.check new file mode 100644 index 000000000000..257cc5642cb1 --- /dev/null +++ b/tests/pending/run/t4570.check @@ -0,0 +1 @@ +foo diff --git a/tests/pending/run/t4570.scala b/tests/pending/run/t4570.scala new file mode 100644 index 000000000000..5e1a20c52db7 --- /dev/null +++ b/tests/pending/run/t4570.scala @@ -0,0 +1,8 @@ +object Test extends Enumeration { + val foo = Value + def bar = withName("foo") + + def main(args: Array[String]): Unit = { + values foreach println + } +} diff --git a/tests/pending/run/t4577.scala b/tests/pending/run/t4577.scala new file mode 100644 index 000000000000..2859e509800e --- /dev/null +++ b/tests/pending/run/t4577.scala @@ -0,0 +1,38 @@ +object Test { + val bippy = new Symbol("bippy") + val imposter = new Symbol("bippy") + val notBippy = new Symbol("not-bippy") + val syms = List(bippy, imposter, notBippy) + + // the equals method should only be used for case `bippy`, + // for the singleton type pattern, case _: bippy.type, the spec mandates `bippy eq _` as the test + class Symbol(val name: String) { + override def equals(other: Any) = other match { + case x: Symbol => name == x.name + case _ => false + } + override def toString = name + } + + // TODO: test bytecode equality for f and fDirect (and g and gDirect), + // for now the optimizer doesn't quite get from `f` to `fDirect` + def f(s: Symbol) = s match { + case _: bippy.type => true + case _ => false + } + def fDirect(s: Symbol) = bippy eq s + + def g(s: Symbol) = s match { + case _: bippy.type => 1 + case `bippy` => 2 + case _ => 3 + } + def gDirect(s: Symbol) = if (bippy eq s) 1 else if (bippy == s) 2 else 3 + + def main(args: Array[String]): Unit = { + // `syms map f` should be: true false false + assert(syms forall (s => f(s) == fDirect(s))) + // `syms map g` should be: 1 2 3 + assert(syms forall (s => g(s) == gDirect(s))) + } +} diff --git a/tests/pending/run/t4582.scala b/tests/pending/run/t4582.scala new file mode 100644 index 000000000000..f7477915464d --- /dev/null +++ b/tests/pending/run/t4582.scala @@ -0,0 +1,11 @@ +object Test { + def main(args: Array[String]): Unit = { + var flag = true + def it = { + flag = false + Iterator(2) + } + val flat = (Iterator(Iterator(1)) ++ Iterator(it)).flatten + assert(flag) + } +} diff --git a/tests/pending/run/t4592.check b/tests/pending/run/t4592.check new file mode 100644 index 000000000000..e133386482d6 --- /dev/null +++ b/tests/pending/run/t4592.check @@ -0,0 +1,3 @@ +3.14 +3.14 +3.14 diff --git a/tests/pending/run/t4592.scala b/tests/pending/run/t4592.scala new file mode 100644 index 000000000000..d1666d84d796 --- /dev/null +++ b/tests/pending/run/t4592.scala @@ -0,0 +1,10 @@ +object Test { + def repeat[T](count: Int = 1, x: Boolean = true)(thunk: => T) : T = (0 until count).map(_ => thunk).last + def repeat[T](thunk: => T) : T = repeat()(thunk) + + def main(args: Array[String]): Unit = { + println(repeat(3.14)) + println(repeat(count=5)(3.14)) + println(repeat(count=5,x=false)(3.14)) + } +} diff --git a/tests/pending/run/t4594-repl-settings.scala b/tests/pending/run/t4594-repl-settings.scala new file mode 100644 index 000000000000..db5dc19866a7 --- /dev/null +++ b/tests/pending/run/t4594-repl-settings.scala @@ -0,0 +1,26 @@ + +import scala.tools.partest.SessionTest + +// Detected repl transcript paste: ctrl-D to finish. +object Test extends SessionTest { + def session = +""" |Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> @deprecated(message="Please don't do that.", since="Time began.") def depp = "john" + |depp: String + | + |scala> def a = depp + |warning: there was one deprecation warning; re-run with -deprecation for details + |a: String + | + |scala> :settings -deprecation + | + |scala> def b = depp + |:8: warning: method depp is deprecated: Please don't do that. + | def b = depp + | ^ + |b: String + | + |scala> :quit""" +} diff --git a/tests/pending/run/t4601.check b/tests/pending/run/t4601.check new file mode 100644 index 000000000000..83b0b0b0ff7a --- /dev/null +++ b/tests/pending/run/t4601.check @@ -0,0 +1 @@ +'blubber diff --git a/tests/pending/run/t4601.scala b/tests/pending/run/t4601.scala new file mode 100644 index 000000000000..300da58b276d --- /dev/null +++ b/tests/pending/run/t4601.scala @@ -0,0 +1,15 @@ +class A + +trait B { + self: A => + + def test: Unit = { + println('blubber) + } +} + +object Test extends A with B { + def main(args: Array[String]): Unit = { + test + } +} diff --git a/tests/pending/run/t4608.scala b/tests/pending/run/t4608.scala new file mode 100644 index 000000000000..34586e2d0dec --- /dev/null +++ b/tests/pending/run/t4608.scala @@ -0,0 +1,8 @@ +// #4608 +object Test { + + def main(args: Array[String]): Unit = { + ((1 to 100) sliding 10).toList.par.map{_.map{i => i * i}}.flatten + } + +} diff --git a/tests/pending/run/t4617.check b/tests/pending/run/t4617.check new file mode 100644 index 000000000000..6bbcce30eba6 --- /dev/null +++ b/tests/pending/run/t4617.check @@ -0,0 +1 @@ +Str 8.0 diff --git a/tests/pending/run/t4617.scala b/tests/pending/run/t4617.scala new file mode 100644 index 000000000000..3d054816034f --- /dev/null +++ b/tests/pending/run/t4617.scala @@ -0,0 +1,15 @@ +object Test { + def f1 = new { def f: Unit = { lazy val d = 0d } } + def f2 = { + lazy val d = 4D + lazy val f = 4f + + def bar = "Str " + (d + f) + bar + } + + def main(args: Array[String]): Unit = { + f1 + println(f2) + } +} diff --git a/tests/pending/run/t4656.check b/tests/pending/run/t4656.check new file mode 100644 index 000000000000..15a62794a9f5 --- /dev/null +++ b/tests/pending/run/t4656.check @@ -0,0 +1 @@ +List(1, 2, 3) diff --git a/tests/pending/run/t4656.scala b/tests/pending/run/t4656.scala new file mode 100644 index 000000000000..4f3d189c8f92 --- /dev/null +++ b/tests/pending/run/t4656.scala @@ -0,0 +1,13 @@ +object Test { + def f = { + val buf = new collection.mutable.ListBuffer[Int] + buf ++= List(1, 2, 3) + val l = buf.toList + buf prependToList List(4, 5, 6) + l + } + + def main(args: Array[String]): Unit = { + println(f) + } +} diff --git a/tests/pending/run/t4658.check b/tests/pending/run/t4658.check new file mode 100644 index 000000000000..bb6405175e65 --- /dev/null +++ b/tests/pending/run/t4658.check @@ -0,0 +1,80 @@ +Ranges: +1073741824 +1073741824 +0 +0 +55 +25 +1 +-45 +-55 +0 +-24 +-30 +0 +-40 +-55 +-10 +-24 +-30 +-10 +IntRanges: +-1073741824 +-1073741824 +0 +0 +55 +25 +1 +-45 +-55 +0 +-24 +-30 +0 +-40 +-55 +-10 +-24 +-30 +-10 +LongRanges: +2305843008139952128 +-2305843008139952128 +0 +0 +55 +25 +1 +-45 +-55 +0 +-24 +-30 +0 +-40 +-55 +-10 +-24 +-30 +-10 +BigIntRanges: +2305843008139952128 +-2305843008139952128 +0 +0 +55 +25 +1 +-45 +-55 +0 +-24 +-30 +0 +-40 +-55 +-10 +-24 +-30 +-10 diff --git a/tests/pending/run/t4658.scala b/tests/pending/run/t4658.scala new file mode 100644 index 000000000000..d9fe86f82fdb --- /dev/null +++ b/tests/pending/run/t4658.scala @@ -0,0 +1,33 @@ +import scala.collection.immutable.NumericRange +//#4658 +object Test { + + case class R(start: Int, end: Int, step: Int = 1, inclusive: Boolean = true) + + val rangeData = Array( + R(1, Int.MaxValue), R(-Int.MaxValue, -1), R(0, 0), R(0,0, inclusive = false), R(1,10), + R(1,10,2), R(1,10,11), R(-10, -5), R(-10, 0), R(-10, 10), R(-10, -5, 2), R(-10, 0, 2), R(-10, 10, 2), + R(-10, -5, inclusive = false), R(-10, 0, inclusive = false), R(-10, 10, inclusive = false), + R(-10, -5, 2, inclusive = false), R(-10, 0, 2, inclusive = false), R(-10, 10, 2, inclusive = false) + ) + + def ranges = rangeData.map(r => if (r.inclusive) r.start to r.end by r.step else r.start until r.end by r.step) + + def numericIntRanges = rangeData.map(r => if (r.inclusive) NumericRange.inclusive(r.start, r.end, r.step) else NumericRange(r.start, r.end, r.step)) + + def numericLongRanges = rangeData.map(r => if (r.inclusive) NumericRange.inclusive(r.start.toLong, r.end, r.step) else NumericRange(r.start.toLong, r.end, r.step)) + + def numericBigIntRanges = rangeData.map(r => if (r.inclusive) NumericRange.inclusive(BigInt(r.start), BigInt(r.end), BigInt(r.step)) else NumericRange(BigInt(r.start), BigInt(r.end), BigInt(r.step))) + + def main(args: Array[String]): Unit = { + println("Ranges:") + ranges.foreach{range => println(range.sum)} + println("IntRanges:") + numericIntRanges.foreach{range => println(range.sum)} + println("LongRanges:") + numericLongRanges.foreach{range => println(range.sum)} + println("BigIntRanges:") + numericBigIntRanges.foreach{range => println(range.sum)} + } + +} diff --git a/tests/pending/run/t4660.scala b/tests/pending/run/t4660.scala new file mode 100644 index 000000000000..9aac10ddfd36 --- /dev/null +++ b/tests/pending/run/t4660.scala @@ -0,0 +1,11 @@ +object Test { + def main(args: Array[String]): Unit = { + val traversable = 1 to 20 map (_.toString) + def normalize(m: Map[Char, Traversable[String]]) = m.map { case (k,v) => (k, v.toList) } + + val groupedFromView = traversable.view.groupBy(_(0)) + val groupedFromStrict = traversable.groupBy(_(0)) + + assert(normalize(groupedFromView) == normalize(groupedFromStrict)) + } +} diff --git a/tests/pending/run/t4671.check b/tests/pending/run/t4671.check new file mode 100644 index 000000000000..1640dac8e49c --- /dev/null +++ b/tests/pending/run/t4671.check @@ -0,0 +1,46 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> object o { val file = sys.props("partest.cwd") + "/t4671.scala" } +defined object o + +scala> val s = scala.io.Source.fromFile(o.file) +s: scala.io.BufferedSource = non-empty iterator + +scala> println(s.getLines.mkString("\n")) +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/t4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} + +scala> + +scala> val s = scala.io.Source.fromFile(o.file) +s: scala.io.BufferedSource = non-empty iterator + +scala> println(s.mkString("")) +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/t4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} + + +scala> :quit diff --git a/tests/pending/run/t4671.scala b/tests/pending/run/t4671.scala new file mode 100644 index 000000000000..6170104c33b5 --- /dev/null +++ b/tests/pending/run/t4671.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/t4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} diff --git a/tests/pending/run/t4680.check b/tests/pending/run/t4680.check new file mode 100644 index 000000000000..21a1e0cd1505 --- /dev/null +++ b/tests/pending/run/t4680.check @@ -0,0 +1,67 @@ +t4680.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + new C { 5 } + ^ +t4680.scala:69: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + new { val x = 5 } with E() { 5 } + ^ +warning: there was one deprecation warning; re-run with -deprecation for details + + +// new C { } +-A -B -C + +// new C { 5 } +-A -B -C +A+ B+ C+ + +// new D() +-A -B -C -D +A+ B+ C+ D+ + +// new D() { } +-A -B -C -D +A+ B+ C+ D+ + +// new D() { val x = 5 } +-A -B -C -D +A+ B+ C+ D+ +A+ B+ C+ D+ + +// new { val x = 5 } with D() +-A -B -C -D +A+ B+ C+ D+ + +// new E() { val x = 5 } +-A -B -C -D +A+ B+ C+ D+ E+ +-E + +A+ B+ C+ D+ E+ + +A+ B+ C+ D+ E+ + + +// new { val x = 5 } with E() +-A -B -C -D +A+ B+ C+ D+ E+ +-E + +A+ B+ C+ D+ E+ + + +// new { val x = 5 } with E() { } +-A -B -C -D +A+ B+ C+ D+ E+ +-E + +A+ B+ C+ D+ E+ + + +// new { val x = 5 } with E() { 5 } +-A -B -C -D +A+ B+ C+ D+ E+ +-E + +A+ B+ C+ D+ E+ + +A+ B+ C+ D+ E+ diff --git a/tests/pending/run/t4680.scala b/tests/pending/run/t4680.scala new file mode 100644 index 000000000000..927eac1551f0 --- /dev/null +++ b/tests/pending/run/t4680.scala @@ -0,0 +1,91 @@ +trait A extends DelayedInit { + print("-A ") + + def delayedInit(body: => Unit) = { + body + postConstructionCode + } + protected def postConstructionCode: Unit = { + print("\nA+ ") + } +} +trait B extends A { + print("-B ") + override protected def postConstructionCode: Unit = { + super.postConstructionCode + print("B+ ") + } +} + +trait C extends B { + print("-C ") + override protected def postConstructionCode: Unit = { + super.postConstructionCode + print("C+ ") + } +} + +class D() extends C { + print("-D ") + override protected def postConstructionCode: Unit = { + super.postConstructionCode + print("D+ ") + } +} +class E() extends D() { + println("-E") + override protected def postConstructionCode: Unit = { + super.postConstructionCode + println("E+") + } +} + + +object Test { + def p(msg: String) = println("\n\n// " + msg) + + def main(args: Array[String]): Unit = { + p("new C { }") + new C { } + p("new C { 5 }") + new C { 5 } + + p("new D()") + new D() + p("new D() { }") + new D() { } + p("new D() { val x = 5 }") + new D() { val x = 5 } + p("new { val x = 5 } with D()") + new D() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +} + + p("new E() { val x = 5 }") + new E() { val x = 5 } + p("new { val x = 5 } with E()") + new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers +} + p("new { val x = 5 } with E() { }") + new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + } + p("new { val x = 5 } with E() { 5 }") + new E() { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = 5 +// END copied early initializers + 5 } + } +} diff --git a/tests/pending/run/t4697.check b/tests/pending/run/t4697.check new file mode 100644 index 000000000000..b9d569380ca1 --- /dev/null +++ b/tests/pending/run/t4697.check @@ -0,0 +1 @@ +50005000 diff --git a/tests/pending/run/t4697.scala b/tests/pending/run/t4697.scala new file mode 100644 index 000000000000..95592172e074 --- /dev/null +++ b/tests/pending/run/t4697.scala @@ -0,0 +1,8 @@ +object Test { + var st = Stream(0) + for (i <- 1 to 10000) st = i +: st + + def main(args: Array[String]): Unit = { + println(st.take(10000).sum) + } +} diff --git a/tests/pending/run/t4709.scala b/tests/pending/run/t4709.scala new file mode 100644 index 000000000000..29d0dac613ab --- /dev/null +++ b/tests/pending/run/t4709.scala @@ -0,0 +1,10 @@ + + +import collection.GenSeq + + +object Test { + def main(args: Array[String]): Unit = { + val Seq(1, 2) = Stream(1, 2) + } +} diff --git a/tests/pending/run/t4710.check b/tests/pending/run/t4710.check new file mode 100644 index 000000000000..0dd49dfbd312 --- /dev/null +++ b/tests/pending/run/t4710.check @@ -0,0 +1,8 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol } +warning: there was one feature warning; re-run with -feature for details +method: String + +scala> :quit diff --git a/tests/pending/run/t4710.scala b/tests/pending/run/t4710.scala new file mode 100644 index 000000000000..5e5b1e86b587 --- /dev/null +++ b/tests/pending/run/t4710.scala @@ -0,0 +1,6 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """def method : String = { implicit def f(s: Symbol) = "" ; 'symbol }""" +} + diff --git a/tests/pending/run/t4723.scala b/tests/pending/run/t4723.scala new file mode 100644 index 000000000000..462d0be43b15 --- /dev/null +++ b/tests/pending/run/t4723.scala @@ -0,0 +1,9 @@ + + + +object Test { + def main(args: Array[String]): Unit = { + assert(Nil == collection.parallel.ParSeq()) + assert(collection.parallel.ParSeq() == Nil) + } +} diff --git a/tests/pending/run/t4729.check b/tests/pending/run/t4729.check new file mode 100644 index 000000000000..9a2aa56d994e --- /dev/null +++ b/tests/pending/run/t4729.check @@ -0,0 +1,4 @@ +WrappedArray(1, 2) +WrappedArray(1, 2) +WrappedArray(1, 2) +WrappedArray(1, 2) diff --git a/tests/pending/run/t4729/J_1.java b/tests/pending/run/t4729/J_1.java new file mode 100644 index 000000000000..2ffb5a88d104 --- /dev/null +++ b/tests/pending/run/t4729/J_1.java @@ -0,0 +1,4 @@ +// Java Interface: +public interface J_1 { + public void method(String... s); +} diff --git a/tests/pending/run/t4729/S_2.scala b/tests/pending/run/t4729/S_2.scala new file mode 100644 index 000000000000..f823433dedc6 --- /dev/null +++ b/tests/pending/run/t4729/S_2.scala @@ -0,0 +1,30 @@ +import scala.language.reflectiveCalls + // Scala class: +class ScalaVarArgs extends J_1 { + // -- no problem on overriding it using ordinary class + def method(s: String*) { println(s) } +} + +object Test { + def main(args: Array[String]) { + //[1] Ok - no problem using inferred type + val varArgs = new J_1 { + def method(s: String*) { println(s) } + } + varArgs.method("1", "2") + + //[2] Ok -- no problem when explicit set its type after construction + val b: J_1 = varArgs + b.method("1", "2") + + //[3] Ok -- no problem on calling its method + (new ScalaVarArgs).method("1", "2") + (new ScalaVarArgs: J_1).method("1", "2") + + //[4] Not Ok -- error when assigning anonymous class to an explictly typed val + // Compiler error: object creation impossible, since method method in trait VarArgs of type (s: [java.lang.String])Unit is not defined + val tagged: J_1 = new J_1 { + def method(s: String*) { println(s) } + } + } +} diff --git a/tests/pending/run/t4742.flags b/tests/pending/run/t4742.flags new file mode 100644 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t4742.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t4742.scala b/tests/pending/run/t4742.scala new file mode 100644 index 000000000000..47656049b941 --- /dev/null +++ b/tests/pending/run/t4742.scala @@ -0,0 +1,7 @@ +trait T { val x: Int = 0 } +object O extends T { override final val x = 1 } + +object Test extends dotty.runtime.LegacyApp { + // was throwing an UnitializedFieldError as constant 1 is folded into the accessor + assert((O: T).x == 1) +} diff --git a/tests/pending/run/t4750.check b/tests/pending/run/t4750.check new file mode 100644 index 000000000000..bf55f70df34e --- /dev/null +++ b/tests/pending/run/t4750.check @@ -0,0 +1 @@ +US$ 5.80 diff --git a/tests/pending/run/t4750.scala b/tests/pending/run/t4750.scala new file mode 100644 index 000000000000..7b043236255a --- /dev/null +++ b/tests/pending/run/t4750.scala @@ -0,0 +1,7 @@ +import scala.util.matching.Regex + +object Test extends dotty.runtime.LegacyApp { + val input = "CURRENCY 5.80" + println("CURRENCY".r.replaceAllIn(input, Regex quoteReplacement "US$")) +} + diff --git a/tests/pending/run/t4752.scala b/tests/pending/run/t4752.scala new file mode 100644 index 000000000000..3d5c166a7a13 --- /dev/null +++ b/tests/pending/run/t4752.scala @@ -0,0 +1,10 @@ +object Test { + object Bippy { + case object Dingus + } + + def main(args: Array[String]): Unit = { + assert(None.## == "None".##, None) + assert(Test.Bippy.Dingus.## == "Dingus".##, Test.Bippy.Dingus) + } +} diff --git a/tests/pending/run/t4753.check b/tests/pending/run/t4753.check new file mode 100644 index 000000000000..7b19ee8df299 --- /dev/null +++ b/tests/pending/run/t4753.check @@ -0,0 +1 @@ +boolean diff --git a/tests/pending/run/t4753.scala b/tests/pending/run/t4753.scala new file mode 100644 index 000000000000..cfb252cbe527 --- /dev/null +++ b/tests/pending/run/t4753.scala @@ -0,0 +1,12 @@ +trait A { + val actualType: Class[_] +} +trait B extends A { + final val actualType = classOf[Boolean] +} + +object Test extends B { + def main(args: Array[String]): Unit = { + println(actualType) + } +} diff --git a/tests/pending/run/t4761.check b/tests/pending/run/t4761.check new file mode 100644 index 000000000000..1698a57bfaed --- /dev/null +++ b/tests/pending/run/t4761.check @@ -0,0 +1,4 @@ +Vector(1, 1, 1, 1, 1) +Vector(Vector(1, 1, 1, 1, 1)) +List(1, 2) +List(List(1, 2)) diff --git a/tests/pending/run/t4761.scala b/tests/pending/run/t4761.scala new file mode 100644 index 000000000000..c9d8576ab244 --- /dev/null +++ b/tests/pending/run/t4761.scala @@ -0,0 +1,11 @@ +object Test { + def main(args: Array[String]): Unit = { + val gs = for (x <- (1 to 5)) yield { if (x % 2 == 0) List(1).seq else List(1).par } + println(gs.flatten) + println(gs.transpose) + + val s = Stream(Vector(1).par, Vector(2).par) + println(s.flatten.toList) + println(s.transpose.map(_.toList).toList) + } +} diff --git a/tests/pending/run/t4766.check b/tests/pending/run/t4766.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t4766.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t4766.scala b/tests/pending/run/t4766.scala new file mode 100644 index 000000000000..b7d1b6cfa7ff --- /dev/null +++ b/tests/pending/run/t4766.scala @@ -0,0 +1,11 @@ + +import scala.language.postfixOps +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val x = new { + def > = 1 + } + + println(x>) +} diff --git a/tests/pending/run/t4770.check b/tests/pending/run/t4770.check new file mode 100644 index 000000000000..38e5a831fa04 --- /dev/null +++ b/tests/pending/run/t4770.check @@ -0,0 +1,2 @@ +(a,2) +(2,a) diff --git a/tests/pending/run/t4770.scala b/tests/pending/run/t4770.scala new file mode 100644 index 000000000000..25bf3050c3cb --- /dev/null +++ b/tests/pending/run/t4770.scala @@ -0,0 +1,15 @@ +package crasher { + class Z[@specialized A, @specialized(AnyRef) B](var a: A, var b: B) { + override def toString = "" + ((a, b)) + } + object O { + def apply[@specialized A, @specialized(AnyRef) B](a0: A, b0: B) = new Z(a0, b0) + } +} + +object Test { + def main(args: Array[String]): Unit = { + println(crasher.O("a", 2)) + println(crasher.O(2, "a")) + } +} diff --git a/tests/pending/run/t4777.check b/tests/pending/run/t4777.check new file mode 100644 index 000000000000..11f1f59d430d --- /dev/null +++ b/tests/pending/run/t4777.check @@ -0,0 +1,2 @@ +28 +28 diff --git a/tests/pending/run/t4777.scala b/tests/pending/run/t4777.scala new file mode 100644 index 000000000000..ef163c476677 --- /dev/null +++ b/tests/pending/run/t4777.scala @@ -0,0 +1,8 @@ +class A(val a: Int = 13) +class DefaultsTest(x: Int = 25) extends A(28) +object DefaultsTest extends DefaultsTest(12) + +object Test extends dotty.runtime.LegacyApp { + println(new DefaultsTest().a) + println(DefaultsTest.a) +} diff --git a/tests/pending/run/t4788-separate-compilation.check b/tests/pending/run/t4788-separate-compilation.check new file mode 100644 index 000000000000..172ad90102cd --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation.check @@ -0,0 +1,5 @@ +Some(@Ljava/lang/Deprecated;()) +None +None +Some(@LCAnnotation;() // invisible) +Some(@LRAnnotation;()) diff --git a/tests/pending/run/t4788-separate-compilation/CAnnotation_1.java b/tests/pending/run/t4788-separate-compilation/CAnnotation_1.java new file mode 100644 index 000000000000..7120218d6255 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/CAnnotation_1.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.CLASS; + +@Retention(value=CLASS) +@interface CAnnotation {} diff --git a/tests/pending/run/t4788-separate-compilation/C_1.scala b/tests/pending/run/t4788-separate-compilation/C_1.scala new file mode 100644 index 000000000000..aba9b595e4f9 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/C_1.scala @@ -0,0 +1,2 @@ +@CAnnotation +class C diff --git a/tests/pending/run/t4788-separate-compilation/D_1.scala b/tests/pending/run/t4788-separate-compilation/D_1.scala new file mode 100644 index 000000000000..c2479fba8647 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/D_1.scala @@ -0,0 +1,5 @@ +@Deprecated +class DJava + +@deprecated("", "") +class DScala diff --git a/tests/pending/run/t4788-separate-compilation/RAnnotation_1.java b/tests/pending/run/t4788-separate-compilation/RAnnotation_1.java new file mode 100644 index 000000000000..f24cf66f7b4a --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/RAnnotation_1.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Retention(value=RUNTIME) +@interface RAnnotation {} diff --git a/tests/pending/run/t4788-separate-compilation/R_1.scala b/tests/pending/run/t4788-separate-compilation/R_1.scala new file mode 100644 index 000000000000..ab0cd065d9a4 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/R_1.scala @@ -0,0 +1,2 @@ +@RAnnotation +class R diff --git a/tests/pending/run/t4788-separate-compilation/SAnnotation_1.java b/tests/pending/run/t4788-separate-compilation/SAnnotation_1.java new file mode 100644 index 000000000000..471f27d82a00 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/SAnnotation_1.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.SOURCE; + +@Retention(value=SOURCE) +@interface SAnnotation {} diff --git a/tests/pending/run/t4788-separate-compilation/S_1.scala b/tests/pending/run/t4788-separate-compilation/S_1.scala new file mode 100644 index 000000000000..f8756d9bc851 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/S_1.scala @@ -0,0 +1,2 @@ +@SAnnotation +class S diff --git a/tests/pending/run/t4788-separate-compilation/Test_2.scala b/tests/pending/run/t4788-separate-compilation/Test_2.scala new file mode 100644 index 000000000000..cbbb5ff38615 --- /dev/null +++ b/tests/pending/run/t4788-separate-compilation/Test_2.scala @@ -0,0 +1,35 @@ +import java.io.PrintWriter; + +import scala.tools.partest.BytecodeTest +import scala.tools.asm.util._ +import scala.tools.nsc.util.stringFromWriter + +object Test extends BytecodeTest { + def annotationsForClass(className: String): Option[String] = { + val classNode = loadClassNode(className, skipDebugInfo = false) + val textifier = new Textifier + classNode.accept(new TraceClassVisitor(null, textifier, null)) + + val classString = stringFromWriter(w => textifier.print(w)) + classString + .split('\n') + .filterNot(_.contains("@Lscala/reflect/ScalaSignature")) + .find(_.contains("@L")) + .map(_.trim) + } + + def show { + // It seems like @java.lang.Deprecated shows up in both the + // Deprecated attribute and RuntimeVisibleAnnotation attribute, + // while @scala.deprecated only shows up in the Deprecated attribute. + // The check file just documents status quo, not sure if Scala + // should brought in line with Java or not... + // See the commit message and SI-8883 for more info. + println(annotationsForClass("DJava")) + println(annotationsForClass("DScala")) + + println(annotationsForClass("S")) + println(annotationsForClass("C")) + println(annotationsForClass("R")) + } +} diff --git a/tests/pending/run/t4788.check b/tests/pending/run/t4788.check new file mode 100644 index 000000000000..172ad90102cd --- /dev/null +++ b/tests/pending/run/t4788.check @@ -0,0 +1,5 @@ +Some(@Ljava/lang/Deprecated;()) +None +None +Some(@LCAnnotation;() // invisible) +Some(@LRAnnotation;()) diff --git a/tests/pending/run/t4788/C.scala b/tests/pending/run/t4788/C.scala new file mode 100644 index 000000000000..aba9b595e4f9 --- /dev/null +++ b/tests/pending/run/t4788/C.scala @@ -0,0 +1,2 @@ +@CAnnotation +class C diff --git a/tests/pending/run/t4788/CAnnotation.java b/tests/pending/run/t4788/CAnnotation.java new file mode 100644 index 000000000000..7120218d6255 --- /dev/null +++ b/tests/pending/run/t4788/CAnnotation.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.CLASS; + +@Retention(value=CLASS) +@interface CAnnotation {} diff --git a/tests/pending/run/t4788/D.scala b/tests/pending/run/t4788/D.scala new file mode 100644 index 000000000000..c2479fba8647 --- /dev/null +++ b/tests/pending/run/t4788/D.scala @@ -0,0 +1,5 @@ +@Deprecated +class DJava + +@deprecated("", "") +class DScala diff --git a/tests/pending/run/t4788/R.scala b/tests/pending/run/t4788/R.scala new file mode 100644 index 000000000000..ab0cd065d9a4 --- /dev/null +++ b/tests/pending/run/t4788/R.scala @@ -0,0 +1,2 @@ +@RAnnotation +class R diff --git a/tests/pending/run/t4788/RAnnotation.java b/tests/pending/run/t4788/RAnnotation.java new file mode 100644 index 000000000000..f24cf66f7b4a --- /dev/null +++ b/tests/pending/run/t4788/RAnnotation.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Retention(value=RUNTIME) +@interface RAnnotation {} diff --git a/tests/pending/run/t4788/S.scala b/tests/pending/run/t4788/S.scala new file mode 100644 index 000000000000..f8756d9bc851 --- /dev/null +++ b/tests/pending/run/t4788/S.scala @@ -0,0 +1,2 @@ +@SAnnotation +class S diff --git a/tests/pending/run/t4788/SAnnotation.java b/tests/pending/run/t4788/SAnnotation.java new file mode 100644 index 000000000000..471f27d82a00 --- /dev/null +++ b/tests/pending/run/t4788/SAnnotation.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.SOURCE; + +@Retention(value=SOURCE) +@interface SAnnotation {} diff --git a/tests/pending/run/t4788/Test.scala b/tests/pending/run/t4788/Test.scala new file mode 100644 index 000000000000..cbbb5ff38615 --- /dev/null +++ b/tests/pending/run/t4788/Test.scala @@ -0,0 +1,35 @@ +import java.io.PrintWriter; + +import scala.tools.partest.BytecodeTest +import scala.tools.asm.util._ +import scala.tools.nsc.util.stringFromWriter + +object Test extends BytecodeTest { + def annotationsForClass(className: String): Option[String] = { + val classNode = loadClassNode(className, skipDebugInfo = false) + val textifier = new Textifier + classNode.accept(new TraceClassVisitor(null, textifier, null)) + + val classString = stringFromWriter(w => textifier.print(w)) + classString + .split('\n') + .filterNot(_.contains("@Lscala/reflect/ScalaSignature")) + .find(_.contains("@L")) + .map(_.trim) + } + + def show { + // It seems like @java.lang.Deprecated shows up in both the + // Deprecated attribute and RuntimeVisibleAnnotation attribute, + // while @scala.deprecated only shows up in the Deprecated attribute. + // The check file just documents status quo, not sure if Scala + // should brought in line with Java or not... + // See the commit message and SI-8883 for more info. + println(annotationsForClass("DJava")) + println(annotationsForClass("DScala")) + + println(annotationsForClass("S")) + println(annotationsForClass("C")) + println(annotationsForClass("R")) + } +} diff --git a/tests/pending/run/t4794.check b/tests/pending/run/t4794.check new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/tests/pending/run/t4794.check @@ -0,0 +1 @@ +10 diff --git a/tests/pending/run/t4794.scala b/tests/pending/run/t4794.scala new file mode 100644 index 000000000000..5806cae4981a --- /dev/null +++ b/tests/pending/run/t4794.scala @@ -0,0 +1,13 @@ +trait Mutable[@specialized A] { def a: A; def a_=(a0: A): Unit } +trait NotSpecialized { } +class Arr[@specialized A](val arr: Array[A]) { + def bippy(m: Mutable[A]): Unit = { m.a = arr(0) } + def quux(m: Mutable[A] with NotSpecialized): Unit = { m.a = arr(0) } +} + +object Test { + def main(args: Array[String]): Unit = { + def quuxae = classOf[Arr[_]].getMethods filter (_.getName contains "quux") + println(quuxae.size) // expect 10, not 1 + } +} diff --git a/tests/pending/run/t4809.scala b/tests/pending/run/t4809.scala new file mode 100644 index 000000000000..9c66458050db --- /dev/null +++ b/tests/pending/run/t4809.scala @@ -0,0 +1,34 @@ + + +import scala.util.control.Breaks._ + + + +object Test { + + def main(args: Array[String]): Unit = { + val x = tryBreakable { + break + 2 + } catchBreak { + 3 + } + assert(x == 3, x) + + val y = tryBreakable { + 2 + } catchBreak { + 3 + } + assert(y == 2, y) + + val z = tryBreakable { + break + 1.0 + } catchBreak { + 2 + } + assert(z == 2.0, z) + } + +} diff --git a/tests/pending/run/t4813.check b/tests/pending/run/t4813.check new file mode 100644 index 000000000000..a9ecc29fea08 --- /dev/null +++ b/tests/pending/run/t4813.check @@ -0,0 +1 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t4813.scala b/tests/pending/run/t4813.scala new file mode 100644 index 000000000000..1146bb16ec04 --- /dev/null +++ b/tests/pending/run/t4813.scala @@ -0,0 +1,37 @@ +import collection.mutable._ +import reflect._ + + +object Test extends dotty.runtime.LegacyApp { + def runTest[T, U](col: T)(clone: T => U)(mod: T => Unit)(implicit ct: ClassTag[T]): Unit = { + val cloned = clone(col) + assert(cloned == col, s"cloned should be equal to original. $cloned != $col") + mod(col) + assert(cloned != col, s"cloned should not modify when original does: $ct") + } + + // Seqs + runTest(ArrayBuffer(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(ArraySeq(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(Buffer(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(DoubleLinkedList(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(IndexedSeq(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(LinearSeq(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(LinkedList(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(ListBuffer(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(MutableList(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(Queue(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + runTest(Stack(1,2,3))(_.clone) { buf => buf transform (_ + 1) } + + // Sets + runTest(BitSet(1,2,3))(_.clone) { buf => buf add 4 } + runTest(HashSet(1,2,3))(_.clone) { buf => buf add 4 } + runTest(Set(1,2,3))(_.clone) { buf => buf add 4 } + runTest(SortedSet(1,2,3))(_.clone) { buf => buf add 4 } + runTest(TreeSet(1,2,3))(_.clone) { buf => buf add 4 } + + // Maps + runTest(HashMap(1->1,2->2,3->3))(_.clone) { buf => buf put (4,4) } + runTest(WeakHashMap(1->1,2->2,3->3))(_.clone) { buf => buf put (4,4) } +} + diff --git a/tests/pending/run/t4827.scala b/tests/pending/run/t4827.scala new file mode 100644 index 000000000000..7270cf169def --- /dev/null +++ b/tests/pending/run/t4827.scala @@ -0,0 +1,15 @@ +object Test { + def main(args: Array[String]): Unit = Foo.foo() +} + +trait CommonTrait { + def foo(): String = null +} + +class Foo + +object Foo { + def goo() = new Foo() with CommonTrait + + def foo(): String = null +} diff --git a/tests/pending/run/t4827b.scala b/tests/pending/run/t4827b.scala new file mode 100644 index 000000000000..84d6d907d39e --- /dev/null +++ b/tests/pending/run/t4827b.scala @@ -0,0 +1,18 @@ +package foo { + class Foo { } + object Foo { + def bippy(x: Int) = x + } +} + +package bar { + class Bippy extends foo.Foo { + def bippy(x: Int) = x + } +} + +object Test { + def main(args: Array[String]): Unit = { + new bar.Bippy bippy 5 + } +} diff --git a/tests/pending/run/t4835.check b/tests/pending/run/t4835.check new file mode 100644 index 000000000000..0987722d5fab --- /dev/null +++ b/tests/pending/run/t4835.check @@ -0,0 +1,7 @@ +-1 0 1 2 3 4 5 6 7 8 9 +-1 1 3 5 7 9 11 13 15 17 19 +1 1 +2 1 2 +2 1 A 2 +3 1 2 3 +3 1 A 2 B 3 diff --git a/tests/pending/run/t4835.scala b/tests/pending/run/t4835.scala new file mode 100644 index 000000000000..26275c0ab4fc --- /dev/null +++ b/tests/pending/run/t4835.scala @@ -0,0 +1,38 @@ +/* + * Test case for SI-4835. This tests confirm that the fix + * doesn't break laziness. To test memory consumption, + * I need to confirm that OutOfMemoryError doesn't occur. + * I could create such tests. However, such tests consume + * too much time and memory. + */ +object Test { + private final val INFINITE = -1 + def testStreamIterator(num: Int, stream: Stream[Int]): Unit = { + val iter = stream.iterator + print(num) + // if num == -1, then steram is infinite sequence + if (num == INFINITE) { + for(i <- 0 until 10) { + print(" " + iter.next()) + } + } else { + while(iter.hasNext) { + print(" " + iter.next()) + } + } + println() + } + + def main(args: Array[String]): Unit = { + import Stream.{from, cons, empty} + testStreamIterator(INFINITE, from(0)) + testStreamIterator(INFINITE, from(0).filter(_ % 2 == 1)) + testStreamIterator(1, Stream(1)) + testStreamIterator(2, Stream(1, 2)) + //Stream with side effect + testStreamIterator(2, cons(1, cons({ print(" A"); 2}, empty))) + testStreamIterator(3, Stream(1, 2, 3)) + //Stream with side effect + testStreamIterator(3, cons(1, cons({ print(" A"); 2}, cons({ print(" B"); 3}, Stream.empty)))) + } +} diff --git a/tests/pending/run/t4841-isolate-plugins.check b/tests/pending/run/t4841-isolate-plugins.check new file mode 100644 index 000000000000..a6462b424bf1 --- /dev/null +++ b/tests/pending/run/t4841-isolate-plugins.check @@ -0,0 +1,2 @@ +My phase name is ploogin1_1 +My phase name is ploogin1_2 diff --git a/tests/pending/run/t4841-isolate-plugins/ploogin.scala b/tests/pending/run/t4841-isolate-plugins/ploogin.scala new file mode 100644 index 000000000000..bd8c7275ec1e --- /dev/null +++ b/tests/pending/run/t4841-isolate-plugins/ploogin.scala @@ -0,0 +1,30 @@ + +package t4841 + +import scala.tools.nsc.{ Global, Phase } +import scala.tools.nsc.plugins.{ Plugin, PluginComponent } +import scala.reflect.io.Path +import scala.reflect.io.File + +/** A test plugin. */ +class Ploogin(val global: Global, val name: String = "ploogin") extends Plugin { + import global._ + + val description = "A sample plugin for testing." + val components = List[PluginComponent](TestComponent) + + private object TestComponent extends PluginComponent { + val global: Ploogin.this.global.type = Ploogin.this.global + //override val runsBefore = List("refchecks") + val runsAfter = List("jvm") + val phaseName = Ploogin.this.name + override def description = "A sample phase that does so many things it's kind of hard to describe briefly." + def newPhase(prev: Phase) = new TestPhase(prev) + class TestPhase(prev: Phase) extends StdPhase(prev) { + override def description = TestComponent.this.description + def apply(unit: CompilationUnit) { + if (settings.developer) inform(s"My phase name is $phaseName") + } + } + } +} diff --git a/tests/pending/run/t4841-isolate-plugins/t4841-isolate-plugin.scala b/tests/pending/run/t4841-isolate-plugins/t4841-isolate-plugin.scala new file mode 100644 index 000000000000..5421922c9c8d --- /dev/null +++ b/tests/pending/run/t4841-isolate-plugins/t4841-isolate-plugin.scala @@ -0,0 +1,39 @@ + +import tools.nsc.plugins.PluginDescription +import tools.partest.DirectTest + +import java.io.File + +// show that plugins are on isolated class loaders +object Test extends DirectTest { + override def code = "class Code" + + override def extraSettings = s"-usejavacp" + + // plugin named ploogin1_1 or ploogin1_2, but not ploogin2_x + // Although the samples are in different classloaders, the plugin + // loader checks for distinctness by class name, so the names must differ. + def pluginCode(index: Int) = s""" + |package t4841 { + | class SamplePloogin$index(global: scala.tools.nsc.Global) extends Ploogin(global, s"$${PlooginCounter.named}_$index") + | object PlooginCounter { + | val count = new java.util.concurrent.atomic.AtomicInteger + | def named = s"ploogin$${count.incrementAndGet}" + | } + |}""".stripMargin.trim + + def compilePlugin(i: Int) = { + val out = (testOutput / s"p$i").createDirectory() + val args = Seq("-usejavacp", "-d", out.path) + compileString(newCompiler(args: _*))(pluginCode(i)) + val xml = PluginDescription(s"p$i", s"t4841.SamplePloogin$i").toXML + (out / "scalac-plugin.xml").toFile writeAll xml + out + } + + override def show() = { + val dirs = 1 to 2 map (compilePlugin(_)) + compile("-Xdev", s"-Xplugin:${dirs mkString ","}", "-usejavacp", "-d", testOutput.path) + } +} + diff --git a/tests/pending/run/t4841-no-plugin.check b/tests/pending/run/t4841-no-plugin.check new file mode 100644 index 000000000000..4338f0ce233f --- /dev/null +++ b/tests/pending/run/t4841-no-plugin.check @@ -0,0 +1 @@ +warning: No plugin in path t4841-no-plugin-run.obj/plugins.partest diff --git a/tests/pending/run/t4841-no-plugin.scala b/tests/pending/run/t4841-no-plugin.scala new file mode 100644 index 000000000000..d91bf7ee2179 --- /dev/null +++ b/tests/pending/run/t4841-no-plugin.scala @@ -0,0 +1,17 @@ + +import tools.partest.DirectTest + +import java.io.File + +// warn only if no plugin on Xplugin path +object Test extends DirectTest { + override def code = "class Code" + + override def extraSettings = s"-usejavacp -d ${testOutput.path}" + + override def show() = { + val tmp = new File(testOutput.jfile, "plugins.partest").getAbsolutePath + compile("-Xdev", s"-Xplugin:$tmp", "-Xpluginsdir", tmp) + } +} + diff --git a/tests/pending/run/t4859.check b/tests/pending/run/t4859.check new file mode 100644 index 000000000000..d329744ca037 --- /dev/null +++ b/tests/pending/run/t4859.check @@ -0,0 +1,8 @@ +Inner +Inner.i +About to reference Inner.i +Outer +Inner.i +About to reference O.N +About to reference O.N +About to reference O.N.apply() diff --git a/tests/pending/run/t4859.scala b/tests/pending/run/t4859.scala new file mode 100644 index 000000000000..8b354ca9451a --- /dev/null +++ b/tests/pending/run/t4859.scala @@ -0,0 +1,29 @@ +object O { + case class N() + object P +} + +object Outer { + println("Outer") + object Inner { + println("Inner") + def i: Unit = { + println("Inner.i") + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + Outer.Inner.i // we still don't initialize Outer here (but should we?) + + {println("About to reference Inner.i"); Outer}.Inner.i // Outer will be initialized. + + {println("About to reference O.N" ); O}.N + + {println("About to reference O.N" ); O}.N + + {println("About to reference O.N.apply()"); O}.N.apply() + } +} + diff --git a/tests/pending/run/t4871.check b/tests/pending/run/t4871.check new file mode 100644 index 000000000000..a60526a0f395 --- /dev/null +++ b/tests/pending/run/t4871.check @@ -0,0 +1,2 @@ +class Test$C +class Test$D diff --git a/tests/pending/run/t4871.scala b/tests/pending/run/t4871.scala new file mode 100644 index 000000000000..e25d5c138741 --- /dev/null +++ b/tests/pending/run/t4871.scala @@ -0,0 +1,12 @@ +object Test { + class C + class D + + def main(args: Array[String]): Unit = { + val z: Class[C] = classOf + val z2: Class[D] = classOf[D] + + println(z) + println(z2) + } +} diff --git a/tests/pending/run/t4891.check b/tests/pending/run/t4891.check new file mode 100644 index 000000000000..79fd7f6fbb25 --- /dev/null +++ b/tests/pending/run/t4891.check @@ -0,0 +1,7 @@ +test.generic.T1 + (m) public abstract A test.generic.T1.t1(A) +test.generic.C1 + (m) public void test.generic.C1.m1() +test.generic.C2 + (m) public void test.generic.C1.m1() +null diff --git a/tests/pending/run/t4891/J_2.java b/tests/pending/run/t4891/J_2.java new file mode 100644 index 000000000000..db1cc52b1311 --- /dev/null +++ b/tests/pending/run/t4891/J_2.java @@ -0,0 +1,13 @@ +import test.generic.*; + +public class J_2 { + public static void foo(T1 x) { + // x.m1(); + } + + public static void main(String[] args) { + Bug4891.main(null); + T1 x = new C2(); + foo(x); + } +} diff --git a/tests/pending/run/t4891/S_1.scala b/tests/pending/run/t4891/S_1.scala new file mode 100644 index 000000000000..3309d22fbd38 --- /dev/null +++ b/tests/pending/run/t4891/S_1.scala @@ -0,0 +1,26 @@ +package test.generic { + class C1[A] { + def m1(): Unit = () + } + + trait T1[A] extends C1[A] { + def t1(x: A) = x + } + + class C2[A] extends T1[A] +} + +import scala.tools.partest._ + +object Bug4891 extends SigTest { + import test.generic._ + + def main(args: Array[String]): Unit = { + show[T1[_]]() + show[C1[_]]() + show[C2[_]]("m1") + + println(classOf[T1[_]].getGenericSuperclass) + classOf[T1[_]].getGenericInterfaces foreach println + } +} diff --git a/tests/pending/run/t4891/S_3.scala b/tests/pending/run/t4891/S_3.scala new file mode 100644 index 000000000000..0da4912bc52a --- /dev/null +++ b/tests/pending/run/t4891/S_3.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + J_2 main null + } +} diff --git a/tests/pending/run/t4894.scala b/tests/pending/run/t4894.scala new file mode 100644 index 000000000000..b2d915fdad13 --- /dev/null +++ b/tests/pending/run/t4894.scala @@ -0,0 +1,27 @@ + + + + + +object Test { + + def main(args: Array[String]): Unit = { + import collection._ + val hs = mutable.HashSet[Int]() + hs ++= 1 to 10 + hs --= 1 to 10 + + val phs = parallel.mutable.ParHashSet[Int]() + phs ++= 1 to 10 + for (i <- 1 to 10) assert(phs(i)) + phs --= 1 to 10 + assert(phs.isEmpty) + + val phm = parallel.mutable.ParHashMap[Int, Int]() + phm ++= ((1 to 10) zip (1 to 10)) + for (i <- 1 to 10) assert(phm(i) == i) + phm --= 1 to 10 + assert(phm.isEmpty) + } + +} diff --git a/tests/pending/run/t4895.scala b/tests/pending/run/t4895.scala new file mode 100644 index 000000000000..fdd091511ab7 --- /dev/null +++ b/tests/pending/run/t4895.scala @@ -0,0 +1,16 @@ +object Test { + + def checkPar(sz: Int): Unit = { + import collection._ + val hs = mutable.HashSet[Int]() ++ (1 to sz) + assert(hs.par.map(_ + 1).seq.toSeq.sorted == (2 to (sz + 1))) + } + + def main(args: Array[String]): Unit = { + for (i <- 0 until 100) checkPar(i) + for (i <- 100 until 1000 by 50) checkPar(i) + for (i <- 1000 until 10000 by 500) checkPar(i) + for (i <- 10000 until 100000 by 5000) checkPar(i) + } + +} diff --git a/tests/pending/run/t4897.check b/tests/pending/run/t4897.check new file mode 100644 index 000000000000..17dda56fe1fb --- /dev/null +++ b/tests/pending/run/t4897.check @@ -0,0 +1 @@ +joepie diff --git a/tests/pending/run/t4897.scala b/tests/pending/run/t4897.scala new file mode 100644 index 000000000000..f65c2745efaa --- /dev/null +++ b/tests/pending/run/t4897.scala @@ -0,0 +1,10 @@ +class CSuper { + object A +} +class C extends CSuper { + def f = (A: AnyRef) match { case _: A.type => "joepie" } +} + +object Test extends C with App { + println(f) +} diff --git a/tests/pending/run/t493.scala b/tests/pending/run/t493.scala new file mode 100644 index 000000000000..7aaad1fece1d --- /dev/null +++ b/tests/pending/run/t493.scala @@ -0,0 +1,22 @@ +object Test { + + val y = new collection.mutable.HashMap[String,Any] + val z = new collection.mutable.HashMap[String,Any] + + y("msg") = Array[String]("1","2") + + val array: Array[String] = Array[String]("1","2") + z("msg") = array + + def main(args:Array[String]) = { + + assert(y("msg").isInstanceOf[Array[_]]) + assert(z("msg").isInstanceOf[Array[_]]) + + // these work, without producing a match error + + (z.get("msg"): @unchecked) match { + case Some(_:Array[String]) => + } + } +} diff --git a/tests/pending/run/t4930.check b/tests/pending/run/t4930.check new file mode 100644 index 000000000000..a58efd4685f5 --- /dev/null +++ b/tests/pending/run/t4930.check @@ -0,0 +1,2 @@ +List(1) +List(1) diff --git a/tests/pending/run/t4930.scala b/tests/pending/run/t4930.scala new file mode 100644 index 000000000000..775f62794845 --- /dev/null +++ b/tests/pending/run/t4930.scala @@ -0,0 +1,11 @@ +import collection.immutable.SortedMap + +object Test { + implicit val ord: Ordering[Array[Byte]] = Ordering.by((_: Array[Byte]).toIterable) + + def main(args: Array[String]): Unit = { + val m = SortedMap(Array[Byte](1) -> 0) + println(m.to(Array[Byte](1)) flatMap (_._1.mkString)) + println(m.from(Array[Byte](1)) flatMap (_._1.mkString)) + } +} diff --git a/tests/pending/run/t4935.check b/tests/pending/run/t4935.check new file mode 100644 index 000000000000..ce013625030b --- /dev/null +++ b/tests/pending/run/t4935.check @@ -0,0 +1 @@ +hello diff --git a/tests/pending/run/t4935.flags b/tests/pending/run/t4935.flags new file mode 100644 index 000000000000..49d036a8879c --- /dev/null +++ b/tests/pending/run/t4935.flags @@ -0,0 +1 @@ +-optimize diff --git a/tests/pending/run/t4935.scala b/tests/pending/run/t4935.scala new file mode 100644 index 000000000000..88940be6bffe --- /dev/null +++ b/tests/pending/run/t4935.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + for (i <- 0 to 1) { + val a = Foo + } +} + +object Foo { + println("hello") +} diff --git a/tests/pending/run/t4950.check b/tests/pending/run/t4950.check new file mode 100644 index 000000000000..3f3a302b62d8 --- /dev/null +++ b/tests/pending/run/t4950.check @@ -0,0 +1,9 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val 1 = 2 +scala.MatchError: 2 (of class java.lang.Integer) + +scala> val List(1) = List(1) + +scala> :quit diff --git a/tests/pending/run/t4950.scala b/tests/pending/run/t4950.scala new file mode 100644 index 000000000000..cef06027bf28 --- /dev/null +++ b/tests/pending/run/t4950.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // Filter out the abbreviated stacktrace "... X elided" + // because the number seems to differ between versions/platforms/... + override def show = eval() filterNot (_ contains "elided") foreach println + def code = +""" +val 1 = 2 +val List(1) = List(1) +""" +} diff --git a/tests/pending/run/t4954.scala b/tests/pending/run/t4954.scala new file mode 100644 index 000000000000..655a90f749cb --- /dev/null +++ b/tests/pending/run/t4954.scala @@ -0,0 +1,45 @@ + + +import collection._ + + +object Test { + + def main(args: Array[String]): Unit = { + val m = scala.collection.mutable.LinkedHashMap("one" -> 1, "two" -> 2, "three" -> 3, "four" -> 4, "five" -> 5) + val expected = List("one", "two", "three", "four", "five") + assert(m.keys.iterator.toList == expected) + assert(m.keys.drop(0).iterator.toList == expected) + assert(m.keys.drop(1).iterator.toList == expected.drop(1)) + assert(m.keys.drop(2).iterator.toList == expected.drop(2)) + assert(m.keys.drop(3).iterator.toList == expected.drop(3)) + assert(m.keys.drop(4).iterator.toList == expected.drop(4)) + assert(m.keys.drop(5).iterator.toList == expected.drop(5)) + + val expvals = List(1, 2, 3, 4, 5) + assert(m.values.iterator.toList == expvals) + assert(m.values.drop(0).iterator.toList == expvals) + assert(m.values.drop(1).iterator.toList == expvals.drop(1)) + assert(m.values.drop(2).iterator.toList == expvals.drop(2)) + assert(m.values.drop(3).iterator.toList == expvals.drop(3)) + assert(m.values.drop(4).iterator.toList == expvals.drop(4)) + assert(m.values.drop(5).iterator.toList == expvals.drop(5)) + + val pred = (x: String) => x.length < 6 + val filtered = m.filterKeys(pred) + assert(filtered.drop(0).keys.toList == expected.filter(pred)) + assert(filtered.drop(1).keys.toList == expected.filter(pred).drop(1)) + assert(filtered.drop(2).keys.toList == expected.filter(pred).drop(2)) + assert(filtered.drop(3).keys.toList == expected.filter(pred).drop(3)) + assert(filtered.drop(4).keys.toList == expected.filter(pred).drop(4)) + + val mapped = m.mapValues(-_) + assert(mapped.drop(0).keys.toList == expected) + assert(mapped.drop(1).keys.toList == expected.drop(1)) + assert(mapped.drop(2).keys.toList == expected.drop(2)) + assert(mapped.drop(3).keys.toList == expected.drop(3)) + assert(mapped.drop(4).keys.toList == expected.drop(4)) + assert(mapped.drop(5).keys.toList == expected.drop(5)) + } + +} diff --git a/tests/pending/run/t498.check b/tests/pending/run/t498.check new file mode 100644 index 000000000000..b1ce75e80bc7 --- /dev/null +++ b/tests/pending/run/t498.check @@ -0,0 +1 @@ +Stream(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) diff --git a/tests/pending/run/t498.scala b/tests/pending/run/t498.scala new file mode 100644 index 000000000000..d50d8fd3f3cc --- /dev/null +++ b/tests/pending/run/t498.scala @@ -0,0 +1,8 @@ + +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { +// the function passed to flatMap produces lots of empty streams, but this should not overflow the stack + val res = Stream.from(1).flatMap(i => if (i < 3000) Stream.empty else List(1)) + println(res take 42 force) +} diff --git a/tests/pending/run/t4996.check b/tests/pending/run/t4996.check new file mode 100644 index 000000000000..8d45b413c9fe --- /dev/null +++ b/tests/pending/run/t4996.check @@ -0,0 +1,4 @@ +B.foo +M.foo +B.foo +M.foo \ No newline at end of file diff --git a/tests/pending/run/t4996.scala b/tests/pending/run/t4996.scala new file mode 100644 index 000000000000..e8ef5949cbe4 --- /dev/null +++ b/tests/pending/run/t4996.scala @@ -0,0 +1,47 @@ + + + + + + +trait A[@specialized(Int) T] { + def foo(t: T): Unit +} + + +trait B extends A[Int] { + def foo(t: Int): Unit = { + println("B.foo") + } +} + + +trait M extends B { + abstract override def foo(t: Int): Unit = { + super.foo(t) + println("M.foo") + } +} + + +object C extends B with M + + +object D extends B { + override def foo(t: Int): Unit = { + super.foo(t) + println("M.foo") + } +} + + +object Test { + + def main(args: Array[String]): Unit = { + D.foo(42) // OK, prints B.foo M.foo + C.foo(42) // was StackOverflowError + } + +} + + diff --git a/tests/pending/run/t5009.check b/tests/pending/run/t5009.check new file mode 100644 index 000000000000..6c567227b5e0 --- /dev/null +++ b/tests/pending/run/t5009.check @@ -0,0 +1,5 @@ +C(1,true) +10 +C(7283,20) +C(66,-3) +100 diff --git a/tests/pending/run/t5009.scala b/tests/pending/run/t5009.scala new file mode 100644 index 000000000000..9e4700c07fd0 --- /dev/null +++ b/tests/pending/run/t5009.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + + case class C[T, U <: String, O >: Object](x: Int, y: T)(z: U, b: Boolean)(s: O, val l: Int) + + val c = C(1, true)("dlkfj", true)("dlkfjlk", 10) + println(c) + println(c.l) + + println(c.copy(y = 20, x = 7283)("enwa", b = false)(l = -1, s = new Object)) + + val res = c.copy[Int, String, Object](y = -3, x = 66)("lkdjen", false)(new Object, 100) + println(res) + println(res.l) +} diff --git a/tests/pending/run/t5018.scala b/tests/pending/run/t5018.scala new file mode 100644 index 000000000000..147d69cf867a --- /dev/null +++ b/tests/pending/run/t5018.scala @@ -0,0 +1,37 @@ + + + +import java.io._ +import collection._ + + + +object Test { + + def serializeDeserialize[T <: AnyRef](obj: T) = { + val buffer = new ByteArrayOutputStream + val out = new ObjectOutputStream(buffer) + out.writeObject(obj) + val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray)) + in.readObject.asInstanceOf[T] + } + + def main(args: Array[String]): Unit = { + val values = mutable.Map(1 -> 1).values + assert(serializeDeserialize(values).toList == values.toList) + + val keyset = mutable.Map(1 -> 1).keySet + assert(serializeDeserialize(keyset) == keyset) + + val imkeyset = immutable.Map(1 -> 1).keySet + assert(serializeDeserialize(imkeyset) == imkeyset) + + val defaultmap = immutable.Map(1 -> 1).withDefaultValue(1) + assert(serializeDeserialize(defaultmap) == defaultmap) + + val minusmap = mutable.Map(1 -> 1).withDefault(x => -x) + assert(serializeDeserialize(minusmap) == minusmap) + } + +} + diff --git a/tests/pending/run/t5037.check b/tests/pending/run/t5037.check new file mode 100644 index 000000000000..da29283aaa47 --- /dev/null +++ b/tests/pending/run/t5037.check @@ -0,0 +1,2 @@ +true +false diff --git a/tests/pending/run/t5037.scala b/tests/pending/run/t5037.scala new file mode 100644 index 000000000000..c64aa28145fa --- /dev/null +++ b/tests/pending/run/t5037.scala @@ -0,0 +1,18 @@ +object Test { + def main(args: Array[String]): Unit = { + val t = new Test + t.inner.foo() + } +} + +class Test { + class Inner { + def foo(): Unit = { + println(bar) + bar = false + println(bar) + } + } + val inner = new Inner + private[this] final var bar = true +} diff --git a/tests/pending/run/t5040.check b/tests/pending/run/t5040.check new file mode 100644 index 000000000000..3f7b5908a9b6 --- /dev/null +++ b/tests/pending/run/t5040.check @@ -0,0 +1 @@ +applyDynamic diff --git a/tests/pending/run/t5040.flags b/tests/pending/run/t5040.flags new file mode 100644 index 000000000000..1141f975075d --- /dev/null +++ b/tests/pending/run/t5040.flags @@ -0,0 +1 @@ +-language:dynamics diff --git a/tests/pending/run/t5040.scala b/tests/pending/run/t5040.scala new file mode 100644 index 000000000000..6813c1b27d89 --- /dev/null +++ b/tests/pending/run/t5040.scala @@ -0,0 +1,11 @@ +abstract class Prova2 extends Dynamic { + def applyDynamic(m: String)(): Unit + private def privateMethod() = println("private method") +} + +object Test extends dotty.runtime.LegacyApp { + val prova= new Prova2 { + def applyDynamic(m: String)() = println("applyDynamic") + } + prova.privateMethod() +} diff --git a/tests/pending/run/t5045.check b/tests/pending/run/t5045.check new file mode 100644 index 000000000000..7e9c1961b7fa --- /dev/null +++ b/tests/pending/run/t5045.check @@ -0,0 +1,6 @@ + extract an exact match 2011-07-15 2011-07-15 + extract from middle of string 2011-07-15 2011-07-15 + extract from middle of string (P2) 2011-07-15 2011-07-15 + extract from middle of string (P3) 2011-07-15 2011-07-15 + copyright example has date Copyright 2011 Copyright 2011 + copyright example missing date No copyright No copyright diff --git a/tests/pending/run/t5045.scala b/tests/pending/run/t5045.scala new file mode 100644 index 000000000000..3778339aa4b1 --- /dev/null +++ b/tests/pending/run/t5045.scala @@ -0,0 +1,49 @@ + +import scala.language.postfixOps + +object Test extends dotty.runtime.LegacyApp { + + import scala.util.matching.{ Regex, UnanchoredRegex } + + val dateP1 = """(\d\d\d\d)-(\d\d)-(\d\d)""".r.unanchored + val dateP2 = """(\d\d\d\d)-(\d\d)-(\d\d)""" r ("year", "month", "day") unanchored + val dateP3 = new Regex("""(\d\d\d\d)-(\d\d)-(\d\d)""", "year", "month", "day") with UnanchoredRegex + + val yearStr = "2011" + val dateStr = List(yearStr,"07","15").mkString("-") + + def test(msg: String)(strs: Seq[String]): Unit = println("%40s %s".format(msg, strs mkString " ")) + + test("extract an exact match") { + val dateP1(y,m,d) = dateStr + Seq(List(y,m,d).mkString("-"), dateStr) + } + + test("extract from middle of string") { + val dateP1(y,m,d) = "Tested on "+dateStr+"." + Seq(List(y,m,d).mkString("-"), dateStr) + } + + test("extract from middle of string (P2)") { + val dateP2(y,m,d) = "Tested on "+dateStr+"." + Seq(List(y,m,d).mkString("-"), dateStr) + } + + test("extract from middle of string (P3)") { + val dateP2(y,m,d) = "Tested on "+dateStr+"." + Seq(List(y,m,d).mkString("-"), dateStr) + } + + def copyright(in: String): String = in match { + case dateP1(year, month, day) => "Copyright "+year + case _ => "No copyright" + } + + test("copyright example has date") { + Seq(copyright("Date of this document: "+dateStr), "Copyright "+yearStr) + } + + test("copyright example missing date") { + Seq(copyright("Date of this document: unknown"), "No copyright") + } +} diff --git a/tests/pending/run/t5053.check b/tests/pending/run/t5053.check new file mode 100644 index 000000000000..5ec39bbdeb5c --- /dev/null +++ b/tests/pending/run/t5053.check @@ -0,0 +1,6 @@ +true +true +true +true +true +true diff --git a/tests/pending/run/t5053.scala b/tests/pending/run/t5053.scala new file mode 100644 index 000000000000..797faaeaf7f5 --- /dev/null +++ b/tests/pending/run/t5053.scala @@ -0,0 +1,23 @@ + +import scala.language.{ existentials } + +object Test extends dotty.runtime.LegacyApp { + { + val (left, right) = Seq((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip + println(left.isInstanceOf[scala.collection.SeqViewLike[_,_,_]]) + val (l, m, r) = Seq((1, 1.0, "a"), (1, 1.0, "a"), (1, 1.0, "a"), (3, 3.0, "c")).view.unzip3 + println(l.isInstanceOf[scala.collection.SeqViewLike[_,_,_]]) + } + { + val (left, right) = Iterable((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip + println(left.isInstanceOf[scala.collection.IterableViewLike[_,_,_]]) + val (l, m, r) = Iterable((1, 1.0, "a"), (1, 1.0, "a"), (1, 1.0, "a"), (3, 3.0, "c")).view.unzip3 + println(l.isInstanceOf[scala.collection.IterableViewLike[_,_,_]]) + } + { + val (left, right) = Traversable((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip + println(left.isInstanceOf[scala.collection.TraversableViewLike[_,_,_]]) + val (l, m, r) = Traversable((1, 1.0, "a"), (1, 1.0, "a"), (1, 1.0, "a"), (3, 3.0, "c")).view.unzip3 + println(l.isInstanceOf[scala.collection.TraversableViewLike[_,_,_]]) + } +} diff --git a/tests/pending/run/t5064.check b/tests/pending/run/t5064.check new file mode 100644 index 000000000000..61ccfd16e760 --- /dev/null +++ b/tests/pending/run/t5064.check @@ -0,0 +1,25 @@ +[53] T5064.super.() +[53] T5064.super. +[53] this +[16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) +[16:20] immutable.this.List.apply +<16:20> immutable.this.List +<16:20> immutable.this +[16:23] scala.this.Predef.wrapIntArray(Array[Int]{1}) +[20] scala.this.Predef.wrapIntArray +[20] scala.this.Predef +[20] scala.this +[26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) +[26:29] collection.this.Seq.apply +<26:29> collection.this.Seq +<26:29> collection.this +[26:32] scala.this.Predef.wrapIntArray(Array[Int]{1}) +[29] scala.this.Predef.wrapIntArray +[29] scala.this.Predef +[29] scala.this +[35:39] immutable.this.List +<35:39> immutable.this +[42:45] collection.this.Seq +<42:45> collection.this +[48:51] immutable.this.Nil +<48:51> immutable.this diff --git a/tests/pending/run/t5064.scala b/tests/pending/run/t5064.scala new file mode 100644 index 000000000000..35f0951765f0 --- /dev/null +++ b/tests/pending/run/t5064.scala @@ -0,0 +1,23 @@ +import scala.tools.partest._ + +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -Yrangepos" + override def sources = List( + """|class T5064 { + | List(1) + | Seq(1) + | List + | Seq + | Nil + |}""".stripMargin + ) + def check(source: String, unit: CompilationUnit) { + for (ClassDef(_, _, _, Template(_, _, stats)) <- unit.body ; stat <- stats ; t <- stat) { + t match { + case _: Select | _: Apply | _: This => println("%-15s %s".format(t.pos.show, t)) + case _ => + } + } + } +} \ No newline at end of file diff --git a/tests/pending/run/t5072.check b/tests/pending/run/t5072.check new file mode 100644 index 000000000000..ab34e49869da --- /dev/null +++ b/tests/pending/run/t5072.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class C +defined class C + +scala> Thread.currentThread.getContextClassLoader.loadClass(classOf[C].getName) +res0: Class[_] = class C + +scala> :quit diff --git a/tests/pending/run/t5072.scala b/tests/pending/run/t5072.scala new file mode 100644 index 000000000000..eef8604ef189 --- /dev/null +++ b/tests/pending/run/t5072.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +class C +Thread.currentThread.getContextClassLoader.loadClass(classOf[C].getName) + """ +} diff --git a/tests/pending/run/t5080.check b/tests/pending/run/t5080.check new file mode 100644 index 000000000000..1385f264afb7 --- /dev/null +++ b/tests/pending/run/t5080.check @@ -0,0 +1 @@ +hey diff --git a/tests/pending/run/t5080.scala b/tests/pending/run/t5080.scala new file mode 100644 index 000000000000..c20e378bbf5a --- /dev/null +++ b/tests/pending/run/t5080.scala @@ -0,0 +1,28 @@ + +import scala.language.implicitConversions +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + + abstract class Value { + } + + case class Num(value: Int) extends Value { + override def toString = value.toString; + } + + implicit def conversions(x: Value): AnyRef{def toInt: Int} = new { + def toInt = + x match { + case Num(n) => n + case _ => throw new RuntimeException + } + } + + def eval(v: Value): Value = { + println("hey") + Num(1) + } + + eval(Num(1)).toInt +} diff --git a/tests/pending/run/t5105.check b/tests/pending/run/t5105.check new file mode 100644 index 000000000000..1d4f6efff472 --- /dev/null +++ b/tests/pending/run/t5105.check @@ -0,0 +1 @@ +You buttered your bread. Now sleep in it! diff --git a/tests/pending/run/t5105.scala b/tests/pending/run/t5105.scala new file mode 100644 index 000000000000..9de714c87d98 --- /dev/null +++ b/tests/pending/run/t5105.scala @@ -0,0 +1,14 @@ +object Test { + def main(args: Array[String]): Unit = { + new foo.Bar + println("You buttered your bread. Now sleep in it!") + } +} + +package foo { + trait Foo { def foo(): Unit = {} } + class Bar extends Baz with Foo + + abstract class Baz + object Baz extends Foo +} diff --git a/tests/pending/run/t5125.check b/tests/pending/run/t5125.check new file mode 100644 index 000000000000..d8a05650050f --- /dev/null +++ b/tests/pending/run/t5125.check @@ -0,0 +1,4 @@ +public void O1$.f(java.lang.String[]) +public void O1$.f(scala.collection.Seq) +public void O2$.f(java.lang.String[]) +public void O2$.f(scala.collection.Seq) diff --git a/tests/pending/run/t5125.scala b/tests/pending/run/t5125.scala new file mode 100644 index 000000000000..b9f732085a97 --- /dev/null +++ b/tests/pending/run/t5125.scala @@ -0,0 +1,24 @@ +object O1 { + def instance = this + @scala.annotation.varargs + def f(values:String*) = println("Calling O1.f(): " + values) +} + +object O2 { + def instance = this + @scala.annotation.varargs + def f(values:String*) = println("Calling O2.f(): " + values) + // uncommenting g() results in errors in A.java + def g(): String => Int = s => s.hashCode +} + +object Test extends dotty.runtime.LegacyApp { + def check(c: Class[_]): Unit = { + val methodName = "f" + val methods = c.getDeclaredMethods.filter(_.getName == methodName) + println(methods.map(_.toString).sorted.mkString("\n")) + } + + check(O1.getClass) + check(O2.getClass) +} diff --git a/tests/pending/run/t5125b.check b/tests/pending/run/t5125b.check new file mode 100644 index 000000000000..ddbf908f04b8 --- /dev/null +++ b/tests/pending/run/t5125b.check @@ -0,0 +1,7 @@ +public void C1.f(java.lang.String[]) +public void C1.f(scala.collection.Seq) +public void C2.f(java.lang.String[]) +public void C2.f(scala.collection.Seq) +public void C2$C3.f(java.lang.String[]) +public void C2$C3.f(scala.collection.Seq) +public void C4.f(scala.collection.Seq) diff --git a/tests/pending/run/t5125b.scala b/tests/pending/run/t5125b.scala new file mode 100644 index 000000000000..cf01db3248c7 --- /dev/null +++ b/tests/pending/run/t5125b.scala @@ -0,0 +1,37 @@ +class C1 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C1.f(): " + values) +} + +class C2 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C2.f(): " + values) + def g(): String => Int = s => s.hashCode + + class C3 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C3.f(): " + values) + } +} + +class C4 { + def f(values: String*) = println("Calling C4.f(): " + values) + + locally { + @scala.annotation.varargs + def f(values: String*) = println("Calling C4..f(): " + values) + } +} + +object Test extends dotty.runtime.LegacyApp { + def check(c: Class[_]): Unit = { + val methodName = "f" + val methods = c.getDeclaredMethods.filter(_.getName == methodName) + println(methods.map(_.toString).sorted.mkString("\n")) + } + + check(classOf[C1]) + check(classOf[C2]) + check(classOf[C2#C3]) + check(classOf[C4]) +} diff --git a/tests/pending/run/t5134.scala b/tests/pending/run/t5134.scala new file mode 100644 index 000000000000..fe946040f3c1 --- /dev/null +++ b/tests/pending/run/t5134.scala @@ -0,0 +1,8 @@ +import language._ + +object Test extends dotty.runtime.LegacyApp { + def b = new AnyRef { + def a= () + } + b.a match { case _ => () } +} diff --git a/tests/pending/run/t5158.check b/tests/pending/run/t5158.check new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tests/pending/run/t5158.check @@ -0,0 +1 @@ +0 diff --git a/tests/pending/run/t5158.scala b/tests/pending/run/t5158.scala new file mode 100644 index 000000000000..34c02c3062e7 --- /dev/null +++ b/tests/pending/run/t5158.scala @@ -0,0 +1,17 @@ +case class B(var x: Int) { + def succ(): Unit = { + x = x + 1 + } +} + +object Test { + def main(args: Array[String]): Unit = { + val b = B(0) + b match { + case B(x) => + //println(x) + b.succ() + println(x) + } + } +} diff --git a/tests/pending/run/t5162.scala b/tests/pending/run/t5162.scala new file mode 100644 index 000000000000..e4ad9ff8d2a6 --- /dev/null +++ b/tests/pending/run/t5162.scala @@ -0,0 +1,19 @@ +// In run, rather than pos, to check for problems like SI-4283 +object O1 { + private[O1] class Base { + def foo: Int = 0 + } + class Mediator extends Base +} + +object O2 { + class Derived extends O1.Mediator { + override def foo: Int = super.foo + } +} + +object Test { + def main(args: Array[String]): Unit = { + new O2.Derived().foo + } +} diff --git a/tests/pending/run/t5171.check b/tests/pending/run/t5171.check new file mode 100644 index 000000000000..159606d35c17 --- /dev/null +++ b/tests/pending/run/t5171.check @@ -0,0 +1 @@ +IsList diff --git a/tests/pending/run/t5171.scala b/tests/pending/run/t5171.scala new file mode 100644 index 000000000000..3495082683ba --- /dev/null +++ b/tests/pending/run/t5171.scala @@ -0,0 +1,7 @@ +abstract sealed class ArgNumber +case object IsList extends ArgNumber +case object ArgNumber + +object Test extends dotty.runtime.LegacyApp { + println(IsList) +} diff --git a/tests/pending/run/t5201.check b/tests/pending/run/t5201.check new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/pending/run/t5201.check @@ -0,0 +1 @@ +true diff --git a/tests/pending/run/t5201.scala b/tests/pending/run/t5201.scala new file mode 100644 index 000000000000..70ab6e9ae816 --- /dev/null +++ b/tests/pending/run/t5201.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + // First make sure specific types are preserved + val tmp: Vector[Int] = Vector(Vector(1,2), Vector(3,4)).view.flatten.force + + // Now make sure we really get a view + val seq = Seq(Seq(1, 2), Seq(3, 4)).view.flatten + Console.println(seq.isInstanceOf[collection.SeqView[_,_]]) +} diff --git a/tests/pending/run/t5224.check b/tests/pending/run/t5224.check new file mode 100644 index 000000000000..b11480acdfb5 --- /dev/null +++ b/tests/pending/run/t5224.check @@ -0,0 +1,14 @@ +t5224.scala:3: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class Foo(bar: String) extends annotation.ClassfileAnnotation + ^ +{ + @new Foo(bar = "qwe") class C extends AnyRef { + def () = { + super.(); + () + } + }; + () +} diff --git a/tests/pending/run/t5224.scala b/tests/pending/run/t5224.scala new file mode 100644 index 000000000000..d0cd9a455e4b --- /dev/null +++ b/tests/pending/run/t5224.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +class Foo(bar: String) extends annotation.ClassfileAnnotation + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{@Foo(bar = "qwe") class C}.tree + println(tree.toString) +} diff --git a/tests/pending/run/t5225_1.check b/tests/pending/run/t5225_1.check new file mode 100644 index 000000000000..1a47aacfd05a --- /dev/null +++ b/tests/pending/run/t5225_1.check @@ -0,0 +1,4 @@ +{ + @new transient() @new volatile() var x = 2; + () +} diff --git a/tests/pending/run/t5225_1.scala b/tests/pending/run/t5225_1.scala new file mode 100644 index 000000000000..a553e83ceaab --- /dev/null +++ b/tests/pending/run/t5225_1.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{@transient @volatile var x = 2}.tree + println(tree.toString) +} diff --git a/tests/pending/run/t5225_2.check b/tests/pending/run/t5225_2.check new file mode 100644 index 000000000000..477ea4eb6d41 --- /dev/null +++ b/tests/pending/run/t5225_2.check @@ -0,0 +1,4 @@ +{ + def foo(@new elidable(0) x: Int) = ""; + () +} diff --git a/tests/pending/run/t5225_2.scala b/tests/pending/run/t5225_2.scala new file mode 100644 index 000000000000..54e7fec1ff24 --- /dev/null +++ b/tests/pending/run/t5225_2.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{def foo(@annotation.elidable(0) x: Int) = ""}.tree + println(tree.toString) +} diff --git a/tests/pending/run/t5229_1.scala b/tests/pending/run/t5229_1.scala new file mode 100644 index 000000000000..62341fdbb1df --- /dev/null +++ b/tests/pending/run/t5229_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + object C + }.eval +} diff --git a/tests/pending/run/t5229_2.check b/tests/pending/run/t5229_2.check new file mode 100644 index 000000000000..43c25b96af41 --- /dev/null +++ b/tests/pending/run/t5229_2.check @@ -0,0 +1,2 @@ +2 +evaluated = () diff --git a/tests/pending/run/t5229_2.scala b/tests/pending/run/t5229_2.scala new file mode 100644 index 000000000000..a9cd089479a3 --- /dev/null +++ b/tests/pending/run/t5229_2.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + object C { + val x = 2 + } + + println(C.x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5230.check b/tests/pending/run/t5230.check new file mode 100644 index 000000000000..43c25b96af41 --- /dev/null +++ b/tests/pending/run/t5230.check @@ -0,0 +1,2 @@ +2 +evaluated = () diff --git a/tests/pending/run/t5230.scala b/tests/pending/run/t5230.scala new file mode 100644 index 000000000000..5c934c3452f9 --- /dev/null +++ b/tests/pending/run/t5230.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { + val x = 2 + } + + println(new C().x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5256a.check b/tests/pending/run/t5256a.check new file mode 100644 index 000000000000..09b5a02831cf --- /dev/null +++ b/tests/pending/run/t5256a.check @@ -0,0 +1,6 @@ +class A +A +AnyRef { + def (): A + def foo: Nothing +} diff --git a/tests/pending/run/t5256a.scala b/tests/pending/run/t5256a.scala new file mode 100644 index 000000000000..a1ed76b11a49 --- /dev/null +++ b/tests/pending/run/t5256a.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class A { def foo = ??? } + +object Test extends dotty.runtime.LegacyApp { + val c = cm.classSymbol(classOf[A]) + println(c) + println(c.fullName) + println(c.info) +} diff --git a/tests/pending/run/t5256b.check b/tests/pending/run/t5256b.check new file mode 100644 index 000000000000..ca93aaa7069b --- /dev/null +++ b/tests/pending/run/t5256b.check @@ -0,0 +1,6 @@ +class A +Test.A +AnyRef { + def (): Test.A + def foo: Nothing +} diff --git a/tests/pending/run/t5256b.scala b/tests/pending/run/t5256b.scala new file mode 100644 index 000000000000..065890a2b2db --- /dev/null +++ b/tests/pending/run/t5256b.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A { def foo = ??? } + val c = cm.classSymbol(classOf[A]) + println(c) + println(c.fullName) + println(c.info) +} diff --git a/tests/pending/run/t5256c.check b/tests/pending/run/t5256c.check new file mode 100644 index 000000000000..3eb7b13a97ad --- /dev/null +++ b/tests/pending/run/t5256c.check @@ -0,0 +1,6 @@ +class A$1 +Test.A$1 +java.lang.Object { + def foo(): Nothing + def (): Test.A$1 +} diff --git a/tests/pending/run/t5256c.scala b/tests/pending/run/t5256c.scala new file mode 100644 index 000000000000..21bac2e5d36c --- /dev/null +++ b/tests/pending/run/t5256c.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + { + class A { def foo = ??? } + val c = cm.classSymbol(classOf[A]) + println(c) + println(c.fullName) + println(c.info) + } +} diff --git a/tests/pending/run/t5256d.check b/tests/pending/run/t5256d.check new file mode 100644 index 000000000000..c2b49989abaf --- /dev/null +++ b/tests/pending/run/t5256d.check @@ -0,0 +1,28 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.runtime.{currentMirror=>cm} + +scala> class A { def foo = ??? } +defined class A + +scala> val c = cm.classSymbol(classOf[A]) +c: reflect.runtime.universe.ClassSymbol = class A + +scala> println(c) +class A + +scala> println(c.fullName) +$line8.$read.$iw.$iw.$iw.$iw.A + +scala> println(c.info) +scala.AnyRef { + def (): A + def foo: scala.Nothing +} + +scala> :quit diff --git a/tests/pending/run/t5256d.scala b/tests/pending/run/t5256d.scala new file mode 100644 index 000000000000..5aa26071c0bf --- /dev/null +++ b/tests/pending/run/t5256d.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +class A { def foo = ??? } +val c = cm.classSymbol(classOf[A]) +println(c) +println(c.fullName) +println(c.info) + """ +} \ No newline at end of file diff --git a/tests/pending/run/t5256e.check b/tests/pending/run/t5256e.check new file mode 100644 index 000000000000..ed3513183e13 --- /dev/null +++ b/tests/pending/run/t5256e.check @@ -0,0 +1,6 @@ +class A +Test.C.A +AnyRef { + def (): C.this.A + def foo: Nothing +} diff --git a/tests/pending/run/t5256e.scala b/tests/pending/run/t5256e.scala new file mode 100644 index 000000000000..a7a83d0683d8 --- /dev/null +++ b/tests/pending/run/t5256e.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class C { class A { def foo = ??? } } + val c = cm.classSymbol(classOf[C#A]) + println(c) + println(c.fullName) + println(c.info) +} diff --git a/tests/pending/run/t5256f.check b/tests/pending/run/t5256f.check new file mode 100644 index 000000000000..6a89d0b86a7b --- /dev/null +++ b/tests/pending/run/t5256f.check @@ -0,0 +1,12 @@ +class A1 +Test.A1 +AnyRef { + def (): Test.A1 + def foo: Nothing +} +class A2 +Test.A2 +AnyRef { + def (): Test.this.A2 + def foo: Nothing +} diff --git a/tests/pending/run/t5256f.scala b/tests/pending/run/t5256f.scala new file mode 100644 index 000000000000..3a9dd5998cf0 --- /dev/null +++ b/tests/pending/run/t5256f.scala @@ -0,0 +1,22 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class A1 { def foo = ??? } + + val c1 = cm.classSymbol(classOf[A1]) + println(c1) + println(c1.fullName) + println(c1.info) + + new Test +} + +class Test { + class A2 { def foo = ??? } + + val c2 = cm.classSymbol(classOf[A2]) + println(c2) + println(c2.fullName) + println(c2.info) +} diff --git a/tests/pending/run/t5256g.check b/tests/pending/run/t5256g.check new file mode 100644 index 000000000000..cef3a413c251 --- /dev/null +++ b/tests/pending/run/t5256g.check @@ -0,0 +1,5 @@ +$anon +Test.$anon$1 +A with B { + def (): A with B +} diff --git a/tests/pending/run/t5256g.scala b/tests/pending/run/t5256g.scala new file mode 100644 index 000000000000..fce57ab6eedd --- /dev/null +++ b/tests/pending/run/t5256g.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class A +trait B + +object Test extends dotty.runtime.LegacyApp { + val mutant = new A with B + val c = cm.classSymbol(mutant.getClass) + println(c) + println(c.fullName) + println(c.info) +} diff --git a/tests/pending/run/t5256h.check b/tests/pending/run/t5256h.check new file mode 100644 index 000000000000..dc3e919897e5 --- /dev/null +++ b/tests/pending/run/t5256h.check @@ -0,0 +1,7 @@ +$anon +Test.$anon$1 +java.lang.Object { + final private val x: Int + def x(): Int + def (): $anon$1 +} diff --git a/tests/pending/run/t5256h.scala b/tests/pending/run/t5256h.scala new file mode 100644 index 000000000000..5376caeffb15 --- /dev/null +++ b/tests/pending/run/t5256h.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + val mutant = new { val x = 2 } + val c = cm.classSymbol(mutant.getClass) + println(c) + println(c.fullName) + // under -Xcheckinit there's an additional $init$ field + c.info.toString.lines.filter(_ != " private var bitmap$init$0: Boolean") foreach println +} diff --git a/tests/pending/run/t5258a.check b/tests/pending/run/t5258a.check new file mode 100644 index 000000000000..4e0b2da04c5d --- /dev/null +++ b/tests/pending/run/t5258a.check @@ -0,0 +1 @@ +int \ No newline at end of file diff --git a/tests/pending/run/t5258a.scala b/tests/pending/run/t5258a.scala new file mode 100644 index 000000000000..5a22a251c2a1 --- /dev/null +++ b/tests/pending/run/t5258a.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(classOf[Int]) + }.eval +} diff --git a/tests/pending/run/t5262.check b/tests/pending/run/t5262.check new file mode 100644 index 000000000000..4c7a875de53e --- /dev/null +++ b/tests/pending/run/t5262.check @@ -0,0 +1,2 @@ +List(1, 2, 3, 4) +List(1, 2, null, 4) \ No newline at end of file diff --git a/tests/pending/run/t5262.scala b/tests/pending/run/t5262.scala new file mode 100644 index 000000000000..fd194e90aa73 --- /dev/null +++ b/tests/pending/run/t5262.scala @@ -0,0 +1,26 @@ + + + + + + + +object Test { + + def serializationDeserialization(obj : Any): Unit = { + val bos = new java.io.ByteArrayOutputStream() + val out = new java.io.ObjectOutputStream(bos) + out.writeObject(obj) + + val arr = bos.toByteArray() + val in = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(arr)) + val o = in.readObject() + println(o) + } + + def main(args : Array[String]): Unit = { + serializationDeserialization(List(1,2,3,4)) + serializationDeserialization(List(1,2,null,4)) + } + +} diff --git a/tests/pending/run/t5266_1.check b/tests/pending/run/t5266_1.check new file mode 100644 index 000000000000..35f20802ee63 --- /dev/null +++ b/tests/pending/run/t5266_1.check @@ -0,0 +1,2 @@ +2 +evaluated = () \ No newline at end of file diff --git a/tests/pending/run/t5266_1.scala b/tests/pending/run/t5266_1.scala new file mode 100644 index 000000000000..5ed943ee678b --- /dev/null +++ b/tests/pending/run/t5266_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + def x = 2 + println(x) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5266_2.check b/tests/pending/run/t5266_2.check new file mode 100644 index 000000000000..35f20802ee63 --- /dev/null +++ b/tests/pending/run/t5266_2.check @@ -0,0 +1,2 @@ +2 +evaluated = () \ No newline at end of file diff --git a/tests/pending/run/t5266_2.scala b/tests/pending/run/t5266_2.scala new file mode 100644 index 000000000000..c8c3ab82457d --- /dev/null +++ b/tests/pending/run/t5266_2.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + def x = 2 + def y = x + println(y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5269.check b/tests/pending/run/t5269.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5269.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5269.scala b/tests/pending/run/t5269.scala new file mode 100644 index 000000000000..dbaa1d1d8a24 --- /dev/null +++ b/tests/pending/run/t5269.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + trait Z { + val z = 2 + } + + class X extends Z { + def println() = Predef.println(z) + } + + new X().println() + }.eval +} diff --git a/tests/pending/run/t5270.check b/tests/pending/run/t5270.check new file mode 100644 index 000000000000..08839f6bb296 --- /dev/null +++ b/tests/pending/run/t5270.check @@ -0,0 +1 @@ +200 diff --git a/tests/pending/run/t5270.scala b/tests/pending/run/t5270.scala new file mode 100644 index 000000000000..03ba765fde27 --- /dev/null +++ b/tests/pending/run/t5270.scala @@ -0,0 +1,20 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class Y { + def y = 100 + } + + trait Z { this: Y => + val z = 2 * y + } + + class X extends Y with Z { + def println() = Predef.println(z) + } + + new X().println() + }.eval +} diff --git a/tests/pending/run/t5271_1.check b/tests/pending/run/t5271_1.check new file mode 100644 index 000000000000..544b4d2762a4 --- /dev/null +++ b/tests/pending/run/t5271_1.check @@ -0,0 +1,12 @@ +{ + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + () +} +() diff --git a/tests/pending/run/t5271_1.scala b/tests/pending/run/t5271_1.scala new file mode 100644 index 000000000000..cdae3df581e7 --- /dev/null +++ b/tests/pending/run/t5271_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + case class C(foo: Int, bar: Int) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/pending/run/t5271_2.check b/tests/pending/run/t5271_2.check new file mode 100644 index 000000000000..1df88872a77e --- /dev/null +++ b/tests/pending/run/t5271_2.check @@ -0,0 +1,14 @@ +{ + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + val c = C.apply(2, 2); + Predef.println(c.foo.$times(c.bar)) +} +4 +() diff --git a/tests/pending/run/t5271_2.scala b/tests/pending/run/t5271_2.scala new file mode 100644 index 000000000000..654fa7b30b48 --- /dev/null +++ b/tests/pending/run/t5271_2.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + case class C(foo: Int, bar: Int) + val c = C(2, 2) + println(c.foo * c.bar) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/pending/run/t5271_3.check b/tests/pending/run/t5271_3.check new file mode 100644 index 000000000000..99aacc2cee74 --- /dev/null +++ b/tests/pending/run/t5271_3.check @@ -0,0 +1,21 @@ +{ + object C extends AnyRef { + def () = { + super.(); + () + }; + def qwe = 4 + }; + case class C extends Product with Serializable { + val foo: Int = _; + val bar: Int = _; + def (foo: Int, bar: Int) = { + super.(); + () + } + }; + val c = C.apply(2, 2); + Predef.println(c.foo.$times(c.bar).$eq$eq(C.qwe)) +} +true +() diff --git a/tests/pending/run/t5271_3.scala b/tests/pending/run/t5271_3.scala new file mode 100644 index 000000000000..2fa4cea77b33 --- /dev/null +++ b/tests/pending/run/t5271_3.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + object C { def qwe = 4 } + case class C(foo: Int, bar: Int) + val c = C(2, 2) + println(c.foo * c.bar == C.qwe) + }; + + val toolbox = cm.mkToolBox() + println(code.tree) + println(code.eval) +} diff --git a/tests/pending/run/t5271_4.scala b/tests/pending/run/t5271_4.scala new file mode 100644 index 000000000000..03cca7c48ddb --- /dev/null +++ b/tests/pending/run/t5271_4.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + case object C + }.eval +} diff --git a/tests/pending/run/t5272_1_newpatmat.check b/tests/pending/run/t5272_1_newpatmat.check new file mode 100644 index 000000000000..9f8d6f24e71f --- /dev/null +++ b/tests/pending/run/t5272_1_newpatmat.check @@ -0,0 +1 @@ +okay \ No newline at end of file diff --git a/tests/pending/run/t5272_1_newpatmat.scala b/tests/pending/run/t5272_1_newpatmat.scala new file mode 100644 index 000000000000..30d0c875d96b --- /dev/null +++ b/tests/pending/run/t5272_1_newpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case 2 => println("okay") + case _ => println("not okay") + } + }.eval +} diff --git a/tests/pending/run/t5272_1_oldpatmat.check b/tests/pending/run/t5272_1_oldpatmat.check new file mode 100644 index 000000000000..9f8d6f24e71f --- /dev/null +++ b/tests/pending/run/t5272_1_oldpatmat.check @@ -0,0 +1 @@ +okay \ No newline at end of file diff --git a/tests/pending/run/t5272_1_oldpatmat.scala b/tests/pending/run/t5272_1_oldpatmat.scala new file mode 100644 index 000000000000..30d0c875d96b --- /dev/null +++ b/tests/pending/run/t5272_1_oldpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case 2 => println("okay") + case _ => println("not okay") + } + }.eval +} diff --git a/tests/pending/run/t5272_2_newpatmat.check b/tests/pending/run/t5272_2_newpatmat.check new file mode 100644 index 000000000000..549f3f3af860 --- /dev/null +++ b/tests/pending/run/t5272_2_newpatmat.check @@ -0,0 +1 @@ +okay2 \ No newline at end of file diff --git a/tests/pending/run/t5272_2_newpatmat.scala b/tests/pending/run/t5272_2_newpatmat.scala new file mode 100644 index 000000000000..436f0fd4f843 --- /dev/null +++ b/tests/pending/run/t5272_2_newpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case x => println("okay" + x) + } + }.eval +} diff --git a/tests/pending/run/t5272_2_oldpatmat.check b/tests/pending/run/t5272_2_oldpatmat.check new file mode 100644 index 000000000000..549f3f3af860 --- /dev/null +++ b/tests/pending/run/t5272_2_oldpatmat.check @@ -0,0 +1 @@ +okay2 \ No newline at end of file diff --git a/tests/pending/run/t5272_2_oldpatmat.scala b/tests/pending/run/t5272_2_oldpatmat.scala new file mode 100644 index 000000000000..436f0fd4f843 --- /dev/null +++ b/tests/pending/run/t5272_2_oldpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + 2 match { + case x => println("okay" + x) + } + }.eval +} diff --git a/tests/pending/run/t5273_1_newpatmat.check b/tests/pending/run/t5273_1_newpatmat.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5273_1_newpatmat.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5273_1_newpatmat.scala b/tests/pending/run/t5273_1_newpatmat.scala new file mode 100644 index 000000000000..1ed2ce79af97 --- /dev/null +++ b/tests/pending/run/t5273_1_newpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + List(1, 2, 3) match { + case foo :: bar :: _ => println(foo * bar) + case _ => println("this is getting out of hand!") + } + }.eval +} diff --git a/tests/pending/run/t5273_1_oldpatmat.check b/tests/pending/run/t5273_1_oldpatmat.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5273_1_oldpatmat.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5273_1_oldpatmat.scala b/tests/pending/run/t5273_1_oldpatmat.scala new file mode 100644 index 000000000000..1ed2ce79af97 --- /dev/null +++ b/tests/pending/run/t5273_1_oldpatmat.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + List(1, 2, 3) match { + case foo :: bar :: _ => println(foo * bar) + case _ => println("this is getting out of hand!") + } + }.eval +} diff --git a/tests/pending/run/t5273_2a_newpatmat.check b/tests/pending/run/t5273_2a_newpatmat.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5273_2a_newpatmat.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5273_2a_newpatmat.scala b/tests/pending/run/t5273_2a_newpatmat.scala new file mode 100644 index 000000000000..cb4c151462b4 --- /dev/null +++ b/tests/pending/run/t5273_2a_newpatmat.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val foo :: bar :: _ = List(1, 2, 3) + println(foo * bar) + }.eval +} diff --git a/tests/pending/run/t5273_2a_oldpatmat.check b/tests/pending/run/t5273_2a_oldpatmat.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5273_2a_oldpatmat.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5273_2a_oldpatmat.scala b/tests/pending/run/t5273_2a_oldpatmat.scala new file mode 100644 index 000000000000..cb4c151462b4 --- /dev/null +++ b/tests/pending/run/t5273_2a_oldpatmat.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val foo :: bar :: _ = List(1, 2, 3) + println(foo * bar) + }.eval +} diff --git a/tests/pending/run/t5273_2b_newpatmat.check b/tests/pending/run/t5273_2b_newpatmat.check new file mode 100644 index 000000000000..c551774ca5c5 --- /dev/null +++ b/tests/pending/run/t5273_2b_newpatmat.check @@ -0,0 +1 @@ +name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/pending/run/t5273_2b_newpatmat.scala b/tests/pending/run/t5273_2b_newpatmat.scala new file mode 100644 index 000000000000..ca4a31566dc8 --- /dev/null +++ b/tests/pending/run/t5273_2b_newpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r + val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" + println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) + }.eval +} diff --git a/tests/pending/run/t5273_2b_oldpatmat.check b/tests/pending/run/t5273_2b_oldpatmat.check new file mode 100644 index 000000000000..c551774ca5c5 --- /dev/null +++ b/tests/pending/run/t5273_2b_oldpatmat.check @@ -0,0 +1 @@ +name = American Dollar, shortname = USD, value = 2,8567 diff --git a/tests/pending/run/t5273_2b_oldpatmat.scala b/tests/pending/run/t5273_2b_oldpatmat.scala new file mode 100644 index 000000000000..ca4a31566dc8 --- /dev/null +++ b/tests/pending/run/t5273_2b_oldpatmat.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r + val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext" + println("name = %s, shortname = %s, value = %s".format(name, shortname, value)) + }.eval +} diff --git a/tests/pending/run/t5274_1.check b/tests/pending/run/t5274_1.check new file mode 100644 index 000000000000..fca8bc3d3e57 --- /dev/null +++ b/tests/pending/run/t5274_1.check @@ -0,0 +1,3 @@ +50! = 30414093201713378043612608166064768844377641568960512000000000000 +49! = 608281864034267560872252163321295376887552831379210240000000000 +50!/49! = 50 diff --git a/tests/pending/run/t5274_1.scala b/tests/pending/run/t5274_1.scala new file mode 100644 index 000000000000..bc0ba99e45a1 --- /dev/null +++ b/tests/pending/run/t5274_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def factorial(n: BigInt): BigInt = + if (n == 0) 1 else n * factorial(n-1) + + val f50 = factorial(50); val f49 = factorial(49) + println("50! = " + f50) + println("49! = " + f49) + println("50!/49! = " + (f50 / f49)) + }.eval +} diff --git a/tests/pending/run/t5274_2.check b/tests/pending/run/t5274_2.check new file mode 100644 index 000000000000..375536cc296b --- /dev/null +++ b/tests/pending/run/t5274_2.check @@ -0,0 +1,2 @@ +[6,2,8,5,1] +[1,2,5,6,8] diff --git a/tests/pending/run/t5274_2.scala b/tests/pending/run/t5274_2.scala new file mode 100644 index 000000000000..b484111edd97 --- /dev/null +++ b/tests/pending/run/t5274_2.scala @@ -0,0 +1,51 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + /** Nested methods can use and even update everything + * visible in their scope (including local variables or + * arguments of enclosing methods). + */ + def sort(a: Array[Int]): Unit = { + + def swap(i: Int, j: Int): Unit = { + val t = a(i); a(i) = a(j); a(j) = t + } + + def sort1(l: Int, r: Int): Unit = { + val pivot = a((l + r) / 2) + var i = l + var j = r + while (i <= j) { + while (a(i) < pivot) i += 1 + while (a(j) > pivot) j -= 1 + if (i <= j) { + swap(i, j) + i += 1 + j -= 1 + } + } + if (l < j) sort1(l, j) + if (j < r) sort1(i, r) + } + + if (a.length > 0) + sort1(0, a.length - 1) + } + + def println(ar: Array[Int]): Unit = { + def print1 = { + def iter(i: Int): String = + ar(i) + (if (i < ar.length-1) "," + iter(i+1) else "") + if (ar.length == 0) "" else iter(0) + } + Console.println("[" + print1 + "]") + } + + val ar = Array(6, 2, 8, 5, 1) + println(ar) + sort(ar) + println(ar) + }.eval +} diff --git a/tests/pending/run/t5275.check b/tests/pending/run/t5275.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5275.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5275.scala b/tests/pending/run/t5275.scala new file mode 100644 index 000000000000..38b77abab9be --- /dev/null +++ b/tests/pending/run/t5275.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C(val foo: Int) + println(new C(2).foo) + }.eval +} diff --git a/tests/pending/run/t5276_1a.check b/tests/pending/run/t5276_1a.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5276_1a.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5276_1a.scala b/tests/pending/run/t5276_1a.scala new file mode 100644 index 000000000000..ad76b2e69fcf --- /dev/null +++ b/tests/pending/run/t5276_1a.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + lazy val x = 2 + println(x) + }.eval +} diff --git a/tests/pending/run/t5276_1b.check b/tests/pending/run/t5276_1b.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5276_1b.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5276_1b.scala b/tests/pending/run/t5276_1b.scala new file mode 100644 index 000000000000..8f11bdc6e6c7 --- /dev/null +++ b/tests/pending/run/t5276_1b.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + implicit lazy val x = 2 + println(implicitly[Int]) + }.eval +} diff --git a/tests/pending/run/t5276_2a.check b/tests/pending/run/t5276_2a.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5276_2a.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5276_2a.scala b/tests/pending/run/t5276_2a.scala new file mode 100644 index 000000000000..7086fc98306f --- /dev/null +++ b/tests/pending/run/t5276_2a.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + lazy val x = 2 + } + + println(new C().x) + }.eval +} diff --git a/tests/pending/run/t5276_2b.check b/tests/pending/run/t5276_2b.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t5276_2b.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t5276_2b.scala b/tests/pending/run/t5276_2b.scala new file mode 100644 index 000000000000..cccc76a2d3a4 --- /dev/null +++ b/tests/pending/run/t5276_2b.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + class C { + implicit lazy val x = 2 + def y = implicitly[Int] + } + + println(new C().y) + }.eval +} diff --git a/tests/pending/run/t5277_1.check b/tests/pending/run/t5277_1.check new file mode 100644 index 000000000000..a48033a30d48 --- /dev/null +++ b/tests/pending/run/t5277_1.check @@ -0,0 +1 @@ +10! = 3628800 diff --git a/tests/pending/run/t5277_1.scala b/tests/pending/run/t5277_1.scala new file mode 100644 index 000000000000..58009866600a --- /dev/null +++ b/tests/pending/run/t5277_1.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +import scala.language.{ implicitConversions, postfixOps } +object Test extends dotty.runtime.LegacyApp { + reify { + def fact(n: Int): BigInt = + if (n == 0) 1 else fact(n-1) * n + class Factorizer(n: Int) { + def ! = fact(n) + } + implicit def int2fact(n: Int) = new Factorizer(n) + + println("10! = " + (10!)) + }.eval +} diff --git a/tests/pending/run/t5277_2.check b/tests/pending/run/t5277_2.check new file mode 100644 index 000000000000..ca017e2a40cf --- /dev/null +++ b/tests/pending/run/t5277_2.check @@ -0,0 +1,2 @@ +2() +1() diff --git a/tests/pending/run/t5277_2.scala b/tests/pending/run/t5277_2.scala new file mode 100644 index 000000000000..33e31da27328 --- /dev/null +++ b/tests/pending/run/t5277_2.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + def p(implicit i: Int) = print(i) + implicit val v = 2 + + println(p) + println(p(1)) + }.eval +} diff --git a/tests/pending/run/t5279.check b/tests/pending/run/t5279.check new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/tests/pending/run/t5279.check @@ -0,0 +1 @@ +10 diff --git a/tests/pending/run/t5279.scala b/tests/pending/run/t5279.scala new file mode 100644 index 000000000000..ed151020455c --- /dev/null +++ b/tests/pending/run/t5279.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new Integer(10)) + }.eval +} diff --git a/tests/pending/run/t5284.check b/tests/pending/run/t5284.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5284.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5284.scala b/tests/pending/run/t5284.scala new file mode 100644 index 000000000000..cf5c0608b544 --- /dev/null +++ b/tests/pending/run/t5284.scala @@ -0,0 +1,25 @@ + + + + + +/** Here we have a situation where a normalized method parameter `W` + * is used in a position which accepts an instance of type `T` - we know we can + * safely cast `T` to `W` whenever type bounds on `W` hold. + */ +object Test { + def main(args: Array[String]): Unit = { + val a = Blarg(Array(1, 2, 3)) + println(a.m((x: Int) => x + 1)) + } +} + + +object Blarg { + def apply[T: Manifest](a: Array[T]) = new Blarg(a) +} + + +class Blarg[@specialized(Int) T: Manifest](val a: Array[T]) { + def m[@specialized(Int) W >: T, @specialized(Int) S](f: W => S) = f(a(0)) +} diff --git a/tests/pending/run/t5284b.check b/tests/pending/run/t5284b.check new file mode 100644 index 000000000000..71426ad0b788 --- /dev/null +++ b/tests/pending/run/t5284b.check @@ -0,0 +1,4 @@ +t5284b.scala:27: warning: type S is unused or used in non-specializable positions. + def bar[@specialized(Int) W <: T, @specialized(Int) S](w: W) = id(w) + ^ +17 diff --git a/tests/pending/run/t5284b.scala b/tests/pending/run/t5284b.scala new file mode 100644 index 000000000000..7f905143e635 --- /dev/null +++ b/tests/pending/run/t5284b.scala @@ -0,0 +1,28 @@ + + + + + + +/** Here we have a situation where a normalized method parameter `W` + * is used in a position which expects a type `T` - we know we can + * safely cast `W` to `T` whenever typebounds of `W` hold. + */ +object Test { + def main(args: Array[String]): Unit = { + val foo = Foo.createUnspecialized[Int] + println(foo.bar(17)) + } +} + + +object Foo { + def createUnspecialized[T] = new Foo[T] +} + + +class Foo[@specialized(Int) T] { + val id: T => T = x => x + + def bar[@specialized(Int) W <: T, @specialized(Int) S](w: W) = id(w) +} diff --git a/tests/pending/run/t5284c.check b/tests/pending/run/t5284c.check new file mode 100644 index 000000000000..cf578ad102ef --- /dev/null +++ b/tests/pending/run/t5284c.check @@ -0,0 +1,4 @@ +t5284c.scala:29: warning: type W is unused or used in non-specializable positions. + def bar[@specialized(Int) W <: T](ws: List[W]) = len(ws) + ^ +3 diff --git a/tests/pending/run/t5284c.scala b/tests/pending/run/t5284c.scala new file mode 100644 index 000000000000..8a20343a4613 --- /dev/null +++ b/tests/pending/run/t5284c.scala @@ -0,0 +1,30 @@ + + + + + + +/** Here we have a compound type `List[W]` used in + * a position where `List[T]` is expected. The cast + * emitted in the normalized `bar` is safe because the + * normalized `bar` can only be called if the type + * bounds hold. + */ +object Test { + def main(args: Array[String]): Unit = { + val foo = Foo.createUnspecialized[Int] + println(foo.bar(List(1, 2, 3))) + } +} + + +object Foo { + def createUnspecialized[T] = new Foo[T] +} + + +class Foo[@specialized(Int) T] { + val len: List[T] => Int = xs => xs.length + + def bar[@specialized(Int) W <: T](ws: List[W]) = len(ws) +} diff --git a/tests/pending/run/t5293-map.scala b/tests/pending/run/t5293-map.scala new file mode 100644 index 000000000000..1ef7d97e5b81 --- /dev/null +++ b/tests/pending/run/t5293-map.scala @@ -0,0 +1,88 @@ + + + +import scala.collection.JavaConverters._ + + + +object Test extends dotty.runtime.LegacyApp { + + def bench(label: String)(body: => Unit): Long = { + val start = System.nanoTime + + 0.until(10).foreach(_ => body) + + val end = System.nanoTime + + //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0)) + + end - start + } + + def benchJava(values: java.util.Map[Int, Int]) = { + bench("Java Map") { + val m = new java.util.HashMap[Int, Int] + + m.putAll(values) + } + } + + def benchScala(values: Iterable[(Int, Int)]) = { + bench("Scala Map") { + val m = new scala.collection.mutable.HashMap[Int, Int] + + m ++= values + } + } + + def benchScalaSorted(values: Iterable[(Int, Int)]) = { + bench("Scala Map sorted") { + val m = new scala.collection.mutable.HashMap[Int, Int] + + m ++= values.toArray.sorted + } + } + + def benchScalaPar(values: Iterable[(Int, Int)]) = { + bench("Scala ParMap") { + val m = new scala.collection.parallel.mutable.ParHashMap[Int, Int] map { x => x } + + m ++= values + } + } + + val total = 50000 + val values = (0 until total) zip (0 until total) + val map = scala.collection.mutable.HashMap.empty[Int, Int] + + map ++= values + + // warmup + for (x <- 0 until 5) { + benchJava(map.asJava) + benchScala(map) + benchScalaPar(map) + benchJava(map.asJava) + benchScala(map) + benchScalaPar(map) + } + + val javamap = benchJava(map.asJava) + val scalamap = benchScala(map) + val scalaparmap = benchScalaPar(map) + + // println(javamap) + // println(scalamap) + // println(scalaparmap) + + assert(scalamap < (javamap * 10), "scalamap: " + scalamap + " vs. javamap: " + javamap) + assert(scalaparmap < (javamap * 10), "scalaparmap: " + scalaparmap + " vs. javamap: " + javamap) +} + + + + + + + + diff --git a/tests/pending/run/t5293.scala b/tests/pending/run/t5293.scala new file mode 100644 index 000000000000..8a99989c5f4e --- /dev/null +++ b/tests/pending/run/t5293.scala @@ -0,0 +1,83 @@ + + + +import scala.collection.JavaConverters._ + + + +object Test extends dotty.runtime.LegacyApp { + + def bench(label: String)(body: => Unit): Long = { + val start = System.nanoTime + + 0.until(10).foreach(_ => body) + + val end = System.nanoTime + + //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0)) + + end - start + } + + def benchJava(values: java.util.Collection[Int]) = { + bench("Java Set") { + val set = new java.util.HashSet[Int] + + set.addAll(values) + } + } + + def benchScala(values: Iterable[Int]) = { + bench("Scala Set") { + val set = new scala.collection.mutable.HashSet[Int] + + set ++= values + } + } + + def benchScalaSorted(values: Iterable[Int]) = { + bench("Scala Set sorted") { + val set = new scala.collection.mutable.HashSet[Int] + + set ++= values.toArray.sorted + } + } + + def benchScalaPar(values: Iterable[Int]) = { + bench("Scala ParSet") { + val set = new scala.collection.parallel.mutable.ParHashSet[Int] map { x => x } + + set ++= values + } + } + + val values = 0 until 50000 + val set = scala.collection.mutable.HashSet.empty[Int] + + set ++= values + + // warmup + for (x <- 0 until 5) { + benchJava(set.asJava) + benchScala(set) + benchScalaPar(set) + benchJava(set.asJava) + benchScala(set) + benchScalaPar(set) + } + + val javaset = benchJava(set.asJava) + val scalaset = benchScala(set) + val scalaparset = benchScalaPar(set) + + assert(scalaset < (javaset * 8), "scalaset: " + scalaset + " vs. javaset: " + javaset) + assert(scalaparset < (javaset * 8), "scalaparset: " + scalaparset + " vs. javaset: " + javaset) +} + + + + + + + + diff --git a/tests/pending/run/t5300.scala b/tests/pending/run/t5300.scala new file mode 100644 index 000000000000..0f1c807177ad --- /dev/null +++ b/tests/pending/run/t5300.scala @@ -0,0 +1,7 @@ +object Test { + val pf: PartialFunction[Any, Unit] = { case _ => () } + + def main(args: Array[String]): Unit = { + pf orElse pf + } +} diff --git a/tests/pending/run/t5313.check b/tests/pending/run/t5313.check new file mode 100644 index 000000000000..7a48b2b71176 --- /dev/null +++ b/tests/pending/run/t5313.check @@ -0,0 +1,12 @@ +STORE_LOCAL(variable kept1) +STORE_LOCAL(value result) +STORE_LOCAL(variable kept1) +STORE_LOCAL(variable kept2) +STORE_LOCAL(value kept3) +STORE_LOCAL(variable kept2) +STORE_LOCAL(variable kept4) +STORE_LOCAL(variable kept4) +STORE_LOCAL(variable kept5) +STORE_LOCAL(variable kept5) +STORE_LOCAL(variable kept6) +STORE_LOCAL(variable kept6) diff --git a/tests/pending/run/t5313.scala b/tests/pending/run/t5313.scala new file mode 100644 index 000000000000..0d7168fa8968 --- /dev/null +++ b/tests/pending/run/t5313.scala @@ -0,0 +1,54 @@ +import scala.tools.partest.IcodeComparison + +object Test extends IcodeComparison { + override def printIcodeAfterPhase = "dce" + + override def extraSettings: String = super.extraSettings + " -optimize" + + override def code = + """class Foo { + def randomBoolean = scala.util.Random.nextInt % 2 == 0 + def bar = { + var kept1 = new Object + val result = new java.lang.ref.WeakReference(kept1) + kept1 = null // we can't eliminate this assigment because result can observe + // when the object has no more references. See SI-5313 + kept1 = new Object // but we can eliminate this one because kept1 has already been clobbered + var erased2 = null // we can eliminate this store because it's never used + val erased3 = erased2 // and this + var erased4 = erased2 // and this + val erased5 = erased4 // and this + var kept2: Object = new Object // ultimately can't be eliminated + while(randomBoolean) { + val kept3 = kept2 + kept2 = null // this can't, because it clobbers kept2, which is used + erased4 = null // safe to eliminate + println(kept3) + } + var kept4 = new Object // have to keep, it's used + try + println(kept4) + catch { + case _ : Throwable => kept4 = null // have to keep, it clobbers kept4 which is used + } + var kept5 = new Object + print(kept5) + kept5 = null // can't eliminate it's a clobber and it's used + print(kept5) + kept5 = null // can eliminate because we don't care about clobbers of nulls + while(randomBoolean) { + var kept6: AnyRef = null // not used, but have to keep because it clobbers the next used store + // on the back edge of the loop + kept6 = new Object // used + println(kept6) + } + result + } + }""".stripMargin + + override def show() { + val storeLocal = "STORE_LOCAL" + val lines1 = collectIcode() filter (_ contains storeLocal) map (x => x.drop(x.indexOf(storeLocal))) + println(lines1 mkString "\n") + } +} diff --git a/tests/pending/run/t5328.check b/tests/pending/run/t5328.check new file mode 100644 index 000000000000..77a43968c56d --- /dev/null +++ b/tests/pending/run/t5328.check @@ -0,0 +1,3 @@ +2 +1,2,8 +1,8,3 diff --git a/tests/pending/run/t5328.scala b/tests/pending/run/t5328.scala new file mode 100644 index 000000000000..74c8ace89c52 --- /dev/null +++ b/tests/pending/run/t5328.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(Vector(1).view.updated(0,2).toList mkString ",") + println(Seq(1,2,3).view.updated(2,8).toList mkString ",") + println(List(1,2,3).view.updated(1,8).toList mkString ",") +} diff --git a/tests/pending/run/t5334_1.check b/tests/pending/run/t5334_1.check new file mode 100644 index 000000000000..96d80cd6c4e7 --- /dev/null +++ b/tests/pending/run/t5334_1.check @@ -0,0 +1 @@ +C \ No newline at end of file diff --git a/tests/pending/run/t5334_1.scala b/tests/pending/run/t5334_1.scala new file mode 100644 index 000000000000..58954c2f98dd --- /dev/null +++ b/tests/pending/run/t5334_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { override def toString = "C" } + val ret = new C + ret.asInstanceOf[Object] + }; + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/pending/run/t5334_2.check b/tests/pending/run/t5334_2.check new file mode 100644 index 000000000000..613d286a1881 --- /dev/null +++ b/tests/pending/run/t5334_2.check @@ -0,0 +1 @@ +List((C,C)) \ No newline at end of file diff --git a/tests/pending/run/t5334_2.scala b/tests/pending/run/t5334_2.scala new file mode 100644 index 000000000000..1058194056d0 --- /dev/null +++ b/tests/pending/run/t5334_2.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + class C { override def toString() = "C" } + val ret = List((new C, new C)) + ret.asInstanceOf[List[Any]] + }; + + val toolbox = cm.mkToolBox() + println(toolbox.eval(code.tree)) +} diff --git a/tests/pending/run/t5335.check b/tests/pending/run/t5335.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5335.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5335.scala b/tests/pending/run/t5335.scala new file mode 100644 index 000000000000..c85c5730e6d8 --- /dev/null +++ b/tests/pending/run/t5335.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println(new {def x = 2}.x) + }.eval +} diff --git a/tests/pending/run/t5356.check b/tests/pending/run/t5356.check new file mode 100644 index 000000000000..7522e7ea7480 --- /dev/null +++ b/tests/pending/run/t5356.check @@ -0,0 +1,6 @@ +1 java.lang.Integer +1 java.lang.Integer +1 scala.math.BigInt +1 java.lang.Double +1 java.lang.Float +1 diff --git a/tests/pending/run/t5356.scala b/tests/pending/run/t5356.scala new file mode 100644 index 000000000000..dabb9ef8557a --- /dev/null +++ b/tests/pending/run/t5356.scala @@ -0,0 +1,14 @@ + +import scala.language.{ reflectiveCalls } +object Test { + def f(x: Any { def toInt: Int }) = println(x.toInt + " " + x.getClass.getName) + + def main(args: Array[String]): Unit = { + f(1) + f(1.toInt) + f(BigInt(1)) + f(1d) + f(1f) + println((1: (Any { def toInt: Int })).toInt) + } +} diff --git a/tests/pending/run/t5375.check b/tests/pending/run/t5375.check new file mode 100644 index 000000000000..b1a57eeeecad --- /dev/null +++ b/tests/pending/run/t5375.check @@ -0,0 +1 @@ +Runtime exception diff --git a/tests/pending/run/t5375.scala b/tests/pending/run/t5375.scala new file mode 100644 index 000000000000..8c2c06fde30a --- /dev/null +++ b/tests/pending/run/t5375.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + val foos = (1 to 1000).toSeq + try + foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i) + catch { + case ex: RuntimeException => println("Runtime exception") + } +} diff --git a/tests/pending/run/t5377.check b/tests/pending/run/t5377.check new file mode 100644 index 000000000000..7bd0e297bfeb --- /dev/null +++ b/tests/pending/run/t5377.check @@ -0,0 +1,18 @@ +1 List(1) +1 List(1) +2 List(1, 2) List(2, 1) +2 List(1, 2) List(2, 1) +2 List(2, 1) List(1, 2) +2 List(2, 1) List(1, 2) +3 List(1, 2, 3) List(1, 3, 2) List(2, 1, 3) List(2, 3, 1) List(3, 1, 2) List(3, 2, 1) +3 List(1, 2, 3) List(1, 3, 2) List(2, 1, 3) List(2, 3, 1) List(3, 1, 2) List(3, 2, 1) +3 List(1, 3, 2) List(1, 2, 3) List(3, 1, 2) List(3, 2, 1) List(2, 1, 3) List(2, 3, 1) +3 List(1, 3, 2) List(1, 2, 3) List(3, 1, 2) List(3, 2, 1) List(2, 1, 3) List(2, 3, 1) +3 List(2, 1, 3) List(2, 3, 1) List(1, 2, 3) List(1, 3, 2) List(3, 2, 1) List(3, 1, 2) +3 List(2, 1, 3) List(2, 3, 1) List(1, 2, 3) List(1, 3, 2) List(3, 2, 1) List(3, 1, 2) +3 List(2, 3, 1) List(2, 1, 3) List(3, 2, 1) List(3, 1, 2) List(1, 2, 3) List(1, 3, 2) +3 List(2, 3, 1) List(2, 1, 3) List(3, 2, 1) List(3, 1, 2) List(1, 2, 3) List(1, 3, 2) +3 List(3, 1, 2) List(3, 2, 1) List(1, 3, 2) List(1, 2, 3) List(2, 3, 1) List(2, 1, 3) +3 List(3, 1, 2) List(3, 2, 1) List(1, 3, 2) List(1, 2, 3) List(2, 3, 1) List(2, 1, 3) +3 List(3, 2, 1) List(3, 1, 2) List(2, 3, 1) List(2, 1, 3) List(1, 3, 2) List(1, 2, 3) +3 List(3, 2, 1) List(3, 1, 2) List(2, 3, 1) List(2, 1, 3) List(1, 3, 2) List(1, 2, 3) diff --git a/tests/pending/run/t5377.scala b/tests/pending/run/t5377.scala new file mode 100644 index 000000000000..2e8fb1a6af05 --- /dev/null +++ b/tests/pending/run/t5377.scala @@ -0,0 +1,47 @@ +object Test { + def testPermutations1(num: Int, stream: Stream[Int]): Unit = { + val perm = stream.permutations + print(num) + while(perm.hasNext) { + print(" " + perm.next().toList) + } + println() + } + def testPermutations2(num: Int, stream: List[Int]): Unit = { + val perm = stream.permutations + print(num) + while(perm.hasNext) { + print(" " + perm.next().toList) + } + println() + } + + def main(args: Array[String]): Unit = { + testPermutations1(1, Stream(1)) + testPermutations2(1, List(1)) + + testPermutations1(2, Stream(1, 2)) + testPermutations2(2, List(1, 2)) + + testPermutations1(2, Stream(2, 1)) + testPermutations2(2, List(2, 1)) + + testPermutations1(3, Stream(1, 2, 3)) + testPermutations2(3, List(1, 2, 3)) + + testPermutations1(3, Stream(1, 3, 2)) + testPermutations2(3, List(1, 3, 2)) + + testPermutations1(3, Stream(2, 1, 3)) + testPermutations2(3, List(2, 1, 3)) + + testPermutations1(3, Stream(2, 3, 1)) + testPermutations2(3, List(2, 3, 1)) + + testPermutations1(3, Stream(3, 1, 2)) + testPermutations2(3, List(3, 1, 2)) + + testPermutations1(3, Stream(3, 2, 1)) + testPermutations2(3, List(3, 2, 1)) + } +} diff --git a/tests/pending/run/t5380.check b/tests/pending/run/t5380.check new file mode 100644 index 000000000000..731a798301cb --- /dev/null +++ b/tests/pending/run/t5380.check @@ -0,0 +1,9 @@ +t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + val f = () => return try { 1 } catch { case _: Throwable => 0 } + ^ +t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + val f = () => return try { 1 } catch { case _: Throwable => 0 } + ^ +t5380.scala:3: warning: enclosing method main has result type Unit: return value discarded + val f = () => return try { 1 } catch { case _: Throwable => 0 } + ^ diff --git a/tests/pending/run/t5380.scala b/tests/pending/run/t5380.scala new file mode 100644 index 000000000000..a5f793c1d915 --- /dev/null +++ b/tests/pending/run/t5380.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val f = () => return try { 1 } catch { case _: Throwable => 0 } + f() + } +} diff --git a/tests/pending/run/t5385.check b/tests/pending/run/t5385.check new file mode 100644 index 000000000000..1df74fcfb5cf --- /dev/null +++ b/tests/pending/run/t5385.check @@ -0,0 +1,8 @@ +[0:9] class Azz +[0:9] class Bzz +[0:9] class Czz +[0:9] class Dzz +[0:11] class Ezz +[0:11] class Fzz +[0:13] class Gzz +[0:13] class Hzz diff --git a/tests/pending/run/t5385.scala b/tests/pending/run/t5385.scala new file mode 100644 index 000000000000..b803897e71cc --- /dev/null +++ b/tests/pending/run/t5385.scala @@ -0,0 +1,16 @@ +import scala.tools.partest._ + +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -Yrangepos" + override def sources = List( + "class Azz", "class Bzz ", "class Czz ", "class Dzz\n", + "class Ezz{}", "class Fzz{} ", "class Gzz { }", "class Hzz { } " + ) + def check(source: String, unit: CompilationUnit) { + unit.body foreach { + case cdef: ClassDef => println("%-15s class %s".format(cdef.pos.show, cdef.name)) + case _ => + } + } +} diff --git a/tests/pending/run/t5387.scala b/tests/pending/run/t5387.scala new file mode 100644 index 000000000000..dabf9e201ed5 --- /dev/null +++ b/tests/pending/run/t5387.scala @@ -0,0 +1,15 @@ +/* + * This tests that the predicate of dropWhile is only evaluated as often as needed, see https://issues.scala-lang.org/browse/SI-5387 + */ +import scala.collection.immutable.ListMap +object Test extends dotty.runtime.LegacyApp{ + val subject = ListMap(1->1,2->2,3->3,4->4,5->5) + val result = ListMap(3->3,4->4,5->5) + assert( result == subject.dropWhile{ + case (key, value) => { + assert( key <= 3, "predicate evaluated more often than needed, key "+key ) + key < 3 + } + } + ) +} diff --git a/tests/pending/run/t5394.scala b/tests/pending/run/t5394.scala new file mode 100644 index 000000000000..5f649ee0a53a --- /dev/null +++ b/tests/pending/run/t5394.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + def f[T](l: List[T]): Int = l match { case x :: xs => f(xs) case Nil => 0 } + f(List.fill(10000)(0)) +} diff --git a/tests/pending/run/t5407.check b/tests/pending/run/t5407.check new file mode 100644 index 000000000000..51993f072d58 --- /dev/null +++ b/tests/pending/run/t5407.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/tests/pending/run/t5407.scala b/tests/pending/run/t5407.scala new file mode 100644 index 000000000000..cc761e5c008c --- /dev/null +++ b/tests/pending/run/t5407.scala @@ -0,0 +1,17 @@ +case class Foo(private val x: Int, y: Option[Int], z: Boolean) + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, y, z) => 0 + } + val x = Foo(1, Some(2), false) + println(foo(x)) + + + def bar(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, None, z) => 0 + } + println(bar(x)) +} diff --git a/tests/pending/run/t5415.scala b/tests/pending/run/t5415.scala new file mode 100644 index 000000000000..cdc90b8aed5d --- /dev/null +++ b/tests/pending/run/t5415.scala @@ -0,0 +1,12 @@ +object Test extends dotty.runtime.LegacyApp{ + case class Queryable2[T]() { def filter(predicate: T => Boolean) = ??? } + trait CoffeesTable{ def sales : Int } + val q = Queryable2[CoffeesTable]() + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{universe => ru} + val code = reify{q.filter(_.sales > 5)} + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(code.tree) +} diff --git a/tests/pending/run/t5418.scala b/tests/pending/run/t5418.scala new file mode 100644 index 000000000000..beec4370d59e --- /dev/null +++ b/tests/pending/run/t5418.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + new Object().getClass + }.eval +} diff --git a/tests/pending/run/t5418a.check b/tests/pending/run/t5418a.check new file mode 100644 index 000000000000..527022936d90 --- /dev/null +++ b/tests/pending/run/t5418a.check @@ -0,0 +1 @@ +Expr[Class[_ <: java.lang.Object]](new Object().getClass()) diff --git a/tests/pending/run/t5418a.scala b/tests/pending/run/t5418a.scala new file mode 100644 index 000000000000..7223486851b6 --- /dev/null +++ b/tests/pending/run/t5418a.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.runtime.universe.reify(new Object().getClass)) +} diff --git a/tests/pending/run/t5418b.check b/tests/pending/run/t5418b.check new file mode 100644 index 000000000000..f036a4be849b --- /dev/null +++ b/tests/pending/run/t5418b.check @@ -0,0 +1,2 @@ +new Object().getClass() +TypeRef(ThisType(java.lang), java.lang.Class, List(TypeRef(NoPrefix, TypeName("?0"), List()))) diff --git a/tests/pending/run/t5418b.scala b/tests/pending/run/t5418b.scala new file mode 100644 index 000000000000..650700ae26fd --- /dev/null +++ b/tests/pending/run/t5418b.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val untyped = reify(new Object().getClass).tree + val typed = tb.typecheck(untyped) + println(typed) + println(showRaw(typed.tpe)) +} diff --git a/tests/pending/run/t5419.check b/tests/pending/run/t5419.check new file mode 100644 index 000000000000..a9c0f262e373 --- /dev/null +++ b/tests/pending/run/t5419.check @@ -0,0 +1 @@ +5: @Foo.asInstanceOf[Int] diff --git a/tests/pending/run/t5419.scala b/tests/pending/run/t5419.scala new file mode 100644 index 000000000000..e0ee02a5cbe9 --- /dev/null +++ b/tests/pending/run/t5419.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +class Foo extends annotation.StaticAnnotation + +object Test extends dotty.runtime.LegacyApp { + val tree = reify{(5: @Foo).asInstanceOf[Int]}.tree + println(tree.toString) +} diff --git a/tests/pending/run/t5423.check b/tests/pending/run/t5423.check new file mode 100644 index 000000000000..ae3d3fb82b77 --- /dev/null +++ b/tests/pending/run/t5423.check @@ -0,0 +1 @@ +List(table) \ No newline at end of file diff --git a/tests/pending/run/t5423.scala b/tests/pending/run/t5423.scala new file mode 100644 index 000000000000..98aeda1299dc --- /dev/null +++ b/tests/pending/run/t5423.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +final class table extends annotation.StaticAnnotation +@table class A + +object Test extends dotty.runtime.LegacyApp { + val s = cm.classSymbol(classOf[A]) + println(s.annotations) +} diff --git a/tests/pending/run/t5428.check b/tests/pending/run/t5428.check new file mode 100644 index 000000000000..52fce0939968 --- /dev/null +++ b/tests/pending/run/t5428.check @@ -0,0 +1,2 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +Stack(8, 7, 6, 5, 4, 3) diff --git a/tests/pending/run/t5428.scala b/tests/pending/run/t5428.scala new file mode 100644 index 000000000000..697dcbf5c9dc --- /dev/null +++ b/tests/pending/run/t5428.scala @@ -0,0 +1,29 @@ + + + +import collection.mutable.{Stack, StackProxy} + + + +class A extends StackProxy[Int] { + val self = Stack[Int]() +} + + +object Test { + + def main(args: Array[String]): Unit = { + val a = new A + + a push 3 + a push 4 + a push 5 + + a.push(6, 7, 8) + + println(a) + + a.pop + } + +} diff --git a/tests/pending/run/t5488-fn.check b/tests/pending/run/t5488-fn.check new file mode 100644 index 000000000000..18907d0ab8f9 --- /dev/null +++ b/tests/pending/run/t5488-fn.check @@ -0,0 +1,17 @@ +B$mcII$sp +B$mcIL$sp +B$mcIV$sp +B$mcLI$sp +B +B$mcLV$sp +B$mcVI$sp +B$mcVL$sp +B$mcVV$sp +C$mcIII$sp +C$mcIIL$sp +C$mcILI$sp +C$mcILL$sp +C$mcLII$sp +C$mcLIL$sp +C$mcLLI$sp +C diff --git a/tests/pending/run/t5488-fn.scala b/tests/pending/run/t5488-fn.scala new file mode 100644 index 000000000000..b744017d71b9 --- /dev/null +++ b/tests/pending/run/t5488-fn.scala @@ -0,0 +1,27 @@ +class B[@specialized(Int, AnyRef, Unit) A, @specialized(Int, AnyRef, Unit) B](f: A => B) +class C[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int, AnyRef) C](f: (A, B) => C) + +object Test { + def main(args:Array[String]): Unit = { + def show(x: Any) = println(x.getClass.getName) + + show(new B((x: Int) => 1)) + show(new B((x: Int) => "abc")) + show(new B((x: Int) => ())) + show(new B((x: AnyRef) => 1)) + show(new B((x: AnyRef) => "abc")) + show(new B((x: AnyRef) => ())) + show(new B((x: Unit) => 1)) + show(new B((x: Unit) => "abc")) + show(new B((x: Unit) => ())) + + show(new C((x: Int, y: Int) => 1)) + show(new C((x: Int, y: Int) => "abc")) + show(new C((x: Int, y: AnyRef) => 1)) + show(new C((x: Int, y: AnyRef) => "abc")) + show(new C((x: AnyRef, y: Int) => 1)) + show(new C((x: AnyRef, y: Int) => "abc")) + show(new C((x: AnyRef, y: AnyRef) => 1)) + show(new C((x: AnyRef, y: AnyRef) => "abc")) + } +} diff --git a/tests/pending/run/t5488.check b/tests/pending/run/t5488.check new file mode 100644 index 000000000000..ccd98c4dbce8 --- /dev/null +++ b/tests/pending/run/t5488.check @@ -0,0 +1,14 @@ +A0$mcI$sp +A0 +B0$mcII$sp +B0$mcIL$sp +B0$mcLI$sp +B0 +C0$mcIII$sp +C0$mcIIL$sp +C0$mcILI$sp +C0$mcILL$sp +C0$mcLII$sp +C0$mcLIL$sp +C0$mcLLI$sp +C0 diff --git a/tests/pending/run/t5488.scala b/tests/pending/run/t5488.scala new file mode 100644 index 000000000000..e0315f0b877d --- /dev/null +++ b/tests/pending/run/t5488.scala @@ -0,0 +1,26 @@ +class A0[@specialized(Int, AnyRef) A]() +class B0[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B]() +class C0[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int, AnyRef) C]() + +object Test { + def main(args:Array[String]): Unit = { + def show(x: Any) = println(x.getClass.getName) + + show(new A0[Int]()) + show(new A0[AnyRef]()) + + show(new B0[Int, Int]()) + show(new B0[Int, AnyRef]()) + show(new B0[AnyRef, Int]()) + show(new B0[AnyRef, AnyRef]()) + + show(new C0[Int, Int, Int]()) + show(new C0[Int, Int, AnyRef]()) + show(new C0[Int, AnyRef, Int]()) + show(new C0[Int, AnyRef, AnyRef]()) + show(new C0[AnyRef, Int, Int]()) + show(new C0[AnyRef, Int, AnyRef]()) + show(new C0[AnyRef, AnyRef, Int]()) + show(new C0[AnyRef, AnyRef, AnyRef]()) + } +} diff --git a/tests/pending/run/t5500.check b/tests/pending/run/t5500.check new file mode 100644 index 000000000000..19c6dda00e64 --- /dev/null +++ b/tests/pending/run/t5500.check @@ -0,0 +1,2 @@ +C1$mcLI$sp +C2$mcLI$sp diff --git a/tests/pending/run/t5500.scala b/tests/pending/run/t5500.scala new file mode 100644 index 000000000000..881a83ca9bd7 --- /dev/null +++ b/tests/pending/run/t5500.scala @@ -0,0 +1,12 @@ +import scala.{specialized => spec} + +class C1[@spec(Int, AnyRef) A, @spec(Int, AnyRef) B](v:A, w:B) + +class C2[@spec(Unit, Boolean, Byte, Char, Short, Int, Long, Float, Double, AnyRef) A, @spec(Unit, Boolean, Byte, Char, Short, Int, Long, Float, Double, AnyRef) B](v:A, w:B) + +object Test { + def main(args:Array[String]): Unit = { + println(new C1("abc", 123).getClass.getName) + println(new C2[String, Int]("abc", 123).getClass.getName) + } +} diff --git a/tests/pending/run/t5500b.check b/tests/pending/run/t5500b.check new file mode 100644 index 000000000000..4259b24b5342 --- /dev/null +++ b/tests/pending/run/t5500b.check @@ -0,0 +1,28 @@ +C1A$mcLI$sp +C1A$mcLD$sp +C1A +C1A$mcII$sp +C1A$mcID$sp +C1A$mcIL$sp +C1A$mcDI$sp +C1A$mcDD$sp +C1A$mcDL$sp +C1B$mcLI$sp +C1B$mcLD$sp +C1B +C1B$mcII$sp +C1B$mcID$sp +C1B$mcIL$sp +C1B$mcDI$sp +C1B$mcDD$sp +C1B$mcDL$sp +C1C$mcLI$sp +C1C$mcLI$sp +C1C$mcLD$sp +C1C +C1C$mcII$sp +C1C$mcID$sp +C1C$mcIL$sp +C1C$mcDI$sp +C1C$mcDD$sp +C1C$mcDL$sp diff --git a/tests/pending/run/t5500b.scala b/tests/pending/run/t5500b.scala new file mode 100644 index 000000000000..0d8edc094775 --- /dev/null +++ b/tests/pending/run/t5500b.scala @@ -0,0 +1,51 @@ +import scala.{specialized => spec} + +class C1A[ + @spec(Double, Int, AnyRef) A, + @spec(Double, Int, AnyRef) B +] + +class C1B[ + @spec(Double, Int, AnyRef) A, + @spec(Double, Int, AnyRef) B +](v: A) + +class C1C[ + @spec(Double, Int, AnyRef) A, + @spec(Double, Int, AnyRef) B +](v:A, w:B) + +object Test { + def main(args:Array[String]): Unit = { + println(new C1A[String, Int].getClass.getName) + println(new C1A[String, Double].getClass.getName) + println(new C1A[String, String].getClass.getName) + println(new C1A[Int, Int].getClass.getName) + println(new C1A[Int, Double].getClass.getName) + println(new C1A[Int, String].getClass.getName) + println(new C1A[Double, Int].getClass.getName) + println(new C1A[Double, Double].getClass.getName) + println(new C1A[Double, String].getClass.getName) + + println(new C1B[String, Int]("abc").getClass.getName) + println(new C1B[String, Double]("abc").getClass.getName) + println(new C1B[String, String]("abc").getClass.getName) + println(new C1B[Int, Int](1).getClass.getName) + println(new C1B[Int, Double](1).getClass.getName) + println(new C1B[Int, String](1).getClass.getName) + println(new C1B[Double, Int](1d).getClass.getName) + println(new C1B[Double, Double](1d).getClass.getName) + println(new C1B[Double, String](1d).getClass.getName) + + println(new C1C("abc", 123).getClass.getName) + println(new C1C("abc", 123).getClass.getName) + println(new C1C("a", 1d).getClass.getName) + println(new C1C("a", "a").getClass.getName) + println(new C1C(1, 1).getClass.getName) + println(new C1C(1, 1d).getClass.getName) + println(new C1C(1, "a").getClass.getName) + println(new C1C(1d, 1).getClass.getName) + println(new C1C(1d, 1d).getClass.getName) + println(new C1C(1d, "a").getClass.getName) + } +} diff --git a/tests/pending/run/t5530.check b/tests/pending/run/t5530.check new file mode 100644 index 000000000000..1013e3356f41 --- /dev/null +++ b/tests/pending/run/t5530.check @@ -0,0 +1,2 @@ +something like this + 7 now works!. diff --git a/tests/pending/run/t5530.scala b/tests/pending/run/t5530.scala new file mode 100644 index 000000000000..7975abca1c66 --- /dev/null +++ b/tests/pending/run/t5530.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(s"""something like this + ${3+4} now works!.""") +} diff --git a/tests/pending/run/t5532.scala b/tests/pending/run/t5532.scala new file mode 100644 index 000000000000..6304ec644101 --- /dev/null +++ b/tests/pending/run/t5532.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x = s"1" + val y = s"2" +} diff --git a/tests/pending/run/t5535.check b/tests/pending/run/t5535.check new file mode 100644 index 000000000000..84097ccea900 --- /dev/null +++ b/tests/pending/run/t5535.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def h()(i: Int) = 1 + i +h: ()(i: Int)Int + +scala> println(h()(5)) +6 + +scala> val f = h() _ +f: Int => Int = + +scala> println(f(10)) +11 + +scala> :quit diff --git a/tests/pending/run/t5535.scala b/tests/pending/run/t5535.scala new file mode 100644 index 000000000000..7bc12f347043 --- /dev/null +++ b/tests/pending/run/t5535.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +def h()(i: Int) = 1 + i +println(h()(5)) +val f = h() _ +println(f(10)) + """ +} diff --git a/tests/pending/run/t5537.check b/tests/pending/run/t5537.check new file mode 100644 index 000000000000..98265ccc9228 --- /dev/null +++ b/tests/pending/run/t5537.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> List[Predef.type]() +res0: List[scala.Predef.type] = List() + +scala> List[scala.`package`.type]() +res1: List[scala.type] = List() + +scala> List[List.type]() +res2: List[scala.collection.immutable.List.type] = List() + +scala> List[Set.type]() +res3: List[Set.type] = List() + +scala> :quit diff --git a/tests/pending/run/t5537.scala b/tests/pending/run/t5537.scala new file mode 100644 index 000000000000..ae88dcc11fef --- /dev/null +++ b/tests/pending/run/t5537.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +List[Predef.type]() +List[scala.`package`.type]() +List[List.type]() +List[Set.type]() + """ +} diff --git a/tests/pending/run/t5543.check b/tests/pending/run/t5543.check new file mode 100644 index 000000000000..2ef2d51ff47e --- /dev/null +++ b/tests/pending/run/t5543.check @@ -0,0 +1,9 @@ +Test, 7, 119 +m, 3, 19 +Test, 5, 85 +T +C +T +T +D +T diff --git a/tests/pending/run/t5543.scala b/tests/pending/run/t5543.scala new file mode 100644 index 000000000000..1144184d7a1c --- /dev/null +++ b/tests/pending/run/t5543.scala @@ -0,0 +1,45 @@ + +object Test extends Function0[Int] { + // this and v resolve to Test.this, Test.v not A.this, A.v + class A(x: Function0[Int] = this)(val a: Int = v, val b: Int = v * x()) extends Function0[Int] { + val v = 3 + override def toString = x.toString +", "+ a +", "+ b + // ordinary instance scope + def m(i: Int = v, y: Function0[Int] = this) = "m, "+ i +", "+ y() + def apply() = 19 + } + object A { + val v = 5 + // should happily coexist with default getters, in a happier world + def init(x: Function0[Int] = Test.this)(a: Int = v, b: Int = v * x()) = x.toString +", "+ a +", "+ b + override def toString = "A" + } + val v = 7 + def apply() = 17 + override def toString = "Test" + def main(args: Array[String]): Unit = { + val sut = new A()() + println(sut.toString) + println(sut.m()) + println(A.init()()) + + println((new T.C()).x) + println((new T.D(0,0)).x) + } +} + +object T { + override def toString = "T" + + // `this` refers to T + class C(val x: Any = {println(this); this}) { // prints T + println(this) // prints C + override def toString() = "C" + } + + class D(val x: Any) { + override def toString() = "D" + // `this` refers again to T + def this(a: Int, b: Int, c: Any = {println(this); this}) = { this(c); println(this) } // prints T, then prints D + } +} diff --git a/tests/pending/run/t5544.check b/tests/pending/run/t5544.check new file mode 100644 index 000000000000..257cc5642cb1 --- /dev/null +++ b/tests/pending/run/t5544.check @@ -0,0 +1 @@ +foo diff --git a/tests/pending/run/t5544/Api_1.scala b/tests/pending/run/t5544/Api_1.scala new file mode 100644 index 000000000000..b4c92864de5c --- /dev/null +++ b/tests/pending/run/t5544/Api_1.scala @@ -0,0 +1,8 @@ +import scala.annotation.StaticAnnotation + +class ann(val bar: Any) extends StaticAnnotation + +object Api { + @ann({def foo = "foo!!"}) + def foo = println("foo") +} diff --git a/tests/pending/run/t5544/Test_2.scala b/tests/pending/run/t5544/Test_2.scala new file mode 100644 index 000000000000..ea92322213c6 --- /dev/null +++ b/tests/pending/run/t5544/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Api.foo +} diff --git a/tests/pending/run/t5545.scala b/tests/pending/run/t5545.scala new file mode 100644 index 000000000000..7efa6d84f1a0 --- /dev/null +++ b/tests/pending/run/t5545.scala @@ -0,0 +1,27 @@ +import scala.tools.partest._ +import java.io._ + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -d " + testOutput.path + " -cp " + testOutput.path + + override def code = """ + // SI-5545 + trait F[@specialized(Int) T1, R] { + def f(v1: T1): R + def g = v1 => f(v1) + } + """.trim + + override def show(): Unit = { + // redirect err to out, for logging + val prevErr = System.err + System.setErr(System.out) + compile() + // the bug manifests at the second compilation, when the bytecode is already there + compile() + System.setErr(prevErr) + } + + override def isDebug = false // so we don't get the newSettings warning +} diff --git a/tests/pending/run/t5552.check b/tests/pending/run/t5552.check new file mode 100644 index 000000000000..a19a60840edb --- /dev/null +++ b/tests/pending/run/t5552.check @@ -0,0 +1,2 @@ +(3,3) +(3.0,3.0) diff --git a/tests/pending/run/t5552.scala b/tests/pending/run/t5552.scala new file mode 100644 index 000000000000..dd32ce22ccfa --- /dev/null +++ b/tests/pending/run/t5552.scala @@ -0,0 +1,10 @@ +class C[@specialized(Int) A](a:A) { + lazy val b = (a, a) + def c = b +} +object Test { + def main(args:Array[String]): Unit = { + println(new C(3).c) + println(new C(3.0).c) + } +} diff --git a/tests/pending/run/t5565.scala b/tests/pending/run/t5565.scala new file mode 100644 index 000000000000..c46068caf5d6 --- /dev/null +++ b/tests/pending/run/t5565.scala @@ -0,0 +1,12 @@ +import scala.language.reflectiveCalls +import scala.language.implicitConversions + +object Test extends dotty.runtime.LegacyApp { + implicit def doubleWithApproxEquals(d: Double): AnyRef{def ~==(v: Double,margin: Double): Boolean; def ~==$default$2: Double @scala.annotation.unchecked.uncheckedVariance} = new { + def ~==(v: Double, margin: Double = 0.001): Boolean = + math.abs(d - v) < margin + } + + assert(math.abs(-4.0) ~== (4.0, 0.001)) + assert(math.abs(-4.0) ~== 4.0) +} diff --git a/tests/pending/run/t5568.check b/tests/pending/run/t5568.check new file mode 100644 index 000000000000..67aaf16e079f --- /dev/null +++ b/tests/pending/run/t5568.check @@ -0,0 +1,9 @@ +void +int +class scala.runtime.BoxedUnit +class scala.runtime.BoxedUnit +class java.lang.Integer +class java.lang.Integer +5 +5 +5 diff --git a/tests/pending/run/t5568.flags b/tests/pending/run/t5568.flags new file mode 100644 index 000000000000..ad51758c3932 --- /dev/null +++ b/tests/pending/run/t5568.flags @@ -0,0 +1 @@ +-nowarn diff --git a/tests/pending/run/t5568.scala b/tests/pending/run/t5568.scala new file mode 100644 index 000000000000..14599d9ed245 --- /dev/null +++ b/tests/pending/run/t5568.scala @@ -0,0 +1,16 @@ +object Test { + def main(args: Array[String]): Unit = { + // these should give unboxed results + println(().getClass) + println(5.getClass) + // these should give boxed results + println(().asInstanceOf[AnyRef with Unit].getClass) + println(().asInstanceOf[Unit with AnyRef].getClass) + println(5.asInstanceOf[AnyRef with Int].getClass) + println(5.asInstanceOf[Int with AnyRef].getClass) + //make sure ## wasn't broken + println(5.##) + println((5.asInstanceOf[AnyRef]).##) + println((5:Any).##) + } +} diff --git a/tests/pending/run/t5577.check b/tests/pending/run/t5577.check new file mode 100644 index 000000000000..3eca387955cb --- /dev/null +++ b/tests/pending/run/t5577.check @@ -0,0 +1,11 @@ +Received a size hint: 10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 \ No newline at end of file diff --git a/tests/pending/run/t5577.scala b/tests/pending/run/t5577.scala new file mode 100644 index 000000000000..d54a37e45d30 --- /dev/null +++ b/tests/pending/run/t5577.scala @@ -0,0 +1,27 @@ + + + +import collection._ + + + +object Test { + + class AlarmingBuffer[T] extends mutable.ArrayBuffer[T] { + override def sizeHint(x: Int): Unit = { + println("Received a size hint: " + x) + super.sizeHint(x) + } + } + + def main(args: Array[String]): Unit = { + val iteratorBuilder = (new AlarmingBuffer[Int]) mapResult { + res => res.iterator + } + + iteratorBuilder.sizeHint(10) + iteratorBuilder ++= (0 until 10) + iteratorBuilder.result.foreach(println) + } + +} diff --git a/tests/pending/run/t5583.check b/tests/pending/run/t5583.check new file mode 100644 index 000000000000..32d285cbb373 --- /dev/null +++ b/tests/pending/run/t5583.check @@ -0,0 +1,16 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> var s = 0 +s: Int = 0 + +scala> for (i <- 1 to 10) {s += i} + +scala> for (i <- 1 to 10) {s += i} + +scala> for (i <- 1 to 10) {s += i} + +scala> println(s) +165 + +scala> :quit diff --git a/tests/pending/run/t5583.scala b/tests/pending/run/t5583.scala new file mode 100644 index 000000000000..8561a5946fb9 --- /dev/null +++ b/tests/pending/run/t5583.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +var s = 0 +for (i <- 1 to 10) {s += i} +for (i <- 1 to 10) {s += i} +for (i <- 1 to 10) {s += i} +println(s) + """ +} diff --git a/tests/pending/run/t5588.check b/tests/pending/run/t5588.check new file mode 100644 index 000000000000..bb101b641b9b --- /dev/null +++ b/tests/pending/run/t5588.check @@ -0,0 +1,2 @@ +true +true diff --git a/tests/pending/run/t5588.scala b/tests/pending/run/t5588.scala new file mode 100644 index 000000000000..62bca8fd4913 --- /dev/null +++ b/tests/pending/run/t5588.scala @@ -0,0 +1,14 @@ +object Test { + object MyEnum extends Enumeration { + val Foo = Value(2000000000) + val Bar = Value(-2000000000) + val X = Value(Integer.MAX_VALUE) + val Y = Value(Integer.MIN_VALUE) + } + + import MyEnum._ + def main(args: Array[String]): Unit = { + println(Foo > Bar) + println(X > Y) + } +} diff --git a/tests/pending/run/t5590.check b/tests/pending/run/t5590.check new file mode 100644 index 000000000000..ad4a2eee6496 --- /dev/null +++ b/tests/pending/run/t5590.check @@ -0,0 +1,4 @@ +Map(a -> a, b -> b, c -> c) +Map(a -> a, b -> b, c -> c) +Set(a, b, c, d, e) +Set(a, b, c, d, e) \ No newline at end of file diff --git a/tests/pending/run/t5590.scala b/tests/pending/run/t5590.scala new file mode 100644 index 000000000000..aded59863e0e --- /dev/null +++ b/tests/pending/run/t5590.scala @@ -0,0 +1,31 @@ + + + +import java.io._ +import collection._ + + + +object Test { + + def check(obj: AnyRef): Unit = { + println(obj) + + val bos = new ByteArrayOutputStream() + val out = new ObjectOutputStream(bos) + out.writeObject(obj) + val arr = bos.toByteArray() + val in = new ObjectInputStream(new ByteArrayInputStream(arr)) + val deser = in.readObject() + + println(deser) + } + + def main(args: Array[String]): Unit = { + val lhm = mutable.LinkedHashMap("a" -> "a", "b" -> "b", "c" -> "c") + val lhs = mutable.LinkedHashSet("a", "b", "c", "d", "e") + check(lhm) + check(lhs) + } + +} diff --git a/tests/pending/run/t5603.check b/tests/pending/run/t5603.check new file mode 100644 index 000000000000..760a92567ca7 --- /dev/null +++ b/tests/pending/run/t5603.check @@ -0,0 +1,29 @@ +[[syntax trees at end of parser]] // newSource1.scala +[0:241]package [0:0] { + [0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef { + [15]def $init$() = [15]{ + [15]() + }; + [23:39]val name: [33:39]String; + [46:76]val msg = [56:76][56:72][56:71]"How are you, ".$plus([72:76]name) + }; + [87:209]class C extends [94:209][151:159]Greeting { + [119:139]val nameElse = _; + [95:101] private[this] val i: [98:101]Int = _; + <95:139>def (<95:101>i: [98]Int) = <95:139>{ + <119:139>val nameElse = <134:139>"Bob"; + [NoPosition][NoPosition][NoPosition]super.(); + <95:139>() + }; + [168:184]val name = [179:184]"avc"; + [191:203][191:198]println([199:202]msg) + }; + [215:241]object Test extends [227:241][235:238]App { + [227]def () = [227]{ + [NoPosition][NoPosition][NoPosition]super.(); + [227]() + }; + [NoPosition] + } +} + diff --git a/tests/pending/run/t5603.scala b/tests/pending/run/t5603.scala new file mode 100644 index 000000000000..79a1ba07697c --- /dev/null +++ b/tests/pending/run/t5603.scala @@ -0,0 +1,43 @@ +import scala.tools.partest._ +import java.io._ +import scala.tools.nsc._ +import scala.tools.cmd.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 = """ + trait Greeting { + val name: String + val msg = "How are you, "+name + } + class C(i: Int) extends { + val nameElse = "Bob" + } with Greeting { + val name = "avc" + println(msg) + } + + object Test extends dotty.runtime.LegacyApp {} + """.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 + settings.Yrangepos.value = true + val command = new CompilerCommand((CommandLineParser tokenize extraSettings) ++ args.toList, settings) + Global(command.settings, new ConsoleReporter(settings)) + } +} diff --git a/tests/pending/run/t5604.check b/tests/pending/run/t5604.check new file mode 100644 index 000000000000..53a2fc889446 --- /dev/null +++ b/tests/pending/run/t5604.check @@ -0,0 +1,8 @@ +long +double +long +double +long +double +long +double diff --git a/tests/pending/run/t5604.scala b/tests/pending/run/t5604.scala new file mode 100644 index 000000000000..eccad1639bde --- /dev/null +++ b/tests/pending/run/t5604.scala @@ -0,0 +1,50 @@ +// a.scala +// Fri Jan 13 11:31:47 PST 2012 + +package foo { + object regular extends Duh { + def buh(n: Long) = println("long") + def buh(n: Double) = println("double") + } + class regular { + import regular._ + + duh(33L) + duh(3.0d) + foo.regular.duh(33L) + foo.regular.duh(3.0d) + buh(66L) + buh(6.0d) + foo.regular.buh(66L) + foo.regular.buh(6.0d) + } + + trait Duh { + def duh(n: Long) = println("long") + def duh(n: Double) = println("double") + } + package object bar extends Duh { + def buh(n: Long) = println("long") + def buh(n: Double) = println("double") + } + package bar { + object Main { + def main(args:Array[String]): Unit = { + duh(33L) + duh(3.0d) + foo.bar.duh(33L) + foo.bar.duh(3.0d) + buh(66L) + buh(6.0d) + foo.bar.buh(66L) + foo.bar.buh(6.0d) + } + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + foo.bar.Main.main(null) + } +} diff --git a/tests/pending/run/t5608.check b/tests/pending/run/t5608.check new file mode 100644 index 000000000000..ba70d2170152 --- /dev/null +++ b/tests/pending/run/t5608.check @@ -0,0 +1 @@ +A@6 diff --git a/tests/pending/run/t5608.scala b/tests/pending/run/t5608.scala new file mode 100644 index 000000000000..43e912122bba --- /dev/null +++ b/tests/pending/run/t5608.scala @@ -0,0 +1,12 @@ +object Test { + def main(args:Array[String]): Unit = { + val ns = Array(3L, 3L, 3L) + val a1: A = new A(ns(0)) + val a2: A = new A(ns(0)) + println(a1 + a2) + } +} + +class A(val u: Long) extends AnyVal { + def +(other: A) = new A(other.u + u) +} diff --git a/tests/pending/run/t5610.check b/tests/pending/run/t5610.check new file mode 100644 index 000000000000..023f18d8f129 --- /dev/null +++ b/tests/pending/run/t5610.check @@ -0,0 +1,6 @@ +some string +some string +some string +some string +List(2, 3) +List(5, 6) diff --git a/tests/pending/run/t5610.scala b/tests/pending/run/t5610.scala new file mode 100644 index 000000000000..3659c69f0cb4 --- /dev/null +++ b/tests/pending/run/t5610.scala @@ -0,0 +1,30 @@ +object Test { + def main(args: Array[String]): Unit = { + var test: String = null + val fun1: Int => () => Unit = foo(test) _ + val fun2: Int => () => Unit = foo(test)(_) + val fun3: Int => () => Unit = { + lazy val eta1: String = test + (dummy: Int) => foo(eta1)(dummy) + } + val fun4: Int => () => Unit = { + val eta1: () => String = () => test + (dummy: Int) => foo(eta1())(dummy) + } + test = "some string" + fun1(1)() + fun2(1)() + fun3(1)() + fun4(1)() + + val f: (String, Int*) => Unit = m(2, 3) + f("", 5, 6) + } + + def foo(s: => String)(dummy: Int) = () => println(s) + + def m(a: Int*)(z: String, b: Int*): Unit = { + println(a.toList) + println(b.toList) + } +} diff --git a/tests/pending/run/t5610a.check b/tests/pending/run/t5610a.check new file mode 100644 index 000000000000..2aa46b3b91a8 --- /dev/null +++ b/tests/pending/run/t5610a.check @@ -0,0 +1 @@ +Stroke a kitten diff --git a/tests/pending/run/t5610a.scala b/tests/pending/run/t5610a.scala new file mode 100644 index 000000000000..3787c098455d --- /dev/null +++ b/tests/pending/run/t5610a.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + class Result(_str: => String) { + lazy val str = _str + } + + def foo(str: => String)(i: Int) = new Result(str) + + def bar(f: Int => Result) = f(42) + + var test: String = null + val result = bar(foo(test)) + test = "bar" + + if (result.str == null) { + println("Destroy ALL THE THINGS!!!") + } else { + println("Stroke a kitten") + } +} diff --git a/tests/pending/run/t5612.check b/tests/pending/run/t5612.check new file mode 100644 index 000000000000..9d19cca29280 --- /dev/null +++ b/tests/pending/run/t5612.check @@ -0,0 +1,4 @@ +START for List(Two, Two, One, Three) +TWO +TWO +ONE diff --git a/tests/pending/run/t5612.scala b/tests/pending/run/t5612.scala new file mode 100644 index 000000000000..08d006f88276 --- /dev/null +++ b/tests/pending/run/t5612.scala @@ -0,0 +1,28 @@ +object L extends Enumeration { + val One, Two, Three = Value +} + +class Foo { + def foo(xs: List[L.Value]): Unit = { + import scala.util.control.Breaks.{break, breakable} + println("START for " + xs) + breakable { + for (x <- xs) { + x match { + case L.One => println("ONE"); return + case L.Two => println("TWO") + case L.Three => println("THREE"); break + } + } + } + println("FINISH") + } +} + +object Test { + def main(args: Array[String]): Unit = { + val f = new Foo() + val l = List(L.Two, L.Two, L.One, L.Three) + f.foo(l) + } +} diff --git a/tests/pending/run/t5614.check b/tests/pending/run/t5614.check new file mode 100644 index 000000000000..f659f2da3b2a --- /dev/null +++ b/tests/pending/run/t5614.check @@ -0,0 +1,3 @@ +3 +a +b diff --git a/tests/pending/run/t5614.scala b/tests/pending/run/t5614.scala new file mode 100644 index 000000000000..c3410f28b7bb --- /dev/null +++ b/tests/pending/run/t5614.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val str = s"a\nb" + println(str.length) + println(str) +} diff --git a/tests/pending/run/t5629.check b/tests/pending/run/t5629.check new file mode 100644 index 000000000000..6a2d630f4e6d --- /dev/null +++ b/tests/pending/run/t5629.check @@ -0,0 +1,2 @@ +int child got: 33 +any child got: 33 diff --git a/tests/pending/run/t5629.scala b/tests/pending/run/t5629.scala new file mode 100644 index 000000000000..867e92f344b4 --- /dev/null +++ b/tests/pending/run/t5629.scala @@ -0,0 +1,36 @@ + + + +import scala.{specialized => spec} + + + +trait GrandParent[@spec(Int) -A] { + def foo(a: A): Unit + def bar[B <: A](b: B): Unit = println("grandparent got: %s" format b) +} + + +trait Parent[@spec(Int) -A] extends GrandParent[A] { + def foo(a: A) = bar(a) +} + + +class IntChild extends Parent[Int] { + override def bar[B <: Int](b: B): Unit = println("int child got: %s" format b) +} + + +class AnyChild extends Parent[Any] { + override def bar[B <: Any](b: B): Unit = println("any child got: %s" format b) +} + + +object Test { + + def main(args: Array[String]): Unit = { + new IntChild().foo(33) + new AnyChild().foo(33) + } + +} diff --git a/tests/pending/run/t5629b.check b/tests/pending/run/t5629b.check new file mode 100644 index 000000000000..e0f25f0b0535 --- /dev/null +++ b/tests/pending/run/t5629b.check @@ -0,0 +1,10 @@ +=== pf(1): +MySmartPF.apply entered... +newPF.applyOrElse entered... +default +scala.MatchError: 1 (of class java.lang.Integer) +=== pf(42): +MySmartPF.apply entered... +newPF.applyOrElse entered... +ok +=== done diff --git a/tests/pending/run/t5629b.scala b/tests/pending/run/t5629b.scala new file mode 100644 index 000000000000..9cee1889316e --- /dev/null +++ b/tests/pending/run/t5629b.scala @@ -0,0 +1,36 @@ +object Test extends dotty.runtime.LegacyApp { + + trait MyPF[@specialized(Int) -A] extends (A => Unit) { + def isDefinedAt(x: A): Boolean + def applyOrElse[A1 <: A](x: A1, default: A1 => Unit): Unit = { + println("MyPF.applyOrElse entered...") + if (isDefinedAt(x)) apply(x) else default(x) + } + } + + trait MySmartPF[@specialized(Int) -A] extends MyPF[A] { + def apply(x: A): Unit = { + println("MySmartPF.apply entered...") + applyOrElse(x, { default: Any => throw new MatchError(default) }) + } + } + + type T = Int + //type T = Any + + def newPF(test: T): MyPF[T] = new MySmartPF[T] { + def isDefinedAt(x: T): Boolean = x != test + override def applyOrElse[A1 <: T](x: A1, default: A1 => Unit): Unit = { + println("newPF.applyOrElse entered...") + if (x != test) { println("ok"); () } else { println("default"); default(x) } + } + } + + val pf = newPF(1) + println("=== pf(1):") + try { pf(1) } catch { case x: Throwable => println(x) } + println("=== pf(42):") + pf(42) + println("=== done") + +} diff --git a/tests/pending/run/t5648.check b/tests/pending/run/t5648.check new file mode 100644 index 000000000000..1140ff52e2ba --- /dev/null +++ b/tests/pending/run/t5648.check @@ -0,0 +1,4 @@ +true +true +true +true diff --git a/tests/pending/run/t5648.flags b/tests/pending/run/t5648.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/t5648.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t5648.scala b/tests/pending/run/t5648.scala new file mode 100644 index 000000000000..c5cea9e1cbb9 --- /dev/null +++ b/tests/pending/run/t5648.scala @@ -0,0 +1,10 @@ +case class C(val s: Int*) + +object Test { + def main(args: Array[String]): Unit = { + println(new C(1, 3, 7) == new C(1, 3, 7)) + println(new C(1, 3, 7) == C(1, 3, 7)) + println(C(1, 3, 7) == new C(1, 3, 7)) + println(C(1, 3, 7) == C(1, 3, 7)) + } +} diff --git a/tests/pending/run/t5652.check b/tests/pending/run/t5652.check new file mode 100644 index 000000000000..11438ef2179e --- /dev/null +++ b/tests/pending/run/t5652.check @@ -0,0 +1,8 @@ +public static final int T1$class.g$1(T1) +public static int T1$class.f0(T1) +public static void T1$class.$init$(T1) +public final int A1.A1$$g$2() +public int A1.f1() +public final int A2.A2$$g$1() +public int A2.f0() +public int A2.f2() diff --git a/tests/pending/run/t5652/t5652_1.scala b/tests/pending/run/t5652/t5652_1.scala new file mode 100644 index 000000000000..5343f260a2ac --- /dev/null +++ b/tests/pending/run/t5652/t5652_1.scala @@ -0,0 +1,6 @@ +trait T1 { + def f0 = { def g = 1 ; class A { def a = g } ; g ; new A().a } +} +class A1 { + def f1 = { def g = 1 ; class A { def a = g } ; g ; new A().a } +} diff --git a/tests/pending/run/t5652/t5652_2.scala b/tests/pending/run/t5652/t5652_2.scala new file mode 100644 index 000000000000..db13b75ac4fe --- /dev/null +++ b/tests/pending/run/t5652/t5652_2.scala @@ -0,0 +1,9 @@ +class A2 extends A1 with T1{ + def f2 = { def g = 5 ; class A { def a = g }; g ; new A().a } +} + +object Test extends A2 { + def main(args: Array[String]): Unit = { + println(Seq(Class.forName(classOf[T1].getName + "$class"), classOf[A1], classOf[A2]).flatMap(_.getDeclaredMethods.map(_.toString).sorted).mkString("\n")) + } +} diff --git a/tests/pending/run/t5652b.check b/tests/pending/run/t5652b.check new file mode 100644 index 000000000000..ca9d0a74f094 --- /dev/null +++ b/tests/pending/run/t5652b.check @@ -0,0 +1,4 @@ +private final int A1.g$1() +public int A1.f1() +private final int A2.g$1() +public int A2.f2() diff --git a/tests/pending/run/t5652b/t5652b_1.scala b/tests/pending/run/t5652b/t5652b_1.scala new file mode 100644 index 000000000000..72ba5dcd825c --- /dev/null +++ b/tests/pending/run/t5652b/t5652b_1.scala @@ -0,0 +1,3 @@ +class A1 { + def f1 = { def g = 5 ; class A { def a = 0 } ; new A; g } +} diff --git a/tests/pending/run/t5652b/t5652b_2.scala b/tests/pending/run/t5652b/t5652b_2.scala new file mode 100644 index 000000000000..0fd6a9ab428b --- /dev/null +++ b/tests/pending/run/t5652b/t5652b_2.scala @@ -0,0 +1,9 @@ +class A2 extends A1 { + def f2 = { def g = 5 ; class A { def a = 0 } ; new A; g } +} + +object Test extends A2 { + def main(args: Array[String]): Unit = { + println(Seq(classOf[A1], classOf[A2]).flatMap(_.getDeclaredMethods.map(_.toString).sorted).mkString("\n")) + } +} diff --git a/tests/pending/run/t5652c.check b/tests/pending/run/t5652c.check new file mode 100644 index 000000000000..3b889e066dab --- /dev/null +++ b/tests/pending/run/t5652c.check @@ -0,0 +1,6 @@ +public final int A1.A1$$g$1() +public final int A1.A1$$g$2() +public int A1.f1() +public int A1.f2() +1 +2 diff --git a/tests/pending/run/t5652c/t5652c.scala b/tests/pending/run/t5652c/t5652c.scala new file mode 100644 index 000000000000..0a7e584f6b76 --- /dev/null +++ b/tests/pending/run/t5652c/t5652c.scala @@ -0,0 +1,10 @@ +class A1 { + def f1 = { def g = 1 ; class A { def a = g } ; new A().a } + def f2 = { def g = 2 ; class A { def a = g } ; new A().a } +} + +object Test extends dotty.runtime.LegacyApp { + println(classOf[A1].getDeclaredMethods.map(_.toString).sorted.mkString("\n")) + println(new A1().f1) + println(new A1().f2) +} diff --git a/tests/pending/run/t5655.check b/tests/pending/run/t5655.check new file mode 100644 index 000000000000..4bbc54b64124 --- /dev/null +++ b/tests/pending/run/t5655.check @@ -0,0 +1,26 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> object x { def x={} } +defined object x + +scala> import x._ +import x._ + +scala> x +:12: error: reference to x is ambiguous; +it is imported twice in the same scope by +import x._ +and import x + x + ^ + +scala> x +:12: error: reference to x is ambiguous; +it is imported twice in the same scope by +import x._ +and import x + x + ^ + +scala> :quit diff --git a/tests/pending/run/t5655.scala b/tests/pending/run/t5655.scala new file mode 100644 index 000000000000..b15feb788eee --- /dev/null +++ b/tests/pending/run/t5655.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +object x { def x={} } +import x._ +x +x + """ +} diff --git a/tests/pending/run/t5656.check b/tests/pending/run/t5656.check new file mode 100644 index 000000000000..9543ee799e44 --- /dev/null +++ b/tests/pending/run/t5656.check @@ -0,0 +1 @@ +List(1, 2, 3)_List(a, b, c) \ No newline at end of file diff --git a/tests/pending/run/t5656.scala b/tests/pending/run/t5656.scala new file mode 100644 index 000000000000..2c97d374d069 --- /dev/null +++ b/tests/pending/run/t5656.scala @@ -0,0 +1,11 @@ + + + + +object Test { + + def main(args: Array[String]): Unit = { + println(Seq(List('1', '2', '3'), List('a', 'b', 'c')).view.addString(new StringBuilder, "_")) + } + +} diff --git a/tests/pending/run/t5665.scala b/tests/pending/run/t5665.scala new file mode 100644 index 000000000000..3ac498b5c03a --- /dev/null +++ b/tests/pending/run/t5665.scala @@ -0,0 +1,13 @@ +object O { + trait T { + private[this] val c: Int = 42 + def f = + { x: Int => c } + } +} + +object Test { + def main(args: Array[String]): Unit = { + assert(new O.T{}.f(0) == 42) + } +} diff --git a/tests/pending/run/t5676.check b/tests/pending/run/t5676.check new file mode 100644 index 000000000000..3b562d30468a --- /dev/null +++ b/tests/pending/run/t5676.check @@ -0,0 +1,3 @@ +ok +false +true diff --git a/tests/pending/run/t5676.flags b/tests/pending/run/t5676.flags new file mode 100644 index 000000000000..e1b37447c953 --- /dev/null +++ b/tests/pending/run/t5676.flags @@ -0,0 +1 @@ +-Xexperimental \ No newline at end of file diff --git a/tests/pending/run/t5676.scala b/tests/pending/run/t5676.scala new file mode 100644 index 000000000000..817ac823a8d1 --- /dev/null +++ b/tests/pending/run/t5676.scala @@ -0,0 +1,24 @@ +import java.lang.reflect.Modifier + +class Bar[T] + +class Foo[T] { + object A extends Bar[T] +} + +class Baz[S] extends Foo[S] { + override object A extends Bar[S] { + def foo(): String = "ok" + } +} + +object Test { + + def main(a: Array[String]): Unit = { + val b = new Baz[Any] + println(b.A.foo()) + println(Modifier.isFinal(classOf[Baz[Any]].getModifiers())) + println(Modifier.isFinal(Test.getClass.getModifiers())) + } + +} diff --git a/tests/pending/run/t5680.check b/tests/pending/run/t5680.check new file mode 100644 index 000000000000..0d825ab7d0f8 --- /dev/null +++ b/tests/pending/run/t5680.check @@ -0,0 +1,3 @@ +[Lscala.runtime.BoxedUnit +() +() diff --git a/tests/pending/run/t5680.scala b/tests/pending/run/t5680.scala new file mode 100644 index 000000000000..7f4252839871 --- /dev/null +++ b/tests/pending/run/t5680.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + val x = Array[Unit]((), ()) + println(x.toString.substring(0, x.toString.indexOf(";"))) + println(x(0)) + x(1) = () + println(x(1)) +} diff --git a/tests/pending/run/t5688.check b/tests/pending/run/t5688.check new file mode 100644 index 000000000000..2c84f9e2ef7a --- /dev/null +++ b/tests/pending/run/t5688.check @@ -0,0 +1 @@ +Vector(ta, tb, tab) diff --git a/tests/pending/run/t5688.scala b/tests/pending/run/t5688.scala new file mode 100644 index 000000000000..ebbba0d66957 --- /dev/null +++ b/tests/pending/run/t5688.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + trait T + + trait TA + trait TB + + class A extends T with TA + class B extends T with TB + class AB extends T with TA with TB + // Matching on _: TA with TB + + val li: Vector[T] = Vector(new A, new B, new AB) + + val matched = (for (l <- li) yield { + l match { + case _: TA with TB => "tab" + case _: TA => "ta" + case _: TB => "tb" + } + }) + + println(matched) +} diff --git a/tests/pending/run/t5699.check b/tests/pending/run/t5699.check new file mode 100755 index 000000000000..df19644ae618 --- /dev/null +++ b/tests/pending/run/t5699.check @@ -0,0 +1,11 @@ +[[syntax trees at end of parser]] // annodef.java +package { + object MyAnnotation extends { + def () = _ + }; + class MyAnnotation extends scala.annotation.Annotation with _root_.java.lang.annotation.Annotation with scala.annotation.ClassfileAnnotation { + def () = _; + def value(): String + } +} + diff --git a/tests/pending/run/t5699.scala b/tests/pending/run/t5699.scala new file mode 100755 index 000000000000..ec3b1d26b490 --- /dev/null +++ b/tests/pending/run/t5699.scala @@ -0,0 +1,24 @@ +import scala.tools.partest.DirectTest +import scala.reflect.internal.util.BatchSourceFile + +object Test extends DirectTest { + // Java code + override def code = """ + |public @interface MyAnnotation { String value(); } + """.stripMargin + + override def extraSettings: String = "-usejavacp -Ystop-after:typer -Xprint:parser" + + override def show(): Unit = { + // redirect err to out, for logging + val prevErr = System.err + System.setErr(System.out) + compile() + System.setErr(prevErr) + } + + override def newSources(sourceCodes: String*) = { + assert(sourceCodes.size == 1) + List(new BatchSourceFile("annodef.java", sourceCodes(0))) + } +} diff --git a/tests/pending/run/t5704.check b/tests/pending/run/t5704.check new file mode 100644 index 000000000000..102e3209c644 --- /dev/null +++ b/tests/pending/run/t5704.check @@ -0,0 +1 @@ +String diff --git a/tests/pending/run/t5704.flags b/tests/pending/run/t5704.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t5704.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5704.scala b/tests/pending/run/t5704.scala new file mode 100644 index 000000000000..b9765ebb62ec --- /dev/null +++ b/tests/pending/run/t5704.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + class MyQuerycollection{ + def findUserByName( name:String ) = { + val tree = reify{ "test" == name }.tree + val toolbox = cm.mkToolBox() + toolbox.typecheck(tree) match{ + case Apply(Select(lhs,op),rhs::Nil) => + println(rhs.tpe) + } + } + } + val qc = new MyQuerycollection + qc.findUserByName("some value") +} diff --git a/tests/pending/run/t5710-1.check b/tests/pending/run/t5710-1.check new file mode 100644 index 000000000000..eac2025aeb4b --- /dev/null +++ b/tests/pending/run/t5710-1.check @@ -0,0 +1 @@ +evaluated = (abc,abc) diff --git a/tests/pending/run/t5710-1.scala b/tests/pending/run/t5710-1.scala new file mode 100644 index 000000000000..5548ca4cabc3 --- /dev/null +++ b/tests/pending/run/t5710-1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val (x, y) = ("abc": Any) match { case x => (x, x) } + (x, y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5710-2.check b/tests/pending/run/t5710-2.check new file mode 100644 index 000000000000..eac2025aeb4b --- /dev/null +++ b/tests/pending/run/t5710-2.check @@ -0,0 +1 @@ +evaluated = (abc,abc) diff --git a/tests/pending/run/t5710-2.scala b/tests/pending/run/t5710-2.scala new file mode 100644 index 000000000000..c5129ce34e4f --- /dev/null +++ b/tests/pending/run/t5710-2.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val (x, y) = "abc" match { case x => (x, x) } + (x, y) + }; + + val toolbox = cm.mkToolBox() + val evaluated = toolbox.eval(code.tree) + println("evaluated = " + evaluated) +} diff --git a/tests/pending/run/t5713.check b/tests/pending/run/t5713.check new file mode 100644 index 000000000000..1419eb9d7967 --- /dev/null +++ b/tests/pending/run/t5713.check @@ -0,0 +1 @@ +err diff --git a/tests/pending/run/t5713.flags b/tests/pending/run/t5713.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t5713.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5713/Impls_Macros_1.scala b/tests/pending/run/t5713/Impls_Macros_1.scala new file mode 100644 index 000000000000..7b04197cfa57 --- /dev/null +++ b/tests/pending/run/t5713/Impls_Macros_1.scala @@ -0,0 +1,28 @@ +package m + +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Level extends Enumeration { + val Error = Value(5) +} + +object Logger { + def error(message: String): Unit = macro LoggerMacros.error +} + +private object LoggerMacros { + + type LoggerContext = Context { type PrefixType = Logger.type } + + def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] = + log(c)(c.universe.reify(Level.Error), message) + + private def log(c: LoggerContext)(level: c.Expr[Level.Value], message: c.Expr[String]): c.Expr[Unit] = +// was: if (level.splice.id < 4) // TODO Remove hack! + if (c.eval(level).id < 4) // TODO Remove hack! + c.universe.reify(()) + else { + c.universe.reify(println(message.splice)) + } +} \ No newline at end of file diff --git a/tests/pending/run/t5713/Test_2.scala b/tests/pending/run/t5713/Test_2.scala new file mode 100644 index 000000000000..7e4d02a80e65 --- /dev/null +++ b/tests/pending/run/t5713/Test_2.scala @@ -0,0 +1,5 @@ +import m._ + +object Test extends dotty.runtime.LegacyApp { + Logger.error("err") +} \ No newline at end of file diff --git a/tests/pending/run/t5717.scala b/tests/pending/run/t5717.scala new file mode 100755 index 000000000000..a0997f5a49ba --- /dev/null +++ b/tests/pending/run/t5717.scala @@ -0,0 +1,21 @@ +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) + } + // TODO + // Don't assume output is on physical disk + // Let the compiler tell us output dir + // val sc = newCompiler("-cp", classpath, "-d", testOutput.path) + // val out = sc.settings.outputDirs.getSingleOutput.get + def show(): Unit = { + // Don't crash when we find a file 'a' where package 'a' should go. + scala.reflect.io.File(testOutput.path + "/a").writeAll("a") + compileCode("package a { class B }") + } +} diff --git a/tests/pending/run/t5733.check b/tests/pending/run/t5733.check new file mode 100644 index 000000000000..e697046a9452 --- /dev/null +++ b/tests/pending/run/t5733.check @@ -0,0 +1,2 @@ +Running ABTest asserts +Done diff --git a/tests/pending/run/t5733.scala b/tests/pending/run/t5733.scala new file mode 100644 index 000000000000..a9e58d77e637 --- /dev/null +++ b/tests/pending/run/t5733.scala @@ -0,0 +1,53 @@ +import scala.language.dynamics + +object A extends Dynamic { + var a = "a" + + def selectDynamic(method:String): String = a + + def updateDynamic(method:String)(v:String): Unit = { a = v } +} + +class B extends Dynamic { + var b = "b" + + def selectDynamic(method:String): String = b + + def updateDynamic(method:String)(v:String): Unit = { b = v } +} + +object Test extends dotty.runtime.LegacyApp { + assert( A.foo == "a" ) + assert( A.bar == "a" ) + A.aaa = "aaa" + assert( A.bar == "aaa" ) + + val b = new B + assert( b.foo == "b" ) + assert( b.bar == "b" ) + b.bbb = "bbb" + assert( b.bar == "bbb" ) + + { + println("Running ABTest asserts") + A.a = "a" + (new ABTest).test() + } + + println("Done") +} + +class ABTest { + def test(): Unit = { + assert( A.foo == "a" ) + assert( A.bar == "a" ) + A.aaa = "aaa" + assert( A.bar == "aaa" ) + + val b = new B + assert( b.foo == "b" ) + assert( b.bar == "b" ) + b.bbb = "bbb" + assert( b.bar == "bbb" ) + } +} diff --git a/tests/pending/run/t5753_1.check b/tests/pending/run/t5753_1.check new file mode 100644 index 000000000000..f70d7bba4ae1 --- /dev/null +++ b/tests/pending/run/t5753_1.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/pending/run/t5753_1.flags b/tests/pending/run/t5753_1.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t5753_1.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5753_1/Impls_Macros_1.scala b/tests/pending/run/t5753_1/Impls_Macros_1.scala new file mode 100644 index 000000000000..ce0713885204 --- /dev/null +++ b/tests/pending/run/t5753_1/Impls_Macros_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait Impls { + def impl(c: Context)(x: c.Expr[Any]) = x +} + +object Macros extends Impls { + def foo(x: Any) = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t5753_1/Test_2.scala b/tests/pending/run/t5753_1/Test_2.scala new file mode 100644 index 000000000000..413eefff320e --- /dev/null +++ b/tests/pending/run/t5753_1/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/pending/run/t5753_2.check b/tests/pending/run/t5753_2.check new file mode 100644 index 000000000000..f70d7bba4ae1 --- /dev/null +++ b/tests/pending/run/t5753_2.check @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/tests/pending/run/t5753_2.flags b/tests/pending/run/t5753_2.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t5753_2.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t5753_2/Impls_Macros_1.scala b/tests/pending/run/t5753_2/Impls_Macros_1.scala new file mode 100644 index 000000000000..d446d37bdf75 --- /dev/null +++ b/tests/pending/run/t5753_2/Impls_Macros_1.scala @@ -0,0 +1,10 @@ +import scala.reflect.macros.blackbox.Context + +trait Macro_T { + def foo[T](c: Context)(s: c.Expr[T]) = s +} + +object Macros { + def foo[T](s: T) = macro Impls.foo[T] + object Impls extends Macro_T +} diff --git a/tests/pending/run/t5753_2/Test_2.scala b/tests/pending/run/t5753_2/Test_2.scala new file mode 100644 index 000000000000..413eefff320e --- /dev/null +++ b/tests/pending/run/t5753_2/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + import Macros._ + println(foo(42)) +} \ No newline at end of file diff --git a/tests/pending/run/t576.check b/tests/pending/run/t576.check new file mode 100644 index 000000000000..22f3843abfea --- /dev/null +++ b/tests/pending/run/t576.check @@ -0,0 +1,6 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +1 +2 +3 +4 +5 diff --git a/tests/pending/run/t576.scala b/tests/pending/run/t576.scala new file mode 100644 index 000000000000..5c8c9a90cba4 --- /dev/null +++ b/tests/pending/run/t576.scala @@ -0,0 +1,47 @@ +import scala.language.reflectiveCalls + +class A { + override def equals(other: Any) = other match { + case _: this.type => true + case _ => false + } +} + +object Dingus { + def IamDingus = 5 +} + +object Test { + val x1 = new A + val x2 = new A + + val x3 = new { self => + override def equals(other : Any) = other match { + case that: self.type => true + case _ => false + } + } + val x4 = new { self => + def f(x: Any): Int = x match { + case _: x1.type => 1 + case _: x2.type => 2 + case _: x3.type => 3 + case _: self.type => 4 + case x: Dingus.type => x.IamDingus + } + } + + def main(args: Array[String]): Unit = { + + assert(x1 == x1) + assert(x1 != x2) + assert(x1 != ()) + assert(x2 != x1) + + assert(x3 == x3) + assert(x3 != x2) + assert(x2 != x3) + + List(x1, x2, x3, x4, Dingus) map x4.f foreach println + } +} diff --git a/tests/pending/run/t5770.check b/tests/pending/run/t5770.check new file mode 100644 index 000000000000..f00c965d8307 --- /dev/null +++ b/tests/pending/run/t5770.check @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/tests/pending/run/t5770.scala b/tests/pending/run/t5770.scala new file mode 100644 index 000000000000..409efb2d1899 --- /dev/null +++ b/tests/pending/run/t5770.scala @@ -0,0 +1,25 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect._ + +object Test extends dotty.runtime.LegacyApp { + var i = 0 + val action = reify { i += 1; println(i) }.tree + + val tb1 = cm.mkToolBox() + tb1.eval(action) + tb1.eval(action) + tb1.eval(action) + tb1.frontEnd.reset() + tb1.eval(action) + tb1.eval(action) + + val tb2 = cm.mkToolBox() + tb2.eval(action) + tb2.frontEnd.reset() + tb2.eval(action) + tb2.eval(action) + tb2.frontEnd.reset() + tb2.eval(action) + tb2.eval(action) +} diff --git a/tests/pending/run/t5789.check b/tests/pending/run/t5789.check new file mode 100644 index 000000000000..193abfaff028 --- /dev/null +++ b/tests/pending/run/t5789.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val n = 2 +n: Int = 2 + +scala> () => n +res0: () => Int = + +scala> :quit diff --git a/tests/pending/run/t5789.scala b/tests/pending/run/t5789.scala new file mode 100644 index 000000000000..461f6a4aae07 --- /dev/null +++ b/tests/pending/run/t5789.scala @@ -0,0 +1,14 @@ + +import scala.tools.nsc._ +import interpreter.ILoop +import scala.tools.partest.ReplTest + + +object Test extends ReplTest { + override def extraSettings = "-Yinline" + def code = """ + val n = 2 + () => n + """ +} + diff --git a/tests/pending/run/t5804.check b/tests/pending/run/t5804.check new file mode 100644 index 000000000000..3ccc1c24d3da --- /dev/null +++ b/tests/pending/run/t5804.check @@ -0,0 +1,4 @@ +128 +16 +128 +32 \ No newline at end of file diff --git a/tests/pending/run/t5804.scala b/tests/pending/run/t5804.scala new file mode 100644 index 000000000000..93cfa69ff70f --- /dev/null +++ b/tests/pending/run/t5804.scala @@ -0,0 +1,32 @@ + + +import collection.mutable._ + + +object Test { + + def main(args: Array[String]): Unit = { + class CustomHashMap extends HashMap[Int, Int] { + override def initialSize = 65 + + println(table.length) + } + + new CustomHashMap + new HashMap { + println(table.length) + } + + class CustomHashSet extends HashSet[Int] { + override def initialSize = 96 + + println(table.length) + } + + new CustomHashSet + new HashSet { + println(table.length) + } + } + +} diff --git a/tests/pending/run/t5816.check b/tests/pending/run/t5816.check new file mode 100644 index 000000000000..8e58ace9b409 --- /dev/null +++ b/tests/pending/run/t5816.check @@ -0,0 +1 @@ +5.+(Test.this.y) diff --git a/tests/pending/run/t5816.scala b/tests/pending/run/t5816.scala new file mode 100644 index 000000000000..4c2a5bcb7066 --- /dev/null +++ b/tests/pending/run/t5816.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + + def printSource[T](expr: Expr[T]): Unit = { + val ttree = toolbox typecheck expr.tree + println(ttree.toString) + } + + var y = 3 + printSource(reify { + 5 + y + }) +} diff --git a/tests/pending/run/t5824.check b/tests/pending/run/t5824.check new file mode 100644 index 000000000000..3774da60e546 --- /dev/null +++ b/tests/pending/run/t5824.check @@ -0,0 +1 @@ +a b c diff --git a/tests/pending/run/t5824.scala b/tests/pending/run/t5824.scala new file mode 100644 index 000000000000..c5cfc280f8cc --- /dev/null +++ b/tests/pending/run/t5824.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends dotty.runtime.LegacyApp { + reify { + println("%s %s %s".format(List("a", "b", "c"): _*)) + }.eval +} diff --git a/tests/pending/run/t5830.check b/tests/pending/run/t5830.check new file mode 100644 index 000000000000..926085467624 --- /dev/null +++ b/tests/pending/run/t5830.check @@ -0,0 +1,7 @@ +a with oef +a with oef +a with oef +a +def with oef +def +default diff --git a/tests/pending/run/t5830.flags b/tests/pending/run/t5830.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/t5830.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t5830.scala b/tests/pending/run/t5830.scala new file mode 100644 index 000000000000..2ae1544e54a7 --- /dev/null +++ b/tests/pending/run/t5830.scala @@ -0,0 +1,55 @@ +import scala.annotation.switch + +object Test extends dotty.runtime.LegacyApp { + def noSwitch(ch: Char, eof: Boolean) = ch match { + case 'a' if eof => println("a with oef") // then branch + } + + def onlyThen(ch: Char, eof: Boolean) = ch match { + case 'a' if eof => println("a with oef") // then branch + case 'c' => + } + + def ifThenElse(ch: Char, eof: Boolean) = (ch: @switch) match { + case 'a' if eof => println("a with oef") // then branch + case 'a' if eof => println("a with oef2") // unreachable, but the analysis is not that sophisticated + case 'a' => println("a") // else-branch + case 'c' => + } + + def defaultUnguarded(ch: Char, eof: Boolean) = ch match { + case ' ' if eof => println("spacey oef") + case _ => println("default") + } + + def defaults(ch: Char, eof: Boolean) = (ch: @switch) match { + case _ if eof => println("def with oef") // then branch + case _ if eof => println("def with oef2") // unreachable, but the analysis is not that sophisticated + case _ => println("def") // else-branch + } + + // test binders in collapsed cases (no need to run, it's "enough" to know it doesn't crash the compiler) + def guard(x: Any): Boolean = true + def testBinders = + try { println("") } // work around SI-6015 + catch { + case _ if guard(null) => + case x if guard(x) => throw x + } + + // def unreachable(ch: Char) = (ch: @switch) match { + // case 'a' => println("b") // ok + // case 'a' => println("b") // unreachable + // case 'c' => + // } + + noSwitch('a', true) + onlyThen('a', true) // 'a with oef' + ifThenElse('a', true) // 'a with oef' + ifThenElse('a', false) // 'a' + defaults('a', true) // 'def with oef' + defaults('a', false) // 'def' + + // test that it jumps to default case, no match error + defaultUnguarded(' ', false) // default +} diff --git a/tests/pending/run/t5840.scala b/tests/pending/run/t5840.scala new file mode 100644 index 000000000000..ba2376f0f864 --- /dev/null +++ b/tests/pending/run/t5840.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + reify { + class C[T <: String with Singleton] + } +} diff --git a/tests/pending/run/t5856.scala b/tests/pending/run/t5856.scala new file mode 100644 index 000000000000..e4e0e3f58f24 --- /dev/null +++ b/tests/pending/run/t5856.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + override def toString = "Test" + + assert(s"$this" == "Test") + assert(s"$this$this" == "TestTest") + assert(s"$this$$" == "Test$") + assert(s"$this.##" == "Test.##") + assert(s"$this.toString" == "Test.toString") + assert(s"$this=THIS" == "Test=THIS") +} diff --git a/tests/pending/run/t5857.scala b/tests/pending/run/t5857.scala new file mode 100644 index 000000000000..eabf5dc86e47 --- /dev/null +++ b/tests/pending/run/t5857.scala @@ -0,0 +1,45 @@ + + + +object Test { + + def time[U](b: =>U): Long = { + val start = System.currentTimeMillis + b + val end = System.currentTimeMillis + + end - start + } + + def main(args: Array[String]): Unit = { + val sz = 1000000000 + + val range = 1 to sz + check { assert(range.min == 1, range.min) } + check { assert(range.max == sz, range.max) } + + val descending = sz to 1 by -1 + check { assert(descending.min == 1) } + check { assert(descending.max == sz) } + + val numeric = 1.0 to sz.toDouble by 1 + check { assert(numeric.min == 1.0) } + check { assert(numeric.max == sz.toDouble) } + + val numdesc = sz.toDouble to 1.0 by -1 + check { assert(numdesc.min == 1.0) } + check { assert(numdesc.max == sz.toDouble) } + } + + def check[U](b: =>U): Unit = { + val exectime = time { + b + } + + // whatever it is, it should be less than, say, 250ms + // if `max` involves traversal, it takes over 5 seconds on a 3.2GHz i7 CPU + //println(exectime) + assert(exectime < 250, exectime) + } + +} diff --git a/tests/pending/run/t5866.check b/tests/pending/run/t5866.check new file mode 100644 index 000000000000..9f4ec729a704 --- /dev/null +++ b/tests/pending/run/t5866.check @@ -0,0 +1,2 @@ +0.0 +Foo(0.0) diff --git a/tests/pending/run/t5866.scala b/tests/pending/run/t5866.scala new file mode 100644 index 000000000000..120773effa87 --- /dev/null +++ b/tests/pending/run/t5866.scala @@ -0,0 +1,11 @@ +class Foo(val d: Double) extends AnyVal { + override def toString = s"Foo($d)" +} +object Test { + def main(args: Array[String]): Unit = { + val d: Double = null.asInstanceOf[Double] + println(d) + val f: Foo = null.asInstanceOf[Foo] + println(f) + } +} diff --git a/tests/pending/run/t5867.check b/tests/pending/run/t5867.check new file mode 100644 index 000000000000..e1811eeefa80 --- /dev/null +++ b/tests/pending/run/t5867.check @@ -0,0 +1 @@ +UnrolledBuffer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50) \ No newline at end of file diff --git a/tests/pending/run/t5867.scala b/tests/pending/run/t5867.scala new file mode 100644 index 000000000000..c7f5d0a41a39 --- /dev/null +++ b/tests/pending/run/t5867.scala @@ -0,0 +1,14 @@ +import collection.mutable.UnrolledBuffer + + + +object Test { + + def main(args: Array[String]): Unit = { + val buf = UnrolledBuffer(1 to 50: _*) + val dub = buf ++ buf + + println(dub) + } + +} diff --git a/tests/pending/run/t5879.check b/tests/pending/run/t5879.check new file mode 100644 index 000000000000..4bdf3f5fcff0 --- /dev/null +++ b/tests/pending/run/t5879.check @@ -0,0 +1,8 @@ +Map(1 -> 1) +1 +(1,1) +Map(1 -> 1) +1 +(1,2) +Map(1 -> 2) +2 diff --git a/tests/pending/run/t5879.scala b/tests/pending/run/t5879.scala new file mode 100644 index 000000000000..f96a1741007e --- /dev/null +++ b/tests/pending/run/t5879.scala @@ -0,0 +1,59 @@ +import collection.immutable.HashMap + + +object Test { + + def main(args: Array[String]): Unit = { + resolveDefault() + resolveFirst() + resolveSecond() + resolveMany() + } + + def resolveDefault(): Unit = { + val a = HashMap(1 -> "1") + val b = HashMap(1 -> "2") + + val r = a.merged(b)(null) + println(r) + println(r(1)) + } + + def resolveFirst(): Unit = { + val a = HashMap(1 -> "1") + val b = HashMap(1 -> "2") + def collision(a: (Int, String), b: (Int, String)) = { + println(a) + a + } + + val r = a.merged(b) { collision } + println(r) + println(r(1)) + } + + def resolveSecond(): Unit = { + val a = HashMap(1 -> "1") + val b = HashMap(1 -> "2") + def collision(a: (Int, String), b: (Int, String)) = { + println(b) + b + } + + val r = a.merged(b) { collision } + println(r) + println(r(1)) + } + + def resolveMany(): Unit = { + val a = HashMap((0 until 100) zip (0 until 100): _*) + val b = HashMap((0 until 100) zip (100 until 200): _*) + def collision(a: (Int, Int), b: (Int, Int)) = { + (a._1, a._2 + b._2) + } + + val r = a.merged(b) { collision } + for ((k, v) <- r) assert(v == 100 + 2 * k, (k, v)) + } + +} diff --git a/tests/pending/run/t5880.scala b/tests/pending/run/t5880.scala new file mode 100644 index 000000000000..5608f4fed937 --- /dev/null +++ b/tests/pending/run/t5880.scala @@ -0,0 +1,41 @@ + + +import scala.collection.JavaConversions._ + + + +object Test { + + def main(args:Array[String]) = { + val tests = 5000 + val jm: java.util.Map[Int, Int] = scala.collection.mutable.Map((0 until tests) zip (0 until tests).reverse: _*) + val es = jm.entrySet() + val it = es.iterator + + // chi square test + val groups = 10 + val hits = new Array[Int](groups) + def hit(hc: Int): Unit = { + val bucket = math.abs(hc) / (Int.MaxValue / groups) + hits(bucket) += 1 + } + def expected = tests / groups + def Dstat = { + val diffs = for (i <- 0 until groups) yield math.abs(hits(i) - expected) + diffs.sum.toDouble / expected + } + def ChiSquare = { + val diffs = for (i <- 0 until groups) yield (hits(i) - expected) * (hits(i) - expected) + diffs.sum.toDouble / expected + } + + while (it.hasNext) { + val x = it.next() + hit(x.##) + } + // println(hits.toBuffer) + // println(ChiSquare) + assert(ChiSquare < 4.0, ChiSquare + " -> " + hits.mkString(", ")) + } + +} diff --git a/tests/pending/run/t5881.check b/tests/pending/run/t5881.check new file mode 100644 index 000000000000..f4aeec680ad9 --- /dev/null +++ b/tests/pending/run/t5881.check @@ -0,0 +1,2 @@ +scala.collection.immutable.List +scala.collection.immutable.List diff --git a/tests/pending/run/t5881.scala b/tests/pending/run/t5881.scala new file mode 100644 index 000000000000..3191e975d4f7 --- /dev/null +++ b/tests/pending/run/t5881.scala @@ -0,0 +1,7 @@ +import scala.language.existentials +import scala.reflect.ClassTag + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[ClassTag[List[T forSome { type T <: List[T] }]]]) + println(implicitly[ClassTag[List[Any]]]) +} diff --git a/tests/pending/run/t5894.scala b/tests/pending/run/t5894.scala new file mode 100644 index 000000000000..c67a46def505 --- /dev/null +++ b/tests/pending/run/t5894.scala @@ -0,0 +1,18 @@ +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +class Test + +object Test { + def foo: Unit = macro fooImpl + def fooImpl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + + def main(args: Array[String]): Unit = { + try { + val method = classOf[Test].getMethod("foo") + sys.error("Static forwarder generated for macro: " + method) + } catch { + case _: NoSuchMethodException => // okay + } + } +} diff --git a/tests/pending/run/t5903a.check b/tests/pending/run/t5903a.check new file mode 100644 index 000000000000..ce6efd812d76 --- /dev/null +++ b/tests/pending/run/t5903a.check @@ -0,0 +1 @@ +(SomeTree,SomeTree) diff --git a/tests/pending/run/t5903a.flags b/tests/pending/run/t5903a.flags new file mode 100644 index 000000000000..02ecab49e720 --- /dev/null +++ b/tests/pending/run/t5903a.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903a/Macros_1.scala b/tests/pending/run/t5903a/Macros_1.scala new file mode 100644 index 000000000000..5d084ceed5e6 --- /dev/null +++ b/tests/pending/run/t5903a/Macros_1.scala @@ -0,0 +1,28 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +trait Tree +case object SomeTree extends Tree + +object NewQuasiquotes { + implicit class QuasiquoteInterpolation(c: StringContext) { + object nq { + def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl + } + } +} + +object QuasiquoteMacros { + def unapplyImpl(c: Context)(t: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = this + def _1 = SomeTree + def _2 = SomeTree + def unapply(t: Tree) = this + }.unapply($t) + """ + } +} diff --git a/tests/pending/run/t5903a/Test_2.scala b/tests/pending/run/t5903a/Test_2.scala new file mode 100644 index 000000000000..55a8320b3333 --- /dev/null +++ b/tests/pending/run/t5903a/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import NewQuasiquotes._ + SomeTree match { + case nq"$x + $y" => println((x, y)) + } +} diff --git a/tests/pending/run/t5903b.check b/tests/pending/run/t5903b.check new file mode 100644 index 000000000000..75891bc672c6 --- /dev/null +++ b/tests/pending/run/t5903b.check @@ -0,0 +1 @@ +oops diff --git a/tests/pending/run/t5903b.flags b/tests/pending/run/t5903b.flags new file mode 100644 index 000000000000..02ecab49e720 --- /dev/null +++ b/tests/pending/run/t5903b.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903b/Macros_1.scala b/tests/pending/run/t5903b/Macros_1.scala new file mode 100644 index 000000000000..29a05f7feca7 --- /dev/null +++ b/tests/pending/run/t5903b/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] + } + } +} + +object Macros { + def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = this + def _1 = 2 + def unapply(x: Int) = this + override def toString = "oops" + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/t5903b/Test_2.scala b/tests/pending/run/t5903b/Test_2.scala new file mode 100644 index 000000000000..23a92225d71b --- /dev/null +++ b/tests/pending/run/t5903b/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 2 match { + case t"$x" => println(x) + } +} diff --git a/tests/pending/run/t5903c.check b/tests/pending/run/t5903c.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t5903c.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t5903c.flags b/tests/pending/run/t5903c.flags new file mode 100644 index 000000000000..02ecab49e720 --- /dev/null +++ b/tests/pending/run/t5903c.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903c/Macros_1.scala b/tests/pending/run/t5903c/Macros_1.scala new file mode 100644 index 000000000000..34fe1d8808ca --- /dev/null +++ b/tests/pending/run/t5903c/Macros_1.scala @@ -0,0 +1,23 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply[T](x: T): Any = macro Macros.unapplyImpl[T] + } + } +} + +object Macros { + def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + def isEmpty = false + def get = 2 + def unapply(x: Int) = this + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/t5903c/Test_2.scala b/tests/pending/run/t5903c/Test_2.scala new file mode 100644 index 000000000000..23a92225d71b --- /dev/null +++ b/tests/pending/run/t5903c/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 2 match { + case t"$x" => println(x) + } +} diff --git a/tests/pending/run/t5903d.check b/tests/pending/run/t5903d.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/t5903d.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/t5903d.flags b/tests/pending/run/t5903d.flags new file mode 100644 index 000000000000..02ecab49e720 --- /dev/null +++ b/tests/pending/run/t5903d.flags @@ -0,0 +1 @@ +-Xlog-reflective-calls \ No newline at end of file diff --git a/tests/pending/run/t5903d/Macros_1.scala b/tests/pending/run/t5903d/Macros_1.scala new file mode 100644 index 000000000000..f1f8dc1fde60 --- /dev/null +++ b/tests/pending/run/t5903d/Macros_1.scala @@ -0,0 +1,25 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +object Interpolation { + implicit class TestInterpolation(c: StringContext) { + object t { + def unapply(x: Int): Any = macro Macros.unapplyImpl + } + } +} + +object Macros { + def unapplyImpl(c: Context)(x: c.Tree) = { + import c.universe._ + q""" + new { + class Match(x: Int) { + def isEmpty = false + def get = x + } + def unapply(x: Int) = new Match(x) + }.unapply($x) + """ + } +} diff --git a/tests/pending/run/t5903d/Test_2.scala b/tests/pending/run/t5903d/Test_2.scala new file mode 100644 index 000000000000..5df60f024b83 --- /dev/null +++ b/tests/pending/run/t5903d/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import Interpolation._ + 42 match { + case t"$x" => println(x) + } +} diff --git a/tests/pending/run/t5905-features.flags b/tests/pending/run/t5905-features.flags new file mode 100644 index 000000000000..ad51758c3932 --- /dev/null +++ b/tests/pending/run/t5905-features.flags @@ -0,0 +1 @@ +-nowarn diff --git a/tests/pending/run/t5905-features.scala b/tests/pending/run/t5905-features.scala new file mode 100644 index 000000000000..b518d611455f --- /dev/null +++ b/tests/pending/run/t5905-features.scala @@ -0,0 +1,31 @@ + +import tools.partest.DirectTest + +// verify that all languageFeature names are accepted by -language +object Test extends DirectTest { + override def code = "class Code { def f = (1 to 10) size }" // exercise a feature to sanity-check coverage of -language options + + override def extraSettings = s"-usejavacp -d ${testOutput.path}" + + override def show() = { + val global = newCompiler("-Ystop-after:typer") + compileString(global)("") // warm me up, scotty + import global._ + exitingTyper { + //def isFeature(s: Symbol) = s.annotations.exists((a: AnnotationInfo) => a.tpe <:< typeOf[scala.annotation.meta.languageFeature]) + def isFeature(s: Symbol) = s hasAnnotation definitions.LanguageFeatureAnnot + val langf = definitions.languageFeatureModule.typeSignature + val feats = langf.declarations filter (s => isFeature(s)) map (_.name.decoded) + val xmen = langf.member(TermName("experimental")).typeSignature.declarations filter (s => isFeature(s)) map (s => s"experimental.${s.name.decoded}") + val all = (feats ++ xmen) mkString "," + + assert(feats.nonEmpty, "Test must find feature flags.") + + //compile("junk") // tragically, does not fail the test, i.e., arg must not be totally borked + + //dynamics,postfixOps,reflectiveCalls,implicitConversions,higherKinds,existentials,experimental.macros + compile(s"-language:$all") + } + } +} + diff --git a/tests/pending/run/t5905b-features.check b/tests/pending/run/t5905b-features.check new file mode 100644 index 000000000000..08c76d74aa31 --- /dev/null +++ b/tests/pending/run/t5905b-features.check @@ -0,0 +1 @@ +'noob' is not a valid choice for '-language' diff --git a/tests/pending/run/t5905b-features.scala b/tests/pending/run/t5905b-features.scala new file mode 100644 index 000000000000..627df8334b89 --- /dev/null +++ b/tests/pending/run/t5905b-features.scala @@ -0,0 +1,15 @@ + +import tools.partest.DirectTest + +// verify that only languageFeature names are accepted by -language +object Test extends DirectTest { + override def code = "class Code" + + override def extraSettings = s"-usejavacp -d ${testOutput.path}" + + override def show() = { + //compile("-language", "--") // no error + compile(s"-language:noob") + } +} + diff --git a/tests/pending/run/t5907.check b/tests/pending/run/t5907.check new file mode 100644 index 000000000000..bc23692679dc --- /dev/null +++ b/tests/pending/run/t5907.check @@ -0,0 +1,31 @@ +c1: 2 +c1: 2873 +c2: 37 +c3: 1, 2, 27 +c3: 1, 22, 27 +c3: 11, 7, 27 +c4: 1 +c4: 23 +c5: 1, 2, 33, b +c5: 1, 19, 33, b +c5: 1, 2, 193, c +c5: 1, 371, 193, c +c5: -1, 2, -2, lken +c6: 29, 18, -12 +c6: 1, 93, 2892 +c6: 1, 93, 761 +c7: 1, 22, 33, elkj +c7: 1, 283, 29872, me +c7: 37, 298, 899, ekjr +c8: 172, 989, 77, eliurna +c8: 1, 82, 2111, schtring +c8: -1, 92, 29, lken +c9: 1, 271, ehebab +c9: 1, 299, enag +c9: 1, 299, enag +c9: 1, 299, enag +c9: -42, 99, flae +c9: 10, 298, 27 +c9: elkn, en, emn +c9: ka, kb, kb +c9: ka, kb, ka diff --git a/tests/pending/run/t5907.scala b/tests/pending/run/t5907.scala new file mode 100644 index 000000000000..02a5b88932b4 --- /dev/null +++ b/tests/pending/run/t5907.scala @@ -0,0 +1,118 @@ +object Test extends dotty.runtime.LegacyApp { + t + + def t: Unit = { + val c1 = C1()(1) + println(c1.copy()(2)) + + { + implicit val i: Int = 2873 + println(c1.copy()) + } + + val c2 = C2()(1) + println(c2.copy()(37)) + + val c3 = C3(1,2)(3) + println(c3.copy()(27)) + println(c3.copy(y = 22)(27)) + println(c3.copy(y = 7, x = 11)(27)) + + val c4 = C4(1) + println(c4.copy()) + println(c4.copy(x = 23)) + + val c5 = C5(1,2)(3,"a") + println(c5.copy()(33,"b")) + println(c5.copy(y = 19)(33,"b")) + + { + implicit val i: Int = 193 + implicit val s: String = "c" + println(c5.copy()) + println(c5.copy(y = 371)) + println(c5.copy(x = -1)(-2, "lken")) + } + + val c6 = C6(1)(2)(3) + println(c6.copy(29)(18)(-12)) + + { + implicit val i: Int = 2892 + println(c6.copy(x = 1)(93)) + println(c6.copy(x = 1)(93)(761)) + } + + val c7 = C7(1)(2)(3)("h") + println(c7.copy()(22)(33)("elkj")) + + { + implicit val s: String = "me" + println(c7.copy()(283)(29872)) + println(c7.copy(37)(298)(899)("ekjr")) + } + + val c8 = C8(1)(2,3)()("els") + println(c8.copy(x = 172)(989, 77)()("eliurna")) + + { + implicit val s: String = "schtring" + println(c8.copy()(82,2111)()) + println(c8.copy(x = -1)(92,29)()("lken")) + } + + val c9 = C9(1)(2)()()("u") + println(c9.copy()(271)()()("ehebab")) + + { + implicit val s: String = "enag" + println(c9.copy()(299)) + println(c9.copy()(299)()) + println(c9.copy()(299)()()) + println(c9.copy(x = -42)(99)()()("flae")) + } + + class KA { override def toString = "ka" } + class KB extends KA { override def toString = "kb" } + val c10 = C10(10)(3)(19) + println(c10.copy()(298)(27)) + println(c10.copy("elkn")("en")("emn")) + println(c10.copy(new KA)(new KB)(new KB)) + + { + implicit val k: KA = new KA + println(c10.copy(new KA)(new KB)) + } + } +} + +case class C1(implicit x: Int) { + override def toString = s"c1: $x" +} +case class C2()(y: Int) { + override def toString = s"c2: $y" +} +case class C3(x: Int, y: Int)(z: Int) { + override def toString = s"c3: $x, $y, $z" +} +case class C4(x: Int) { + override def toString = s"c4: $x" +} +case class C5(x: Int, y: Int)(implicit z: Int, s: String) { + override def toString = s"c5: $x, $y, $z, $s" +} +case class C6(x: Int)(y: Int)(implicit z: Int) { + override def toString = s"c6: $x, $y, $z" +} +case class C7(x: Int)(y: Int)(z: Int)(implicit s: String) { + override def toString = s"c7: $x, $y, $z, $s" +} +case class C8(x: Int)(y: Int, z: Int)()(implicit s: String) { + override def toString = s"c8: $x, $y, $z, $s" +} +case class C9(x: Int)(y: Int)()()(implicit s: String) { + override def toString = s"c9: $x, $y, $s" +} +case class C10[T,U <: T](x: T)(y: U)(implicit z: T) { + override def toString = s"c9: $x, $y, $z" +} diff --git a/tests/pending/run/t5912.scala b/tests/pending/run/t5912.scala new file mode 100644 index 000000000000..6e70205ab5ce --- /dev/null +++ b/tests/pending/run/t5912.scala @@ -0,0 +1,7 @@ +import scala.language.existentials +object Test extends dotty.runtime.LegacyApp{ + import scala.reflect.runtime.{currentMirror=>cm} + import scala.tools.reflect._ + import scala.reflect.runtime.universe._ + val tree = cm.mkToolBox().typecheck( Literal(Constant("test")) ) +} diff --git a/tests/pending/run/t5914.check b/tests/pending/run/t5914.check new file mode 100644 index 000000000000..818e321255fb --- /dev/null +++ b/tests/pending/run/t5914.check @@ -0,0 +1 @@ +correct diff --git a/tests/pending/run/t5914.scala b/tests/pending/run/t5914.scala new file mode 100644 index 000000000000..472c4c8530da --- /dev/null +++ b/tests/pending/run/t5914.scala @@ -0,0 +1,23 @@ +import scala.reflect.ClassTag + +trait Trees { + class Tree + implicit val ttTag: ClassTag[TypeTree] + type TypeTree <: Tree + val TypeTree: TypeTreeExtractor + abstract class TypeTreeExtractor { + def unapply(t: TypeTree): Option[String] + } + def test(tree: Tree) = + tree match { + case TypeTree(_) => println("lolwut") + case null => println("correct") + } +} + +object Test extends dotty.runtime.LegacyApp with Trees { + val ttTag = implicitly[ClassTag[TypeTree]] + case class TypeTree(meh: String) extends Tree + object TypeTree extends TypeTreeExtractor + test(null) // should not crash +} diff --git a/tests/pending/run/t5923a.check b/tests/pending/run/t5923a.check new file mode 100644 index 000000000000..7165b734acb9 --- /dev/null +++ b/tests/pending/run/t5923a.check @@ -0,0 +1,3 @@ +C(Int) +C(String) +C(Nothing) diff --git a/tests/pending/run/t5923a/Macros_1.scala b/tests/pending/run/t5923a/Macros_1.scala new file mode 100644 index 000000000000..9050fd4b118e --- /dev/null +++ b/tests/pending/run/t5923a/Macros_1.scala @@ -0,0 +1,53 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +case class C[T](t: String) +object C { + implicit def foo[T]: C[T] = macro Macros.impl[T] +} + +object Macros { + def impl[T](c: Context)(ttag: c.WeakTypeTag[T]) = { + import c.universe._ + import internal._ + val ttag0 = ttag; + { + // When we're expanding implicitly[C[Nothing]], the type inferencer will see + // that foo[T] returns C[T] and that we request an implicit of type C[Nothing]. + // + // Then the type inferencer will try to match C[T] against C[Nothing] and infer everything it can infer + // from that match, but not more (e.g. if we were returning Iso[T, U] and the type we were looking at was Iso[Foo, L], + // we wouldn't want U to be auto-inferred to Nothing, as it usually happens with normal methods, + // but would rather want it to remain unknown, so that our macro could take a stab at inferring it: + // see the comments in this commit for more information). + // + // Equipped with common sense, in our case of C[T] and C[Nothing] we would expect T to be inferred as Nothing, and then we + // would expect T in the corresponding macro invocation to be Nothing. Unfortunately it is not that simple. + // + // Internally the type inferencer uses Nothing as a dummy value, which stands for "don't know how to + // infer this type parameter". In the Iso example, matching Iso[T, U] against Iso[Foo, L] would result in + // T being inferred as Foo and U being inferred as Nothing (!!). Then the type inferencer will think: + // "Aha! U ended up being Nothing. This means that I failed to infer it, + // therefore the result of my work is: T -> Foo, U -> still unknown". + // + // That's all very good and works very well until Nothing is a genuine result of type inference, + // as in our original example of inferring T in C[T] from C[Nothing]. In that case, the inferencer becomes confused + // and here in the macro implementation we get weakTypeOf[T] equal to some dummy type carrying a type parameter + // instead of Nothing. + // + // This eccentric behavior of the type inferencer is a long-standing problem in scalac, + // so the best one can do for now until it's fixed is to work around, manually converting + // suspicious T's into Nothings. Of course, this means that we would have to approximate, + // because there's no way to know whether having T here stands for a failed attempt to infer Nothing + // or for a failed attempt to infer anything, but at least we're in full control of making the best + // of this sad situation. + implicit def ttag: WeakTypeTag[T] = { + val tpe = ttag0.tpe + val sym = tpe.typeSymbol.asType + if (sym.isParameter && !isSkolem(sym)) TypeTag.Nothing.asInstanceOf[TypeTag[T]] + else ttag0 + } + reify(C[T](c.Expr[String](Literal(Constant(weakTypeOf[T].toString))).splice)) + } + } +} \ No newline at end of file diff --git a/tests/pending/run/t5923a/Test_2.scala b/tests/pending/run/t5923a/Test_2.scala new file mode 100644 index 000000000000..1f0413bdfab7 --- /dev/null +++ b/tests/pending/run/t5923a/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(implicitly[C[Int]]) + println(implicitly[C[String]]) + println(implicitly[C[Nothing]]) +} \ No newline at end of file diff --git a/tests/pending/run/t5923b.check b/tests/pending/run/t5923b.check new file mode 100644 index 000000000000..d56076f84ebe --- /dev/null +++ b/tests/pending/run/t5923b.check @@ -0,0 +1,3 @@ +class [Ljava.lang.Object; +class [Ljava.lang.Object; +class [Ljava.lang.Object; diff --git a/tests/pending/run/t5923b/Test.scala b/tests/pending/run/t5923b/Test.scala new file mode 100644 index 000000000000..ee4e67f2b2be --- /dev/null +++ b/tests/pending/run/t5923b/Test.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.collection.generic.CanBuildFrom + val cbf = implicitly[CanBuildFrom[Nothing, Nothing, Array[Nothing]]] + println(cbf().result.getClass) + println(new Array[Nothing](0).getClass) + println(Array[Nothing]().getClass) +} diff --git a/tests/pending/run/t5923c.scala b/tests/pending/run/t5923c.scala new file mode 100644 index 000000000000..5f3384638a1a --- /dev/null +++ b/tests/pending/run/t5923c.scala @@ -0,0 +1,4 @@ +// see neg/macro-blackbox-fundep-materialization and run/macro-whitebox-fundep-materialization +object Test extends dotty.runtime.LegacyApp { + // do nothing +} diff --git a/tests/pending/run/t5923d/Macros_1.scala b/tests/pending/run/t5923d/Macros_1.scala new file mode 100644 index 000000000000..1400674d4b2d --- /dev/null +++ b/tests/pending/run/t5923d/Macros_1.scala @@ -0,0 +1,9 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +trait MappedRow +trait RowMapper[T <: MappedRow] +object RowMapper { + implicit def mapper[T <: MappedRow]: RowMapper[T] = macro impl[T] + def impl[T <: MappedRow : c.WeakTypeTag](c: Context) = c.universe.reify(new RowMapper[T]{}) +} \ No newline at end of file diff --git a/tests/pending/run/t5923d/Test_2.scala b/tests/pending/run/t5923d/Test_2.scala new file mode 100644 index 000000000000..e9c446209124 --- /dev/null +++ b/tests/pending/run/t5923d/Test_2.scala @@ -0,0 +1,7 @@ +class RowA extends MappedRow +class RowB extends MappedRow + +object Test extends dotty.runtime.LegacyApp { + implicitly[RowMapper[RowA]] + implicitly[RowMapper[RowB]] +} \ No newline at end of file diff --git a/tests/pending/run/t5937.scala b/tests/pending/run/t5937.scala new file mode 100644 index 000000000000..8176d5438ea7 --- /dev/null +++ b/tests/pending/run/t5937.scala @@ -0,0 +1,12 @@ + + + +import collection._ + + + +object Test extends dotty.runtime.LegacyApp { + + val list: List[Int] = (immutable.Vector(1, 2, 3) :+ 4)(breakOut) + +} diff --git a/tests/pending/run/t594.check b/tests/pending/run/t594.check new file mode 100644 index 000000000000..814f4a422927 --- /dev/null +++ b/tests/pending/run/t594.check @@ -0,0 +1,2 @@ +one +two diff --git a/tests/pending/run/t594.scala b/tests/pending/run/t594.scala new file mode 100644 index 000000000000..f923a3cd2a3a --- /dev/null +++ b/tests/pending/run/t594.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + val array = Array("one", "two", "three") + val firstTwo: Array[String] = array.slice(0,2) + for (x <- firstTwo) + Console.println(x) + } +} diff --git a/tests/pending/run/t5940.scala b/tests/pending/run/t5940.scala new file mode 100644 index 000000000000..8560708218e4 --- /dev/null +++ b/tests/pending/run/t5940.scala @@ -0,0 +1,41 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + def code = ??? + + def macros_1 = """ + import scala.reflect.macros.blackbox.Context + + object Impls { + def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + } + + object Macros { + //import Impls._ + def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } + def foo: Unit = macro impl + } + """ + def compileMacros() = { + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") + compileString(newCompiler("-language:experimental.macros", "-cp", classpath, "-d", testOutput.path))(macros_1) + } + + def test_2 = """ + object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + } + """ + def compileTest() = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(test_2) + } + + def show(): Unit = { + log("Compiling Macros_1...") + if (compileMacros()) { + log("Compiling Test_2...") + if (compileTest()) log("Success!") else log("Failed...") + } + } +} \ No newline at end of file diff --git a/tests/pending/run/t5942.scala b/tests/pending/run/t5942.scala new file mode 100644 index 000000000000..b7a3c5138aff --- /dev/null +++ b/tests/pending/run/t5942.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect._ + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + tb.parse("def x = {}") + try { tb.parse("def x = {") } catch { case _: Throwable => } + tb.parse("def x = {}") +} diff --git a/tests/pending/run/t5943a1.check b/tests/pending/run/t5943a1.check new file mode 100644 index 000000000000..9f4d160af865 --- /dev/null +++ b/tests/pending/run/t5943a1.check @@ -0,0 +1 @@ +scala.this.Predef.intWrapper(1).to(3).map[Int, scala.collection.immutable.IndexedSeq[Int]](((x$1: Int) => x$1.+(1)))(immutable.this.IndexedSeq.canBuildFrom[Int]) diff --git a/tests/pending/run/t5943a1.scala b/tests/pending/run/t5943a1.scala new file mode 100644 index 000000000000..ce13259d65bf --- /dev/null +++ b/tests/pending/run/t5943a1.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val expr = tb.parse("1 to 3 map (_+1)") + println(tb.typecheck(expr)) +} diff --git a/tests/pending/run/t5943a2.check b/tests/pending/run/t5943a2.check new file mode 100644 index 000000000000..29ad79c3ce36 --- /dev/null +++ b/tests/pending/run/t5943a2.check @@ -0,0 +1 @@ +Vector(2, 3, 4) diff --git a/tests/pending/run/t5943a2.scala b/tests/pending/run/t5943a2.scala new file mode 100644 index 000000000000..2ad87050f557 --- /dev/null +++ b/tests/pending/run/t5943a2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val expr = tb.parse("1 to 3 map (_+1)") + println(tb.eval(expr)) +} diff --git a/tests/pending/run/t5966.check b/tests/pending/run/t5966.check new file mode 100644 index 000000000000..bfe8358a77d5 --- /dev/null +++ b/tests/pending/run/t5966.check @@ -0,0 +1,3 @@ +(o()_)("") = List() +(o("a1")_)("") = WrappedArray(a1) +(o("a1", "a2")_)("") = WrappedArray(a1, a2) diff --git a/tests/pending/run/t5966.scala b/tests/pending/run/t5966.scala new file mode 100644 index 000000000000..fe2da8474793 --- /dev/null +++ b/tests/pending/run/t5966.scala @@ -0,0 +1,9 @@ +object o { def apply(i: AnyRef*)(j: String) = i } + +object Test { + def main(args: Array[String]): Unit = { + println("(o()_)(\"\") = " + (o()_)("")) + println("(o(\"a1\")_)(\"\") = " + (o("a1")_)("")) + println("(o(\"a1\", \"a2\")_)(\"\") = " + (o("a1", "a2")_)("")) + } +} diff --git a/tests/pending/run/t5971.check b/tests/pending/run/t5971.check new file mode 100644 index 000000000000..0c36a1ff0251 --- /dev/null +++ b/tests/pending/run/t5971.check @@ -0,0 +1,4 @@ +r,b +r +a,b +r,a,b \ No newline at end of file diff --git a/tests/pending/run/t5971.scala b/tests/pending/run/t5971.scala new file mode 100644 index 000000000000..bd41350aa442 --- /dev/null +++ b/tests/pending/run/t5971.scala @@ -0,0 +1,23 @@ + + + + + +/** When using `AbstractTransformed` abstract inner class in views in order + * to force generating bridges, one must take care to push the corresponding + * collection trait (such as `Iterable` or `Seq`) as far as possible to the + * left in the linearization order -- otherwise, overridden methods from these + * traits can override the already overridden methods in view. This was the + * case with `takeWhile`. + * Mind blowing, I know. + */ +object Test { + + def main(args: Array[String]): Unit = { + println("bar".view.reverse.filter(_ > 'a').mkString(",")) + println("bar".view.reverse.take(1).mkString(",")) + println("bar".view.reverse.dropWhile(_ > 'a').mkString(",")) + println("bar".view.reverse.takeWhile(_ => true).mkString(",")) + } + +} diff --git a/tests/pending/run/t5974.check b/tests/pending/run/t5974.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t5974.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t5974.scala b/tests/pending/run/t5974.scala new file mode 100644 index 000000000000..e4e64c51e3b4 --- /dev/null +++ b/tests/pending/run/t5974.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.collection.JavaConverters._ + + def ser(a: AnyRef) = + (new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream())).writeObject(a) + + val l = java.util.Arrays.asList("pigdog").asScala + ser(l) + println("ok") +} diff --git a/tests/pending/run/t5986.check b/tests/pending/run/t5986.check new file mode 100644 index 000000000000..4101770c6d85 --- /dev/null +++ b/tests/pending/run/t5986.check @@ -0,0 +1,15 @@ +Foo(bar, 1) +Foo(bar, 1) +Foo(bar, 1),Foo(baz, 3),Foo(bazz, 4) +Foo(bar, 1) +Foo(bar, 1) +Foo(bar, 1),Foo(baz, 3),Foo(bazz, 4) +Foo(bar, 1) +Foo(bar, 1) +Foo(bar, 1),Foo(baz, 3),Foo(bazz, 4) +Foo(bar, 1) +Foo(bar, 1) +Foo(bar, 1),Foo(baz, 3),Foo(bazz, 4) +Foo(bar, 1) +Foo(bar, 1) +Foo(bar, 1),Foo(baz, 3),Foo(bazz, 4) \ No newline at end of file diff --git a/tests/pending/run/t5986.scala b/tests/pending/run/t5986.scala new file mode 100644 index 000000000000..b05d488f206d --- /dev/null +++ b/tests/pending/run/t5986.scala @@ -0,0 +1,36 @@ + + + +import scala.collection._ + + + +/** A sorted set should not replace elements when adding + * and the element already exists in the set. + */ +object Test { + + class Foo(val name: String, val n: Int) { + override def equals(obj: Any): Boolean = obj match { case other: Foo => name == other.name; case _ => false } + override def hashCode = name.## + override def toString = "Foo(" + name + ", " + n + ")" + } + + implicit val ordering: Ordering[Foo] = Ordering.fromLessThan[Foo] { (a, b) => a.name.compareTo(b.name) < 0 } + + def check[S <: Set[Foo]](set: S): Unit = { + def output(s: Set[Foo]) = println(s.toList.sorted.mkString(",")) + output(set + new Foo("bar", 2)) + output(set ++ List(new Foo("bar", 2), new Foo("bar", 3), new Foo("bar", 4))) + output(set union Set(new Foo("bar", 2), new Foo("baz", 3), new Foo("bazz", 4))) + } + + def main(args: Array[String]): Unit = { + check(Set(new Foo("bar", 1))) + check(immutable.Set(new Foo("bar", 1))) + check(mutable.Set(new Foo("bar", 1))) + check(immutable.SortedSet(new Foo("bar", 1))) + check(mutable.SortedSet(new Foo("bar", 1))) + } + +} diff --git a/tests/pending/run/t601.check b/tests/pending/run/t601.check new file mode 100644 index 000000000000..7c2a4f6a1507 --- /dev/null +++ b/tests/pending/run/t601.check @@ -0,0 +1 @@ +FooA diff --git a/tests/pending/run/t601.scala b/tests/pending/run/t601.scala new file mode 100644 index 000000000000..98b51ce97cd5 --- /dev/null +++ b/tests/pending/run/t601.scala @@ -0,0 +1,8 @@ +object Test +{ + private case object FooA + + def main(argv : Array[String]) : Unit = { + Console.println(FooA) + } +} diff --git a/tests/pending/run/t6011b.check b/tests/pending/run/t6011b.check new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/tests/pending/run/t6011b.check @@ -0,0 +1 @@ +3 diff --git a/tests/pending/run/t6011b.scala b/tests/pending/run/t6011b.scala new file mode 100644 index 000000000000..d99bf46fcdd9 --- /dev/null +++ b/tests/pending/run/t6011b.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + var cond = true + + // should not generate a switch + def f(ch: Char): Int = ch match { + case 'a' if cond => 1 + case 'z' | 'a' => 2 + } + + println(f('a') + f('z')) // 3 +} diff --git a/tests/pending/run/t6011c.check b/tests/pending/run/t6011c.check new file mode 100644 index 000000000000..088e6fdaae97 --- /dev/null +++ b/tests/pending/run/t6011c.check @@ -0,0 +1,3 @@ +t6011c.scala:11: warning: unreachable code + case 1 => 3 // crash + ^ diff --git a/tests/pending/run/t6011c.scala b/tests/pending/run/t6011c.scala new file mode 100644 index 000000000000..8050c27a48e2 --- /dev/null +++ b/tests/pending/run/t6011c.scala @@ -0,0 +1,13 @@ +object Test extends dotty.runtime.LegacyApp { + // A variation of SI-6011, which eluded the fix + // in 2.10.0. + // + // duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see SI-6011. + // at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:50) + // at scala.tools.nsc.Global.abort(Global.scala:249) + // at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder$jcode$.emitSWITCH(GenASM.scala:1850) + ((1: Byte): @unchecked) match { + case 1 => 2 + case 1 => 3 // crash + } +} diff --git a/tests/pending/run/t6023.check b/tests/pending/run/t6023.check new file mode 100644 index 000000000000..ee93565234a0 --- /dev/null +++ b/tests/pending/run/t6023.check @@ -0,0 +1,12 @@ +{ + abstract trait Foo extends AnyRef { + def a: Int + }; + () +} +{ + abstract trait Foo extends AnyRef { + def a: Int + }; + () +} diff --git a/tests/pending/run/t6023.scala b/tests/pending/run/t6023.scala new file mode 100644 index 000000000000..9ec8724a4388 --- /dev/null +++ b/tests/pending/run/t6023.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + // test 1: reify + val tree = reify{ trait Foo { val a: Int } }.tree + println(tree.toString) + + // test 2: import and typecheck + val toolbox = cm.mkToolBox() + val ttree = toolbox.typecheck(tree) + println(ttree.toString) + + // test 3: import and compile + toolbox.eval(tree) +} diff --git a/tests/pending/run/t6028.check b/tests/pending/run/t6028.check new file mode 100644 index 000000000000..edc8b22d6d0d --- /dev/null +++ b/tests/pending/run/t6028.check @@ -0,0 +1,84 @@ +[[syntax trees at end of lambdalift]] // newSource1.scala +package { + class T extends Object { + val classParam: Int = _; + def (classParam: Int): T = { + T.super.(); + () + }; + private[this] val field: Int = 0; + def field(): Int = T.this.field; + def foo(methodParam: Int): Function0 = { + val methodLocal: Int = 0; + { + (new <$anon: Function0>(T.this, methodParam, methodLocal): Function0) + } + }; + def bar(barParam: Int): Object = { + @volatile var MethodLocalObject$module: runtime.VolatileObjectRef = scala.runtime.VolatileObjectRef.zero(); + T.this.MethodLocalObject$1(barParam, MethodLocalObject$module) + }; + def tryy(tryyParam: Int): Function0 = { + var tryyLocal: runtime.IntRef = scala.runtime.IntRef.create(0); + { + (new <$anon: Function0>(T.this, tryyParam, tryyLocal): Function0) + } + }; + @SerialVersionUID(value = 0) final class $anonfun$foo$1 extends scala.runtime.AbstractFunction0$mcI$sp with Serializable { + def ($outer: T, methodParam$1: Int, methodLocal$1: Int): <$anon: Function0> = { + $anonfun$foo$1.super.(); + () + }; + final def apply(): Int = $anonfun$foo$1.this.apply$mcI$sp(); + def apply$mcI$sp(): Int = $anonfun$foo$1.this.$outer.classParam.+($anonfun$foo$1.this.$outer.field()).+($anonfun$foo$1.this.methodParam$1).+($anonfun$foo$1.this.methodLocal$1); + private[this] val $outer: T = _; + def $outer(): T = $anonfun$foo$1.this.$outer; + final def apply(): Object = scala.Int.box($anonfun$foo$1.this.apply()); + private[this] val methodParam$1: Int = _; + private[this] val methodLocal$1: Int = _ + }; + abstract trait MethodLocalTrait$1 extends Object { + def $outer(): T + }; + object MethodLocalObject$2 extends Object with T#MethodLocalTrait$1 { + def ($outer: T, barParam$1: Int): T#MethodLocalObject$2.type = { + MethodLocalObject$2.super.(); + MethodLocalObject$2.this.$asInstanceOf[T#MethodLocalTrait$1$class]()./*MethodLocalTrait$1$class*/$init$(barParam$1); + () + }; + private[this] val $outer: T = _; + def $outer(): T = MethodLocalObject$2.this.$outer; + def $outer(): T = MethodLocalObject$2.this.$outer + }; + final private[this] def MethodLocalObject$1(barParam$1: Int, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = { + MethodLocalObject$module$1.elem = new T#MethodLocalObject$2.type(T.this, barParam$1); + MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]() + }; + abstract trait MethodLocalTrait$1$class extends Object with T#MethodLocalTrait$1 { + def /*MethodLocalTrait$1$class*/$init$(barParam$1: Int): Unit = { + () + }; + scala.this.Predef.print(scala.Int.box(barParam$1)) + }; + @SerialVersionUID(value = 0) final class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable { + def ($outer: T, tryyParam$1: Int, tryyLocal$1: runtime.IntRef): <$anon: Function0> = { + $anonfun$tryy$1.super.(); + () + }; + final def apply(): Unit = $anonfun$tryy$1.this.apply$mcV$sp(); + def apply$mcV$sp(): Unit = try { + $anonfun$tryy$1.this.tryyLocal$1.elem = $anonfun$tryy$1.this.tryyParam$1 + } finally (); + private[this] val $outer: T = _; + def $outer(): T = $anonfun$tryy$1.this.$outer; + final def apply(): Object = { + $anonfun$tryy$1.this.apply(); + scala.runtime.BoxedUnit.UNIT + }; + private[this] val tryyParam$1: Int = _; + private[this] val tryyLocal$1: runtime.IntRef = _ + } + } +} + +warning: there was one feature warning; re-run with -feature for details diff --git a/tests/pending/run/t6028.scala b/tests/pending/run/t6028.scala new file mode 100644 index 000000000000..a6f920c5bb67 --- /dev/null +++ b/tests/pending/run/t6028.scala @@ -0,0 +1,21 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Ydelambdafy:inline -Xprint:lambdalift -d " + testOutput.path + + override def code = """class T(classParam: Int) { + | val field: Int = 0 + | def foo(methodParam: Int) = {val methodLocal = 0 ; () => classParam + field + methodParam + methodLocal } + | def bar(barParam: Int) = { trait MethodLocalTrait { print(barParam) }; object MethodLocalObject extends MethodLocalTrait; MethodLocalObject } + | def tryy(tryyParam: Int) = { var tryyLocal = 0; () => try { tryyLocal = tryyParam } finally () } + |} + |""".stripMargin.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/t603.check b/tests/pending/run/t603.check new file mode 100644 index 000000000000..1f408250216b --- /dev/null +++ b/tests/pending/run/t603.check @@ -0,0 +1,5 @@ +s = Susp(?) +evaluating... +s() = 3 +s = Susp(3) +2 + s = 5 diff --git a/tests/pending/run/t603.scala b/tests/pending/run/t603.scala new file mode 100644 index 000000000000..84a224a40a91 --- /dev/null +++ b/tests/pending/run/t603.scala @@ -0,0 +1,35 @@ +object forceDelay { + import scala.language.implicitConversions + + class Susp[+A](lazyValue: => A) extends Function0[A] { + private var func: () => Any = () => lazyValue + private var value: Any = null + + override def apply() = { + if (func != null) { + value = func().asInstanceOf[A] + func = null + } + value.asInstanceOf[A] + } + + override def toString() = + if (func == null) "Susp(" + value + ")" + else "Susp(?)" + } + + def delay[A](value: => A) = new Susp[A](value) + implicit def force[A](s: Susp[A]): A = s() +} + +object Test { + import forceDelay._ + + def main(args: Array[String]) = { + val s: Susp[Int] = delay { Console.println("evaluating..."); 3 } + Console.println("s = " + s) + Console.println("s() = " + s()) + Console.println("s = " + s) + Console.println("2 + s = " + (2 + s)) + } +} diff --git a/tests/pending/run/t6052.scala b/tests/pending/run/t6052.scala new file mode 100644 index 000000000000..e740f00e16d0 --- /dev/null +++ b/tests/pending/run/t6052.scala @@ -0,0 +1,21 @@ + + + + + + + +object Test extends dotty.runtime.LegacyApp { + def seqarr(i: Int) = Array[Int]() ++ (0 until i) + def pararr(i: Int) = seqarr(i).par + + def check[T](i: Int, f: Int => T): Unit = { + val gseq = seqarr(i).toSeq.groupBy(f) + val gpar = pararr(i).groupBy(f) + assert(gseq == gpar, (gseq, gpar)) + } + + for (i <- 0 until 20) check(i, _ > 0) + for (i <- 0 until 20) check(i, _ % 2) + for (i <- 0 until 20) check(i, _ % 4) +} diff --git a/tests/pending/run/t6063.check b/tests/pending/run/t6063.check new file mode 100644 index 000000000000..39347383f3cb --- /dev/null +++ b/tests/pending/run/t6063.check @@ -0,0 +1 @@ +public static int foo.Ob.f5() diff --git a/tests/pending/run/t6063/S_1.scala b/tests/pending/run/t6063/S_1.scala new file mode 100644 index 000000000000..69b1e9127131 --- /dev/null +++ b/tests/pending/run/t6063/S_1.scala @@ -0,0 +1,11 @@ +package foo + +abstract class Foo { + private[foo] def f1 = 1 + private def f2 = 2 + protected[foo] def f3 = 3 + protected def f4 = 4 + def f5 = 5 +} + +object Ob extends Foo diff --git a/tests/pending/run/t6063/S_2.scala b/tests/pending/run/t6063/S_2.scala new file mode 100644 index 000000000000..a990cc7931f6 --- /dev/null +++ b/tests/pending/run/t6063/S_2.scala @@ -0,0 +1,8 @@ +import java.lang.reflect.Modifier._ + +object Test { + def main(args: Array[String]): Unit = { + val forwarders = Class.forName("foo.Ob").getMethods.toList filter (m => isStatic(m.getModifiers)) + forwarders.sortBy(_.toString) foreach println + } +} diff --git a/tests/pending/run/t6064.scala b/tests/pending/run/t6064.scala new file mode 100644 index 000000000000..319ad1ae2f5c --- /dev/null +++ b/tests/pending/run/t6064.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + assert(Option(42) contains 42) + assert(Some(42) contains 42) + assert(Option(BigInt(42)) contains 42) + assert(Option(42) contains BigInt(42)) + assert(!(None contains 42)) + assert(Some(null) contains null) + assert(!(Option(null) contains null)) +} diff --git a/tests/pending/run/t6070.check b/tests/pending/run/t6070.check new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/tests/pending/run/t6070.check @@ -0,0 +1 @@ +3 diff --git a/tests/pending/run/t6070.scala b/tests/pending/run/t6070.scala new file mode 100644 index 000000000000..828386d139c6 --- /dev/null +++ b/tests/pending/run/t6070.scala @@ -0,0 +1,36 @@ +abstract class Bomb { + type T + val x: T + + def size(that: T): Int +} + +class StringBomb extends Bomb { + type T = String + val x = "abc" + def size(that: String): Int = that.length +} + +class IntBomb extends Bomb { + type T = Int + val x = 10 + + def size(that: Int) = x + that +} + +case class Mean(var bomb: Bomb) + +object Test extends dotty.runtime.LegacyApp { + def foo(x: Mean) = x match { + case Mean(b) => + // BUG: b is assumed to be a stable identifier, but it can actually be mutated + println(b.size({ mutate(); b.x })) + } + + def mutate(): Unit = { + m.bomb = new IntBomb + } + + val m = Mean(new StringBomb) + foo(m) // should print 3 +} diff --git a/tests/pending/run/t6077_patmat_cse_irrefutable.check b/tests/pending/run/t6077_patmat_cse_irrefutable.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t6077_patmat_cse_irrefutable.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t6077_patmat_cse_irrefutable.scala b/tests/pending/run/t6077_patmat_cse_irrefutable.scala new file mode 100644 index 000000000000..ef8c3dc59ddd --- /dev/null +++ b/tests/pending/run/t6077_patmat_cse_irrefutable.scala @@ -0,0 +1,13 @@ +class LiteralNode(val value: Any) + +object LiteralNode { + // irrefutable + def unapply(n: LiteralNode) = Some(n.value) +} + +object Test extends dotty.runtime.LegacyApp { + ((new LiteralNode(false)): Any) match { + case LiteralNode(true) => println("uh-oh") + case LiteralNode(false) => println("ok") + } +} diff --git a/tests/pending/run/t6086-repl.check b/tests/pending/run/t6086-repl.check new file mode 100644 index 000000000000..b904f118e8df --- /dev/null +++ b/tests/pending/run/t6086-repl.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> case class X(s: String) +defined class X + +scala> scala.reflect.runtime.universe.typeOf[X] +res0: reflect.runtime.universe.Type = X + +scala> :quit diff --git a/tests/pending/run/t6086-repl.scala b/tests/pending/run/t6086-repl.scala new file mode 100644 index 000000000000..87f94ec9f66f --- /dev/null +++ b/tests/pending/run/t6086-repl.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |case class X(s: String) + |scala.reflect.runtime.universe.typeOf[X] + |""".stripMargin +} diff --git a/tests/pending/run/t6086-vanilla.check b/tests/pending/run/t6086-vanilla.check new file mode 100644 index 000000000000..62d8fe9f6db6 --- /dev/null +++ b/tests/pending/run/t6086-vanilla.check @@ -0,0 +1 @@ +X diff --git a/tests/pending/run/t6086-vanilla.scala b/tests/pending/run/t6086-vanilla.scala new file mode 100644 index 000000000000..0fd5eedf6eea --- /dev/null +++ b/tests/pending/run/t6086-vanilla.scala @@ -0,0 +1,6 @@ +case class X(s: String) + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + println(typeOf[X]) +} diff --git a/tests/pending/run/t6089.check b/tests/pending/run/t6089.check new file mode 100644 index 000000000000..a8d442410627 --- /dev/null +++ b/tests/pending/run/t6089.check @@ -0,0 +1 @@ +scala.MatchError: Foo(0) (of class Foo) diff --git a/tests/pending/run/t6089.scala b/tests/pending/run/t6089.scala new file mode 100644 index 000000000000..8fb4082b7403 --- /dev/null +++ b/tests/pending/run/t6089.scala @@ -0,0 +1,13 @@ +case class Foo(x: Int) + +object Test { + def bippo(result: Boolean): Boolean = result + def bungus(m: Foo): Boolean = + bippo(m match { case Foo(2) => bungus(m) }) + + def main(args: Array[String]): Unit = try { + bungus(Foo(0)) + } catch { + case x: MatchError => println(x) + } +} diff --git a/tests/pending/run/t6090.scala b/tests/pending/run/t6090.scala new file mode 100644 index 000000000000..e7dbb36a05ae --- /dev/null +++ b/tests/pending/run/t6090.scala @@ -0,0 +1,6 @@ +class X { def ==(other: X) = true } +class V(val x: X) extends AnyVal +object Test extends { + def main(args: Array[String]) = + assert((new V(new X) == new V(new X))) +} diff --git a/tests/pending/run/t6102.check b/tests/pending/run/t6102.check new file mode 100644 index 000000000000..aa3e6cc9e25c --- /dev/null +++ b/tests/pending/run/t6102.check @@ -0,0 +1,32 @@ +[running phase parser on t6102.scala] +[running phase namer on t6102.scala] +[running phase packageobjects on t6102.scala] +[running phase typer on t6102.scala] +[running phase patmat on t6102.scala] +[running phase superaccessors on t6102.scala] +[running phase extmethods on t6102.scala] +[running phase pickler on t6102.scala] +[running phase refchecks on t6102.scala] +[running phase uncurry on t6102.scala] +[running phase tailcalls on t6102.scala] +[running phase specialize on t6102.scala] +[running phase explicitouter on t6102.scala] +[running phase erasure on t6102.scala] +[running phase posterasure on t6102.scala] +[running phase lazyvals on t6102.scala] +[running phase lambdalift on t6102.scala] +[running phase constructors on t6102.scala] +[running phase flatten on t6102.scala] +[running phase mixin on t6102.scala] +[running phase cleanup on t6102.scala] +[running phase delambdafy on t6102.scala] +[running phase icode on t6102.scala] +#partest -optimise +[running phase inliner on t6102.scala] +[running phase inlinehandlers on t6102.scala] +[running phase closelim on t6102.scala] +[running phase constopt on t6102.scala] +#partest +[running phase dce on t6102.scala] +[running phase jvm on icode] +hello diff --git a/tests/pending/run/t6102.flags b/tests/pending/run/t6102.flags new file mode 100644 index 000000000000..726e2a997f63 --- /dev/null +++ b/tests/pending/run/t6102.flags @@ -0,0 +1 @@ +-Ydead-code -Ydebug -Xfatal-warnings diff --git a/tests/pending/run/t6102.scala b/tests/pending/run/t6102.scala new file mode 100644 index 000000000000..225791bb1869 --- /dev/null +++ b/tests/pending/run/t6102.scala @@ -0,0 +1,13 @@ +// SI-6102 Wrong bytecode in lazyval + no-op finally clause + +object Test { + + def main(args: Array[String]): Unit = { + try { + val x = 3 + } finally { + print("hello") + } + } +} + diff --git a/tests/pending/run/t6104.check b/tests/pending/run/t6104.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t6104.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t6104.scala b/tests/pending/run/t6104.scala new file mode 100644 index 000000000000..ac6d4c77e500 --- /dev/null +++ b/tests/pending/run/t6104.scala @@ -0,0 +1,8 @@ +class A { Self => + val ok = "ok" + this match { + case me@Self => println(me.ok) + } +} + +object Test extends A with App diff --git a/tests/pending/run/t6111.check b/tests/pending/run/t6111.check new file mode 100644 index 000000000000..588065800198 --- /dev/null +++ b/tests/pending/run/t6111.check @@ -0,0 +1,3 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details +(8,8) +(x,x) diff --git a/tests/pending/run/t6111.scala b/tests/pending/run/t6111.scala new file mode 100644 index 000000000000..6f0164833794 --- /dev/null +++ b/tests/pending/run/t6111.scala @@ -0,0 +1,28 @@ +// SI-6675 DEPRECATED AUTO-TUPLING BECAUSE BAD IDEA -- MEAMAXIMACULPA +// TODO: remove this test case in 2.12, when the deprecation will go into effect and this will no longer compile +// slightly overkill, but a good test case for implicit resolution in extractor calls, +// along with the real fix: an extractor pattern with 1 sub-pattern should type check for all extractors +// that return Option[T], whatever T (even if it's a tuple) +object Foo { + def unapply[S, T](scrutinee: S)(implicit witness: FooHasType[S, T]): Option[T] = scrutinee match { + case i: Int => Some((i, i).asInstanceOf[T]) + } +} + +class FooHasType[S, T] +object FooHasType { + implicit object int extends FooHasType[Int, (Int, Int)] +} + +// resurrected from neg/t997 +object Foo997 { def unapply(x : String): Option[(String, String)] = Some((x, x)) } + +object Test extends dotty.runtime.LegacyApp { + val x = 8 + println(x match { + case Foo(p) => p // p should be a pair of Int + }) + + // Prints '(x, x)' + "x" match { case Foo997(a) => println(a) } +} diff --git a/tests/pending/run/t6113.check b/tests/pending/run/t6113.check new file mode 100644 index 000000000000..65fb3cd09012 --- /dev/null +++ b/tests/pending/run/t6113.check @@ -0,0 +1 @@ +Foo[[X](Int, X)] diff --git a/tests/pending/run/t6113.scala b/tests/pending/run/t6113.scala new file mode 100644 index 000000000000..5322a4a35d67 --- /dev/null +++ b/tests/pending/run/t6113.scala @@ -0,0 +1,8 @@ +import scala.language.higherKinds + +trait Foo[C[_]] + +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + println(typeOf[Foo[({type l[X] = (Int, X)})#l]]) +} diff --git a/tests/pending/run/t6114.scala b/tests/pending/run/t6114.scala new file mode 100644 index 000000000000..8c19e4c2b9fd --- /dev/null +++ b/tests/pending/run/t6114.scala @@ -0,0 +1,61 @@ +object Test extends dotty.runtime.LegacyApp { + def testList = { + val list = new java.util.ArrayList[Int] + list.add(1) + list.add(2) + list.add(3) + import scala.collection.JavaConverters._ + val next = list.asScala ++ List(4,5,6) + assert(next != list.asScala) + + val raw = list.asScala + val cloned = raw.clone + list.add(1) + assert(raw != cloned) + } + def testSet = { + val set = new java.util.HashSet[Int] + set.add(1) + set.add(2) + set.add(3) + import scala.collection.JavaConverters._ + val next = set.asScala ++ Set(4,5,6) + assert(next != set.asScala) + + val raw = set.asScala + val cloned = raw.clone + set.add(4) + assert(raw != cloned) + } + def testMap = { + val map = new java.util.HashMap[Int,Int] + map.put(1,1) + map.put(2,2) + map.put(3,3) + import scala.collection.JavaConverters._ + val next = map.asScala ++ Map(4->4,5->5,6->6) + assert(next != map.asScala) + + val raw = map.asScala + val cloned = raw.clone + map.put(4,4) + assert(raw != cloned) + } + + def testCollection = { + val list: java.util.Collection[Int] = new java.util.ArrayDeque[Int] + list.add(1) + list.add(2) + list.add(3) + import scala.collection.JavaConverters._ + val next = list.asScala ++ List(4,5,6) + assert(next != list.asScala) + + // Note: Clone is hidden at this level, so no overriden cloning. + } + + testList + testSet + testMap + testCollection +} diff --git a/tests/pending/run/t6126.scala b/tests/pending/run/t6126.scala new file mode 100644 index 000000000000..c328bf08fd72 --- /dev/null +++ b/tests/pending/run/t6126.scala @@ -0,0 +1,8 @@ +trait LogLevelType +object Test { + type LogLevel = Int with LogLevelType + final val ErrorLevel = 1.asInstanceOf[Int with LogLevelType] + def main(args: Array[String]): Unit = { + List(ErrorLevel, ErrorLevel) + } +} diff --git a/tests/pending/run/t6135.scala b/tests/pending/run/t6135.scala new file mode 100644 index 000000000000..c258842ff196 --- /dev/null +++ b/tests/pending/run/t6135.scala @@ -0,0 +1,13 @@ +object Test extends dotty.runtime.LegacyApp { + class A { class V } + + abstract class B[S] { + def foo(t: S, a: A)(v: a.V): Unit + } + + val b1 = new B[String] { + def foo(t: String, a: A)(v: a.V) = () // Bridge method required here! + } + + b1.foo("", null)(null) +} diff --git a/tests/pending/run/t6146b.check b/tests/pending/run/t6146b.check new file mode 100644 index 000000000000..6998873fb7ca --- /dev/null +++ b/tests/pending/run/t6146b.check @@ -0,0 +1,63 @@ +t6146b.scala:15: warning: match may not be exhaustive. +It would fail on the following inputs: S2(), S3() + def foo(f: F[Int]) = f match { case X.S1 => } + ^ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> val u = rootMirror.universe; import u._, language._ +u: $r.intp.global.type = +import u._ +import language._ + +scala> val S1 = typeOf[c.X.S1.type forSome { val c: C[_] }].typeSymbol.tpeHK +S1: u.Type = C.X.S1.type + +scala> val S2 = typeOf[O.S2].typeSymbol.tpeHK +S2: u.Type = C.this.S2 + +scala> val S3 = typeOf[O.S3].typeSymbol.tpeHK +S3: u.Type = O.S3 + +scala> val S4 = typeOf[S4].typeSymbol.tpeHK +S4: u.Type = S4 + +scala> val F = typeOf[c.F[_] forSome { val c: C[_] }].typeSymbol.tpeHK +F: u.Type = C.this.F + +scala> val fTpe = typeOf[O.type].decl(newTermName("foo")).paramss.head.head.tpe +fTpe: u.Type = O.F[Int] + +scala> def memType(sub: Type, scrut: Type): Type = + nestedMemberType(sub.typeSymbol, scrut.prefix, scrut.typeSymbol.owner) +memType: (sub: u.Type, scrut: u.Type)u.Type + +scala> + +scala> val mt1 = memType(S1, fTpe) +mt1: u.Type = O.X.S1.type + +scala> global.typeDeconstruct.show(mt1) +res0: String = +TypeRef( + pre = SingleType(pre = ThisType(object O), object X) + TypeSymbol(class S1 extends C.this.F[T]) +) + +scala> memType(S2, fTpe) +res1: u.Type = O.S2 + +scala> memType(S3, fTpe) +res2: u.Type = O.S3 + +scala> memType(S4, fTpe) +res3: u.Type = S4 + +scala> :quit diff --git a/tests/pending/run/t6146b.scala b/tests/pending/run/t6146b.scala new file mode 100644 index 000000000000..e63709aa9daf --- /dev/null +++ b/tests/pending/run/t6146b.scala @@ -0,0 +1,40 @@ +import scala.tools.partest.ReplTest + +class A { + sealed trait F[A] +} + +class C[T] extends A { + sealed trait F[A] + object X { + object S1 extends F[T] + } + class S2 extends F[T] +} +object O extends C[Int] { + def foo(f: F[Int]) = f match { case X.S1 => } + + class S3 extends F[Int] +} +class S4 extends O.F[String] + +object Test extends ReplTest { + override def code = """ +:power +val u = rootMirror.universe; import u._, language._ +val S1 = typeOf[c.X.S1.type forSome { val c: C[_] }].typeSymbol.tpeHK +val S2 = typeOf[O.S2].typeSymbol.tpeHK +val S3 = typeOf[O.S3].typeSymbol.tpeHK +val S4 = typeOf[S4].typeSymbol.tpeHK +val F = typeOf[c.F[_] forSome { val c: C[_] }].typeSymbol.tpeHK +val fTpe = typeOf[O.type].decl(newTermName("foo")).paramss.head.head.tpe +def memType(sub: Type, scrut: Type): Type = + nestedMemberType(sub.typeSymbol, scrut.prefix, scrut.typeSymbol.owner) + +val mt1 = memType(S1, fTpe) +global.typeDeconstruct.show(mt1) +memType(S2, fTpe) +memType(S3, fTpe) +memType(S4, fTpe) + """.stripMargin.trim +} \ No newline at end of file diff --git a/tests/pending/run/t6150.scala b/tests/pending/run/t6150.scala new file mode 100644 index 000000000000..f3e83e15497a --- /dev/null +++ b/tests/pending/run/t6150.scala @@ -0,0 +1,36 @@ +object Test { + import collection.{ immutable, mutable, generic } + def TheOneTrueCBF = collection.IndexedSeq.ReusableCBF + + val cbf1 = implicitly[generic.CanBuildFrom[immutable.Vector[Int], Int, collection.IndexedSeq[Int]]] + val cbf2 = implicitly[generic.CanBuildFrom[immutable.IndexedSeq[Int], Int, collection.IndexedSeq[Int]]] + val cbf3 = implicitly[generic.CanBuildFrom[collection.IndexedSeq[Int], Int, collection.IndexedSeq[Int]]] + + val cbf4 = implicitly[generic.CanBuildFrom[immutable.Vector[Int], Int, immutable.IndexedSeq[Int]]] + val cbf5 = implicitly[generic.CanBuildFrom[immutable.Vector[Int], Int, immutable.Vector[Int]]] + val cbf6 = implicitly[generic.CanBuildFrom[immutable.IndexedSeq[Int], Int, immutable.IndexedSeq[Int]]] + + def check[C](v: C) = { + assert(v == Vector(1, 2, 3, 4)) + assert(v.isInstanceOf[Vector[_]]) + } + def checkRealMccoy(x: AnyRef) = { + assert(x eq TheOneTrueCBF, cbf1) + } + + val v = immutable.Vector(1, 2, 3) + val iiv: immutable.IndexedSeq[Int] = immutable.Vector(1, 2, 3) + val iv: IndexedSeq[Int] = immutable.Vector(1, 2, 3) + + def main(args: Array[String]): Unit = { + List(cbf1, cbf2, cbf3, cbf4, cbf5, cbf6) foreach checkRealMccoy + check(v.:+(4)(cbf1)) + check(v.:+(4)(cbf2)) + check(v.:+(4)(cbf3)) + + check(iiv.:+(4)(cbf2)) + check(iiv.:+(4)(cbf3)) + + check(iv.:+(4)(cbf3)) + } +} diff --git a/tests/pending/run/t6154.check b/tests/pending/run/t6154.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t6154.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t6154.scala b/tests/pending/run/t6154.scala new file mode 100644 index 000000000000..47773490a561 --- /dev/null +++ b/tests/pending/run/t6154.scala @@ -0,0 +1,10 @@ +object Test { + def foo(a: Int): Unit = { + var bar: Int = 0 + bar = try { 0 } catch { case ex: Throwable => 0 } + new { foo(bar) } + } + + def main(args: Array[String]): Unit = + try foo(0) catch { case _: java.lang.StackOverflowError => println("ok") } +} diff --git a/tests/pending/run/t6168/Context.java b/tests/pending/run/t6168/Context.java new file mode 100644 index 000000000000..d0fb5d254376 --- /dev/null +++ b/tests/pending/run/t6168/Context.java @@ -0,0 +1,34 @@ +public class Context { + private ParentType parent; + + public Context() {} + + public ParentType getParent() { + return parent; + } + + public void setParent(ParentType parent) { + this.parent = parent; + } + + public Field intField() { + return new Field() { + @Override + public Integer get() { + return 0; + } + + @Override + public ParentType set(Integer t) { + return parent; + } + }; + } + + public abstract class Field { //Note this is a path dependent type + + public abstract T get(); + + public abstract ParentType set(T t); + } +} \ No newline at end of file diff --git a/tests/pending/run/t6168/JavaTest.java b/tests/pending/run/t6168/JavaTest.java new file mode 100644 index 000000000000..94ae91661d55 --- /dev/null +++ b/tests/pending/run/t6168/JavaTest.java @@ -0,0 +1,8 @@ +public class JavaTest { + public static void main(String[] args) { + SomeClass a = new SomeClass(); + SomeClass2 a2 = new SomeClass2(); + SomeClass b = a.f.set(23).f.set(23); + SomeClass2 b2 = a2.f.set(23).f.set(23); + } +} \ No newline at end of file diff --git a/tests/pending/run/t6168/SomeClass.java b/tests/pending/run/t6168/SomeClass.java new file mode 100644 index 000000000000..6f76b829bb6b --- /dev/null +++ b/tests/pending/run/t6168/SomeClass.java @@ -0,0 +1,14 @@ +public class SomeClass { + private final Context context = new Context(); + { + context.setParent(this); + } + + public final Context.Field f = context.intField(); + + public SomeClass() { + f.set(23).f.set(23); + } +} + + diff --git a/tests/pending/run/t6168/SomeClass2.java b/tests/pending/run/t6168/SomeClass2.java new file mode 100644 index 000000000000..b2c7a7540b21 --- /dev/null +++ b/tests/pending/run/t6168/SomeClass2.java @@ -0,0 +1,12 @@ +public class SomeClass2 { + private final Context context = new Context(); + { + context.setParent(this); + } + + public final Context.Field f = context.intField(); + + public SomeClass2() { + f.set(23).f.set(23); + } +} \ No newline at end of file diff --git a/tests/pending/run/t6168/main.scala b/tests/pending/run/t6168/main.scala new file mode 100644 index 000000000000..ed0c91fd76dc --- /dev/null +++ b/tests/pending/run/t6168/main.scala @@ -0,0 +1,15 @@ + + +object Test extends dotty.runtime.LegacyApp { + JavaTest.main(null) + + var a1 : SomeClass = new SomeClass + var a2 : SomeClass2 = new SomeClass2 + //import language.implicitConversions + //implicit def setParentType2SomeClass(x:Any) = x.asInstanceOf[SomeClass] + //implicit def setParentType2SomeClass2(x:Any) = x.asInstanceOf[SomeClass2] + //var b : SomeClass = a.f.set(23).asInstanceOf[SomeClass].f.set(23).asInstanceOf[SomeClass] + //var b2 : SomeClass2 = a2.f.set(23).asInstanceOf[SomeClass2].f.set(23).asInstanceOf[SomeClass2] + var b1 : SomeClass = a1.f.set(23).f.set(23) + var b2 : SomeClass2 = a2.f.set(23).f.set(23) +} diff --git a/tests/pending/run/t6168b/Context.java b/tests/pending/run/t6168b/Context.java new file mode 100644 index 000000000000..b3ea22126f21 --- /dev/null +++ b/tests/pending/run/t6168b/Context.java @@ -0,0 +1,34 @@ +public class Context { + private ParentType parent; + + public Context() {} + + public ParentType getParent() { + return parent; + } + + public void setParent(ParentType parent) { + this.parent = parent; + } + + public Field intField() { + return new Field() { + @Override + public Integer get() { + return 0; + } + + @Override + public ParentType set(Integer t) { + return parent; + } + }; + } + + public static abstract class Field { + + public abstract T get(); + + public abstract Object set(T t); + } +} \ No newline at end of file diff --git a/tests/pending/run/t6168b/JavaTest.java b/tests/pending/run/t6168b/JavaTest.java new file mode 100644 index 000000000000..a09fa0382d09 --- /dev/null +++ b/tests/pending/run/t6168b/JavaTest.java @@ -0,0 +1,6 @@ +public class JavaTest { + public static void main(String[] args) { + SomeClass a = new SomeClass(); + Object b = a.f.set(23); + } +} \ No newline at end of file diff --git a/tests/pending/run/t6168b/SomeClass.java b/tests/pending/run/t6168b/SomeClass.java new file mode 100644 index 000000000000..566c55e1c50b --- /dev/null +++ b/tests/pending/run/t6168b/SomeClass.java @@ -0,0 +1,11 @@ +public class SomeClass { + private final Context context = new Context(); + { + context.setParent(this); + } + + public final Context.Field f = context.intField(); + +} + + diff --git a/tests/pending/run/t6168b/main.scala b/tests/pending/run/t6168b/main.scala new file mode 100644 index 000000000000..b8871ba1a83d --- /dev/null +++ b/tests/pending/run/t6168b/main.scala @@ -0,0 +1,8 @@ + + +object Test extends dotty.runtime.LegacyApp { + JavaTest.main(null) + + var a1 : SomeClass = new SomeClass + var b1 : Object = a1.f.set(23) +} diff --git a/tests/pending/run/t6175.scala b/tests/pending/run/t6175.scala new file mode 100644 index 000000000000..963177c9c648 --- /dev/null +++ b/tests/pending/run/t6175.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + import reflect.runtime._ + val m = universe.typeOf[List[_]].members.head.asMethod + currentMirror.reflect (List (2, 3, 1)).reflectMethod(m) +} diff --git a/tests/pending/run/t6178.check b/tests/pending/run/t6178.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t6178.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t6178.scala b/tests/pending/run/t6178.scala new file mode 100644 index 000000000000..04833f6171dc --- /dev/null +++ b/tests/pending/run/t6178.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + val plus = typeOf[java.lang.String].member(TermName("$plus")).asMethod + println(cm.reflect("").reflectMethod(plus).apply("2")) +} diff --git a/tests/pending/run/t6181.check b/tests/pending/run/t6181.check new file mode 100644 index 000000000000..d8263ee98605 --- /dev/null +++ b/tests/pending/run/t6181.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/tests/pending/run/t6181.scala b/tests/pending/run/t6181.scala new file mode 100644 index 000000000000..13f07497c85e --- /dev/null +++ b/tests/pending/run/t6181.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class C { def test(x: => Int) = println(x) } + val mm = cm.reflect(new C).reflectMethod(typeOf[C].member(TermName("test")).asMethod) + mm(2) +} diff --git a/tests/pending/run/t6187.check b/tests/pending/run/t6187.check new file mode 100644 index 000000000000..9a9e266ec6a3 --- /dev/null +++ b/tests/pending/run/t6187.check @@ -0,0 +1,32 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +scala> def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.untypecheck(r.tree) ) +} +macroImpl: [T](c: scala.reflect.macros.blackbox.Context)(t: c.Expr[T])(implicit evidence$1: c.WeakTypeTag[T])c.Expr[List[T]] + +scala> def demo[T](t: T): List[T] = macro macroImpl[T] +defined term macro demo: [T](t: T)List[T] + +scala> def m[T](t: T): List[List[T]] = + demo( List((t,true)) collect { case (x,true) => x } ) +m: [T](t: T)List[List[T]] + +scala> m(List(1)) +res0: List[List[List[Int]]] = List(List(List(1))) + +scala> // Showing we haven't added unreachable warnings + +scala> List(1) collect { case x => x } +res1: List[Int] = List(1) + +scala> List("") collect { case x => x } +res2: List[String] = List("") + +scala> :quit diff --git a/tests/pending/run/t6187.scala b/tests/pending/run/t6187.scala new file mode 100644 index 000000000000..7a39cfd9e7ba --- /dev/null +++ b/tests/pending/run/t6187.scala @@ -0,0 +1,18 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ +import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context +def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.untypecheck(r.tree) ) +} +def demo[T](t: T): List[T] = macro macroImpl[T] +def m[T](t: T): List[List[T]] = + demo( List((t,true)) collect { case (x,true) => x } ) +m(List(1)) +// Showing we haven't added unreachable warnings +List(1) collect { case x => x } +List("") collect { case x => x } + """.trim +} diff --git a/tests/pending/run/t6187b.scala b/tests/pending/run/t6187b.scala new file mode 100644 index 000000000000..412880f38311 --- /dev/null +++ b/tests/pending/run/t6187b.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val x: PartialFunction[Int, Int] = { case 1 => 1 } + val o: Any = "" + assert(x.applyOrElse(0, (_: Int) => o) == "") +} diff --git a/tests/pending/run/t6188.check b/tests/pending/run/t6188.check new file mode 100644 index 000000000000..5d64afc47bbf --- /dev/null +++ b/tests/pending/run/t6188.check @@ -0,0 +1 @@ +Failure(java.lang.Exception: this is an exception) diff --git a/tests/pending/run/t6188.flags b/tests/pending/run/t6188.flags new file mode 100644 index 000000000000..0ebca3e7afeb --- /dev/null +++ b/tests/pending/run/t6188.flags @@ -0,0 +1 @@ + -optimize diff --git a/tests/pending/run/t6188.scala b/tests/pending/run/t6188.scala new file mode 100644 index 000000000000..b6261580e6be --- /dev/null +++ b/tests/pending/run/t6188.scala @@ -0,0 +1,12 @@ +// SI-6188 Optimizer incorrectly removes method invocations containing throw expressions + +import scala.util.Success + +object Test { + def main(args: Array[String]): Unit = { + val e = new Exception("this is an exception") + val res = Success(1).flatMap[Int](x => throw e) + println(res) + } +} + diff --git a/tests/pending/run/t6194.check b/tests/pending/run/t6194.check new file mode 100644 index 000000000000..b325f479d794 --- /dev/null +++ b/tests/pending/run/t6194.check @@ -0,0 +1 @@ +C:\FooBar\Java\includes\*.jar diff --git a/tests/pending/run/t6194.scala b/tests/pending/run/t6194.scala new file mode 100644 index 000000000000..ced325942725 --- /dev/null +++ b/tests/pending/run/t6194.scala @@ -0,0 +1,8 @@ +import scala.tools.nsc.util._ + +object Test { + def main(args: Array[String]): Unit = { + val cp = ClassPath.expandPath("""C:\FooBar\Java\includes\*.jar""") mkString java.io.File.pathSeparator + println(cp) + } +} diff --git a/tests/pending/run/t6196.scala b/tests/pending/run/t6196.scala new file mode 100644 index 000000000000..9ded3b9c0c48 --- /dev/null +++ b/tests/pending/run/t6196.scala @@ -0,0 +1,68 @@ +import scala.collection.immutable.HashSet + +object Test extends dotty.runtime.LegacyApp { + + case class Collision(value: Int) extends Ordered[Collision] { + def compare(that:Collision) = value compare that.value + + override def hashCode = value / 5 + } + + def testCorrectness[T : Ordering](n: Int, mkKey: Int => T): Unit = { + val o = implicitly[Ordering[T]] + val s = HashSet.empty[T] ++ (0 until n).map(mkKey) + for (i <- 0 until n) { + val ki = mkKey(i) + val a = s.filter(o.lt(_,ki)) + val b = s.filterNot(o.lt(_,ki)) + require(a.size == i && (0 until i).forall(i => a.contains(mkKey(i)))) + require(b.size == n - i && (i until n).forall(i => b.contains(mkKey(i)))) + } + } + + // this tests the structural sharing of the new filter + // I could not come up with a simple test that tests structural sharing when only parts are reused, but + // at least this fails with the old and passes with the new implementation + def testSharing(): Unit = { + val s = HashSet.empty[Int] ++ (0 until 100) + require(s.filter(_ => true) eq s) + require(s.filterNot(_ => false) eq s) + } + + // this tests that neither hashCode nor equals are called during filter + def testNoHashing(): Unit = { + var hashCount = 0 + var equalsCount = 0 + case class HashCounter(value:Int) extends Ordered[HashCounter] { + def compare(that:HashCounter) = value compare that.value + + override def hashCode = { + hashCount += 1 + value + } + + override def equals(that:Any) = { + equalsCount += 1 + that match { + case HashCounter(value) => this.value == value + case _ => false + } + } + } + + val s = HashSet.empty[HashCounter] ++ (0 until 100).map(HashCounter) + val hashCount0 = hashCount + val equalsCount0 = equalsCount + val t = s.filter(_1 with collisions should use HashSetCollision") + + // remove the collision again by removing all but one element + val y = x - Collision(0) + if(y.getClass.getSimpleName != "HashSet1") + println("HashSet of size 1 should use HashSet1" + y.getClass) +} diff --git a/tests/pending/run/t6199-mirror.check b/tests/pending/run/t6199-mirror.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t6199-mirror.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t6199-mirror.scala b/tests/pending/run/t6199-mirror.scala new file mode 100644 index 000000000000..1b061d4dd756 --- /dev/null +++ b/tests/pending/run/t6199-mirror.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class C { def foo = () } + println(cm.reflect(new C).reflectMethod(typeOf[C].member(TermName("foo")).asMethod)()) +} diff --git a/tests/pending/run/t6199-toolbox.check b/tests/pending/run/t6199-toolbox.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t6199-toolbox.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t6199-toolbox.scala b/tests/pending/run/t6199-toolbox.scala new file mode 100644 index 000000000000..08209b3464b0 --- /dev/null +++ b/tests/pending/run/t6199-toolbox.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + println(tb.eval(q"()")) +} diff --git a/tests/pending/run/t6200.scala b/tests/pending/run/t6200.scala new file mode 100644 index 000000000000..af348f56326c --- /dev/null +++ b/tests/pending/run/t6200.scala @@ -0,0 +1,68 @@ +import scala.collection.immutable.HashMap + +object Test extends dotty.runtime.LegacyApp { + + case class Collision(value: Int) extends Ordered[Collision] { + def compare(that: Collision) = value compare that.value + + override def hashCode = value / 5 + } + + def testCorrectness[T: Ordering](n: Int, mkKey: Int => T): Unit = { + val o = implicitly[Ordering[T]] + val s = HashMap.empty[T, Unit] ++ (0 until n).map(x => mkKey(x) -> (())) + for (i <- 0 until n) { + val ki = mkKey(i) + val a = s.filter(kv => o.lt(kv._1, ki)) + val b = s.filterNot(kv => o.lt(kv._1, ki)) + require(a.size == i && (0 until i).forall(i => a.contains(mkKey(i)))) + require(b.size == n - i && (i until n).forall(i => b.contains(mkKey(i)))) + } + } + + // this tests the structural sharing of the new filter + // I could not come up with a simple test that tests structural sharing when only parts are reused, but + // at least this fails with the old and passes with the new implementation + def testSharing(): Unit = { + val s = HashMap.empty[Int, Unit] ++ (0 until 100).map(_ -> (())) + require(s.filter(_ => true) eq s) + require(s.filterNot(_ => false) eq s) + } + + // this tests that neither hashCode nor equals are called during filter + def testNoHashing(): Unit = { + var hashCount = 0 + var equalsCount = 0 + case class HashCounter(value: Int) extends Ordered[HashCounter] { + def compare(that: HashCounter) = value compare that.value + + override def hashCode = { + hashCount += 1 + value + } + + override def equals(that: Any) = { + equalsCount += 1 + that match { + case HashCounter(value) => this.value == value + case _ => false + } + } + } + + val s = HashMap.empty[HashCounter, Unit] ++ (0 until 100).map(k => HashCounter(k) -> (())) + val hashCount0 = hashCount + val equalsCount0 = equalsCount + val t = s.filter(_._1 < HashCounter(50)) + require(hashCount == hashCount0) + require(equalsCount == equalsCount0) + } + + // this tests correctness of filter and filterNot for integer keys + testCorrectness[Int](100, identity _) + // this tests correctness of filter and filterNot for keys with lots of collisions + // this is necessary because usually collisions are rare so the collision-related code is not thoroughly tested + testCorrectness[Collision](100, Collision.apply _) + testSharing() + testNoHashing() +} diff --git a/tests/pending/run/t6206.check b/tests/pending/run/t6206.check new file mode 100644 index 000000000000..806457366744 --- /dev/null +++ b/tests/pending/run/t6206.check @@ -0,0 +1,4 @@ +outer +outer +inner +inner diff --git a/tests/pending/run/t6206.scala b/tests/pending/run/t6206.scala new file mode 100644 index 000000000000..668ade7f5059 --- /dev/null +++ b/tests/pending/run/t6206.scala @@ -0,0 +1,37 @@ +class Outer { + def apply( position : Inner ): Unit = {} + class Inner + + this.apply(new Inner) + this (new Inner) // error, +} + + +class Outer1 { + + self => + + def apply( position : Inner ) : String = "outer" + + class Inner( ) { + + def apply(arg: Inner): String = "inner" + + def testMe = { + List( + self.apply( this ), // a) this works + self( this ), // b) this does not work! + this apply this, + this(this) + ) foreach println + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + val o = new Outer1 + val i = new o.Inner + i.testMe + } +} diff --git a/tests/pending/run/t6220.scala b/tests/pending/run/t6220.scala new file mode 100644 index 000000000000..31af61ddcc7f --- /dev/null +++ b/tests/pending/run/t6220.scala @@ -0,0 +1,92 @@ +import scala.collection.immutable._ + +object Test extends dotty.runtime.LegacyApp { + + // finds an int x such that improved(x) differs in the first bit to improved(0), + // which is the worst case for the HashTrieSet + def findWorstCaseInts(): Unit = { + // copy of improve from HashSet + def improve(hcode: Int) = { + var h: Int = hcode + ~(hcode << 9) + h = h ^ (h >>> 14) + h = h + (h << 4) + h ^ (h >>> 10) + } + + // find two hashes which have a large separation + val x = 0 + var y = 1 + val ix = improve(x) + while(y!=0 && improve(y)!=ix+(1<<31)) + y+=1 + printf("%s %s %x %x\n",x,y,improve(x), improve(y)) + } + // this is not done every test run since it would slow down ant test.suite too much. + // findWorstCaseInts() + + // two numbers that are immediately adiacent when fed through HashSet.improve + val h0 = 0 + val h1 = 1270889724 + + // h is the hashcode, i is ignored for the hashcode but relevant for equality + case class Collision(h:Int, i:Int) { + override def hashCode = h + } + val a = Collision(h0,0) + val b = Collision(h0,1) + val c = Collision(h1,0) + + // create a HashSetCollision1 + val x = HashSet(a) + b + if(x.getClass.getSimpleName != "HashSetCollision1") + println("x should be a collision") + StructureTests.validate(x) + // StructureTests.printStructure(x) + require(x.size==2 && x.contains(a) && x.contains(b)) + + // go from a HashSetCollision1 to a HashTrieSet with maximum depth + val y = x + c + if(y.getClass.getSimpleName != "HashTrieSet") + println("y should be a HashTrieSet") + StructureTests.validate(y) + // StructureTests.printStructure(y) + require(y.size==3 && y.contains(a) && y.contains(b) && y.contains(c)) + + // go from a HashSet1 directly to a HashTrieSet with maximum depth + val z = HashSet(a) + c + if(y.getClass.getSimpleName != "HashTrieSet") + println("y should be a HashTrieSet") + StructureTests.validate(z) + // StructureTests.printStructure(z) + require(z.size == 2 && z.contains(a) && z.contains(c)) +} + +package scala.collection.immutable { + object StructureTests { + def printStructure(x:HashSet[_], prefix:String=""): Unit = { + x match { + case m:HashSet.HashTrieSet[_] => + println(prefix+m.getClass.getSimpleName + " " + m.size) + m.elems.foreach(child => printStructure(child, prefix + " ")) + case m:HashSet.HashSetCollision1[_] => + println(prefix+m.getClass.getSimpleName + " " + m.ks.size) + case m:HashSet.HashSet1[_] => + println(prefix+m.getClass.getSimpleName + " " + m.head) + case _ => + println(prefix+"empty") + } + } + + def validate(x:HashSet[_]): Unit = { + x match { + case m:HashSet.HashTrieSet[_] => + require(m.elems.size>1 || (m.elems.size==1 && m.elems(0).isInstanceOf[HashSet.HashTrieSet[_]])) + m.elems.foreach(validate _) + case m:HashSet.HashSetCollision1[_] => + require(m.ks.size>1) + case m:HashSet.HashSet1[_] => + case _ => + } + } + } +} diff --git a/tests/pending/run/t6221.check b/tests/pending/run/t6221.check new file mode 100644 index 000000000000..aa1bdd0e6ede --- /dev/null +++ b/tests/pending/run/t6221.check @@ -0,0 +1 @@ +((x) => x.$percent(2).$eq$eq(0)) diff --git a/tests/pending/run/t6221/Macros_1.scala b/tests/pending/run/t6221/Macros_1.scala new file mode 100644 index 000000000000..0aeaa00c8670 --- /dev/null +++ b/tests/pending/run/t6221/Macros_1.scala @@ -0,0 +1,23 @@ +import language.experimental.macros +import language.implicitConversions +import scala.reflect.macros.blackbox.Context +import scala.reflect.runtime.universe.Tree + +class ReflectiveClosure[A, B](val tree: Tree, fn: A => B) extends (A => B) { + def apply(x: A) = fn(x) +} + +object ReflectiveClosure { + implicit def reflectClosure[A, B](f: A => B): ReflectiveClosure[A, B] = macro Macros.reflectiveClosureImpl[A, B] +} + +object Macros { + def reflectiveClosureImpl[A, B](c: Context)(f: c.Expr[A => B]): c.Expr[ReflectiveClosure[A, B]] = { + import c.universe._ + import internal._ + val u = gen.mkRuntimeUniverseRef + val m = EmptyTree + val tree = c.Expr[scala.reflect.runtime.universe.Tree](Select(c.reifyTree(u, m, f.tree), newTermName("tree"))) + c.universe.reify(new ReflectiveClosure(tree.splice, f.splice)) + } +} diff --git a/tests/pending/run/t6221/Test_2.scala b/tests/pending/run/t6221/Test_2.scala new file mode 100644 index 000000000000..bc295d4372b6 --- /dev/null +++ b/tests/pending/run/t6221/Test_2.scala @@ -0,0 +1,10 @@ +object Test extends dotty.runtime.LegacyApp { + implicit class PimpedList[T](val list: List[T]) { + def query(predicate: ReflectiveClosure[T, Boolean]): List[T] = { + println(predicate.tree) + list filter predicate + } + } + + List(1, 2, 3).query(x => x % 2 == 0) +} \ No newline at end of file diff --git a/tests/pending/run/t6223.check b/tests/pending/run/t6223.check new file mode 100644 index 000000000000..4a09d1930f69 --- /dev/null +++ b/tests/pending/run/t6223.check @@ -0,0 +1,4 @@ +bar +bar$mIc$sp +bar$mIcI$sp +bar$mcI$sp diff --git a/tests/pending/run/t6223.scala b/tests/pending/run/t6223.scala new file mode 100644 index 000000000000..68a91a82ff7e --- /dev/null +++ b/tests/pending/run/t6223.scala @@ -0,0 +1,11 @@ +class Foo[@specialized(Int) A](a:A) { + def bar[@specialized(Int) B](f:A => B) = new Foo(f(a)) +} + +object Test { + def main(args:Array[String]): Unit = { + val f = new Foo(333) + val ms = f.getClass().getDeclaredMethods().map(_.getName).sorted + ms.foreach(println) + } +} diff --git a/tests/pending/run/t6240-universe-code-gen.scala b/tests/pending/run/t6240-universe-code-gen.scala new file mode 100644 index 000000000000..4a213c39df08 --- /dev/null +++ b/tests/pending/run/t6240-universe-code-gen.scala @@ -0,0 +1,82 @@ +import scala.tools.partest.nest.FileManager._ + +object Test extends dotty.runtime.LegacyApp { + val cm = reflect.runtime.currentMirror + val u = cm.universe + import u._ + + val JavaUniverseTpe = typeOf[reflect.runtime.JavaUniverse] + val DefinitionsModule = JavaUniverseTpe.member(TermName("definitions")) + + def forceCode(prefix: String, tp: Type): String = { + def isLazyAccessorOrObject(sym: Symbol) = ( + (sym.isMethod && sym.asMethod.isLazy) + || sym.isModule + ) + val forcables = tp.members.sorted.filter(isLazyAccessorOrObject) + forcables.map { + sym => + val path = s"$prefix.${sym.name}" + " " + ( + if (sym.isPrivate || sym.isProtected) s"// inaccessible: $path" + else path + ) + }.mkString("\n") + } + + val code = + s"""|// Generated Code, validated by run/t6240-universe-code-gen.scala + |package scala.reflect + |package runtime + | + |trait JavaUniverseForce { self: runtime.JavaUniverse => + | def force() { + | Literal(Constant(42)).duplicate + | nme.flattenedName() + | nme.raw + | WeakTypeTag + | TypeTag + | TypeTag.Byte.tpe + | TypeTag.Short.tpe + | TypeTag.Char.tpe + | TypeTag.Int.tpe + | TypeTag.Long.tpe + | TypeTag.Float.tpe + | TypeTag.Double.tpe + | TypeTag.Boolean.tpe + | TypeTag.Unit.tpe + | TypeTag.Any.tpe + | TypeTag.AnyVal.tpe + | TypeTag.AnyRef.tpe + | TypeTag.Object.tpe + | TypeTag.Nothing.tpe + | TypeTag.Null.tpe + | + |${forceCode("this", JavaUniverseTpe)} + |${forceCode("definitions", DefinitionsModule.info)} + |${forceCode("refChecks", typeOf[scala.reflect.internal.transform.RefChecks])} + |${forceCode("uncurry", typeOf[scala.reflect.internal.transform.UnCurry])} + |${forceCode("erasure", typeOf[scala.reflect.internal.transform.Erasure])} + | } + |}""".stripMargin + + import java.io.File + val testFile = new File(sys.props("partest.test-path")) + val actualFile = new java.io.File(testFile.getParent + "/../../../src/reflect/scala/reflect/runtime/JavaUniverseForce.scala").getCanonicalFile + val actual = scala.io.Source.fromFile(actualFile) + val actualLines = actual.getLines.toList + val generatedLines = code.lines.toList + if (actualLines != generatedLines) { + val msg = s"""|${actualFile} must be updated. + |=========================================================== + | DIFF: + |=========================================================== + |${compareContents(actualLines, generatedLines)} + |=========================================================== + | NEW CONTENTS: + |=========================================================== + |${code}""".stripMargin + + assert(false, msg) + } +} diff --git a/tests/pending/run/t6240a.check b/tests/pending/run/t6240a.check new file mode 100644 index 000000000000..29f695b6f400 --- /dev/null +++ b/tests/pending/run/t6240a.check @@ -0,0 +1 @@ +StepTwo.type diff --git a/tests/pending/run/t6240a/StepOne.java b/tests/pending/run/t6240a/StepOne.java new file mode 100644 index 000000000000..342d617c79df --- /dev/null +++ b/tests/pending/run/t6240a/StepOne.java @@ -0,0 +1,41 @@ +import java.io.File; +import java.io.IOException; +import java.lang.ClassNotFoundException; +import java.lang.NoSuchMethodException; +import java.lang.IllegalAccessException; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.MalformedURLException; + +public class StepOne { + public static void main(String[] args) + throws MalformedURLException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException { + String[] launchPaths = System.getProperty("launch.classpath").split(File.pathSeparator); + + // move away StepThree + File tempDir = File.createTempFile("temp", Long.toString(System.nanoTime())); + System.setProperty("launch.step.three", tempDir.getAbsolutePath()); + tempDir.delete(); + tempDir.mkdir(); + File[] testClasses = new File(launchPaths[0]).listFiles(); + for (int i = 0; i < testClasses.length; i++) { + File testClass = testClasses[i]; + if (testClass.getPath().contains("StepThree")) { + File testClassMoved = new File(tempDir.getAbsolutePath() + "/" + testClass.getName()); + testClass.renameTo(testClassMoved); + } + } + + // launch StepTwo + URL[] launchURLs = new URL[launchPaths.length]; + for (int i = 0; i < launchPaths.length; i++) { + launchURLs[i] = new File(launchPaths[i]).toURL(); + } + URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader()); + Class stepTwo = classLoader.loadClass("StepTwo"); + Method main = stepTwo.getDeclaredMethod("main", String[].class); + main.invoke(null, (Object)(new String[]{})); + } +} diff --git a/tests/pending/run/t6240a/StepTwo.scala b/tests/pending/run/t6240a/StepTwo.scala new file mode 100644 index 000000000000..d2232c3f7e43 --- /dev/null +++ b/tests/pending/run/t6240a/StepTwo.scala @@ -0,0 +1,7 @@ +import java.io.File +import java.net.URLClassLoader + +object StepTwo extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + println(typeOf[StepTwo.type]) +} diff --git a/tests/pending/run/t6240a/Test.scala b/tests/pending/run/t6240a/Test.scala new file mode 100644 index 000000000000..e474b554c77a --- /dev/null +++ b/tests/pending/run/t6240a/Test.scala @@ -0,0 +1,15 @@ +import java.io.File +import scala.sys.process._ + +object Test extends dotty.runtime.LegacyApp { + def prop(key: String) = { + val value = System.getProperties.getProperty(key) + assert(value != null, key) + value + } + val testClassesDir = prop("partest.output") + assert(new File(testClassesDir).exists, testClassesDir) + val fullTestClassesClasspath = testClassesDir + prop("path.separator") + prop("java.class.path") + val javaBinary = if (new File(prop("javacmd")).isAbsolute) prop("javacmd") else prop("java.home") + "/bin/" + prop("javacmd") + List(javaBinary, "-cp", testClassesDir, "-Dlaunch.classpath=" + fullTestClassesClasspath, "StepOne").! +} diff --git a/tests/pending/run/t6240b.check b/tests/pending/run/t6240b.check new file mode 100644 index 000000000000..255836105ac6 --- /dev/null +++ b/tests/pending/run/t6240b.check @@ -0,0 +1 @@ +StepThree.type diff --git a/tests/pending/run/t6240b/StepOne.java b/tests/pending/run/t6240b/StepOne.java new file mode 100644 index 000000000000..342d617c79df --- /dev/null +++ b/tests/pending/run/t6240b/StepOne.java @@ -0,0 +1,41 @@ +import java.io.File; +import java.io.IOException; +import java.lang.ClassNotFoundException; +import java.lang.NoSuchMethodException; +import java.lang.IllegalAccessException; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.MalformedURLException; + +public class StepOne { + public static void main(String[] args) + throws MalformedURLException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException { + String[] launchPaths = System.getProperty("launch.classpath").split(File.pathSeparator); + + // move away StepThree + File tempDir = File.createTempFile("temp", Long.toString(System.nanoTime())); + System.setProperty("launch.step.three", tempDir.getAbsolutePath()); + tempDir.delete(); + tempDir.mkdir(); + File[] testClasses = new File(launchPaths[0]).listFiles(); + for (int i = 0; i < testClasses.length; i++) { + File testClass = testClasses[i]; + if (testClass.getPath().contains("StepThree")) { + File testClassMoved = new File(tempDir.getAbsolutePath() + "/" + testClass.getName()); + testClass.renameTo(testClassMoved); + } + } + + // launch StepTwo + URL[] launchURLs = new URL[launchPaths.length]; + for (int i = 0; i < launchPaths.length; i++) { + launchURLs[i] = new File(launchPaths[i]).toURL(); + } + URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader()); + Class stepTwo = classLoader.loadClass("StepTwo"); + Method main = stepTwo.getDeclaredMethod("main", String[].class); + main.invoke(null, (Object)(new String[]{})); + } +} diff --git a/tests/pending/run/t6240b/StepThree.scala b/tests/pending/run/t6240b/StepThree.scala new file mode 100644 index 000000000000..a5432cdf1c1b --- /dev/null +++ b/tests/pending/run/t6240b/StepThree.scala @@ -0,0 +1,4 @@ +object StepThree extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + println(typeOf[StepThree.type]) +} diff --git a/tests/pending/run/t6240b/StepTwo.scala b/tests/pending/run/t6240b/StepTwo.scala new file mode 100644 index 000000000000..b3d977819869 --- /dev/null +++ b/tests/pending/run/t6240b/StepTwo.scala @@ -0,0 +1,10 @@ +import java.io.File +import java.net.URLClassLoader + +object StepTwo extends dotty.runtime.LegacyApp { + val classes = new File(System.getProperty("launch.step.three")) + val cl = new URLClassLoader(Array(classes.toURI.toURL), getClass.getClassLoader) + val stepThree = cl.loadClass("StepThree") + val main = stepThree.getDeclaredMethod("main", classOf[Array[String]]) + main.invoke(null, Array[String]()) +} diff --git a/tests/pending/run/t6240b/Test.scala b/tests/pending/run/t6240b/Test.scala new file mode 100644 index 000000000000..e474b554c77a --- /dev/null +++ b/tests/pending/run/t6240b/Test.scala @@ -0,0 +1,15 @@ +import java.io.File +import scala.sys.process._ + +object Test extends dotty.runtime.LegacyApp { + def prop(key: String) = { + val value = System.getProperties.getProperty(key) + assert(value != null, key) + value + } + val testClassesDir = prop("partest.output") + assert(new File(testClassesDir).exists, testClassesDir) + val fullTestClassesClasspath = testClassesDir + prop("path.separator") + prop("java.class.path") + val javaBinary = if (new File(prop("javacmd")).isAbsolute) prop("javacmd") else prop("java.home") + "/bin/" + prop("javacmd") + List(javaBinary, "-cp", testClassesDir, "-Dlaunch.classpath=" + fullTestClassesClasspath, "StepOne").! +} diff --git a/tests/pending/run/t6246.check b/tests/pending/run/t6246.check new file mode 100644 index 000000000000..9532185ead86 --- /dev/null +++ b/tests/pending/run/t6246.check @@ -0,0 +1,90 @@ +runtimeClass = byte, toString = Byte +true +true +true +false +true +false +false +false +false +runtimeClass = short, toString = Short +true +true +true +false +true +false +false +false +false +runtimeClass = char, toString = Char +true +true +true +false +true +false +false +false +false +runtimeClass = int, toString = Int +true +true +true +false +true +false +false +false +false +runtimeClass = long, toString = Long +true +true +true +false +true +false +false +false +false +runtimeClass = float, toString = Float +true +true +true +false +true +false +false +false +false +runtimeClass = double, toString = Double +true +true +true +false +true +false +false +false +false +runtimeClass = void, toString = Unit +true +true +true +false +true +false +false +false +false +runtimeClass = boolean, toString = Boolean +true +true +true +false +true +false +false +false +false \ No newline at end of file diff --git a/tests/pending/run/t6246.scala b/tests/pending/run/t6246.scala new file mode 100644 index 000000000000..179ef8690e2f --- /dev/null +++ b/tests/pending/run/t6246.scala @@ -0,0 +1,27 @@ +import scala.reflect.{ClassTag, classTag} + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + def testValueClass(tag: ClassTag[_]): Unit = { + println(s"runtimeClass = ${tag.runtimeClass}, toString = ${tag.toString}") + println(tag <:< tag) + println(tag <:< ClassTag.AnyVal) + println(tag <:< ClassTag.Any) + println(tag <:< ClassTag.Nothing) + println(ClassTag.Nothing <:< tag) + println(tag <:< ClassTag.Null) + println(ClassTag.Null <:< tag) + println(tag <:< ClassTag.Object) + println(ClassTag.Object <:< tag) + } + + testValueClass(ClassTag.Byte) + testValueClass(ClassTag.Short) + testValueClass(ClassTag.Char) + testValueClass(ClassTag.Int) + testValueClass(ClassTag.Long) + testValueClass(ClassTag.Float) + testValueClass(ClassTag.Double) + testValueClass(ClassTag.Unit) + testValueClass(ClassTag.Boolean) +} diff --git a/tests/pending/run/t6253a.scala b/tests/pending/run/t6253a.scala new file mode 100644 index 000000000000..c2db1f5afed6 --- /dev/null +++ b/tests/pending/run/t6253a.scala @@ -0,0 +1,64 @@ +import scala.collection.immutable.HashSet + +object Test extends dotty.runtime.LegacyApp { + + var hashCount = 0 + + /** + * A key that produces lots of hash collisions, to exercise the part of the code that deals with those + */ + case class Collision(value: Int) { + + override def hashCode = { + // we do not check hash counts for Collision keys because ListSet.++ uses a mutable hashset internally, + // so when we have hash collisions, union will call key.hashCode. + // hashCount += 1 + value / 5 + } + } + + /** + * A key that is identical to int other than that it counts hashCode invocations + */ + case class HashCounter(value: Int) { + + override def hashCode = { + hashCount += 1 + value + } + } + + def testUnion[T](sizes: Seq[Int], offsets: Seq[Double], keyType: String, mkKey: Int => T): Unit = { + for { + i <- sizes + o <- offsets + } { + val e = HashSet.empty[T] + val j = (i * o).toInt + // create two sets of size i with overlap o + val a = e ++ (0 until i).map(mkKey) + require(a.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val b = e ++ (j until (i + j)).map(mkKey) + require(b.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val as = e ++ (0 until j).map(mkKey) + require(as.size == j, s"Building HashSet of size $j failed. Key type $keyType.") + val hashCount0 = hashCount + val u = a union b + require(hashCount == hashCount0, s"key.hashCode should not be called, but has been called ${hashCount - hashCount0} times. Key type $keyType.") + require(u == (a union scala.collection.mutable.HashSet(b.toSeq: _*)), s"Operation must still work for other sets!") + require(u.size == i + j, s"Expected size ${i+j}. Real size ${u.size}. Key type $keyType.") + for (x <- 0 until i + j) + require(u.contains(mkKey(x)), s"Key type $keyType. Set (0 until ${i + j}) should contain $x but does not.") + val a_as = a union as + val as_a = as union a + require((a_as eq a) || (a_as eq as), s"No structural sharing in a union as. Key type $keyType, a=(0 until $i) as=(0 until $j)") + require((as_a eq a) || (as_a eq as), s"No structural sharing in as union a. Key type $keyType, a=(0 until $i) as=(0 until $j)") + } + } + + val sizes = Seq(1, 10, 100, 1000, 10000, 100000) + val offsets = Seq(0.0, 0.25, 0.5, 0.75, 1.0) + testUnion(sizes, offsets, "int", identity[Int]) + testUnion(sizes, offsets, "hashcounter", HashCounter.apply) + testUnion(sizes, offsets, "collision", Collision.apply) +} diff --git a/tests/pending/run/t6253b.scala b/tests/pending/run/t6253b.scala new file mode 100644 index 000000000000..c049aea7f6a2 --- /dev/null +++ b/tests/pending/run/t6253b.scala @@ -0,0 +1,62 @@ +import scala.collection.immutable.HashSet + +object Test extends dotty.runtime.LegacyApp { + + var hashCount = 0 + + /** + * A key that produces lots of hash collisions, to exercise the part of the code that deals with those + */ + case class Collision(value: Int) { + + override def hashCode = { + hashCount += 1 + value / 5 + } + } + + /** + * A key that is identical to int other than that it counts hashCode invocations + */ + case class HashCounter(value: Int) { + + override def hashCode = { + hashCount += 1 + value + } + } + + def testIntersect[T](sizes: Seq[Int], offsets: Seq[Double], keyType: String, mkKey: Int => T): Unit = { + for { + i <- sizes + o <- offsets + } { + val e = HashSet.empty[T] + val j = (i * o).toInt + // create two sets of size i with overlap o + val a = e ++ (0 until i).map(mkKey) + require(a.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val b = e ++ (j until (i + j)).map(mkKey) + require(b.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val as = e ++ (0 until j).map(mkKey) + require(as.size == j, s"Building HashSet of size $j failed. Key type $keyType.") + val hashCount0 = hashCount + val u = a intersect b + require(hashCount == hashCount0, s"key.hashCode should not be called, but has been called ${hashCount - hashCount0} times. Key type $keyType.") + require(u == (a intersect scala.collection.mutable.HashSet(b.toSeq: _*)), s"Operation must still work for other sets!") + require(u.size == i - j, s"Expected size ${i + j}. Real size ${u.size}. Key type $keyType.") + for (x <- j until i) + require(u.contains(mkKey(x)), s"Key type $keyType. Set (0 until ${i + j}) should contain $x but does not.") + val a_as = a intersect as + val as_a = as intersect a + require((a_as eq as) || (a_as eq a), s"No structural sharing in a intersect as. Key type $keyType, a=(0 until $i) as=(0 until $j)") + require((as_a eq as) || (as_a eq a), s"No structural sharing in as intersect a. Key type $keyType, a=(0 until $i) as=(0 until $j)") + } + } + + val sizes = Seq(1, 10, 100, 1000, 10000, 100000) + val offsets = Seq(0.0, 0.25, 0.5, 0.75, 1.0) + testIntersect(sizes, offsets, "int", identity[Int]) + testIntersect(sizes, offsets, "hashcounter", HashCounter.apply) + testIntersect(sizes, offsets, "collision", Collision.apply) +} diff --git a/tests/pending/run/t6253c.scala b/tests/pending/run/t6253c.scala new file mode 100644 index 000000000000..39c3a5b17f0a --- /dev/null +++ b/tests/pending/run/t6253c.scala @@ -0,0 +1,63 @@ +import scala.collection.immutable.HashSet + +object Test extends dotty.runtime.LegacyApp { + + var hashCount = 0 + + /** + * A key that produces lots of hash collisions, to exercise the part of the code that deals with those + */ + case class Collision(value: Int) { + + override def hashCode = { + hashCount += 1 + value / 5 + } + } + + /** + * A key that is identical to int other than that it counts hashCode invocations + */ + case class HashCounter(value: Int) { + + override def hashCode = { + hashCount += 1 + value + } + } + + def testDiff[T](sizes: Seq[Int], offsets: Seq[Double], keyType: String, mkKey: Int => T): Unit = { + for { + i <- sizes + o <- offsets + } { + val e = HashSet.empty[T] + val j = (i * o).toInt + // create two sets of size i with overlap o + val a = e ++ (0 until i).map(mkKey) + require(a.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val b = e ++ (j until (i + j)).map(mkKey) + require(b.size == i, s"Building HashSet of size $i failed. Key type $keyType.") + val as = e ++ (0 until j).map(mkKey) + require(as.size == j, s"Building HashSet of size $j failed. Key type $keyType.") + val hashCount0 = hashCount + val u = a diff b + require(hashCount == hashCount0, s"key.hashCode should not be called, but has been called ${hashCount - hashCount0} times. Key type $keyType.") + require(u == (a diff scala.collection.mutable.HashSet(b.toSeq: _*)), s"Operation must still work for other sets!") + require(u.size == j, s"Expected size $j. Real size ${u.size}. Key type $keyType.") + for (x <- 0 until j) + require(u.contains(mkKey(x)), s"Key type $keyType. Set (0 until ${i + j}) should contain $x but does not.") + require((as intersect b).isEmpty) + val b_as = b diff as + val as_b = as diff b + require((b_as eq b) || (b_as eq as), s"No structural sharing in b diff as. Key type $keyType, b=($j until ${i + j}) as=(0 until $j)") + require((as_b eq b) || (as_b eq as), s"No structural sharing in as diff b. Key type $keyType, b=($j until ${i + j}) as=(0 until $j)") + } + } + + val sizes = Seq(1, 10, 100, 1000, 10000, 100000) + val offsets = Seq(0.0, 0.25, 0.5, 0.75, 1.0) + testDiff(sizes, offsets, "int", identity[Int]) + testDiff(sizes, offsets, "hashCounter", HashCounter.apply) + testDiff(sizes, offsets, "collision", Collision.apply) +} diff --git a/tests/pending/run/t6259.scala b/tests/pending/run/t6259.scala new file mode 100644 index 000000000000..9b4d76b519bd --- /dev/null +++ b/tests/pending/run/t6259.scala @@ -0,0 +1,58 @@ +import scala.reflect.runtime.universe._ + +class A[X](implicit val tt: TypeTag[X]) {} +object B extends A[String] + +object C { + object D extends A[String] +} + +trait E { + object F extends A[String] +} + +class G { + object H extends A[String] +} + +object HasX { + val x = { + object InVal extends A[String] + InVal + 5 + } + +} + +trait NeedsEarly { + val x: AnyRef +} + +object Early extends NeedsEarly { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +val x = { object EarlyOk extends A[String]; EarlyOk } +// END copied early initializers +} + + +class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X] + +object DoubleOk extends DoubleTrouble[String]({ + // Drops to this.getClass and is an issue + object InnerTrouble extends A[String]; + InnerTrouble +}) + +object Test extends dotty.runtime.LegacyApp { + B + C.D + val e = new E {}; e.F + val g = new G; g.H + + locally(HasX.x) + // locally(Early.x) TODO sort out VerifyError in Early$. + // DoubleOk TODO sort out VerifyError in DoubleOk$. +} + + diff --git a/tests/pending/run/t6260-delambdafy.check b/tests/pending/run/t6260-delambdafy.check new file mode 100644 index 000000000000..b2a7bed98890 --- /dev/null +++ b/tests/pending/run/t6260-delambdafy.check @@ -0,0 +1,4 @@ +f(C@2e) + +Test$lambda$1$$apply +apply diff --git a/tests/pending/run/t6260-delambdafy.flags b/tests/pending/run/t6260-delambdafy.flags new file mode 100644 index 000000000000..48b438ddf86a --- /dev/null +++ b/tests/pending/run/t6260-delambdafy.flags @@ -0,0 +1 @@ +-Ydelambdafy:method diff --git a/tests/pending/run/t6260-delambdafy.scala b/tests/pending/run/t6260-delambdafy.scala new file mode 100644 index 000000000000..a4a3cfc8ff02 --- /dev/null +++ b/tests/pending/run/t6260-delambdafy.scala @@ -0,0 +1,12 @@ +class C[A](private val a: Any) extends AnyVal + +object Test { + val f = (x: C[Any]) => {println(s"f($x)"); x} + def main(args: Array[String]): Unit = { + f(new C(".")) + val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted + println("") + println(methods.mkString("\n")) + } +} + diff --git a/tests/pending/run/t6260.check b/tests/pending/run/t6260.check new file mode 100644 index 000000000000..54f98a10f0f5 --- /dev/null +++ b/tests/pending/run/t6260.check @@ -0,0 +1 @@ +Box(abcabc) diff --git a/tests/pending/run/t6260.scala b/tests/pending/run/t6260.scala new file mode 100644 index 000000000000..3ad4926c831c --- /dev/null +++ b/tests/pending/run/t6260.scala @@ -0,0 +1,12 @@ +class Box[X <: CharSequence](val x: X) extends AnyVal { + def map[Y <: CharSequence](f: X => Y): Box[Y] = + ((bx: Box[X]) => new Box(f(bx.x)))(this) + override def toString = s"Box($x)" +} + +object Test { + def main(args: Array[String]): Unit = { + val g = (x: String) => x + x + println(new Box("abc") map g) + } +} diff --git a/tests/pending/run/t6260b.scala b/tests/pending/run/t6260b.scala new file mode 100644 index 000000000000..4450ac4fe16d --- /dev/null +++ b/tests/pending/run/t6260b.scala @@ -0,0 +1,13 @@ +class C[A](val a: A) extends AnyVal + +class DD { + def foo(c: C[String]) = () + def bar[A <: String](c: C[A]) = () + def baz[A](c: C[A]) = () +} + +object Test extends dotty.runtime.LegacyApp { + classOf[DD].getMethod("foo", classOf[String]) + classOf[DD].getMethod("bar", classOf[String]) + classOf[DD].getMethod("baz", classOf[Object]) +} diff --git a/tests/pending/run/t6260c.check b/tests/pending/run/t6260c.check new file mode 100644 index 000000000000..78e9b273711a --- /dev/null +++ b/tests/pending/run/t6260c.check @@ -0,0 +1,9 @@ +f(C@2e) + +#partest !-Ydelambdafy:method +Test$$anonfun$$apply +#partest -Ydelambdafy:method +Test$lambda$1$$apply +#partest +apply +g(C@2e) diff --git a/tests/pending/run/t6260c.scala b/tests/pending/run/t6260c.scala new file mode 100644 index 000000000000..30d0cd87b46d --- /dev/null +++ b/tests/pending/run/t6260c.scala @@ -0,0 +1,17 @@ +class C[A](private val a: Any) extends AnyVal + +object Test { + val f = (x: C[Any]) => {println(s"f($x)"); x} + trait T[A] { + def apply(a: A): A + } + val g = new T[C[Any]] { def apply(a: C[Any]) = { println(s"g($a)"); a } } + def main(args: Array[String]): Unit = { + f(new C(".")) + val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted + println("") + println(methods.mkString("\n")) + g.apply(new C(".")) + } +} + diff --git a/tests/pending/run/t6261.scala b/tests/pending/run/t6261.scala new file mode 100644 index 000000000000..580f4009a850 --- /dev/null +++ b/tests/pending/run/t6261.scala @@ -0,0 +1,123 @@ +import scala.collection.immutable._ + +object Test extends dotty.runtime.LegacyApp { + + def test1(): Unit = { + // test that a HashTrieMap with one leaf element is not created! + val x = HashMap.empty + (1->1) + (2->2) + if(x.getClass.getSimpleName != "HashTrieMap") + println("A hash map containing two non-colliding values should be a HashTrieMap") + + val y = x - 1 + if(y.getClass.getSimpleName != "HashMap1") + println("A hash map containing one element should always use HashMap1") + } + + def test2(): Unit = { + // class that always causes hash collisions + case class Collision(value:Int) { override def hashCode = 0 } + + // create a set that should have a collison + val x = HashMap.empty + (Collision(0)->0) + (Collision(1) ->0) + if(x.getClass.getSimpleName != "HashMapCollision1") + println("HashMap of size >1 with collisions should use HashMapCollision") + + // remove the collision again by removing all but one element + val y = x - Collision(0) + if(y.getClass.getSimpleName != "HashMap1") + println("HashMap of size 1 should use HashMap1" + y.getClass) + } + def test3(): Unit = { + // finds an int x such that improved(x) differs in the first bit to improved(0), + // which is the worst case for the HashTrieSet + def findWorstCaseInts(): Unit = { + // copy of improve from HashSet + def improve(hcode: Int) = { + var h: Int = hcode + ~(hcode << 9) + h = h ^ (h >>> 14) + h = h + (h << 4) + h ^ (h >>> 10) + } + + // find two hashes which have a large separation + val x = 0 + var y = 1 + val ix = improve(x) + while(y!=0 && improve(y)!=ix+(1<<31)) + y+=1 + printf("%s %s %x %x\n",x,y,improve(x), improve(y)) + } + // this is not done every test run since it would slow down ant test.suite too much. + // findWorstCaseInts() + + // two numbers that are immediately adiacent when fed through HashSet.improve + val h0 = 0 + val h1 = 1270889724 + + // h is the hashcode, i is ignored for the hashcode but relevant for equality + case class Collision(h:Int, i:Int) { + override def hashCode = h + } + val a = Collision(h0,0)->0 + val b = Collision(h0,1)->0 + val c = Collision(h1,0)->0 + + // create a HashSetCollision1 + val x = HashMap(a) + b + if(x.getClass.getSimpleName != "HashMapCollision1") + println("x should be a HashMapCollision") + StructureTests.validate(x) + //StructureTests.printStructure(x) + require(x.size==2 && x.contains(a._1) && x.contains(b._1)) + + // go from a HashSetCollision1 to a HashTrieSet with maximum depth + val y = x + c + if(y.getClass.getSimpleName != "HashTrieMap") + println("y should be a HashTrieMap") + StructureTests.validate(y) + // StructureTests.printStructure(y) + require(y.size==3 && y.contains(a._1) && y.contains(b._1) && y.contains(c._1)) + + // go from a HashSet1 directly to a HashTrieSet with maximum depth + val z = HashMap(a) + c + if(y.getClass.getSimpleName != "HashTrieMap") + println("y should be a HashTrieMap") + StructureTests.validate(z) + // StructureTests.printStructure(z) + require(z.size == 2 && z.contains(a._1) && z.contains(c._1)) + } + test1() + test2() + test3() +} + + +package scala.collection.immutable { + object StructureTests { + def printStructure(x:HashMap[_,_], prefix:String=""): Unit = { + x match { + case m:HashMap.HashTrieMap[_,_] => + println(prefix+m.getClass.getSimpleName + " " + m.size) + m.elems.foreach(child => printStructure(child, prefix + " ")) + case m:HashMap.HashMapCollision1[_,_] => + println(prefix+m.getClass.getSimpleName + " " + m.kvs.size) + case m:HashMap.HashMap1[_,_] => + println(prefix+m.getClass.getSimpleName + " " + m.head) + case _ => + println(prefix+"empty") + } + } + + def validate(x:HashMap[_,_]): Unit = { + x match { + case m:HashMap.HashTrieMap[_,_] => + require(m.elems.size>1 || (m.elems.size==1 && m.elems(0).isInstanceOf[HashMap.HashTrieMap[_,_]])) + m.elems.foreach(validate _) + case m:HashMap.HashMapCollision1[_,_] => + require(m.kvs.size>1) + case m:HashMap.HashMap1[_,_] => + case _ => + } + } + } +} diff --git a/tests/pending/run/t627.check b/tests/pending/run/t627.check new file mode 100644 index 000000000000..39e641d98784 --- /dev/null +++ b/tests/pending/run/t627.check @@ -0,0 +1 @@ +WrappedArray(1, 2, 3, 4) diff --git a/tests/pending/run/t627.scala b/tests/pending/run/t627.scala new file mode 100644 index 000000000000..7136169b0044 --- /dev/null +++ b/tests/pending/run/t627.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val s: Seq[Int] = Array(1, 2, 3, 4) + println(s) + } +} diff --git a/tests/pending/run/t6271.scala b/tests/pending/run/t6271.scala new file mode 100644 index 000000000000..e8047a9be7f2 --- /dev/null +++ b/tests/pending/run/t6271.scala @@ -0,0 +1,32 @@ +object Test extends dotty.runtime.LegacyApp { + def filterIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x filter (_ > 0) ) } + filtered.iterator.toIterable.flatten + } + def takenIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x take 0 ) } + filtered.iterator.toIterable.flatten + } + def droppedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x drop 1 ) } + filtered.iterator.toIterable.flatten + } + def flatMappedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x flatMap (_ => List()) ) } + filtered.iterator.toIterable.flatten + } + def slicedIssue = { + val viewed : Iterable[Iterable[Int]] = List(List(0).view).view + val filtered = viewed flatMap { x => List( x slice (2,3) ) } + filtered.iterator.toIterable.flatten + } + filterIssue + takenIssue + droppedIssue + flatMappedIssue + slicedIssue +} diff --git a/tests/pending/run/t6272.check b/tests/pending/run/t6272.check new file mode 100644 index 000000000000..f00c965d8307 --- /dev/null +++ b/tests/pending/run/t6272.check @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/tests/pending/run/t6272.scala b/tests/pending/run/t6272.scala new file mode 100644 index 000000000000..a43e42c476b3 --- /dev/null +++ b/tests/pending/run/t6272.scala @@ -0,0 +1,62 @@ +// x1, x2, and x3 resulted in: symbol variable bitmap$0 does not exist in A. +object A { + + try { + lazy val x1 = 1 + println(x1) + sys.error("!") + } catch { + case _: Throwable => + lazy val x2 = 2 + println(x2) + } finally { + lazy val x3 = 3 + println(x3) + } + + if ("".isEmpty) { + lazy val x4 = 4 + println(x4) + } + + var b = true + while(b) { + lazy val x5 = 5 + println(x5) + b = false + } + + + def method: Unit = { + try { + lazy val x6 = 6 + println(x6) + sys.error("!") + } catch { + case _: Throwable => + lazy val x7 = 7 + println(x7) + } finally { + lazy val x8 = 8 + println(x8) + } + + if ("".isEmpty) { + lazy val x9 = 9 + println(x9) + } + + var b = true + while(b) { + lazy val x10 = 10 + println(x10) + b = false + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + A.method + } +} diff --git a/tests/pending/run/t6273.check b/tests/pending/run/t6273.check new file mode 100644 index 000000000000..3b682800df4d --- /dev/null +++ b/tests/pending/run/t6273.check @@ -0,0 +1,15 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val y = 55 +y: Int = 55 + +scala> val x = s""" + y = $y +""" +x: String = +" + y = 55 +" + +scala> :quit diff --git a/tests/pending/run/t6273.scala b/tests/pending/run/t6273.scala new file mode 100644 index 000000000000..ed0fd452e032 --- /dev/null +++ b/tests/pending/run/t6273.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def tq = "\"\"\"" + def code = s""" +val y = 55 +val x = s$tq + y = $$y +$tq + """ +} diff --git a/tests/pending/run/t6277.check b/tests/pending/run/t6277.check new file mode 100644 index 000000000000..f32a5804e292 --- /dev/null +++ b/tests/pending/run/t6277.check @@ -0,0 +1 @@ +true \ No newline at end of file diff --git a/tests/pending/run/t6277.scala b/tests/pending/run/t6277.scala new file mode 100644 index 000000000000..3e8616852ec2 --- /dev/null +++ b/tests/pending/run/t6277.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + locally { + val sym = typeOf[List[_]].typeSymbol.asClass + val q = sym.isSealed + println(q) + } +} diff --git a/tests/pending/run/t6287.check b/tests/pending/run/t6287.check new file mode 100644 index 000000000000..a86ecbee42f6 --- /dev/null +++ b/tests/pending/run/t6287.check @@ -0,0 +1,3 @@ +Vector(2, 3, 4) +Vector(2, 3, 4) +Vector(2, 3, 4) diff --git a/tests/pending/run/t6287.scala b/tests/pending/run/t6287.scala new file mode 100644 index 000000000000..0607e750b3fd --- /dev/null +++ b/tests/pending/run/t6287.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect._ + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val t1 = tb.parse("1 to 3 map (_+1)") + println(tb.eval(t1)) + println(tb.eval(t1)) + println(tb.eval(t1)) +} diff --git a/tests/pending/run/t6288.check b/tests/pending/run/t6288.check new file mode 100644 index 000000000000..a032a10de656 --- /dev/null +++ b/tests/pending/run/t6288.check @@ -0,0 +1,79 @@ +[[syntax trees at end of patmat]] // newSource1.scala +[7]package [7] { + [7]object Case3 extends [13][106]scala.AnyRef { + [106]def (): [13]Case3.type = [106]{ + [106][106][106]Case3.super.(); + [13]() + }; + [21]def unapply([29]z: [32]): [21]Option[Int] = [56][52][52]scala.Some.apply[[52]Int]([58]-1); + [64]{ + [64]case val x1: [64]Any = [64]""; + [64]case5()[84]{ + [84] val o7: [84]Option[Int] = [84][84]Case3.unapply([84]x1); + [84]if ([84]o7.isEmpty.unary_!) + [97][97]matchEnd4([97]()) + else + [84][84]case6() + }; + [64]case6(){ + [64][64]matchEnd4([64]throw [64][64][64]new [64]MatchError([64]x1)) + }; + [64]matchEnd4(x: [NoPosition]Unit){ + [64]x + } + } + }; + [113]object Case4 extends [119][217]scala.AnyRef { + [217]def (): [119]Case4.type = [217]{ + [217][217][217]Case4.super.(); + [119]() + }; + [127]def unapplySeq([138]z: [141]): [127]Option[List[Int]] = [167]scala.None; + [175]{ + [175]case val x1: [175]Any = [175]""; + [175]case5()[195]{ + [195] val o7: [195]Option[List[Int]] = [195][195]Case4.unapplySeq([195]x1); + [195]if ([195]o7.isEmpty.unary_!) + [195]if ([195][195][195][195]o7.get.!=([195]null).&&([195][195][195][195]o7.get.lengthCompare([195]1).==([195]0))) + [208][208]matchEnd4([208]()) + else + [195][195]case6() + else + [195][195]case6() + }; + [175]case6(){ + [175][175]matchEnd4([175]throw [175][175][175]new [175]MatchError([175]x1)) + }; + [175]matchEnd4(x: [NoPosition]Unit){ + [175]x + } + } + }; + [224]object Case5 extends [230][312]scala.AnyRef { + [312]def (): [230]Case5.type = [312]{ + [312][312][312]Case5.super.(); + [230]() + }; + [238]def unapply([246]z: [249]): [238]Boolean = [265]true; + [273]{ + [273]case val x1: [273]Any = [273]""; + [273]case5()[293]{ + [293] val o7: [293]Option[List[Int]] = [293][293]Case4.unapplySeq([293]x1); + [293]if ([293]o7.isEmpty.unary_!) + [293]if ([293][293][293][293]o7.get.!=([293]null).&&([293][293][293][293]o7.get.lengthCompare([293]0).==([293]0))) + [304][304]matchEnd4([304]()) + else + [293][293]case6() + else + [293][293]case6() + }; + [273]case6(){ + [273][273]matchEnd4([273]throw [273][273][273]new [273]MatchError([273]x1)) + }; + [273]matchEnd4(x: [NoPosition]Unit){ + [273]x + } + } + } +} + diff --git a/tests/pending/run/t6288.scala b/tests/pending/run/t6288.scala new file mode 100644 index 000000000000..cf5865e95a0e --- /dev/null +++ b/tests/pending/run/t6288.scala @@ -0,0 +1,41 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:patmat -Xprint-pos -d " + testOutput.path + + override def code = + """ + |object Case3 { + | def unapply(z: Any): Option[Int] = Some(-1) + | + | "" match { + | case Case3(nr) => () + | } + |} + |object Case4 { + | def unapplySeq(z: Any): Option[List[Int]] = None + | + | "" match { + | case Case4(nr) => () + | } + |} + |object Case5 { + | def unapply(z: Any): Boolean = true + | + | "" match { + | case Case4() => () + | } + |} + | + |""".stripMargin.trim + + override def show(): Unit = { + // Now: [84][84]Case3.unapply([84]x1); + // Was: [84][84]Case3.unapply([64]x1); + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/t6288b-jump-position.check b/tests/pending/run/t6288b-jump-position.check new file mode 100644 index 000000000000..ece88b18f080 --- /dev/null +++ b/tests/pending/run/t6288b-jump-position.check @@ -0,0 +1,76 @@ +object Case3 extends Object { + // fields: + + // methods + def unapply(z: Object (REF(class Object))): Option { + locals: value z + startBlock: 1 + blocks: [1] + + 1: + 2 NEW REF(class Some) + 2 DUP(REF(class Some)) + 2 CONSTANT(-1) + 2 BOX INT + 2 CALL_METHOD scala.Some. (static-instance) + 2 RETURN(REF(class Option)) + + } + Exception handlers: + + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { + locals: value args, value x1, value x + startBlock: 1 + blocks: [1,2,3,6,7] + + 1: + 4 CONSTANT("") + 4 STORE_LOCAL(value x1) + 4 SCOPE_ENTER value x1 + 4 JUMP 2 + + 2: + 5 LOAD_LOCAL(value x1) + 5 IS_INSTANCE REF(class String) + 5 CZJUMP (BOOL)NE ? 3 : 6 + + 3: + 6 LOAD_MODULE object Predef + 6 CONSTANT("case 0") + 6 CALL_METHOD scala.Predef.println (dynamic) + 6 LOAD_FIELD scala.runtime.BoxedUnit.UNIT + 6 STORE_LOCAL(value x) + 6 JUMP 7 + + 6: + 8 LOAD_MODULE object Predef + 8 CONSTANT("default") + 8 CALL_METHOD scala.Predef.println (dynamic) + 8 LOAD_FIELD scala.runtime.BoxedUnit.UNIT + 8 STORE_LOCAL(value x) + 8 JUMP 7 + + 7: + 10 LOAD_MODULE object Predef + 10 CONSTANT("done") + 10 CALL_METHOD scala.Predef.println (dynamic) + 10 RETURN(UNIT) + + } + Exception handlers: + + def (): Case3.type { + locals: + startBlock: 1 + blocks: [1] + + 1: + 12 THIS(Case3) + 12 CALL_METHOD java.lang.Object. (super()) + 12 RETURN(UNIT) + + } + Exception handlers: + + +} diff --git a/tests/pending/run/t6288b-jump-position.scala b/tests/pending/run/t6288b-jump-position.scala new file mode 100644 index 000000000000..c5f3bbe7881d --- /dev/null +++ b/tests/pending/run/t6288b-jump-position.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.IcodeComparison + +object Test extends IcodeComparison { + override def code = + """object Case3 { // 01 + | def unapply(z: Any): Option[Int] = Some(-1) // 02 + | def main(args: Array[String]) { // 03 + | ("": Any) match { // 04 + | case x : String => // 05 Read: JUMP + | println("case 0") // 06 expecting "6 JUMP 7", was "8 JUMP 7" + | case _ => // 07 + | println("default") // 08 expecting "8 JUMP 7" + | } // 09 + | println("done") // 10 + | } + |}""".stripMargin + + override def show() = showIcode() +} diff --git a/tests/pending/run/t629.check b/tests/pending/run/t629.check new file mode 100644 index 000000000000..d86bac9de59a --- /dev/null +++ b/tests/pending/run/t629.check @@ -0,0 +1 @@ +OK diff --git a/tests/pending/run/t629.scala b/tests/pending/run/t629.scala new file mode 100644 index 000000000000..67baead5f16a --- /dev/null +++ b/tests/pending/run/t629.scala @@ -0,0 +1,13 @@ +object Test +{ + def main(args : Array[String]) : Unit = Console.println(new C(1)) +} + +abstract class A(val x : Int) + +class C(x : Int) extends A(x) +{ + override def toString() = "OK" + val v = new D + class D { def value = x } +} diff --git a/tests/pending/run/t6290.scala b/tests/pending/run/t6290.scala new file mode 100644 index 000000000000..6552a747cb4d --- /dev/null +++ b/tests/pending/run/t6290.scala @@ -0,0 +1,4 @@ +object Test { + implicit val foo: languageFeature.dynamics = language.dynamics + def main(args: Array[String]): Unit = () +} diff --git a/tests/pending/run/t6292.check b/tests/pending/run/t6292.check new file mode 100644 index 000000000000..6f7430d5b866 --- /dev/null +++ b/tests/pending/run/t6292.check @@ -0,0 +1 @@ +warning: there were 7 deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t6292.scala b/tests/pending/run/t6292.scala new file mode 100644 index 000000000000..51e31f95fc2f --- /dev/null +++ b/tests/pending/run/t6292.scala @@ -0,0 +1,18 @@ + import scala.collection.mutable.DoubleLinkedList + +object Test { + def main(args: Array[String]): Unit = { + cloneAndtest(DoubleLinkedList[Int]()) + cloneAndtest(DoubleLinkedList[Int](1)) + cloneAndtest(DoubleLinkedList[Int](1,2,3,4)) + } + + def cloneAndtest(l: DoubleLinkedList[Int]): Unit = + testSame(l, l.clone.asInstanceOf[DoubleLinkedList[Int]]) + + def testSame(one: DoubleLinkedList[Int], two: DoubleLinkedList[Int]): Unit = { + def msg = s" for ${one} and ${two} !" + assert(one.size == two.size, s"Cloned sizes are not the same $msg!") + assert(one == two, s"Cloned lists are not equal $msg") + } +} diff --git a/tests/pending/run/t6308.check b/tests/pending/run/t6308.check new file mode 100644 index 000000000000..e2577db72af9 --- /dev/null +++ b/tests/pending/run/t6308.check @@ -0,0 +1,16 @@ +- Unspecialized type args +// Specialized +f1 f1$mIc$sp +f2 f2$mIc$sp +f3 f3$mIc$sp +f4 f4$mIc$sp +f5 f5$mIc$sp + +// Unspecialized type args +f4(Boolean) f4 +f4(String) f4 + +// Ideally these would be specialized +todo1 todo1 +todo2 todo2 +todo3 todo3 diff --git a/tests/pending/run/t6308.scala b/tests/pending/run/t6308.scala new file mode 100644 index 000000000000..62983abe57f9 --- /dev/null +++ b/tests/pending/run/t6308.scala @@ -0,0 +1,45 @@ +import scala.{specialized => sp} + +// NOTE: `{ val c = caller; print(""); c }` is used instead of a simple `caller`, +// because we want to prevent tail-call optimization from eliding the stack- +// frames we want to inspect. + +object Test { + def caller = new Exception().getStackTrace()(1).getMethodName + def f1[@sp(Int) A](a: A, b: Any) = { val c = caller; print(""); c } + def f2[@sp(Int) A, B](a: A, b: String) = { val c = caller; print(""); c } + def f3[B, @sp(Int) A](a: A, b: List[B]) = { val c = caller; print(""); c } + def f4[B, @sp(Int) A](a: A, b: List[(A, B)]) = { val c = caller; print(""); c } + + def f5[@sp(Int) A, B <: Object](a: A, b: B) = { val c = caller; print(""); c } + + // `uncurryTreeType` calls a TypeMap on the call to this method and we end up with new + // type parameter symbols, which are not found in `TypeEnv.includes(typeEnv(member), env)` + // in `specSym`. (One of `uncurry`'s tasks is to expand type aliases in signatures.) + type T = Object + def todo1[@sp(Int) A, B <: T](a: A, b: String) = { val c = caller; print(""); c } + def todo2[@sp(Int) A, B <: AnyRef](a: A, b: String) = { val c = caller; print(""); c } + def todo3[B <: List[A], @specialized(Int) A](a: A, b: B) = { val c = caller; print(""); c } + + def main(args: Array[String]): Unit = { + val s = "" + val result = + s"""|- Unspecialized type args + |// Specialized + |f1 ${f1(1,"some ref")} + |f2 ${f2(1,"some ref")} + |f3 ${f3(1,List("some ref"))} + |f4 ${f4(1,Nil)} + |f5 ${f5(1,s)} + | + |// Unspecialized type args + |f4(Boolean) ${f4(Boolean,Nil)} + |f4(String) ${f4("",Nil)} + | + |// Ideally these would be specialized + |todo1 ${todo1(1,s)} + |todo2 ${todo2(1,s)} + |todo3 ${todo3(1,List(0))}""".stripMargin + println(result) + } +} diff --git a/tests/pending/run/t6309.check b/tests/pending/run/t6309.check new file mode 100644 index 000000000000..7f8f011eb73d --- /dev/null +++ b/tests/pending/run/t6309.check @@ -0,0 +1 @@ +7 diff --git a/tests/pending/run/t6309.scala b/tests/pending/run/t6309.scala new file mode 100644 index 000000000000..f0bcca69c924 --- /dev/null +++ b/tests/pending/run/t6309.scala @@ -0,0 +1,18 @@ +trait A { + def a: Int +} + +object Test { + def f(a: Int) = new A { +// TODO NEEDS MANUAL CHANGE (early initializers) +// BEGIN copied early initializers +private[this] val b = a +// END copied early initializers + + def a = b + } + + def main(args: Array[String]): Unit = { + println(f(7).a) + } +} diff --git a/tests/pending/run/t6318_derived.check b/tests/pending/run/t6318_derived.check new file mode 100644 index 000000000000..926f2a4ba2c6 --- /dev/null +++ b/tests/pending/run/t6318_derived.check @@ -0,0 +1,3 @@ +Some(X) +true +Some(X) diff --git a/tests/pending/run/t6318_derived.scala b/tests/pending/run/t6318_derived.scala new file mode 100644 index 000000000000..024f8b35ed01 --- /dev/null +++ b/tests/pending/run/t6318_derived.scala @@ -0,0 +1,15 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + def test[T: ClassTag](x: T): Unit = { + println(classTag[T].runtimeClass.isAssignableFrom(x.getClass)) + println(classTag[T].unapply(x)) + } + + class X(val x: Int) extends AnyVal { override def toString = "X" } + val x = new X(1) + // the commented line crashes because of SI-6326 + //println(classTag[X].runtimeClass.isAssignableFrom(x.getClass)) + println(classTag[X].unapply(x)) + test(x) +} diff --git a/tests/pending/run/t6318_primitives.check b/tests/pending/run/t6318_primitives.check new file mode 100644 index 000000000000..4bc5e598eb53 --- /dev/null +++ b/tests/pending/run/t6318_primitives.check @@ -0,0 +1,54 @@ +Checking if byte matches byte +Some(1) +Checking if byte matches short +None +Checking if class java.lang.Byte matches byte +Some(1) +Checking if short matches short +Some(1) +Checking if short matches char +None +Checking if class java.lang.Short matches short +Some(1) +Checking if char matches char +Some() +Checking if char matches int +None +Checking if class java.lang.Character matches char +Some() +Checking if int matches int +Some(1) +Checking if int matches long +None +Checking if class java.lang.Integer matches int +Some(1) +Checking if long matches long +Some(1) +Checking if long matches float +None +Checking if class java.lang.Long matches long +Some(1) +Checking if float matches float +Some(1.0) +Checking if float matches double +None +Checking if class java.lang.Float matches float +Some(1.0) +Checking if double matches double +Some(1.0) +Checking if double matches boolean +None +Checking if class java.lang.Double matches double +Some(1.0) +Checking if boolean matches boolean +Some(true) +Checking if boolean matches void +None +Checking if class java.lang.Boolean matches boolean +Some(true) +Checking if void matches void +Some(()) +Checking if void matches byte +None +Checking if class scala.runtime.BoxedUnit matches void +Some(()) diff --git a/tests/pending/run/t6318_primitives.scala b/tests/pending/run/t6318_primitives.scala new file mode 100644 index 000000000000..3b2f968d440e --- /dev/null +++ b/tests/pending/run/t6318_primitives.scala @@ -0,0 +1,89 @@ +import scala.reflect.{ClassTag, classTag} + +object Test extends dotty.runtime.LegacyApp { + def test[T: ClassTag](x: T): Unit = { + println(s"Checking if ${x.getClass} matches ${classTag[T].runtimeClass}") + println(classTag[T].unapply(x)) + } + + { + val x = 1.toByte + println(s"Checking if ${x.getClass} matches ${classTag[Byte].runtimeClass}") + println(ClassTag.Byte.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Short].runtimeClass}") + println(ClassTag.Short.unapply(x)) + test(x) + } + + { + val x = 1.toShort + println(s"Checking if ${x.getClass} matches ${classTag[Short].runtimeClass}") + println(ClassTag.Short.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Char].runtimeClass}") + println(ClassTag.Char.unapply(x)) + test(x) + } + + { + val x = 1.toChar + println(s"Checking if ${x.getClass} matches ${classTag[Char].runtimeClass}") + println(ClassTag.Char.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Int].runtimeClass}") + println(ClassTag.Int.unapply(x)) + test(x) + } + + { + val x = 1.toInt + println(s"Checking if ${x.getClass} matches ${classTag[Int].runtimeClass}") + println(ClassTag.Int.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Long].runtimeClass}") + println(ClassTag.Long.unapply(x)) + test(x) + } + + { + val x = 1.toLong + println(s"Checking if ${x.getClass} matches ${classTag[Long].runtimeClass}") + println(ClassTag.Long.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Float].runtimeClass}") + println(ClassTag.Float.unapply(x)) + test(x) + } + + { + val x = 1.toFloat + println(s"Checking if ${x.getClass} matches ${classTag[Float].runtimeClass}") + println(ClassTag.Float.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Double].runtimeClass}") + println(ClassTag.Double.unapply(x)) + test(x) + } + + { + val x = 1.toDouble + println(s"Checking if ${x.getClass} matches ${classTag[Double].runtimeClass}") + println(ClassTag.Double.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Boolean].runtimeClass}") + println(ClassTag.Boolean.unapply(x)) + test(x) + } + + { + val x = true + println(s"Checking if ${x.getClass} matches ${classTag[Boolean].runtimeClass}") + println(ClassTag.Boolean.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Unit].runtimeClass}") + println(ClassTag.Unit.unapply(x)) + test(x) + } + + { + val x = () + println(s"Checking if ${x.getClass} matches ${classTag[Unit].runtimeClass}") + println(ClassTag.Unit.unapply(x)) + println(s"Checking if ${x.getClass} matches ${classTag[Byte].runtimeClass}") + println(ClassTag.Byte.unapply(x)) + test(x) + } +} diff --git a/tests/pending/run/t6320.check b/tests/pending/run/t6320.check new file mode 100644 index 000000000000..af7c865690ce --- /dev/null +++ b/tests/pending/run/t6320.check @@ -0,0 +1,13 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.dynamics +import scala.language.dynamics + +scala> class Dyn(m: Map[String, Any]) extends Dynamic { def selectDynamic[T](s: String): T = m(s).asInstanceOf[T] } +defined class Dyn + +scala> new Dyn(Map("foo" -> 10)).foo[Int] +res0: Int = 10 + +scala> :quit diff --git a/tests/pending/run/t6320.scala b/tests/pending/run/t6320.scala new file mode 100644 index 000000000000..26085a3d7d98 --- /dev/null +++ b/tests/pending/run/t6320.scala @@ -0,0 +1,9 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +import scala.language.dynamics +class Dyn(m: Map[String, Any]) extends Dynamic { def selectDynamic[T](s: String): T = m(s).asInstanceOf[T] } +new Dyn(Map("foo" -> 10)).foo[Int] + """ +} diff --git a/tests/pending/run/t6323b.check b/tests/pending/run/t6323b.check new file mode 100644 index 000000000000..d6b1d1fd9048 --- /dev/null +++ b/tests/pending/run/t6323b.check @@ -0,0 +1 @@ +cannot reflect value a, because it's a member of a weak type Test diff --git a/tests/pending/run/t6323b.scala b/tests/pending/run/t6323b.scala new file mode 100644 index 000000000000..9cbc1b9ed815 --- /dev/null +++ b/tests/pending/run/t6323b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => m} +import scala.reflect.runtime.{universe => u} + +object Test extends dotty.runtime.LegacyApp { + locally { + try { + case class Test(a:String,b:List[Int]) + + val lookAtMe = m.reflect(Test("a",List(5))) + val value = u.weakTypeOf[Test] + val members = value.members + val member = value.members.filter(_.name.encodedName == TermName("a")) + val aAccessor = lookAtMe.reflectMethod(member.head.asMethod) + val thisShouldBeA = aAccessor.apply() + println(thisShouldBeA) + } catch { + case ScalaReflectionException(msg) => println(msg) + } + } +} diff --git a/tests/pending/run/t6327.check b/tests/pending/run/t6327.check new file mode 100644 index 000000000000..f7bacac931ea --- /dev/null +++ b/tests/pending/run/t6327.check @@ -0,0 +1,4 @@ +A +A +A +A diff --git a/tests/pending/run/t6327.flags b/tests/pending/run/t6327.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/t6327.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/t6327.scala b/tests/pending/run/t6327.scala new file mode 100644 index 000000000000..723f5ce91f85 --- /dev/null +++ b/tests/pending/run/t6327.scala @@ -0,0 +1,22 @@ +import language._ + +object Test extends dotty.runtime.LegacyApp { + + case class R[+T](s: String) { def x() = println(s) } + + // Implicits in contention; StringR is nested to avoid ambiguity + object R { implicit val StringR = R[String]("A") } + implicit val Default = R[Any]("B") + + class B() extends Dynamic { + def selectDynamic[T](f: String)(implicit r: R[T]): Unit = r.x() + } + + val b = new B() + + // These should all produce the same output, but they don't + b.selectDynamic[String]("baz") + b.baz[String] + val c = b.selectDynamic[String]("baz") + val d = b.baz[String] +} diff --git a/tests/pending/run/t6329_repl.check b/tests/pending/run/t6329_repl.check new file mode 100644 index 000000000000..ebb1aace7c65 --- /dev/null +++ b/tests/pending/run/t6329_repl.check @@ -0,0 +1,35 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.classTag +import scala.reflect.classTag + +scala> classManifest[scala.List[_]] +warning: there was one deprecation warning; re-run with -deprecation for details +res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[] + +scala> classTag[scala.List[_]] +res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List + +scala> classManifest[scala.collection.immutable.List[_]] +warning: there was one deprecation warning; re-run with -deprecation for details +res2: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[] + +scala> classTag[scala.collection.immutable.List[_]] +res3: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List + +scala> classManifest[Predef.Set[_]] +warning: there was one deprecation warning; re-run with -deprecation for details +res4: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[] + +scala> classTag[Predef.Set[_]] +res5: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set + +scala> classManifest[scala.collection.immutable.Set[_]] +warning: there was one deprecation warning; re-run with -deprecation for details +res6: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[] + +scala> classTag[scala.collection.immutable.Set[_]] +res7: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set + +scala> :quit diff --git a/tests/pending/run/t6329_repl.scala b/tests/pending/run/t6329_repl.scala new file mode 100644 index 000000000000..f210d6512c4e --- /dev/null +++ b/tests/pending/run/t6329_repl.scala @@ -0,0 +1,15 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.reflect.classTag + |classManifest[scala.List[_]] + |classTag[scala.List[_]] + |classManifest[scala.collection.immutable.List[_]] + |classTag[scala.collection.immutable.List[_]] + |classManifest[Predef.Set[_]] + |classTag[Predef.Set[_]] + |classManifest[scala.collection.immutable.Set[_]] + |classTag[scala.collection.immutable.Set[_]] + """.stripMargin +} diff --git a/tests/pending/run/t6329_repl_bug.check b/tests/pending/run/t6329_repl_bug.check new file mode 100644 index 000000000000..84297a629f54 --- /dev/null +++ b/tests/pending/run/t6329_repl_bug.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> import scala.reflect.runtime._ +import scala.reflect.runtime._ + +scala> classManifest[List[_]] +warning: there was one deprecation warning; re-run with -deprecation for details +res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[] + +scala> scala.reflect.classTag[List[_]] +res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List + +scala> :quit diff --git a/tests/pending/run/t6329_repl_bug.scala b/tests/pending/run/t6329_repl_bug.scala new file mode 100644 index 000000000000..9997d1771e7d --- /dev/null +++ b/tests/pending/run/t6329_repl_bug.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.reflect.runtime.universe._ + |import scala.reflect.runtime._ + |classManifest[List[_]] + |scala.reflect.classTag[List[_]] + |""".stripMargin +} diff --git a/tests/pending/run/t6329_vanilla.check b/tests/pending/run/t6329_vanilla.check new file mode 100644 index 000000000000..ad8f4b5c7720 --- /dev/null +++ b/tests/pending/run/t6329_vanilla.check @@ -0,0 +1,8 @@ +scala.collection.immutable.List[] +scala.collection.immutable.List +scala.collection.immutable.List[] +scala.collection.immutable.List +scala.collection.immutable.Set[] +scala.collection.immutable.Set +scala.collection.immutable.Set[] +scala.collection.immutable.Set diff --git a/tests/pending/run/t6329_vanilla.scala b/tests/pending/run/t6329_vanilla.scala new file mode 100644 index 000000000000..b1c1f7fd773b --- /dev/null +++ b/tests/pending/run/t6329_vanilla.scala @@ -0,0 +1,13 @@ +import scala.reflect.classTag + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + println(classManifest[scala.List[_]]) + println(classTag[scala.List[_]]) + println(classManifest[scala.collection.immutable.List[_]]) + println(classTag[scala.collection.immutable.List[_]]) + println(classManifest[Predef.Set[_]]) + println(classTag[Predef.Set[_]]) + println(classManifest[scala.collection.immutable.Set[_]]) + println(classTag[scala.collection.immutable.Set[_]]) +} diff --git a/tests/pending/run/t6329_vanilla_bug.check b/tests/pending/run/t6329_vanilla_bug.check new file mode 100644 index 000000000000..01bf0636ea13 --- /dev/null +++ b/tests/pending/run/t6329_vanilla_bug.check @@ -0,0 +1,3 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +scala.collection.immutable.List[] +scala.collection.immutable.List diff --git a/tests/pending/run/t6329_vanilla_bug.scala b/tests/pending/run/t6329_vanilla_bug.scala new file mode 100644 index 000000000000..7d6e732ea772 --- /dev/null +++ b/tests/pending/run/t6329_vanilla_bug.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime._ + +object Test extends dotty.runtime.LegacyApp { + println(classManifest[List[_]]) + println(scala.reflect.classTag[List[_]]) +} diff --git a/tests/pending/run/t6331.check b/tests/pending/run/t6331.check new file mode 100644 index 000000000000..9bf3f7823a6d --- /dev/null +++ b/tests/pending/run/t6331.check @@ -0,0 +1,23 @@ + () == () + true == true + true != false + false != true + 0.toByte == 0.toByte + 0.toByte != 1.toByte + 0.toShort == 0.toShort + 0.toShort != 1.toShort + 0 == 0 + 0 != 1 + 0L == 0L + 0L != 1L + 0.0f == 0.0f + 0.0f != -0.0f + -0.0f != 0.0f + NaNf == NaNf + 0.0d == 0.0d + 0.0d != -0.0d + -0.0d != 0.0d + NaNd == NaNd + 0 != 0.0d + 0 != 0L + 0.0d != 0.0f diff --git a/tests/pending/run/t6331.scala b/tests/pending/run/t6331.scala new file mode 100644 index 000000000000..d9d46f10ea0a --- /dev/null +++ b/tests/pending/run/t6331.scala @@ -0,0 +1,66 @@ +import scala.tools.partest.DirectTest + +// Test of Constant#equals, which must must account for floating point intricacies. +object Test extends DirectTest { + + override def code = "" + + override def show() { + val global = newCompiler() + import global._ + + def check(c1: Any, c2: Any): Unit = { + val const1 = Constant(c1) + val const2 = Constant(c2) + val equal = const1 == const2 + def show(a: Any) = "" + a + (a match { + case _: Byte => ".toByte" + case _: Short => ".toShort" + case _: Long => "L" + case _: Float => "f" + case _: Double => "d" + case _ => "" + }) + val op = if (equal) "==" else "!=" + println(f"${show(c1)}%12s $op ${show(c2)}") + + val hash1 = const1.hashCode + val hash2 = const2.hashCode + val hashesEqual = hash1 == hash2 + val hashBroken = equal && !hashesEqual + if (hashBroken) println(f"$hash1%12s != $hash2 // hash codes differ for equal objects!!") + } + + check((), ()) + + check(true, true) + check(true, false) + check(false, true) + + check(0.toByte, 0.toByte) + check(0.toByte, 1.toByte) + + check(0.toShort, 0.toShort) + check(0.toShort, 1.toShort) + + check(0, 0) + check(0, 1) + + check(0L, 0L) + check(0L, 1L) + + check(0f, 0f) + check(0f, -0f) + check(-0f, 0f) + check(Float.NaN, Float.NaN) + + check(0d, 0d) + check(0d, -0d) + check(-0d, 0d) + check(Double.NaN, Double.NaN) + + check(0, 0d) + check(0, 0L) + check(0d, 0f) + } +} diff --git a/tests/pending/run/t6331b.check b/tests/pending/run/t6331b.check new file mode 100644 index 000000000000..6ca09e3814c1 --- /dev/null +++ b/tests/pending/run/t6331b.check @@ -0,0 +1,30 @@ +trace> if (Test.this.t) + -0.0 +else + 0.0 +res: Double = -0.0 + +trace> if (Test.this.t) + 0.0 +else + -0.0 +res: Double = 0.0 + +trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???) + -0.0 +else + 0.0) +res: Any = class scala.NotImplementedError + +trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???) + 0.0 +else + 0.0) +res: Any = class scala.NotImplementedError + +trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???) + () +else + ()) +res: Any = class scala.NotImplementedError + diff --git a/tests/pending/run/t6331b.scala b/tests/pending/run/t6331b.scala new file mode 100644 index 000000000000..8dd070f0861b --- /dev/null +++ b/tests/pending/run/t6331b.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.Util.trace +import scala.util.control.Exception.allCatch + + +object Test extends dotty.runtime.LegacyApp { + def intercept = allCatch.withApply(_.getClass) + val t: Boolean = true + trace(if (t) -0d else 0d) + trace(if (t) 0d else -0d) + trace(intercept(if (???) -0d else 0d)) + trace(intercept(if (???) 0d else 0d)) + trace(intercept(if (???) () else ())) +} diff --git a/tests/pending/run/t6333.scala b/tests/pending/run/t6333.scala new file mode 100644 index 000000000000..0c8986c9e8e2 --- /dev/null +++ b/tests/pending/run/t6333.scala @@ -0,0 +1,29 @@ +object Test extends dotty.runtime.LegacyApp { + import util.Try + + val a = "apple" + def fail: String = throw new Exception("Fail!") + def argh: Try[String] = throw new Exception("Argh!") + + // No throw tests + def tryMethods(expr: => String): Unit = { + Try(expr) orElse argh + Try(expr).transform(_ => argh, _ => argh) + Try(expr).recoverWith { case e if (a == fail) => Try(a) } + Try(expr).recoverWith { case _ => argh } + Try(expr).getOrElse(a) + // TODO - Fail getOrElse? + Try(expr) orElse argh + Try(expr) orElse Try(a) + Try(expr) map (_ => fail) + Try(expr) map (_ => a) + Try(expr) flatMap (_ => argh) + Try(expr) flatMap (_ => Try(a)) + Try(expr) filter (_ => throw new Exception("O NOES")) + Try(expr) filter (_ => true) + Try(expr) recover { case _ => fail } + Try(expr).failed + } + tryMethods(a) + tryMethods(fail) +} diff --git a/tests/pending/run/t6337a.scala b/tests/pending/run/t6337a.scala new file mode 100644 index 000000000000..0a78cd0b8ce3 --- /dev/null +++ b/tests/pending/run/t6337a.scala @@ -0,0 +1,16 @@ +object Test { + def main(args: Array[String]): Unit = { + val x = X(XX(3)) + assert(x.q.x.x + 9 == 13) + } +} +trait Q extends Any { + def x: Int + def inc: XX +} +case class X(val x: Q) extends AnyVal { + def q = X(x.inc) +} +case class XX(val x: Int) extends AnyVal with Q { + def inc = XX(x + 1) +} diff --git a/tests/pending/run/t6344.check b/tests/pending/run/t6344.check new file mode 100644 index 000000000000..8d9adac849d4 --- /dev/null +++ b/tests/pending/run/t6344.check @@ -0,0 +1,132 @@ +C0 +public int C0.v1(int) +public int C0.v1(int) +public int C0.v3() +public int C0.v3() +public int C0.v4(int,scala.collection.immutable.List) +public int C0.v4(int,scala.collection.immutable.List>) +public scala.collection.immutable.List C0.v2() +public scala.collection.immutable.List> C0.v2() + +C1 +public java.lang.Object C1.v1(java.lang.Object) +public java.lang.Object C1.v1(java.lang.Object) +public java.lang.Object C1.v3() +public java.lang.Object C1.v3() +public java.lang.Object C1.v4(java.lang.Object,scala.collection.immutable.List) +public java.lang.Object C1.v4(java.lang.Object,scala.collection.immutable.List) +public scala.collection.immutable.List C1.v2() +public scala.collection.immutable.List C1.v2() + +C2 +public java.lang.String C2.v1(java.lang.String) +public java.lang.String C2.v1(java.lang.String) +public java.lang.String C2.v3() +public java.lang.String C2.v3() +public java.lang.String C2.v4(java.lang.String,scala.collection.immutable.List) +public java.lang.String C2.v4(java.lang.String,scala.collection.immutable.List) +public scala.collection.immutable.List C2.v2() +public scala.collection.immutable.List C2.v2() + +C3 +public java.lang.Object C3.v1(java.lang.Object) +public A C3.v1(A) +public java.lang.Object C3.v3() +public A C3.v3() +public java.lang.Object C3.v4(java.lang.Object,scala.collection.immutable.List) +public A C3.v4(A,scala.collection.immutable.List) +public java.lang.Object C3.x() +public A C3.x() +public scala.collection.immutable.List C3.v2() +public scala.collection.immutable.List C3.v2() + +C4 +public java.lang.Integer C4.v1(java.lang.Integer) +public int C4.v1(int) +public java.lang.Integer C4.v3() +public int C4.v3() +public java.lang.Integer C4.v4(java.lang.Integer,scala.collection.immutable.List) +public int C4.v4(int,scala.collection.immutable.List>) +public scala.collection.immutable.List C4.v2() +public scala.collection.immutable.List> C4.v2() + +C4B +public java.lang.String C4B.v1(java.lang.String) +public java.lang.String C4B.v1(java.lang.String) +public java.lang.String C4B.v3() +public java.lang.String C4B.v3() +public java.lang.String C4B.v4(java.lang.String,scala.collection.immutable.List) +public java.lang.String C4B.v4(java.lang.String,scala.collection.immutable.List) +public scala.collection.immutable.List C4B.v2() +public scala.collection.immutable.List C4B.v2() + +C5 +public double C5.f2(int,java.lang.Object,java.lang.String,double) +public double C5.f2(int,java.lang.Object,java.lang.String,double) +public int C5.f3(java.lang.Integer) +public int C5.f3(int) +public int C5.f4(java.lang.Integer) +public int C5.f4(int) +public int C5.f5(java.lang.Integer) +public int C5.f5(int) +public java.lang.Object C5.f1(int,java.lang.Object,java.lang.String,java.lang.Object) +public A C5.f1(int,java.lang.Object,java.lang.String,A) + +C6 +public java.lang.Object C6.f1(int,java.lang.Object,java.lang.String,java.lang.Object) +public A C6.f1(int,java.lang.Object,java.lang.String,A) + +C7 +public java.lang.Integer C7.f1(int,java.lang.Object,java.lang.String,java.lang.Integer) +public int C7.f1(int,java.lang.Object,java.lang.String,int) +public java.lang.Object C7.f1(int,java.lang.Object,java.lang.String,java.lang.Object) +public java.lang.Object C7.f1(int,java.lang.Object,java.lang.String,java.lang.Object) + +Gen +public abstract Gen Gen.plus(Gen,Gen) +public abstract Gen Gen.plus(Gen,Gen) +public abstract java.lang.Object Gen.x() +public abstract A Gen.x() + +ValueInt +public Gen ValueInt.plus(Gen,Gen) +public Gen ValueInt.plus(Gen,Gen) +public boolean ValueInt.equals(java.lang.Object) +public boolean ValueInt.equals(java.lang.Object) +public int ValueInt.hashCode() +public int ValueInt.hashCode() +public int ValueInt.iplus(int,int) +public int ValueInt.iplus(int,int) +public int ValueInt.x() +public int ValueInt.x() +public java.lang.Object ValueInt.x() +public java.lang.Object ValueInt.x() +public static Gen ValueInt.plus$extension(int,Gen,Gen) +public static Gen ValueInt.plus$extension(int,Gen,Gen) +public static boolean ValueInt.equals$extension(int,java.lang.Object) +public static boolean ValueInt.equals$extension(int,java.lang.Object) +public static int ValueInt.hashCode$extension(int) +public static int ValueInt.hashCode$extension(int) +public static int ValueInt.iplus$extension(int,int,int) +public static int ValueInt.iplus$extension(int,int,int) + +RefInt +public Gen RefInt.plus(Gen,Gen) +public Gen RefInt.plus(Gen,Gen) +public RefInt RefInt.rplus(RefInt,RefInt) +public RefInt RefInt.rplus(RefInt,RefInt) +public int RefInt.x() +public int RefInt.x() +public java.lang.Object RefInt.x() +public java.lang.Object RefInt.x() + +RefInteger +public Gen RefInteger.plus(Gen,Gen) +public Gen RefInteger.plus(Gen,Gen) +public RefInteger RefInteger.bplus(RefInteger,RefInteger) +public RefInteger RefInteger.bplus(RefInteger,RefInteger) +public java.lang.Integer RefInteger.x() +public java.lang.Integer RefInteger.x() +public java.lang.Object RefInteger.x() +public java.lang.Object RefInteger.x() + diff --git a/tests/pending/run/t6344.scala b/tests/pending/run/t6344.scala new file mode 100644 index 000000000000..6f82e4ba51c9 --- /dev/null +++ b/tests/pending/run/t6344.scala @@ -0,0 +1,106 @@ +import scala.reflect.{ClassTag, classTag} +import java.lang.Integer + +trait Gen[A] extends Any { + def x: A + def plus(x1: Gen[A], x2: Gen[A]): Gen[A] +} +class ValueInt(val x: Int) extends AnyVal with Gen[Int] { + // Gen ValueInt.extension$plus(int,Gen,Gen) + def plus(x1: Gen[Int], x2: Gen[Int]): Gen[Int] = new ValueInt(x + x1.x + x2.x) + // int ValueInt.extension$iplus(int,int,int) + def iplus(x1: ValueInt, x2: ValueInt): ValueInt = new ValueInt(x + x1.x + x2.x) +} +class RefInt(val x: Int) extends AnyRef with Gen[Int] { + def plus(x1: Gen[Int], x2: Gen[Int]): Gen[Int] = new RefInt(x + x1.x + x2.x) + def rplus(x1: RefInt, x2: RefInt): RefInt = new RefInt(x + x1.x + x2.x) +} +class RefInteger(val x: java.lang.Integer) extends AnyRef with Gen[Integer] { + def plus(x1: Gen[Integer], x2: Gen[Integer]): Gen[Integer] = new RefInteger(x + x1.x + x2.x) + def bplus(x1: RefInteger, x2: RefInteger): RefInteger = new RefInteger(x + x1.x + x2.x) +} + +class Val[Q](val value: Int) extends AnyVal +class ValAny[Q](val value: Any) extends AnyVal +class ValStr[Q](val value: String) extends AnyVal +class ValA[Q](val value: Q) extends AnyVal { + def f: Q = ??? +} +class ValB[Q, Q0 <: Q](val value: Q) extends AnyVal { + def f: Q0 = ??? +} + +class C0 { + def v1[A](in: Val[A]) = in + def v2[A]: List[Val[A]] = Nil + def v3[A]: Val[A] = new Val[A](0) + def v4[A <: String](x: Val[A], ys: List[Val[A]]) = ys.head +} +class C1 { + def v1[A](in: ValAny[A]) = in + def v2[A]: List[ValAny[A]] = Nil + def v3[A]: ValAny[A] = new ValAny[A]("") + def v4[A <: String](x: ValAny[A], ys: List[ValAny[A]]) = ys.head +} +class C2 { + def v1[A](in: ValStr[A]) = in + def v2[A]: List[ValStr[A]] = Nil + def v3[A]: ValStr[A] = new ValStr[A]("") + def v4[A <: String](x: ValStr[A], ys: List[ValStr[A]]) = ys.head +} +class C3[A](val x: A) { + def v1(in: ValA[A]) = in + def v2: List[ValA[A]] = Nil + def v3: ValA[A] = new ValA[A](x) + def v4(x: ValA[A], ys: List[ValA[A]]) = ys.head +} +class C4 { + def v1(in: ValA[Int]) = in + def v2: List[ValA[Int]] = Nil + def v3: ValA[Int] = new ValA(1) + def v4(x: ValA[Int], ys: List[ValA[Int]]) = ys.head +} +class C4B { + def v1(in: ValA[String]) = in + def v2: List[ValA[String]] = Nil + def v3: ValA[String] = new ValA("") + def v4(x: ValA[String], ys: List[ValA[String]]) = ys.head +} +class C5 { + def f1[A](x1: Val[A], x2: ValAny[A], x3: ValStr[A], x4: ValA[A]) = x4 + def f2(x1: Int, x2: Any, x3: String, x4: Double) = x4 + def f3(x: ValA[Int]) = x.f + def f4(x: ValB[Int, Int]) = x.f + def f5(x: ValB[Int, _ <: Int]) = x.f +} +class C6[A] { + def f1(x1: Val[A], x2: ValAny[A], x3: ValStr[A], x4: ValA[A]) = x4 +} +class C7 extends C6[Int] { + override def f1(x1: Val[Int], x2: ValAny[Int], x3: ValStr[Int], x4: ValA[Int]) = + super.f1(x1, x2, x3, x4) +} + +object Test { + def show[A: ClassTag] = { + println(classTag[A].runtimeClass.getName) + classTag[A].runtimeClass.getDeclaredMethods.toList.sortBy(_.toString).flatMap(m => List(m.toString, m.toGenericString)) foreach println + println("") + } + + def main(args: Array[String]): Unit = { + show[C0] + show[C1] + show[C2] + show[C3[_]] + show[C4] + show[C4B] + show[C5] + show[C6[_]] + show[C7] + show[Gen[_]] + show[ValueInt] + show[RefInt] + show[RefInteger] + } +} diff --git a/tests/pending/run/t6353.check b/tests/pending/run/t6353.check new file mode 100644 index 000000000000..5676bed24545 --- /dev/null +++ b/tests/pending/run/t6353.check @@ -0,0 +1 @@ +applyDynamic(apply)(9) diff --git a/tests/pending/run/t6353.scala b/tests/pending/run/t6353.scala new file mode 100644 index 000000000000..7077eaedae59 --- /dev/null +++ b/tests/pending/run/t6353.scala @@ -0,0 +1,12 @@ +import language.dynamics + +object Test extends dotty.runtime.LegacyApp { + val x = new X(3) + val y = x(9) + class X(i: Int) extends Dynamic { + def applyDynamic(name: String)(in: Int): Int = { + println(s"applyDynamic($name)($in)") + i + in + } + } +} diff --git a/tests/pending/run/t6355.check b/tests/pending/run/t6355.check new file mode 100644 index 000000000000..ce74ab38a20d --- /dev/null +++ b/tests/pending/run/t6355.check @@ -0,0 +1,2 @@ +bippy(x: Int) called with x = 42 +bippy(x: String) called with x = "42" diff --git a/tests/pending/run/t6355.scala b/tests/pending/run/t6355.scala new file mode 100644 index 000000000000..f1921391a308 --- /dev/null +++ b/tests/pending/run/t6355.scala @@ -0,0 +1,17 @@ +import scala.language.dynamics + +class A extends Dynamic { + def applyDynamic(method: String): B = new B(method) +} +class B(method: String) { + def apply(x: Int) = s"$method(x: Int) called with x = $x" + def apply(x: String) = s"""$method(x: String) called with x = "$x"""" +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new A + println(x.bippy(42)) + println(x.bippy("42")) + } +} diff --git a/tests/pending/run/t6370.scala b/tests/pending/run/t6370.scala new file mode 100644 index 000000000000..c86b87dc8acc --- /dev/null +++ b/tests/pending/run/t6370.scala @@ -0,0 +1,12 @@ +object Test { + + def main(args: Array[String]): Unit = { + val m = collection.immutable.ListMap( "x" -> 1 ) + try { + m("y") + } catch { + case e : NoSuchElementException => assert(e.getMessage() == "key not found: y") + } + + } +} diff --git a/tests/pending/run/t6379.check b/tests/pending/run/t6379.check new file mode 100644 index 000000000000..3e5dfec623af --- /dev/null +++ b/tests/pending/run/t6379.check @@ -0,0 +1,14 @@ +compile-time +uninitialized close: List(class IOException) +initialized close: List(class IOException) +uninitialized productElement: List(class IndexOutOfBoundsException) +initialized productElement: List(class IndexOutOfBoundsException) +uninitialized read: List(class IOException) +initialized read: List(class IOException) +runtime +uninitialized close: List(class IOException) +initialized close: List(class IOException) +uninitialized productElement: List(class IndexOutOfBoundsException) +initialized productElement: List(class IndexOutOfBoundsException) +uninitialized read: List(class IOException) +initialized read: List(class IOException) diff --git a/tests/pending/run/t6379/Macros_1.scala b/tests/pending/run/t6379/Macros_1.scala new file mode 100644 index 000000000000..4f3daf49785a --- /dev/null +++ b/tests/pending/run/t6379/Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros +import java.io._ + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: MethodSymbol): Unit = { + println(s"uninitialized ${sym.name}: ${sym.exceptions}") + sym.info + println(s"initialized ${sym.name}: ${sym.exceptions}") + } + + println("compile-time") + test(typeOf[Closeable].declaration(TermName("close")).asMethod) + test(typeOf[Product1[_]].declaration(TermName("productElement")).asMethod) + test(c.mirror.staticClass("Reader").info.decl(TermName("read")).asMethod) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t6379/Test_2.scala b/tests/pending/run/t6379/Test_2.scala new file mode 100644 index 000000000000..05bdd5575a52 --- /dev/null +++ b/tests/pending/run/t6379/Test_2.scala @@ -0,0 +1,22 @@ +import java.io._ +import scala.reflect.runtime.universe._ + +class Reader(fname: String) { + private val in = new BufferedReader(new FileReader(fname)) + @throws[IOException]("if the file doesn't exist") + def read() = in.read() +} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: MethodSymbol): Unit = { + println(s"uninitialized ${sym.name}: ${sym.exceptions}") + sym.info + println(s"initialized ${sym.name}: ${sym.exceptions}") + } + + Macros.foo + println("runtime") + test(typeOf[Closeable].decl(TermName("close")).asMethod) + test(typeOf[Product1[_]].decl(TermName("productElement")).asMethod) + test(typeOf[Reader].decl(TermName("read")).asMethod) +} diff --git a/tests/pending/run/t6380.check b/tests/pending/run/t6380.check new file mode 100644 index 000000000000..912525ed6619 --- /dev/null +++ b/tests/pending/run/t6380.check @@ -0,0 +1,7 @@ +List(class java.lang.Exception) +List(class java.lang.Throwable) +List(class java.lang.RuntimeException) +List(class java.lang.IllegalArgumentException, class java.util.NoSuchElementException) +List(class java.lang.IndexOutOfBoundsException, class java.lang.IndexOutOfBoundsException) +List(class java.lang.IllegalStateException, class java.lang.IllegalStateException) +List(class java.lang.NullPointerException, class java.lang.NullPointerException) diff --git a/tests/pending/run/t6380.scala b/tests/pending/run/t6380.scala new file mode 100644 index 000000000000..c2b221f2d947 --- /dev/null +++ b/tests/pending/run/t6380.scala @@ -0,0 +1,20 @@ +object Test extends dotty.runtime.LegacyApp { + classOf[Foo].getDeclaredMethods().sortBy(_.getName).map(_.getExceptionTypes.sortBy(_.getName).toList).toList.foreach(println) +} + +class Foo { + @throws[Exception] + def bar1 = ??? + @throws[Throwable]("always") + def bar2 = ??? + @throws(classOf[RuntimeException]) + def bar3 = ??? + @throws[IllegalArgumentException] @throws[NoSuchElementException] + def bar4 = ??? + @throws(classOf[IndexOutOfBoundsException]) @throws(classOf[IndexOutOfBoundsException]) + def bar5 = ??? + @throws[IllegalStateException]("Cause") @throws[IllegalStateException] + def bar6 = ??? + @throws[NullPointerException]("Cause A") @throws[NullPointerException]("Cause B") + def bar7 = ??? +} diff --git a/tests/pending/run/t6381.check b/tests/pending/run/t6381.check new file mode 100644 index 000000000000..49c6a784ad51 --- /dev/null +++ b/tests/pending/run/t6381.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.language.experimental.macros +import scala.language.experimental.macros + +scala> def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { + import c.universe._ + c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) +} +pos_impl: (c: scala.reflect.macros.blackbox.Context)c.Expr[String] + +scala> def pos: String = macro pos_impl +defined term macro pos: String + +scala> pos +res0: String = class scala.reflect.internal.util.RangePosition + +scala> :quit diff --git a/tests/pending/run/t6381.scala b/tests/pending/run/t6381.scala new file mode 100644 index 000000000000..5a687c10c176 --- /dev/null +++ b/tests/pending/run/t6381.scala @@ -0,0 +1,15 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.language.experimental.macros + |def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = { + | import c.universe._ + | c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString))) + |} + |def pos: String = macro pos_impl + |pos + |""".stripMargin.trim + + override def extraSettings: String = "-Yrangepos" +} diff --git a/tests/pending/run/t6385.scala b/tests/pending/run/t6385.scala new file mode 100644 index 000000000000..f86fe8c14864 --- /dev/null +++ b/tests/pending/run/t6385.scala @@ -0,0 +1,13 @@ +object Test { + def main(args: Array[String]): Unit = { + val y: AA[Int] = C(2) + val c: Int = y.x.y + assert(c == 2) + } +} +trait AA[T] extends Any { + def x: C[T] +} +case class C[T](val y: T) extends AnyVal with AA[T] { + def x = this +} diff --git a/tests/pending/run/t6392a.check b/tests/pending/run/t6392a.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t6392a.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t6392a.scala b/tests/pending/run/t6392a.scala new file mode 100644 index 000000000000..727b19eb8848 --- /dev/null +++ b/tests/pending/run/t6392a.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val c = tb.parse("object C") + println(tb.eval(c)) +} diff --git a/tests/pending/run/t6392b.check b/tests/pending/run/t6392b.check new file mode 100644 index 000000000000..9bb9b5694f21 --- /dev/null +++ b/tests/pending/run/t6392b.check @@ -0,0 +1 @@ +ModuleDef(Modifiers(), TermName("C")#MOD, Template(List(Select(Ident(scala#PK), TypeName("AnyRef")#TPE)), noSelfType, List(DefDef(Modifiers(), termNames.CONSTRUCTOR#PCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(TypeName("C")), typeNames.EMPTY), termNames.CONSTRUCTOR#PCTOR), List())), Literal(Constant(()))))))) diff --git a/tests/pending/run/t6392b.scala b/tests/pending/run/t6392b.scala new file mode 100644 index 000000000000..4c02b09ef69e --- /dev/null +++ b/tests/pending/run/t6392b.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val c = tb.parse("object C") + println(showRaw(tb.typecheck(c), printKinds = true)) +} diff --git a/tests/pending/run/t6394a.check b/tests/pending/run/t6394a.check new file mode 100644 index 000000000000..2a02d41ce213 --- /dev/null +++ b/tests/pending/run/t6394a.check @@ -0,0 +1 @@ +TEST diff --git a/tests/pending/run/t6394a.flags b/tests/pending/run/t6394a.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t6394a.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t6394a/Macros_1.scala b/tests/pending/run/t6394a/Macros_1.scala new file mode 100644 index 000000000000..376d85ba6732 --- /dev/null +++ b/tests/pending/run/t6394a/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c:Context): c.Expr[Any] = { + import c.universe._ + + val selfTree = This(c.enclosingImpl.symbol.asModule.moduleClass) + c.Expr[AnyRef](selfTree) + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t6394a/Test_2.scala b/tests/pending/run/t6394a/Test_2.scala new file mode 100644 index 000000000000..989ab3031c32 --- /dev/null +++ b/tests/pending/run/t6394a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + override def toString = "TEST" +} \ No newline at end of file diff --git a/tests/pending/run/t6394b.check b/tests/pending/run/t6394b.check new file mode 100644 index 000000000000..2a02d41ce213 --- /dev/null +++ b/tests/pending/run/t6394b.check @@ -0,0 +1 @@ +TEST diff --git a/tests/pending/run/t6394b.flags b/tests/pending/run/t6394b.flags new file mode 100644 index 000000000000..cd66464f2f63 --- /dev/null +++ b/tests/pending/run/t6394b.flags @@ -0,0 +1 @@ +-language:experimental.macros \ No newline at end of file diff --git a/tests/pending/run/t6394b/Macros_1.scala b/tests/pending/run/t6394b/Macros_1.scala new file mode 100644 index 000000000000..1a747816e30a --- /dev/null +++ b/tests/pending/run/t6394b/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c:Context): c.Expr[Any] = { + import c.universe._ + + val selfTree = This(typeNames.EMPTY) + c.Expr[AnyRef](selfTree) + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t6394b/Test_2.scala b/tests/pending/run/t6394b/Test_2.scala new file mode 100644 index 000000000000..989ab3031c32 --- /dev/null +++ b/tests/pending/run/t6394b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo) + override def toString = "TEST" +} \ No newline at end of file diff --git a/tests/pending/run/t6406-regextract.check b/tests/pending/run/t6406-regextract.check new file mode 100644 index 000000000000..88c5a52eb36f --- /dev/null +++ b/tests/pending/run/t6406-regextract.check @@ -0,0 +1,4 @@ +List(1, 3) +List(1, 3) +List(1, 3) +Some(2011) Some(2011) diff --git a/tests/pending/run/t6406-regextract.scala b/tests/pending/run/t6406-regextract.scala new file mode 100644 index 000000000000..26d0baedcd2b --- /dev/null +++ b/tests/pending/run/t6406-regextract.scala @@ -0,0 +1,30 @@ + +object Test extends dotty.runtime.LegacyApp { + import util.matching._ + import Regex._ + + val r = "(\\d+)".r + val q = """(\d)""".r + val ns = List("1,2","x","3,4") + val u = r.unanchored + + val is = ns collect { case u(x) => x } map { case r(x) => x } + println(is) + // Match from same pattern + val js = (ns map { u findFirstMatchIn _ }).flatten map { case r(x) => x } + println(js) + // Match not from same pattern + val ks = (ns map { q findFirstMatchIn _ }).flatten map { case r(x) => x } + println(ks) + + val t = "Last modified 2011-07-15" + val p1 = """(\d\d\d\d)-(\d\d)-(\d\d)""".r + val y1: Option[String] = for { + p1(year, month, day) <- p1 findFirstIn t + } yield year + val y2: Option[String] = for { + p1(year, month, day) <- p1 findFirstMatchIn t + } yield year + println(s"$y1 $y2") + +} diff --git a/tests/pending/run/t6410.check b/tests/pending/run/t6410.check new file mode 100644 index 000000000000..051fe4995a56 --- /dev/null +++ b/tests/pending/run/t6410.check @@ -0,0 +1,2 @@ +ParMap(0 -> 4, 1 -> 5) +ParMap(0 -> 4, 1 -> 5) \ No newline at end of file diff --git a/tests/pending/run/t6410.scala b/tests/pending/run/t6410.scala new file mode 100644 index 000000000000..0855ffecdb2e --- /dev/null +++ b/tests/pending/run/t6410.scala @@ -0,0 +1,9 @@ + + + +object Test extends dotty.runtime.LegacyApp { + val x = collection.parallel.mutable.ParArray.range(1,10) groupBy { _ % 2 } mapValues { _.size } + println(x) + val y = collection.parallel.immutable.ParVector.range(1,10) groupBy { _ % 2 } mapValues { _.size } + println(y) +} diff --git a/tests/pending/run/t6411a.check b/tests/pending/run/t6411a.check new file mode 100644 index 000000000000..9226146195b1 --- /dev/null +++ b/tests/pending/run/t6411a.check @@ -0,0 +1,96 @@ +meth = method yg_1 +as seen by Scala reflection: def yg_1[T](y: Y[T]): T +as seen by Java reflection: public java.lang.Object a$.yg_1(java.lang.Object) +result = 1 +meth = method yg_1 +as seen by Scala reflection: def yg_1[T](y: Y[T]): T +as seen by Java reflection: public java.lang.Object a$.yg_1(java.lang.Object) +result = 1 +meth = method yi_2 +as seen by Scala reflection: def yi_2(y: Y[Int]): Int +as seen by Java reflection: public int a$.yi_2(java.lang.Integer) +result = 2 +meth = method yi_2 +as seen by Scala reflection: def yi_2(y: Y[Int]): Int +as seen by Java reflection: public int a$.yi_2(java.lang.Integer) +result = class java.lang.IllegalArgumentException: argument type mismatch +meth = method ys_3 +as seen by Scala reflection: def ys_3(y: Y[String]): String +as seen by Java reflection: public java.lang.String a$.ys_3(java.lang.String) +result = class java.lang.IllegalArgumentException: argument type mismatch +meth = method ys_3 +as seen by Scala reflection: def ys_3(y: Y[String]): String +as seen by Java reflection: public java.lang.String a$.ys_3(java.lang.String) +result = 3 +meth = method ya_4 +as seen by Scala reflection: def ya_4(ys: Array[Y[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.ya_4(Y[]) +result = class java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +meth = method ya_4 +as seen by Scala reflection: def ya_4(ys: Array[Y[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.ya_4(Y[]) +result = List(4) +meth = method yl_5 +as seen by Scala reflection: def yl_5(ys: List[Y[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.yl_5(scala.collection.immutable.List) +result = class java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +meth = method yl_5 +as seen by Scala reflection: def yl_5(ys: List[Y[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.yl_5(scala.collection.immutable.List) +result = List(5) +meth = method yni_7 +as seen by Scala reflection: def yni_7(y: => Y[Int]): Int +as seen by Java reflection: public int a$.yni_7(scala.Function0) +result = 7 +meth = method yns_8 +as seen by Scala reflection: def yns_8(y: => Y[String]): String +as seen by Java reflection: public java.lang.String a$.yns_8(scala.Function0) +result = 8 +meth = method zg_1 +as seen by Scala reflection: def zg_1[T](z: Z[T]): T +as seen by Java reflection: public java.lang.Object a$.zg_1(Z) +result = 1 +meth = method zg_1 +as seen by Scala reflection: def zg_1[T](z: Z[T]): T +as seen by Java reflection: public java.lang.Object a$.zg_1(Z) +result = 1 +meth = method zi_2 +as seen by Scala reflection: def zi_2(z: Z[Int]): Int +as seen by Java reflection: public int a$.zi_2(Z) +result = 2 +meth = method zi_2 +as seen by Scala reflection: def zi_2(z: Z[Int]): Int +as seen by Java reflection: public int a$.zi_2(Z) +result = class java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer +meth = method zs_3 +as seen by Scala reflection: def zs_3(z: Z[String]): String +as seen by Java reflection: public java.lang.String a$.zs_3(Z) +result = class java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +meth = method zs_3 +as seen by Scala reflection: def zs_3(z: Z[String]): String +as seen by Java reflection: public java.lang.String a$.zs_3(Z) +result = 3 +meth = method za_4 +as seen by Scala reflection: def za_4(zs: Array[Z[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.za_4(Z[]) +result = class java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +meth = method za_4 +as seen by Scala reflection: def za_4(zs: Array[Z[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.za_4(Z[]) +result = List(4) +meth = method zl_5 +as seen by Scala reflection: def zl_5(zs: List[Z[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.zl_5(scala.collection.immutable.List) +result = class java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +meth = method zl_5 +as seen by Scala reflection: def zl_5(zs: List[Z[String]]): List[String] +as seen by Java reflection: public scala.collection.immutable.List a$.zl_5(scala.collection.immutable.List) +result = List(5) +meth = method zni_7 +as seen by Scala reflection: def zni_7(z: => Z[Int]): Int +as seen by Java reflection: public int a$.zni_7(scala.Function0) +result = 7 +meth = method zns_8 +as seen by Scala reflection: def zns_8(z: => Z[String]): String +as seen by Java reflection: public java.lang.String a$.zns_8(scala.Function0) +result = 8 diff --git a/tests/pending/run/t6411a.scala b/tests/pending/run/t6411a.scala new file mode 100644 index 000000000000..616b6cea90f0 --- /dev/null +++ b/tests/pending/run/t6411a.scala @@ -0,0 +1,81 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.language.reflectiveCalls + +class Y[T](val i: T) extends AnyVal { + override def toString = s"Y($i)" +} +class Z[T](val i: T) extends AnyRef { + override def toString = s"Z($i)" +} + +object a { + def yg_1[T](y: Y[T]) = y.i + def yi_2(y: Y[Int]) = y.i + def ys_3(y: Y[String]) = y.i + def ya_4(ys: Array[Y[String]]) = ys.toList.map(_.i) + def yl_5(ys: List[Y[String]]) = ys.map(_.i) + def yv_6(ys: Y[String]*) = ys.toList.map(_.i) + def yni_7(y: => Y[Int]) = y.i + def yns_8(y: => Y[String]) = y.i + + def zg_1[T](z: Z[T]) = z.i + def zi_2(z: Z[Int]) = z.i + def zs_3(z: Z[String]) = z.i + def za_4(zs: Array[Z[String]]) = zs.toList.map(_.i) + def zl_5(zs: List[Z[String]]) = zs.map(_.i) + def zv_6(zs: Z[String]*) = zs.toList.map(_.i) + def zni_7(z: => Z[Int]) = z.i + def zns_8(z: => Z[String]) = z.i +} + +object Test extends dotty.runtime.LegacyApp { + def test(methName: String, arg: Any) = { + val moduleA = cm.reflect(a) + val msym = moduleA.symbol.info.decl(TermName(methName)).asMethod + println(s"meth = $msym") + val mmirror = moduleA.reflectMethod(msym) + val mresult = + try { mmirror(arg) } + catch { + case ex: Exception => + val ex1 = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + s"${ex1.getClass}: ${ex1.getMessage}" + } + println(s"as seen by Scala reflection: ${msym.asInstanceOf[scala.reflect.internal.Symbols#Symbol].defString}") + println(s"as seen by Java reflection: ${mmirror.asInstanceOf[{val jmeth: java.lang.reflect.Method}].jmeth}") + println(s"result = $mresult") + } + + test("yg_1", new Y(1)) + test("yg_1", new Y("1")) + test("yi_2", new Y(2)) + test("yi_2", new Y("2")) + test("ys_3", new Y(3)) + test("ys_3", new Y("3")) + test("ya_4", Array(new Y(4))) + test("ya_4", Array(new Y("4"))) + test("yl_5", List(new Y(5))) + test("yl_5", List(new Y("5"))) + // FIXME: disabled because of SI-7056 + // test("yv_6", new Y(6)) + // test("yv_6", new Y("6")) + test("yni_7", new Y(7)) + test("yns_8", new Y("8")) + + test("zg_1", new Z(1)) + test("zg_1", new Z("1")) + test("zi_2", new Z(2)) + test("zi_2", new Z("2")) + test("zs_3", new Z(3)) + test("zs_3", new Z("3")) + test("za_4", Array(new Z(4))) + test("za_4", Array(new Z("4"))) + test("zl_5", List(new Z(5))) + test("zl_5", List(new Z("5"))) + // FIXME: disabled because of SI-7056 + // test("zv_6", new Z(6)) + // test("zv_6", new Z("6")) + test("zni_7", new Z(7)) + test("zns_8", new Z("8")) +} diff --git a/tests/pending/run/t6411b.check b/tests/pending/run/t6411b.check new file mode 100644 index 000000000000..e20bed6d8d50 --- /dev/null +++ b/tests/pending/run/t6411b.check @@ -0,0 +1 @@ +Bar(Foo(3)) diff --git a/tests/pending/run/t6411b.scala b/tests/pending/run/t6411b.scala new file mode 100644 index 000000000000..3543f24a9ee2 --- /dev/null +++ b/tests/pending/run/t6411b.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ + +case class Foo(n: Int) extends AnyVal +case class Bar(foo: Foo) + +object Test extends dotty.runtime.LegacyApp { + val mirror = runtimeMirror(getClass.getClassLoader) + val cm = mirror.reflectClass(typeOf[Bar].typeSymbol.asClass) + val ctor = typeOf[Bar].decl(termNames.CONSTRUCTOR).asMethod + val ctorm = cm.reflectConstructor(ctor) + println(ctorm(Foo(3))) +} diff --git a/tests/pending/run/t6434.check b/tests/pending/run/t6434.check new file mode 100644 index 000000000000..0a75ae2bd53a --- /dev/null +++ b/tests/pending/run/t6434.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> def f(x: => Int): Int = x +f: (x: => Int)Int + +scala> f _ +res0: (=> Int) => Int = + +scala> :quit diff --git a/tests/pending/run/t6434.scala b/tests/pending/run/t6434.scala new file mode 100644 index 000000000000..e4a45796131d --- /dev/null +++ b/tests/pending/run/t6434.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = +"""def f(x: => Int): Int = x +f _ +""" +} diff --git a/tests/pending/run/t6439.check b/tests/pending/run/t6439.check new file mode 100644 index 000000000000..c4b75910696f --- /dev/null +++ b/tests/pending/run/t6439.check @@ -0,0 +1,73 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class A +defined class A + +scala> object A // warn +defined object A +warning: previously defined class A is not a companion to object A. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> trait B +defined trait B + +scala> object B // warn +defined object B +warning: previously defined trait B is not a companion to object B. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> object C +defined object C + +scala> object Bippy +defined object Bippy + +scala> class C // warn +defined class C +warning: previously defined object C is not a companion to class C. +Companions must be defined together; you may wish to use :paste mode for this. + +scala> class D +defined class D + +scala> def D = 0 // no warn +D: Int + +scala> val D = 0 // no warn +D: Int = 0 + +scala> object E +defined object E + +scala> var E = 0 // no warn +E: Int = 0 + +scala> object F +defined object F + +scala> type F = Int // no warn +defined type alias F + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> object lookup { + import intp._ + def apply(name: String): Symbol = types(name) orElse terms(name) + def types(name: String): Symbol = replScope lookup (TypeName(name)) orElse getClassIfDefined(name) + def terms(name: String): Symbol = replScope lookup (TermName(name)) orElse getModuleIfDefined(name) + def types[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol + def terms[T: global.TypeTag] : Symbol = typeOf[T].termSymbol + def apply[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol +} +defined object lookup + +scala> lookup("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols +res0: $r.intp.global.Symbol = type F + +scala> :quit diff --git a/tests/pending/run/t6439.scala b/tests/pending/run/t6439.scala new file mode 100644 index 000000000000..53155a71a1de --- /dev/null +++ b/tests/pending/run/t6439.scala @@ -0,0 +1,32 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + + def code = """ +class A +object A // warn +trait B +object B // warn +object C +object Bippy +class C // warn +class D +def D = 0 // no warn +val D = 0 // no warn +object E +var E = 0 // no warn +object F +type F = Int // no warn +:power +object lookup { + import intp._ + def apply(name: String): Symbol = types(name) orElse terms(name) + def types(name: String): Symbol = replScope lookup (TypeName(name)) orElse getClassIfDefined(name) + def terms(name: String): Symbol = replScope lookup (TermName(name)) orElse getModuleIfDefined(name) + def types[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol + def terms[T: global.TypeTag] : Symbol = typeOf[T].termSymbol + def apply[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol +} +lookup("F") // this now works as a result of changing .typeSymbol to .typeSymbolDirect in IMain#Request#definedSymbols + """ +} diff --git a/tests/pending/run/t6440.check b/tests/pending/run/t6440.check new file mode 100644 index 000000000000..2358f08fcc71 --- /dev/null +++ b/tests/pending/run/t6440.check @@ -0,0 +1,5 @@ +pos: source-newSource1.scala,line-9,offset=109 missing or invalid dependency detected while loading class file 'U.class'. +Could not access term pack1 in package , +because it (or its dependencies) are missing. Check your build definition for +missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) +A full rebuild may help if 'U.class' was compiled against an incompatible version of . ERROR diff --git a/tests/pending/run/t6440.scala b/tests/pending/run/t6440.scala new file mode 100644 index 000000000000..5a3a4150d9ae --- /dev/null +++ b/tests/pending/run/t6440.scala @@ -0,0 +1,48 @@ +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 library1 = """ + package pack1 + trait T + """ + + def library2 = """ + package pack2 + trait U extends pack1.T + """ + + def app = """ + package pack3 + object X { + trait U + } + import X._ + import pack2._ + + trait V extends U + """ + + def show(): Unit = { + Seq(library1, library2) foreach compileCode + assert(filteredInfos.isEmpty, filteredInfos) + + // blow away the entire package + val pack1 = new File(testOutput.path, "pack1") + val tClass = new File(pack1, "T.class") + assert(tClass.exists) + assert(tClass.delete()) + assert(pack1.delete()) + + // bad symbolic reference error expected (but no stack trace!) + compileCode(app) + println(filteredInfos.mkString("\n")) + } +} diff --git a/tests/pending/run/t6440b.check b/tests/pending/run/t6440b.check new file mode 100644 index 000000000000..a6100d6d1ecf --- /dev/null +++ b/tests/pending/run/t6440b.check @@ -0,0 +1,5 @@ +pos: NoPosition missing or invalid dependency detected while loading class file 'U.class'. +Could not access type T in package pack1, +because it (or its dependencies) are missing. Check your build definition for +missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) +A full rebuild may help if 'U.class' was compiled against an incompatible version of pack1. ERROR diff --git a/tests/pending/run/t6440b.scala b/tests/pending/run/t6440b.scala new file mode 100644 index 000000000000..974aca2844ba --- /dev/null +++ b/tests/pending/run/t6440b.scala @@ -0,0 +1,61 @@ +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 library1 = """ + package pack1 + trait T + class U { + def t = new T {} + def one = 1 + } + """ + + def library2 = """ + package pack2 + object V { + def u = new pack1.U + } + """ + + def app1 = """ + package pack3 + object Test { + pack2.V.u.one // okay + } + """ + + def app2 = """ + package pack3 + object Test { + pack2.V.u.t // we have to fail if T.class is misisng + } + """ + + def show(): Unit = { + compileCode(library1) + val pack1 = new File(testOutput.path, "pack1") + val tClass = new File(pack1, "T.class") + assert(tClass.exists) + assert(tClass.delete()) + + // allowed to compile, no direct reference to `T` + compileCode(library2) + assert(filteredInfos.isEmpty, filteredInfos) + + // allowed to compile, no direct reference to `T` + compileCode(app1) + assert(filteredInfos.isEmpty, filteredInfos) + + // bad symbolic reference error expected (but no stack trace!) + compileCode(app2) + println(filteredInfos.mkString("\n")) + } +} diff --git a/tests/pending/run/t6443-by-name.check b/tests/pending/run/t6443-by-name.check new file mode 100644 index 000000000000..6f98fa4a28ee --- /dev/null +++ b/tests/pending/run/t6443-by-name.check @@ -0,0 +1,3 @@ +1 +foo +foo diff --git a/tests/pending/run/t6443-by-name.scala b/tests/pending/run/t6443-by-name.scala new file mode 100644 index 000000000000..3060a22b4352 --- /dev/null +++ b/tests/pending/run/t6443-by-name.scala @@ -0,0 +1,18 @@ +object Test { + + def main(args: Array[String]): Unit = { + def foo = {println("foo"); 0} + lazyDep(X)(foo) + } + + trait T { + type U + } + object X extends T { type U = Int } + + def lazyDep(t: T)(u: => t.U): Unit = { + println("1") + u + u + } +} diff --git a/tests/pending/run/t6443-varargs.check b/tests/pending/run/t6443-varargs.check new file mode 100644 index 000000000000..257cc5642cb1 --- /dev/null +++ b/tests/pending/run/t6443-varargs.check @@ -0,0 +1 @@ +foo diff --git a/tests/pending/run/t6443-varargs.scala b/tests/pending/run/t6443-varargs.scala new file mode 100644 index 000000000000..006e332444df --- /dev/null +++ b/tests/pending/run/t6443-varargs.scala @@ -0,0 +1,16 @@ +object Test { + + def main(args: Array[String]): Unit = { + def foo = {println("foo"); 0} + lazyDep(X)(foo) + } + + trait T { + type U + } + object X extends T { type U = Int } + + def lazyDep(t: T)(us: t.U*): Unit = { + List(us: _*) + } +} diff --git a/tests/pending/run/t6443.scala b/tests/pending/run/t6443.scala new file mode 100644 index 000000000000..9cc8c29ff4df --- /dev/null +++ b/tests/pending/run/t6443.scala @@ -0,0 +1,17 @@ +import scala.language.existentials + +class Base +class Derived extends Base + +trait A { + def foo(d: String)(d2: d.type): Base + val s = "" + def bar: Unit = foo(s)(s) +} +object B extends A { + def foo(d: String)(d2: d.type): D forSome { type D <: Derived; type S <: Derived } = {d2.isEmpty; null} // Bridge method required here! +} + +object Test extends dotty.runtime.LegacyApp { + B.bar +} diff --git a/tests/pending/run/t6443b.scala b/tests/pending/run/t6443b.scala new file mode 100644 index 000000000000..7633bedfc3fc --- /dev/null +++ b/tests/pending/run/t6443b.scala @@ -0,0 +1,16 @@ +trait A { + type D >: Null <: C + def foo(d: D)(d2: d.type): Unit + trait C { + def bar: Unit = foo(null)(null) + } +} +object B extends A { + class D extends C + + def foo(d: D)(d2: d.type): Unit = () // Bridge method required here! +} + +object Test extends dotty.runtime.LegacyApp { + new B.D().bar +} diff --git a/tests/pending/run/t6448.check b/tests/pending/run/t6448.check new file mode 100644 index 000000000000..94015683190a --- /dev/null +++ b/tests/pending/run/t6448.check @@ -0,0 +1,32 @@ + +=List.collect= +f(1) +f(2) +List(1) + +=List.collectFirst= +f(1) +Some(1) + +=Option.collect= +f(1) +Some(1) + +=Option.collect= +f(2) +None + +=Stream.collect= +f(1) +f(2) +List(1) + +=Stream.collectFirst= +f(1) +Some(1) + +=ParVector.collect= +(ParVector(1),2) + +=ParArray.collect= +(ParArray(1),2) diff --git a/tests/pending/run/t6448.scala b/tests/pending/run/t6448.scala new file mode 100644 index 000000000000..48beeafc26cb --- /dev/null +++ b/tests/pending/run/t6448.scala @@ -0,0 +1,61 @@ +// Tests to show that various `collect` functions avoid calling +// both `PartialFunction#isDefinedAt` and `PartialFunction#apply`. +// +object Test { + def f(i: Int) = { println("f(" + i + ")"); true } + class Counter { + var count = 0 + def apply(i: Int) = synchronized {count += 1; true} + } + + def testing(label: String)(body: => Any): Unit = { + println(s"\n=$label=") + println(body) + } + + def main(args: Array[String]): Unit = { + testing("List.collect")(List(1, 2) collect { case x if f(x) && x < 2 => x}) + testing("List.collectFirst")(List(1, 2) collectFirst { case x if f(x) && x < 2 => x}) + testing("Option.collect")(Some(1) collect { case x if f(x) && x < 2 => x}) + testing("Option.collect")(Some(2) collect { case x if f(x) && x < 2 => x}) + testing("Stream.collect")((Stream(1, 2).collect { case x if f(x) && x < 2 => x}).toList) + testing("Stream.collectFirst")(Stream.continually(1) collectFirst { case x if f(x) && x < 2 => x}) + + import collection.parallel.ParIterable + import collection.parallel.immutable.ParVector + import collection.parallel.mutable.ParArray + testing("ParVector.collect") { + val counter = new Counter() + (ParVector(1, 2) collect { case x if counter(x) && x < 2 => x}, counter.synchronized(counter.count)) + } + + testing("ParArray.collect") { + val counter = new Counter() + (ParArray(1, 2) collect { case x if counter(x) && x < 2 => x}, counter.synchronized(counter.count)) + } + + object PendingTests { + testing("Iterator.collect")((Iterator(1, 2) collect { case x if f(x) && x < 2 => x}).toList) + + testing("List.view.collect")((List(1, 2).view collect { case x if f(x) && x < 2 => x}).force) + + // This would do the trick in Future.collect, but I haven't added this yet as there is a tradeoff + // with extra allocations to consider. + // + // pf.lift(v) match { + // case Some(x) => p success x + // case None => fail(v) + // } + testing("Future.collect") { + import concurrent.ExecutionContext.Implicits.global + import concurrent.Await + import concurrent.duration.Duration + val result = concurrent.Future(1) collect { case x if f(x) => x} + Await.result(result, Duration.Inf) + } + + // TODO Future.{onSuccess, onFailure, recoverWith, andThen} + } + + } +} diff --git a/tests/pending/run/t6467.scala b/tests/pending/run/t6467.scala new file mode 100644 index 000000000000..e02fb166993e --- /dev/null +++ b/tests/pending/run/t6467.scala @@ -0,0 +1,20 @@ + + + + +import collection._ + + + +object Test extends dotty.runtime.LegacyApp { + + def compare(s1: String, s2: String): Unit = { + assert(s1 == s2, s1 + "\nvs.\n" + s2) + } + + compare(List(1, 2, 3, 4).aggregate(new java.lang.StringBuffer)(_ append _, _ append _).toString, "1234") + compare(List(1, 2, 3, 4).par.aggregate(new java.lang.StringBuffer)(_ append _, _ append _).toString, "1234") + compare(Seq(0 until 100: _*).aggregate(new java.lang.StringBuffer)(_ append _, _ append _).toString, (0 until 100).mkString) + compare(Seq(0 until 100: _*).par.aggregate(new java.lang.StringBuffer)(_ append _, _ append _).toString, (0 until 100).mkString) + +} diff --git a/tests/pending/run/t6481.check b/tests/pending/run/t6481.check new file mode 100644 index 000000000000..4a3f6f7ee944 --- /dev/null +++ b/tests/pending/run/t6481.check @@ -0,0 +1,5 @@ +warning: there was one deprecation warning; re-run with -deprecation for details +delayed init +new foo(1, 2) +delayed init +new foo(b = 2, a = 1) diff --git a/tests/pending/run/t6481.scala b/tests/pending/run/t6481.scala new file mode 100644 index 000000000000..8bbf5cf95467 --- /dev/null +++ b/tests/pending/run/t6481.scala @@ -0,0 +1,13 @@ +abstract class foo(a: Int, b: Int) extends scala.DelayedInit { + def delayedInit(x: => Unit): Unit = { + println("delayed init"); + x + } +} + +object Test { + def main(args: Array[String]): Unit = { + new foo(1, 2) { println("new foo(1, 2)") } + new foo(b = 2, a = 1) { println("new foo(b = 2, a = 1)") } + } +} diff --git a/tests/pending/run/t6488.scala b/tests/pending/run/t6488.scala new file mode 100644 index 000000000000..559164044242 --- /dev/null +++ b/tests/pending/run/t6488.scala @@ -0,0 +1,64 @@ +import scala.sys.process._ +import scala.util.Try +import scala.util.Properties.{ javaHome, javaClassPath } +import java.io.{ File, IOException } +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit._ +import java.util.concurrent.atomic._ + +object Test { + /* + // Program that prints "Success" if the command was successfully run then destroyed + // It will silently pass if the command "/bin/ls" does not exist + // It will fail due to the uncatchable exception in t6488 race condition, + // i.e., if any uncaught exceptions on spawned threads are printed. + def main(args: Array[String]) { + try Process("/bin/ls").run(ProcessLogger { _ => () }).destroy + catch { case _ => () } + println("Success") + } + */ + + // Show that no uncaught exceptions are thrown on spawned I/O threads + // when the process is destroyed. The default handler will print + // stack traces in the failing case. + def main(args: Array[String]): Unit = { + if (args.nonEmpty && args(0) == "data") + data() + else + test() // args(0) == "jvm" + } + + // fork the data spewer, wait for input, then destroy the process + def test(): Unit = { + val f = new File(javaHome, "bin").listFiles.sorted filter (_.getName startsWith "java") find (_.canExecute) getOrElse { + // todo signal test runner that test is skipped + new File("/bin/ls") // innocuous + } + //Process(f.getAbsolutePath).run(ProcessLogger { _ => () }).destroy + val reading = new CountDownLatch(1) + val count = new AtomicInteger + def counted = count.get + val command = s"${f.getAbsolutePath} -classpath ${javaClassPath} Test data" + Try { + Process(command) run ProcessLogger { (s: String) => + //Console println s"[[$s]]" // java help + count.getAndIncrement + reading.countDown + Thread.`yield`() + } + } foreach { (p: Process) => + val ok = reading.await(10, SECONDS) + if (!ok) Console println "Timed out waiting for process output!" + p.destroy() + } + //Console println s"Read count $counted lines" + } + + // spew something + def data(): Unit = { + def filler = "." * 100 + for (i <- 1 to 1000) + Console println s"Outputting data line $i $filler" + } +} diff --git a/tests/pending/run/t6500.scala b/tests/pending/run/t6500.scala new file mode 100644 index 000000000000..8df00592b524 --- /dev/null +++ b/tests/pending/run/t6500.scala @@ -0,0 +1,13 @@ +object Test extends dotty.runtime.LegacyApp { + class Box(val value: Int) extends AnyVal + + trait Foo { + def append(box: Box): Foo + } + + class Bar extends Foo { + override def append(box: Box): Bar = this // produces bad forwarder + } + + ((new Bar): Foo).append(new Box(0)) +} diff --git a/tests/pending/run/t6506.scala b/tests/pending/run/t6506.scala new file mode 100644 index 000000000000..64a097b6bfb3 --- /dev/null +++ b/tests/pending/run/t6506.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + new WL(new {} #:: S) with T + } + object S { def #::(a: Any): Any = () } + trait T + class WL(a: Any) +} diff --git a/tests/pending/run/t6507.check b/tests/pending/run/t6507.check new file mode 100644 index 000000000000..5da4aa3a24d5 --- /dev/null +++ b/tests/pending/run/t6507.check @@ -0,0 +1,24 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :silent +Switched off result printing. + +scala> class A { override def toString() = { println("!"); "A" } } + +scala> val a = new A + +scala> var b: A = new A + +scala> b = new A + +scala> new A + +scala> :silent +Switched on result printing. + +scala> res0 +! +res1: A = A + +scala> :quit diff --git a/tests/pending/run/t6507.scala b/tests/pending/run/t6507.scala new file mode 100644 index 000000000000..25f0a73e04d0 --- /dev/null +++ b/tests/pending/run/t6507.scala @@ -0,0 +1,14 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +:silent +class A { override def toString() = { println("!"); "A" } } +val a = new A +var b: A = new A +b = new A +new A +:silent +res0 +""" +} diff --git a/tests/pending/run/t6534.scala b/tests/pending/run/t6534.scala new file mode 100644 index 000000000000..33df97e41e44 --- /dev/null +++ b/tests/pending/run/t6534.scala @@ -0,0 +1,14 @@ +trait Foo extends Any { override def equals(x: Any) = false } +trait Ding extends Any { override def hashCode = -1 } + +class Bippy1(val x: Int) extends AnyVal with Foo { } // warn +class Bippy2(val x: Int) extends AnyVal with Ding { } // warn + +object Test { + def main(args: Array[String]): Unit = { + val b1 = new Bippy1(71) + val b2 = new Bippy2(71) + assert(b1 == b1 && b1.## == b1.x.##, ((b1, b1.##))) + assert(b2 == b2 && b2.## == b2.x.##, ((b2, b2.##))) + } +} diff --git a/tests/pending/run/t6541-option.scala b/tests/pending/run/t6541-option.scala new file mode 100644 index 000000000000..2c10c9e09d99 --- /dev/null +++ b/tests/pending/run/t6541-option.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +:setting -Xsource:2.12 +case class C12(clazz: Class[_]) +val o: Option[Class[T] forSome { type T}] = C12.unapply(C12(classOf[String])) + +:setting -Xsource:2.11 +import scala.language.existentials +case class C11(clazz: Class[_]) +val o: Option[Class[T]] forSome { type T } = C11.unapply(C11(classOf[String])) + """ + + override def show() = { + val r = eval().mkString("\n") + assert(!(r.contains("warning") || r.contains("error")), r) + } +} diff --git a/tests/pending/run/t6541.flags b/tests/pending/run/t6541.flags new file mode 100644 index 000000000000..68d0ddfec205 --- /dev/null +++ b/tests/pending/run/t6541.flags @@ -0,0 +1 @@ +-feature -Xfatal-warnings -Xsource:2.12 \ No newline at end of file diff --git a/tests/pending/run/t6541.scala b/tests/pending/run/t6541.scala new file mode 100644 index 000000000000..f03a752172cc --- /dev/null +++ b/tests/pending/run/t6541.scala @@ -0,0 +1,25 @@ +class A +class B[T](x: T) +case class C(a: A, b: B[_]) + +case class D(a: A, b: B[_]*) + +case class E(c: Class[_]) + +object Test extends dotty.runtime.LegacyApp { + def f1(c: C) = c match { + case C(a, b) => () + } + + def f2(d: D) = d match { + case D(a, b1, b2) => () + } + + def f3(e: E) = e match { + case E(c) => () + } + + f1(C(new A, new B(1))) + f2(D(new A, new B(1), new B(2))) + f3(E(classOf[E])) +} diff --git a/tests/pending/run/t6546.flags b/tests/pending/run/t6546.flags new file mode 100644 index 000000000000..eb4d19bcb91a --- /dev/null +++ b/tests/pending/run/t6546.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file diff --git a/tests/pending/run/t6546/A_1.scala b/tests/pending/run/t6546/A_1.scala new file mode 100644 index 000000000000..bd086c08f863 --- /dev/null +++ b/tests/pending/run/t6546/A_1.scala @@ -0,0 +1,6 @@ +final class Opt { + @inline def getOrElse(x: => String): String = "" +} +class A_1 { + def f(x: Opt): String = x getOrElse null +} diff --git a/tests/pending/run/t6546/B_2.scala b/tests/pending/run/t6546/B_2.scala new file mode 100644 index 000000000000..64ec966f7500 --- /dev/null +++ b/tests/pending/run/t6546/B_2.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.BytecodeTest + +object Test extends BytecodeTest { + def show: Unit = { + val node = loadClassNode("A_1") + assert(node.innerClasses.isEmpty, node.innerClasses) + } +} diff --git a/tests/pending/run/t6548.check b/tests/pending/run/t6548.check new file mode 100644 index 000000000000..5dfcb12e026a --- /dev/null +++ b/tests/pending/run/t6548.check @@ -0,0 +1,2 @@ +false +List(JavaAnnotationWithNestedEnum_1(value = VALUE)) diff --git a/tests/pending/run/t6548/JavaAnnotationWithNestedEnum_1.java b/tests/pending/run/t6548/JavaAnnotationWithNestedEnum_1.java new file mode 100644 index 000000000000..32004de53744 --- /dev/null +++ b/tests/pending/run/t6548/JavaAnnotationWithNestedEnum_1.java @@ -0,0 +1,17 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD, + ElementType.TYPE, ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +public @interface JavaAnnotationWithNestedEnum_1 +{ + public Value value() default Value.VALUE; + + public enum Value + { + VALUE; + } +} \ No newline at end of file diff --git a/tests/pending/run/t6548/Test_2.scala b/tests/pending/run/t6548/Test_2.scala new file mode 100644 index 000000000000..b392ff726e78 --- /dev/null +++ b/tests/pending/run/t6548/Test_2.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class Bean { + @JavaAnnotationWithNestedEnum_1(JavaAnnotationWithNestedEnum_1.Value.VALUE) + def value = 1 +} + +object Test extends dotty.runtime.LegacyApp { + println(cm.staticClass("Bean").isCaseClass) + println(typeOf[Bean].decl(TermName("value")).annotations) +} diff --git a/tests/pending/run/t6549.check b/tests/pending/run/t6549.check new file mode 100644 index 000000000000..be3445927e99 --- /dev/null +++ b/tests/pending/run/t6549.check @@ -0,0 +1,28 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> case class `X"`(var xxx: Any) +defined class X$u0022 + +scala> val m = Map(("": Any) -> `X"`("\""), ('s: Any) -> `X"`("\"")) +m: scala.collection.immutable.Map[Any,X"] = Map("" -> X"("), 's -> X"(")) + +scala> m("") +res0: X" = X"(") + +scala> m("").xxx +res1: Any = " + +scala> m("").xxx = 0 +m("").xxx: Any = 0 + +scala> m("").xxx = "\"" +m("").xxx: Any = " + +scala> m('s).xxx = 's +m(scala.Symbol("s")).xxx: Any = 's + +scala> val `"` = 0 +": Int = 0 + +scala> :quit diff --git a/tests/pending/run/t6549.scala b/tests/pending/run/t6549.scala new file mode 100644 index 000000000000..7335661dc7fb --- /dev/null +++ b/tests/pending/run/t6549.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.ReplTest + +// Check that the fragments of code generated in +// in the REPL correctly escape values added to +// literal strings. +// +// Before, we saw: +// scala> m("").x = 77 +// :10: error: ')' expected but string literal found. +// + "m("").x: Int = " + `$ires8` + "\n" +object Test extends ReplTest { + def code = """ + |case class `X"`(var xxx: Any) + |val m = Map(("": Any) -> `X"`("\""), ('s: Any) -> `X"`("\"")) + |m("") + |m("").xxx + |m("").xxx = 0 + |m("").xxx = "\"" + |m('s).xxx = 's + |val `"` = 0 + """.stripMargin +} diff --git a/tests/pending/run/t6554.check b/tests/pending/run/t6554.check new file mode 100644 index 000000000000..6e0af7b47485 --- /dev/null +++ b/tests/pending/run/t6554.check @@ -0,0 +1 @@ +public java.lang.Object Bar.minBy(java.lang.Object) / public java.lang.Object Bar.minBy(java.lang.Object) diff --git a/tests/pending/run/t6554.scala b/tests/pending/run/t6554.scala new file mode 100644 index 000000000000..e89a3760ec5b --- /dev/null +++ b/tests/pending/run/t6554.scala @@ -0,0 +1,11 @@ +trait Foo[A] { + def minBy[B](b: B): A = ??? +} + +class Bar extends Foo[Int] + +object Test extends dotty.runtime.LegacyApp { + val sigs = classOf[Bar].getDeclaredMethods.map(m => s"${m.toString} / ${m.toGenericString}").sorted + println(sigs.mkString("\n")) +} +// Was public java.lang.Object Bar.minBy(java.lang.Object) / public int Bar.minBy(B) diff --git a/tests/pending/run/t6555.check b/tests/pending/run/t6555.check new file mode 100644 index 000000000000..e3b467ce7cc7 --- /dev/null +++ b/tests/pending/run/t6555.check @@ -0,0 +1,22 @@ +[[syntax trees at end of specialize]] // newSource1.scala +package { + class Foo extends Object { + def (): Foo = { + Foo.super.(); + () + }; + private[this] val f: Int => Int = { + @SerialVersionUID(value = 0) final class $anonfun extends scala.runtime.AbstractFunction1$mcII$sp with Serializable { + def (): <$anon: Int => Int> = { + $anonfun.super.(); + () + }; + final def apply(param: Int): Int = $anonfun.this.apply$mcII$sp(param); + def apply$mcII$sp(param: Int): Int = param + }; + (new <$anon: Int => Int>(): Int => Int) + }; + def f(): Int => Int = Foo.this.f + } +} + diff --git a/tests/pending/run/t6555.scala b/tests/pending/run/t6555.scala new file mode 100644 index 000000000000..cc0e4d1bfadb --- /dev/null +++ b/tests/pending/run/t6555.scala @@ -0,0 +1,15 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:specialize -Ydelambdafy:inline -d " + testOutput.path + + override def code = "class Foo { val f = (param: Int) => param } " + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} diff --git a/tests/pending/run/t6559.scala b/tests/pending/run/t6559.scala new file mode 100644 index 000000000000..5c671f727577 --- /dev/null +++ b/tests/pending/run/t6559.scala @@ -0,0 +1,17 @@ + +object Test { + + def main(args: Array[String]) = { + val one = "1" + val two = "2" + + val raw = raw"\n$one\n$two\n" + val escaped = s"\n$one\n$two\n" + val buggy = "\\n1\n2\n" + val correct = "\\n1\\n2\\n" + + assert(raw != escaped, "Raw strings should not be escaped.") + assert(raw != buggy, "Raw strings after variables should not be escaped.") + assert(raw == correct, "Raw strings should stay raw.") + } +} diff --git a/tests/pending/run/t657.check b/tests/pending/run/t657.check new file mode 100644 index 000000000000..b0aad4deb5bb --- /dev/null +++ b/tests/pending/run/t657.check @@ -0,0 +1 @@ +passed diff --git a/tests/pending/run/t657.scala b/tests/pending/run/t657.scala new file mode 100644 index 000000000000..00cae5d33949 --- /dev/null +++ b/tests/pending/run/t657.scala @@ -0,0 +1,53 @@ + +import scala.language.{ implicitConversions } +abstract class BaseList { + type Node <: NodeImpl; + implicit def convertNode(ni : NodeImpl): BaseList.this.Node = ni.asInstanceOf[Node]; + abstract class NodeImpl; +} +abstract class LinkedList extends BaseList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; +} +trait OffsetList extends LinkedList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; +} + +trait PriorityTree extends BaseList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl { + def chop : Node = this; + } +} + +trait PrecedenceParser extends LinkedList with PriorityTree { + type Node <: NodeImpl; + trait NodeImpl extends super[LinkedList].NodeImpl with super[PriorityTree].NodeImpl; +} + +trait Matcher extends PrecedenceParser { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; + + type Matchable <: Node with MatchableImpl; + implicit def convertMatchable(m : MatchableImpl): Matcher.this.Matchable = m.asInstanceOf[Matchable]; + trait MatchableImpl extends NodeImpl { + override def chop : Node = { + Console.println("passed"); super.chop; + } + } +} + +class Test1 extends OffsetList with Matcher { + type Node = NodeImpl; + trait NodeImpl extends super[OffsetList].NodeImpl with super[Matcher].NodeImpl; + class MatchableImpl extends super.MatchableImpl with NodeImpl; + type Matchable = MatchableImpl; +} + +object Test extends dotty.runtime.LegacyApp { + val test = new Test1; + val m = new test.MatchableImpl; + m.chop; +} diff --git a/tests/pending/run/t6574b.check b/tests/pending/run/t6574b.check new file mode 100644 index 000000000000..e10fa4f810ad --- /dev/null +++ b/tests/pending/run/t6574b.check @@ -0,0 +1 @@ +List(5, 4, 3, 2, 1) diff --git a/tests/pending/run/t6574b.scala b/tests/pending/run/t6574b.scala new file mode 100644 index 000000000000..56f952074f29 --- /dev/null +++ b/tests/pending/run/t6574b.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + implicit class AnyOps(val i: Int) extends AnyVal { + private def parentsOf(x: Int): List[Int] = if (x == 0) Nil else x :: parentsOf(x - 1) + def parents: List[Int] = parentsOf(i) + } + println((5).parents) +} diff --git a/tests/pending/run/t6584.check b/tests/pending/run/t6584.check new file mode 100644 index 000000000000..35c86887515f --- /dev/null +++ b/tests/pending/run/t6584.check @@ -0,0 +1,8 @@ +Array: 102400 +Vector: 102400 +List: 102400 +Stream: 102400 +Array: 102400 +Vector: 102400 +List: 102400 +Stream: 102400 diff --git a/tests/pending/run/t6584.scala b/tests/pending/run/t6584.scala new file mode 100644 index 000000000000..24c236ef3590 --- /dev/null +++ b/tests/pending/run/t6584.scala @@ -0,0 +1,16 @@ +object Test { + def main(args: Array[String]): Unit = { + val size = 100 * 1024 + val doubled = (1 to size) ++ (1 to size) + + println("Array: " + Array.tabulate(size)(x => x).distinct.size) + println("Vector: " + Vector.tabulate(size)(x => x).distinct.size) + println("List: " + List.tabulate(size)(x => x).distinct.size) + println("Stream: " + Stream.tabulate(size)(x => x).distinct.size) + + println("Array: " + doubled.toArray.distinct.size) + println("Vector: " + doubled.toVector.distinct.size) + println("List: " + doubled.toList.distinct.size) + println("Stream: " + doubled.toStream.distinct.size) + } +} diff --git a/tests/pending/run/t6591_1.check b/tests/pending/run/t6591_1.check new file mode 100644 index 000000000000..d1d448f28319 --- /dev/null +++ b/tests/pending/run/t6591_1.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), Select(Ident(A), TypeName("I")), Select(Ident(A), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_1.scala b/tests/pending/run/t6591_1.scala new file mode 100644 index 000000000000..8c152f68acd2 --- /dev/null +++ b/tests/pending/run/t6591_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +trait O { trait I } + +object A extends O { + val impl = new I {} +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val v: A.I = A.impl + v + } + println(showRaw(code.tree)) + + val v: A.I = code.eval +} diff --git a/tests/pending/run/t6591_2.check b/tests/pending/run/t6591_2.check new file mode 100644 index 000000000000..a2930b1749a7 --- /dev/null +++ b/tests/pending/run/t6591_2.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), SelectFromTypeTree(Ident(A), TypeName("I")), Select(Apply(Select(New(Ident(A)), termNames.CONSTRUCTOR), List()), TermName("impl")))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_2.scala b/tests/pending/run/t6591_2.scala new file mode 100644 index 000000000000..9e6c917e84fb --- /dev/null +++ b/tests/pending/run/t6591_2.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +trait O { trait I } + +class A extends O { + val impl = new I {} +} + +object Test extends dotty.runtime.LegacyApp { + val code = reify { + val v: A#I = (new A).impl + v + } + println(showRaw(code.tree)) + + val v: A#I = code.eval +} diff --git a/tests/pending/run/t6591_3.check b/tests/pending/run/t6591_3.check new file mode 100644 index 000000000000..362aafd11cae --- /dev/null +++ b/tests/pending/run/t6591_3.check @@ -0,0 +1 @@ +Block(List(ValDef(Modifiers(), TermName("v"), Select(This(TypeName("A")), TypeName("I")), Apply(Select(New(Select(This(TypeName("A")), TypeName("I"))), termNames.CONSTRUCTOR), List()))), Ident(TermName("v"))) diff --git a/tests/pending/run/t6591_3.scala b/tests/pending/run/t6591_3.scala new file mode 100644 index 000000000000..5069b800e5d9 --- /dev/null +++ b/tests/pending/run/t6591_3.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval + +class O { class I } + +object A extends O { + val code = reify { + val v: I = new I + v + } + println(showRaw(code.tree)) +} + +object Test extends dotty.runtime.LegacyApp { + val v: A.I = A.code.eval +} diff --git a/tests/pending/run/t6591_5.check b/tests/pending/run/t6591_5.check new file mode 100644 index 000000000000..4ebc2236af32 --- /dev/null +++ b/tests/pending/run/t6591_5.check @@ -0,0 +1 @@ +Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(This(TypeName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/pending/run/t6591_5.scala b/tests/pending/run/t6591_5.scala new file mode 100644 index 000000000000..dfb4cd5ade67 --- /dev/null +++ b/tests/pending/run/t6591_5.scala @@ -0,0 +1,23 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +import java.lang.reflect.InvocationTargetException + +class O { class I } + +object A extends O { + val x = new O + val code = reify { + val v: x.I = ??? + v + } + println(showRaw(code)) +} + +object Test extends dotty.runtime.LegacyApp { + try { + val v: A.x.I = A.code.eval + } catch { + case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => + } +} diff --git a/tests/pending/run/t6591_6.check b/tests/pending/run/t6591_6.check new file mode 100644 index 000000000000..940e2026fefd --- /dev/null +++ b/tests/pending/run/t6591_6.check @@ -0,0 +1 @@ +Expr(Block(List(ValDef(Modifiers(), TermName("v"), Select(Select(Ident(TermName("A")), TermName("x")), TypeName("I")), Select(Ident(scala.Predef), TermName("$qmark$qmark$qmark")))), Ident(TermName("v")))) diff --git a/tests/pending/run/t6591_6.scala b/tests/pending/run/t6591_6.scala new file mode 100644 index 000000000000..afb2da229f6b --- /dev/null +++ b/tests/pending/run/t6591_6.scala @@ -0,0 +1,24 @@ +import scala.language.existentials +import scala.reflect.runtime.universe._ +import scala.tools.reflect.ToolBox +import scala.tools.reflect.Eval +import java.lang.reflect.InvocationTargetException + +class O { class I } + +class A extends O { + val x = new O + val code = reify { + val v: x.I = ??? + v + } + println(showRaw(code)) +} + +object Test extends dotty.runtime.LegacyApp { + try { + val v = (new A).code.eval + } catch { + case ex: InvocationTargetException if ex.getCause.isInstanceOf[NotImplementedError] => + } +} diff --git a/tests/pending/run/t6591_7.check b/tests/pending/run/t6591_7.check new file mode 100644 index 000000000000..e21a3669b6e7 --- /dev/null +++ b/tests/pending/run/t6591_7.check @@ -0,0 +1,4 @@ +name = x, stable = true +name = y, stable = true +name = z, stable = false +name = C, stable = true diff --git a/tests/pending/run/t6591_7.scala b/tests/pending/run/t6591_7.scala new file mode 100644 index 000000000000..cec0d2cdad8c --- /dev/null +++ b/tests/pending/run/t6591_7.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval +import internal._ + +object Test extends dotty.runtime.LegacyApp { + locally { + val x = 2 + def y = 3 + var z = 4 + class C { + var w = 5 + locally { + val expr = reify(x + y + z + w) + // blocked by SI-7103, though it's not the focus of this test + // therefore I'm just commenting out the evaluation + // println(expr.eval) + freeTerms(expr.tree) foreach (ft => { + // blocked by SI-7104, though it's not the focus of this test + // therefore I'm just commenting out the call to info + // println(s"name = ${ft.name}, sig = ${ft.info}, stable = ${ft.isStable}") + println(s"name = ${ft.name}, stable = ${ft.isStable}") + }) + } + } + new C() + } +} diff --git a/tests/pending/run/t6608.check b/tests/pending/run/t6608.check new file mode 100644 index 000000000000..15628b322ea0 --- /dev/null +++ b/tests/pending/run/t6608.check @@ -0,0 +1 @@ +(C$$yyy,true) diff --git a/tests/pending/run/t6608.scala b/tests/pending/run/t6608.scala new file mode 100644 index 000000000000..3671e2892b4d --- /dev/null +++ b/tests/pending/run/t6608.scala @@ -0,0 +1,16 @@ +import reflect.runtime.universe + +class C { + private val yyy: Any = 1 + @inline def foo = yyy +} + +object Test extends dotty.runtime.LegacyApp { + import universe._ + val access = typeOf[C].decls + .toList + .filter(_.name.toString.endsWith("yyy")) + .map(x => (x.name, x.isPrivate)) + println(access.head) +} + diff --git a/tests/pending/run/t6611.scala b/tests/pending/run/t6611.scala new file mode 100644 index 000000000000..b8c1da8785d0 --- /dev/null +++ b/tests/pending/run/t6611.scala @@ -0,0 +1,61 @@ +object Test extends dotty.runtime.LegacyApp { + locally { + val a = Array("1") + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array("1": Object) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(true) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1: Short) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1: Byte) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1L) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1f) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(1d) + val a2 = Array(a: _*) + assert(a ne a2) + } + + locally { + val a = Array(()) + val a2 = Array(a: _*) + assert(a ne a2) + } +} diff --git a/tests/pending/run/t6614.check b/tests/pending/run/t6614.check new file mode 100644 index 000000000000..2e80ebda8bf6 --- /dev/null +++ b/tests/pending/run/t6614.check @@ -0,0 +1,11 @@ +(ArrayStack(),true) +(ArrayStack(0),true) +(ArrayStack(0, 1),true) +(ArrayStack(0, 1, 2),true) +(ArrayStack(0, 1, 2, 3),true) +(ArrayStack(0, 1, 2, 3, 4),true) +(ArrayStack(0, 1, 2, 3, 4, 5),true) +(ArrayStack(0, 1, 2, 3, 4, 5, 6),true) +(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7),true) +(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8),true) +(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),true) diff --git a/tests/pending/run/t6614.scala b/tests/pending/run/t6614.scala new file mode 100644 index 000000000000..b3044c9f0d80 --- /dev/null +++ b/tests/pending/run/t6614.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.collection.mutable.ArrayStack + + println((for (i <- 0 to 10) yield { + val in = ArrayStack.tabulate(i)(_.toString) + (in, (in filter (_ => true)) == in) + }).mkString("\n")) +} diff --git a/tests/pending/run/t6622.check b/tests/pending/run/t6622.check new file mode 100644 index 000000000000..5d006d88e62e --- /dev/null +++ b/tests/pending/run/t6622.check @@ -0,0 +1,10 @@ + O1.resultVal isMemberClass = false, null +class A$1 + O1.resultDef isMemberClass = false, public void O1$.resultDef() +class A$2 + C2.resultVal isMemberClass = false, null +class $B$1 + O3.resultDef isMemberClass = false, public void O3$.resultDef() +class C$1 + O4.resultDefDefault isMemberClass = false, public java.lang.Object O4$.resultDefDefault$default$1() +class C$2 diff --git a/tests/pending/run/t6622.scala b/tests/pending/run/t6622.scala new file mode 100644 index 000000000000..ded10e8e22c7 --- /dev/null +++ b/tests/pending/run/t6622.scala @@ -0,0 +1,50 @@ +import Test.check + +object O1 { + lazy val resultVal = { + class A + check("O1.resultVal", classOf[A]) + } + + def resultDef = { + class A + check("O1.resultDef", classOf[A]) + } +} + +class C2 { + val resultVal = { + val tmp = { + class B + check("C2.resultVal", classOf[B]) + } + } +} + +object O3 { + def resultDef = { + class C + check("O3.resultDef", classOf[C]) + } +} + +object O4 { + def resultDefDefault(a: Any = { + class C + check("O4.resultDefDefault", classOf[C]) + }) = (); +} + + +object Test extends dotty.runtime.LegacyApp { + def check(desc: String, clazz: Class[_]): Unit = { + println(s" $desc isMemberClass = ${clazz.isMemberClass}, ${clazz.getEnclosingMethod}") + println(reflect.runtime.currentMirror.classSymbol(clazz)) + } + + O1.resultVal + O1.resultDef + new C2().resultVal + O3.resultDef + O4.resultDefDefault() +} diff --git a/tests/pending/run/t6628.check b/tests/pending/run/t6628.check new file mode 100644 index 000000000000..bb101b641b9b --- /dev/null +++ b/tests/pending/run/t6628.check @@ -0,0 +1,2 @@ +true +true diff --git a/tests/pending/run/t6628.scala b/tests/pending/run/t6628.scala new file mode 100644 index 000000000000..bc87c125046d --- /dev/null +++ b/tests/pending/run/t6628.scala @@ -0,0 +1,11 @@ +object Test { + def coll = new Traversable[String] { + override def foreach[U](f:String=>U): Unit = { f("1") } + } + val dropped = coll.view drop 1 + + def main(args: Array[String]): Unit = { + println(dropped.isEmpty) + println(dropped.force.isEmpty) + } +} diff --git a/tests/pending/run/t6632.check b/tests/pending/run/t6632.check new file mode 100644 index 000000000000..26cf061b5f44 --- /dev/null +++ b/tests/pending/run/t6632.check @@ -0,0 +1,5 @@ +java.lang.IndexOutOfBoundsException: -1 +java.lang.IndexOutOfBoundsException: -2 +java.lang.IndexOutOfBoundsException: -3 +java.lang.IndexOutOfBoundsException: -1 +java.lang.IndexOutOfBoundsException: 5 diff --git a/tests/pending/run/t6632.scala b/tests/pending/run/t6632.scala new file mode 100644 index 000000000000..baf4e7309ded --- /dev/null +++ b/tests/pending/run/t6632.scala @@ -0,0 +1,22 @@ +object Test extends dotty.runtime.LegacyApp { + import collection.mutable.ListBuffer + + def newLB = ListBuffer('a, 'b, 'c, 'd, 'e) + + def iiobe[A](f: => A) = + try { f } + catch { case ex: IndexOutOfBoundsException => println(ex) } + + val lb0 = newLB + iiobe( lb0.insert(-1, 'x) ) + + val lb1 = newLB + iiobe( lb1.insertAll(-2, Array('x, 'y, 'z)) ) + + val lb2 = newLB + iiobe( lb2.update(-3, 'u) ) + + val lb3 = newLB + iiobe( lb3.updated(-1, 'u) ) + iiobe( lb3.updated(5, 'u) ) +} diff --git a/tests/pending/run/t6633.check b/tests/pending/run/t6633.check new file mode 100644 index 000000000000..1ff8cdbc4459 --- /dev/null +++ b/tests/pending/run/t6633.check @@ -0,0 +1,3 @@ +java.lang.IndexOutOfBoundsException: 9 +replStringOf OK +length OK diff --git a/tests/pending/run/t6633.scala b/tests/pending/run/t6633.scala new file mode 100644 index 000000000000..852fc571418e --- /dev/null +++ b/tests/pending/run/t6633.scala @@ -0,0 +1,33 @@ +object Test extends dotty.runtime.LegacyApp { + import collection.mutable.ListBuffer + + def newLB = ListBuffer('a, 'b, 'c, 'd, 'e) + + val lb0 = newLB + + try { + lb0.insert(9, 'x) + } catch { + case ex: IndexOutOfBoundsException => println(ex) + } + + val lb1 = newLB + + try { + lb1.insert(9, 'x) + } catch { + case ex: IndexOutOfBoundsException => + } + + val replStr = scala.runtime.ScalaRunTime.replStringOf(lb1, 100) + if (replStr == "ListBuffer('a, 'b, 'c, 'd, 'e)\n") + println("replStringOf OK") + else + println("replStringOf FAILED: " + replStr) + + val len = lb1.length + if (len == 5) + println("length OK") + else + println("length FAILED: " + len) +} diff --git a/tests/pending/run/t6634.check b/tests/pending/run/t6634.check new file mode 100644 index 000000000000..f6cbb30c6749 --- /dev/null +++ b/tests/pending/run/t6634.check @@ -0,0 +1,31 @@ +Trying lb0 ... +Checking ... +String OK. +Length OK. + +Trying lb1 ... +Checking ... +String OK. +Length OK. + +Trying lb2 ... +Checking ... +String OK. +Length OK. + +Trying lb3 ... +Checking ... +String OK. +Length OK. + +Trying lb4 ... +Checking ... +String OK. +Length OK. + +Trying lb5 ... +java.lang.IllegalArgumentException: removing negative number (-1) of elements +Checking ... +String OK. +Length OK. + diff --git a/tests/pending/run/t6634.scala b/tests/pending/run/t6634.scala new file mode 100644 index 000000000000..bc2f00224cc5 --- /dev/null +++ b/tests/pending/run/t6634.scala @@ -0,0 +1,80 @@ +import collection.mutable.ListBuffer + +object Test extends dotty.runtime.LegacyApp { + def newLB = ListBuffer('a, 'b, 'c, 'd, 'e) + + val lb0 = newLB + println("Trying lb0 ...") + try { + lb0.remove(5, 0) + } catch { + // Not thrown in 2.10, will be thrown in 2.11 + case ex: IndexOutOfBoundsException => println(ex) + } + checkNotCorrupted(lb0) + + val lb1 = newLB + println("Trying lb1 ...") + try { + lb1.remove(6, 6) + } catch { + // Not thrown in 2.10, will be thrown in 2.11 + case ex: IndexOutOfBoundsException => println(ex) + } + checkNotCorrupted(lb1) + + val lb2 = newLB + println("Trying lb2 ...") + try { + lb2.remove(99, 6) + } catch { + // Not thrown in 2.10, will be thrown in 2.11 + case ex: IndexOutOfBoundsException => println(ex) + } + checkNotCorrupted(lb2) + + val lb3 = newLB + println("Trying lb3 ...") + try { + lb3.remove(1, 9) + } catch { + // Not thrown in 2.10, will be thrown in 2.11 + case ex: IllegalArgumentException => println(ex) + } + checkNotCorrupted(lb3, "ListBuffer('a)", 1) + + val lb4 = newLB + println("Trying lb4 ...") + try { + lb4.remove(-1, 1) + } catch { + // Not thrown in 2.10, will be thrown in 2.11 + case ex: IndexOutOfBoundsException => println(ex) + } + checkNotCorrupted(lb4, "ListBuffer('b, 'c, 'd, 'e)", 4) + + val lb5 = newLB + println("Trying lb5 ...") + try { + lb5.remove(1, -1) + } catch { + case ex: IllegalArgumentException => println(ex) + } + checkNotCorrupted(lb5) + + // buffer should neither be changed nor corrupted after calling remove with invalid arguments + def checkNotCorrupted( + lb: ListBuffer[Symbol], + expectedString: String = "ListBuffer('a, 'b, 'c, 'd, 'e)", + expectedLength: Int = 5) = { + println("Checking ...") + val replStr = scala.runtime.ScalaRunTime.replStringOf(lb, 100) + if (replStr == expectedString + "\n") println("String OK.") + else println("!!! replStringOf FAILED: " + replStr) + + val len = lb.length + if (len == expectedLength) println("Length OK.") + else println("!!! length FAILED: " + len) + println() + } +} diff --git a/tests/pending/run/t6637.check b/tests/pending/run/t6637.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t6637.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t6637.scala b/tests/pending/run/t6637.scala new file mode 100644 index 000000000000..7f9c3cd61c6e --- /dev/null +++ b/tests/pending/run/t6637.scala @@ -0,0 +1,8 @@ + +object Test extends dotty.runtime.LegacyApp { + try { + class A ; class B ; List().head.isInstanceOf[A with B] + } catch { + case _ :java.util.NoSuchElementException => println("ok") + } +} diff --git a/tests/pending/run/t6644.scala b/tests/pending/run/t6644.scala new file mode 100644 index 000000000000..5a9850290891 --- /dev/null +++ b/tests/pending/run/t6644.scala @@ -0,0 +1,8 @@ +class Testable(val c: String) extends AnyVal { + def matching(cases: Boolean*) = cases contains true +} + +object Test extends dotty.runtime.LegacyApp { + assert(new Testable("").matching(true, false)) +} + diff --git a/tests/pending/run/t6646.check b/tests/pending/run/t6646.check new file mode 100644 index 000000000000..15715dae91da --- /dev/null +++ b/tests/pending/run/t6646.check @@ -0,0 +1,5 @@ +Found NoNull +Found lower +Found 2 +A single ident is always a pattern +A single ident is always a pattern diff --git a/tests/pending/run/t6646.scala b/tests/pending/run/t6646.scala new file mode 100644 index 000000000000..b96851077bf9 --- /dev/null +++ b/tests/pending/run/t6646.scala @@ -0,0 +1,19 @@ +sealed trait ColumnOption +case object NoNull extends ColumnOption +case object PrimaryKey extends ColumnOption +case object lower extends ColumnOption + +object Test { + def main(args: Array[String]): Unit = { + val l = List(PrimaryKey, NoNull, lower) + + // withFilter must be generated in these + for (option @ NoNull <- l) println("Found " + option) + for (option @ `lower` <- l) println("Found " + option) + for ((`lower`, i) <- l.zipWithIndex) println("Found " + i) + + // no withFilter + for (X <- List("A single ident is always a pattern")) println(X) + for (`x` <- List("A single ident is always a pattern")) println(`x`) + } +} diff --git a/tests/pending/run/t6662.check b/tests/pending/run/t6662.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t6662.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t6662/Macro_1.scala b/tests/pending/run/t6662/Macro_1.scala new file mode 100644 index 000000000000..419859772dbc --- /dev/null +++ b/tests/pending/run/t6662/Macro_1.scala @@ -0,0 +1,8 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Demo { + def id[T](a: T): T = macro idImpl[T] + + def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a +} diff --git a/tests/pending/run/t6662/Test_2.scala b/tests/pending/run/t6662/Test_2.scala new file mode 100644 index 000000000000..82ac54cb4627 --- /dev/null +++ b/tests/pending/run/t6662/Test_2.scala @@ -0,0 +1,8 @@ +// Macro usage: + +object Test { + def main(args: Array[String]) { + val s = Demo id (()) + println(s) + } +} diff --git a/tests/pending/run/t6663.check b/tests/pending/run/t6663.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/t6663.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/t6663.flags b/tests/pending/run/t6663.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/t6663.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/t6663.scala b/tests/pending/run/t6663.scala new file mode 100644 index 000000000000..bfe464ad6323 --- /dev/null +++ b/tests/pending/run/t6663.scala @@ -0,0 +1,17 @@ +import language.dynamics + +class C(v: Any) extends Dynamic { + def selectDynamic[T](n: String): Option[T] = Option(v.asInstanceOf[T]) + def applyDynamic[T](n: String)(): Option[T] = Option(v.asInstanceOf[T]) +} + +object Test extends dotty.runtime.LegacyApp { + // this should be converted to + // C(42).selectDynamic[Int]("foo").get + // but, before fixing SI-6663, became + // C(42).selectDynamic[Nothing]("foo").get + // leading to a ClassCastException + var v = new C(42).foo[Int].get + println(v) +} + diff --git a/tests/pending/run/t6666a.scala b/tests/pending/run/t6666a.scala new file mode 100644 index 000000000000..1d208a32e7f7 --- /dev/null +++ b/tests/pending/run/t6666a.scala @@ -0,0 +1,16 @@ +class A(a: Any) + +object Test { + def main(args: Array[String]): Unit = { + } + + val x: Unit = { + object InVal extends A({ + new {} // okay + val o = {new {}} // nesting triggers a VerifyError. + null + }); + InVal; + () + }; +} diff --git a/tests/pending/run/t6669.scala b/tests/pending/run/t6669.scala new file mode 100644 index 000000000000..2b48823a7b47 --- /dev/null +++ b/tests/pending/run/t6669.scala @@ -0,0 +1,26 @@ +import java.io.{ByteArrayOutputStream, PrintStream} + +object Test extends dotty.runtime.LegacyApp { + val baos = new ByteArrayOutputStream() + val ps = new PrintStream(baos) + + // first test with the default classpath + (scala.Console withOut ps) { + scala.tools.scalap.Main.main(Array("-verbose", "java.lang.Object")) + } + + // now make sure we saw the '.' in the classpath + val msg1 = baos.toString() + assert(msg1 contains "directory classpath: .", s"Did not see '.' in the default class path. Full results were:\n$msg1") + + // then test again with a user specified classpath + baos.reset + + (scala.Console withOut ps) { + scala.tools.scalap.Main.main(Array("-verbose", "-cp", "whatever", "java.lang.Object")) + } + + // now make sure we did not see the '.' in the classpath + val msg2 = baos.toString() + assert(!(msg2 contains "directory classpath: ."), s"Did saw '.' in the user specified class path. Full results were:\n$msg2") +} diff --git a/tests/pending/run/t6673.check b/tests/pending/run/t6673.check new file mode 100644 index 000000000000..ef2aa551dc31 --- /dev/null +++ b/tests/pending/run/t6673.check @@ -0,0 +1 @@ +List(x) diff --git a/tests/pending/run/t6673.scala b/tests/pending/run/t6673.scala new file mode 100644 index 000000000000..9baaed4a6fd9 --- /dev/null +++ b/tests/pending/run/t6673.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + def foo(f: String => Array[String])(s: String) = f(s) + val test = foo(Array(_)) _ + println(test("x").toList) +} diff --git a/tests/pending/run/t6677.scala b/tests/pending/run/t6677.scala new file mode 100644 index 000000000000..d8b0126234b6 --- /dev/null +++ b/tests/pending/run/t6677.scala @@ -0,0 +1,28 @@ + +class Test { + val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror + def error: Unit = { + new cm.universe.Traverser // java.lang.VerifyError: (class: Test, method: error signature: ()V) Incompatible object argument for function call + + } + + def okay1: Unit = { + val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror + + new cm.universe.Traverser + } + + def okay2: Unit = { + val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror + val u: reflect.runtime.universe.type = cm.universe + new u.Traverser + } +} + +object Test { + def main(args: Array[String]): Unit = { + new Test().error + new Test().okay1 + new Test().okay2 + } +} diff --git a/tests/pending/run/t6677b.scala b/tests/pending/run/t6677b.scala new file mode 100644 index 000000000000..2106b2d6d736 --- /dev/null +++ b/tests/pending/run/t6677b.scala @@ -0,0 +1,33 @@ +trait U { + trait U1 { + class X + } + type U11 <: U1 + val u : U11 = null.asInstanceOf[U11] +} +trait A extends U + +trait B extends U { + def foo = "" + class U11 extends U1 { class X extends super.X { foo } } // refer to foo to add $outer pointer + override val u = new U11 +} +class C { + val ab: A with B = new A with B // `B with A` works. + + def foo: Unit = { + // fails + new ab.u.X + + // works: + val u = ab.u + new u.X + } +} +object Test { + def main(args: Array[String]): Unit = { + // java.lang.NoSuchMethodError: A.u()LB$U11; + // at C.foo(t6677b.scala:23) + new C().foo + } +} diff --git a/tests/pending/run/t6687.scala b/tests/pending/run/t6687.scala new file mode 100644 index 000000000000..ee44e5f0d250 --- /dev/null +++ b/tests/pending/run/t6687.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ + +class A { lazy val x = 1 } + +object Test { + def main(args: Array[String]): Unit = { + val vars = typeOf[A].members.toList filter (x => x.isTerm && x.asTerm.isVar) + assert(vars.isEmpty, vars) + } +} diff --git a/tests/pending/run/t6690.check b/tests/pending/run/t6690.check new file mode 100644 index 000000000000..a9ecc29fea08 --- /dev/null +++ b/tests/pending/run/t6690.check @@ -0,0 +1 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t6690.scala b/tests/pending/run/t6690.scala new file mode 100644 index 000000000000..d8d6403119e8 --- /dev/null +++ b/tests/pending/run/t6690.scala @@ -0,0 +1,64 @@ +import scala.collection.mutable + +import scala.language.{ reflectiveCalls } + +object Test extends dotty.runtime.LegacyApp { + def last0(ml: mutable.MutableList[Int]) = + ml.asInstanceOf[{def last0: mutable.LinkedList[Int]}].last0 + + def first0(ml: mutable.MutableList[Int]) = + ml.asInstanceOf[{def first0: mutable.LinkedList[Int]}].first0 + + val f = mutable.Queue[Int]() + def check(desc: String): Unit = { + assert(f.length == 0, s"$desc: non empty: $f") + assert(last0(f).isEmpty, s"$desc: last0 leak: ${last0(f)}") + assert(first0(f).isEmpty, s"$desc: first0 leak: ${last0(f)}") + } + + f.enqueue(1) + f.dequeue() + check("dequeue 1") + + f.enqueue(1) + f.enqueue(2) + f.dequeue() + assert(last0(f).toList == List(2), last0(f)) + f.dequeue() + check("dequeue 2") + + f.enqueue(1) + f.dequeueAll(_ => false) + f.dequeueAll(_ => true) + check("dequeueAll") + + f.enqueue(1) + f.dequeueFirst(_ => true) + check("dequeueFirst") + + { + f.enqueue(1) + val tail = f.tail + assert(last0(tail).isEmpty, last0(tail)) + assert(first0(tail).isEmpty, first0(tail)) + } + + { + val ml = mutable.MutableList[Int]() + 1 +=: ml + val tail = ml.tail + assert(last0(tail).isEmpty, last0(tail)) + assert(first0(tail).isEmpty, first0(tail)) + } + + { + val ml = mutable.MutableList[Int]() + 1 +=: ml + ml += 2 + val tail = ml.tail + assert(last0(tail).toList == List(2), last0(tail)) + assert(first0(tail) == last0(tail).toList, first0(tail)) + assert(last0(tail.tail).toList == Nil, last0(tail.tail).toList) + assert(first0(tail.tail) == Nil, first0(tail.tail)) + } +} diff --git a/tests/pending/run/t6695.scala b/tests/pending/run/t6695.scala new file mode 100644 index 000000000000..ce6181c06622 --- /dev/null +++ b/tests/pending/run/t6695.scala @@ -0,0 +1,18 @@ +object Test extends dotty.runtime.LegacyApp { + try { + Array("a", "b", "c") match { + case Array("a", "x", "c") => println("x") + case Array("a", "b", "x") => println("a"); + case Array("a", "d", _*) => println("wrongly positive") + } + assert(false, "match succeeded") + } catch { + case _: MatchError => // okay + } + + Array("a", "b", "c") match { + case Array("a", "x", "c") => println("x") + case Array("a", "b", "x") => println("a"); + case Array("a", "b", _*) => // okay + } +} diff --git a/tests/pending/run/t6706.scala b/tests/pending/run/t6706.scala new file mode 100644 index 000000000000..905494ca8dc1 --- /dev/null +++ b/tests/pending/run/t6706.scala @@ -0,0 +1,14 @@ +object Test { + var name = "foo" + 1 + var s1 = Symbol(name) + s1 = null + System.gc + val s2 = Symbol("foo1") + name = null + System.gc + val s3 = Symbol("foo1") + + def main(args: Array[String]): Unit = { + assert(s2 eq s3, ((s2, System.identityHashCode(s2), s3, System.identityHashCode(s3)))) + } +} diff --git a/tests/pending/run/t6715.scala b/tests/pending/run/t6715.scala new file mode 100644 index 000000000000..07ff34218aab --- /dev/null +++ b/tests/pending/run/t6715.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ + +class A { + def $$ = 1 + def $times = 1 +} + +object Test { + def main(args: Array[String]): Unit = { + val memberSet: Set[String] = typeOf[A].members.map{ _.toString }.toSet + assert(memberSet contains "method *") + assert(memberSet contains "method $$") + assert(! (memberSet contains "method")) + } +} diff --git a/tests/pending/run/t6719.check b/tests/pending/run/t6719.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t6719.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t6719.scala b/tests/pending/run/t6719.scala new file mode 100644 index 000000000000..f55e3323f694 --- /dev/null +++ b/tests/pending/run/t6719.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val tree = tb.parse("(); val res = 0") + println(tb.eval(tree)) +} diff --git a/tests/pending/run/t6725-1.check b/tests/pending/run/t6725-1.check new file mode 100644 index 000000000000..6ed281c757a9 --- /dev/null +++ b/tests/pending/run/t6725-1.check @@ -0,0 +1,2 @@ +1 +1 diff --git a/tests/pending/run/t6725-1.scala b/tests/pending/run/t6725-1.scala new file mode 100644 index 000000000000..862084402b9e --- /dev/null +++ b/tests/pending/run/t6725-1.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + val a = 1 + val s = f"$a%s%n$a%s" + println(s) +} diff --git a/tests/pending/run/t6725-2.check b/tests/pending/run/t6725-2.check new file mode 100644 index 000000000000..3496917ad539 --- /dev/null +++ b/tests/pending/run/t6725-2.check @@ -0,0 +1,8 @@ + + +aaaa + + +aaaa +aaaa +aaaa diff --git a/tests/pending/run/t6725-2.scala b/tests/pending/run/t6725-2.scala new file mode 100644 index 000000000000..3c1f0f854955 --- /dev/null +++ b/tests/pending/run/t6725-2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + println(f"%n") + println(f"aaaa%n") + println(f"%naaaa") + println(f"aaaa%naaaa") +} diff --git a/tests/pending/run/t6731.check b/tests/pending/run/t6731.check new file mode 100644 index 000000000000..a5d59bd378a7 --- /dev/null +++ b/tests/pending/run/t6731.check @@ -0,0 +1,40 @@ +Mono$.bar() +Mono$.bar +Mono$.bar() +Mono$.bar +Mono$.bar +Mono$.baz +Mono$.bar(bippy=1, boppy=2) +Mono$.baz +Poly.bar[Nothing] +Poly.bar[Int] +Poly.bar[Nothing]() +Poly.bar[Int]() +Poly.bar[Int](1, 2, 3) +Poly.bar[Nothing] +Poly.bar[Int] +Poly.bar[Nothing]() +Poly.bar[Int]() +Poly.bar[Int](1, 2, 3) +Updating.bar +Updating.bar = b +Nest1$Nest2$Nest3$.bippy(1, 2, 3) +Nest1$Nest2$Nest3$.bippy +Named.bippy(a=1, b=2) +Named.boppy(c=3, d=4) +Named.apply() +Named.apply() +Named.apply(e=5, f=6) +Named2.bippy(1)(q0, c) +Named2.bippy(1)(q0, c) +Named2.bippy(1)(b, q0) +Named2.bippy(1)(q0, c) +Named2.bippy(1)(c, b) +Named2.bippy(1)(b, c) +Named2.bippy(1)(q0, c) +Named2.bippy(2)(b, c) +Named2.bippy(1)(q0, c) +Named2.bippy(5)(b, c) +Named2.dingus(100)(b, dong) +Named2.bippy(1)(q0, q1) +Named2.hello(100)(!!, !!) diff --git a/tests/pending/run/t6731.flags b/tests/pending/run/t6731.flags new file mode 100644 index 000000000000..ea7fc37e1af3 --- /dev/null +++ b/tests/pending/run/t6731.flags @@ -0,0 +1 @@ +-Yrangepos:false diff --git a/tests/pending/run/t6731.scala b/tests/pending/run/t6731.scala new file mode 100644 index 000000000000..12357b935e1a --- /dev/null +++ b/tests/pending/run/t6731.scala @@ -0,0 +1,143 @@ +import scala.language.dynamics +import scala.reflect.{ ClassTag, classTag } + +object Util { + def show[T](x: T): T = { println(x) ; x } + def mkArgs(xs: Any*) = xs map { case ((k, v)) => k + "=" + v ; case x => "" + x } mkString ("(", ", ", ")") +} +import Util._ + +abstract class MonoDynamic extends Dynamic { + def selectDynamic(name: String): String = show(this + "." + name) + def applyDynamic(name: String)(args: Any*): String = show(this + "." + name + mkArgs(args: _*)) + def applyDynamicNamed(name: String)(args: (String, Any)*): String = show(this + "." + name + mkArgs(args: _*)) + + override def toString = (this.getClass.getName split '.').last +} + +object Mono extends MonoDynamic { + def f(s: String): String = s + + def f1 = this.bar() + def f2 = this.bar + def f3 = f(this.bar()) + def f4 = f(this.bar) + def f5 = f(f(f(f(f(f(this.bar)))))) + f(f(f(f(f(f(this.baz)))))) + def f6 = f(f(f(f(f(f(this.bar(bippy = 1, boppy = 2))))))) + f(f(f(f(f(f(this.baz)))))) +} + +object Poly extends Dynamic { + def selectDynamic[T: ClassTag](name: String): String = show(s"$this.$name[${classTag[T]}]") + def applyDynamic[T: ClassTag](name: String)(args: Any*): String = show(args.mkString(s"$this.$name[${classTag[T]}](", ", ", ")")) + + def f(s: String): String = s + + def f1 = this.bar + def f2 = this.bar[Int] + def f3 = this.bar() + def f4 = this.bar[Int]() + def f5 = this.bar[Int](1, 2, 3) + + def f6 = f(f(this.bar)) + def f7 = f(f(this.bar[Int])) + def f8 = f(f(this.bar())) + def f9 = f(f(this.bar[Int]())) + def f10 = f(f(this.bar[Int](1, 2, 3))) + + override def toString = "Poly" +} + +object Updating extends Dynamic { + def selectDynamic(name: String): String = show(s"$this.$name") + def updateDynamic(name: String)(value: Any): String = show(s"$this.$name = $value") + + def f1 = this.bar + def f2 = this.bar = "b" + + override def toString = "Updating" +} + +object Nest1 extends Dynamic { + def applyDynamic(name: String)(args: Any*): Nest2.type = Nest2 + + object Nest2 extends Dynamic { + def applyDynamicNamed(name: String)(args: (String, Any)*): Nest3.type = Nest3 + + object Nest3 extends MonoDynamic { + + } + } + + def f1 = Nest1.bip().bop(foo = "bar").bippy(1, 2, 3) + def f2 = Nest1.bip("abc").bop(foo = 5).bippy +} + +object Named extends Dynamic { + def applyDynamic(name: String)(args: Any*): Named.type = { + show(this + "." + name + mkArgs(args: _*)) + this + } + def applyDynamicNamed(name: String)(args: (String, Any)*): Named.type = { + show(this + "." + name + mkArgs(args: _*)) + this + } + + def f1 = this.bippy(a = 1, b = 2).boppy(c = 3, d = 4)()()(e = 5, f = 6) + override def toString = "Named" +} + +object Named2 extends Dynamic { + def applyDynamic(name: String)(a: Any)(b: Any = "b", c: Any = "c"): Named2.type = { + show(this + "." + name + mkArgs(a) + mkArgs(b, c)) + this + } + def applyDynamicNamed(name: String)(a: (String, Any))(b: (String, Any), c: (String, Any)): Named2.type = { + show(this + "." + name + mkArgs(a) + mkArgs(b, c)) + this + } + + def f1 = this.bippy(1)(b = "q0") + def f2 = this.bippy(1)("q0") + def f3 = this.bippy(1)(c = "q0") + def f4 = this.bippy(1)("q0") + def f5 = this.bippy(1)(c = "b", b = "c") + def f6 = this.bippy(1)("b", "c") + def f7 = this.bippy(1)(b = "q0").bippy(2)() + def f8 = this.bippy(1)("q0").bippy(5)(c = "c").dingus(100)(c = "dong") + def f9 = this.bippy(1)(b = "q0", c = "q1").hello(100)("!!", "!!") + + override def toString = "Named2" +} + + +object Test { + def main(args: Array[String]): Unit = { + { + import Mono._ + f1 ; f2 ; f3 ; f4 ; f5 + f6 + } + { + import Poly._ + f1 ; f2 ; f3 ; f4 ; f5 + f6 ; f7 ; f8 ; f9 ; f10 + } + { + import Updating._ + f1 ; f2 + } + { + import Nest1._ + f1 ; f2 + } + { + import Named._ + f1 + } + { + import Named2._ + f1 ; f2 ; f3 ; f4 ; f5 + f6 ; f7 ; f8 ; f9 + } + } +} diff --git a/tests/pending/run/t6732.check b/tests/pending/run/t6732.check new file mode 100644 index 000000000000..016c6e50c05e --- /dev/null +++ b/tests/pending/run/t6732.check @@ -0,0 +1,4 @@ +scala#PK: true, false, true, false +scala#PKC: false, true, true, true +scala.collection.immutable.List#MOD: true, false, false, false +scala.collection.immutable.List#MODC: false, true, false, false diff --git a/tests/pending/run/t6732.scala b/tests/pending/run/t6732.scala new file mode 100644 index 000000000000..ff0f0494d221 --- /dev/null +++ b/tests/pending/run/t6732.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import definitions._ + +object Test extends dotty.runtime.LegacyApp { + def test(sym: Symbol): Unit = { + println(s"${showRaw(sym, printKinds = true)}: ${sym.isModule}, ${sym.isModuleClass}, ${sym.isPackage}, ${sym.isPackageClass}") + } + test(ScalaPackage) + test(ScalaPackageClass) + test(ListModule) + test(ListModule.moduleClass) +} diff --git a/tests/pending/run/t6733.check b/tests/pending/run/t6733.check new file mode 100644 index 000000000000..aeb595fbfd60 --- /dev/null +++ b/tests/pending/run/t6733.check @@ -0,0 +1,27 @@ +method $init$: isPrivateThis = false, isProtectedThis = false +value pri1a: isPrivateThis = true, isProtectedThis = false +method pri2a: isPrivateThis = true, isProtectedThis = false +variable pri3a: isPrivateThis = true, isProtectedThis = false +value pri4a: isPrivateThis = true, isProtectedThis = false +lazy value pri4a: isPrivateThis = true, isProtectedThis = false +type Pri5a: isPrivateThis = true, isProtectedThis = false +class Pri6: isPrivateThis = true, isProtectedThis = false +trait Pri7: isPrivateThis = true, isProtectedThis = false +object Pri8: isPrivateThis = true, isProtectedThis = false +value pro1a: isPrivateThis = false, isProtectedThis = true +value pro1a: isPrivateThis = true, isProtectedThis = false +value pro1b: isPrivateThis = false, isProtectedThis = true +method pro2a: isPrivateThis = false, isProtectedThis = true +method pro2b: isPrivateThis = false, isProtectedThis = true +method pro3a: isPrivateThis = false, isProtectedThis = true +method pro3a_=: isPrivateThis = false, isProtectedThis = true +variable pro3a: isPrivateThis = true, isProtectedThis = false +method pro3b: isPrivateThis = false, isProtectedThis = true +method pro3b_=: isPrivateThis = false, isProtectedThis = true +value pro4a: isPrivateThis = false, isProtectedThis = true +lazy value pro4a: isPrivateThis = true, isProtectedThis = false +type Pro5a: isPrivateThis = false, isProtectedThis = true +type Pro5b: isPrivateThis = false, isProtectedThis = true +class Pro6: isPrivateThis = false, isProtectedThis = true +trait Pro7: isPrivateThis = false, isProtectedThis = true +object Pro8: isPrivateThis = false, isProtectedThis = true diff --git a/tests/pending/run/t6733.scala b/tests/pending/run/t6733.scala new file mode 100644 index 000000000000..99164ae5261e --- /dev/null +++ b/tests/pending/run/t6733.scala @@ -0,0 +1,35 @@ +import scala.reflect.runtime.universe._ + +trait Foo { + private[this] val pri1a = 0 + // private[this] val pri1b: Int + private[this] def pri2a = 1 + // private[this] def pri2b: Int + private[this] var pri3a = 0 + // private[this] var pri3b: Int + private[this] lazy val pri4a = 0 + // private[this] lazy val pri4b: Int + private[this] type Pri5a = Int + // private[this] type Pri5b <: Int + private[this] class Pri6 + private[this] trait Pri7 + private[this] object Pri8 + + protected[this] val pro1a = 0 + protected[this] val pro1b: Int + protected[this] def pro2a = 1 + protected[this] def pro2b: Int + protected[this] var pro3a = 0 + protected[this] var pro3b: Int + protected[this] lazy val pro4a = 0 + // protected[this] lazy val pro4b: Int + protected[this] type Pro5a = Int + protected[this] type Pro5b <: Int + protected[this] class Pro6 + protected[this] trait Pro7 + protected[this] object Pro8 +} + +object Test extends dotty.runtime.LegacyApp { + typeOf[Foo].decls.sorted.foreach(m => println(s"$m: isPrivateThis = ${m.isPrivateThis}, isProtectedThis = ${m.isProtectedThis}")) +} diff --git a/tests/pending/run/t6745-2.scala b/tests/pending/run/t6745-2.scala new file mode 100644 index 000000000000..5afa65d28ad2 --- /dev/null +++ b/tests/pending/run/t6745-2.scala @@ -0,0 +1,22 @@ +import scala.tools.nsc._ +import scala.tools.partest.CompilerTest +import scala.collection.{ mutable, immutable, generic } + +object Test extends CompilerTest { + import global._ + import rootMirror._ + import definitions._ + import global.analyzer.{Context, ImportInfo} + + override def code = """ +package context { +} + """ + + def check(source: String, unit: global.CompilationUnit) = { + val context: Context = global.analyzer.rootContext(unit) + val importInfo: ImportInfo = context.imports.head // Predef._ + val importedSym = importInfo.importedSymbol(termNames.CONSTRUCTOR) + assert(importedSym == NoSymbol, importedSym) // was "constructor Predef" + } +} diff --git a/tests/pending/run/t6793.scala b/tests/pending/run/t6793.scala new file mode 100644 index 000000000000..3d8492c10469 --- /dev/null +++ b/tests/pending/run/t6793.scala @@ -0,0 +1,9 @@ +package a { class C1(private[a] val v0: String) } +package b { class C2(v1: String) extends a.C1(v1) { def foo = v1 } } + +object Test extends dotty.runtime.LegacyApp { + new b.C2("x") + + val c2Fields = classOf[b.C2].getDeclaredFields + assert(c2Fields.size == 1, c2Fields.map(_.getName).toList) +} diff --git a/tests/pending/run/t6793b.scala b/tests/pending/run/t6793b.scala new file mode 100644 index 000000000000..8f7cc331c64a --- /dev/null +++ b/tests/pending/run/t6793b.scala @@ -0,0 +1,11 @@ +package a { + class C1(val v0: String) + class C2(v1: String) extends a.C1(v1) { def foo = v1 } +} + +object Test extends dotty.runtime.LegacyApp { + new a.C2("x") + + val c2Fields = classOf[a.C2].getDeclaredFields + assert(c2Fields.isEmpty, c2Fields.map(_.getName).mkString(", ")) +} diff --git a/tests/pending/run/t6793c.scala b/tests/pending/run/t6793c.scala new file mode 100644 index 000000000000..1c01ca5393cd --- /dev/null +++ b/tests/pending/run/t6793c.scala @@ -0,0 +1,11 @@ +package a { + class C1(private[a] val v0: String) + class C2(v1: String) extends a.C1(v1) { def foo = v1 } +} + +object Test extends dotty.runtime.LegacyApp { + new a.C2("x").foo + + val c2Fields = classOf[a.C2].getDeclaredFields + assert(c2Fields.isEmpty, c2Fields.map(_.getName).toList) +} diff --git a/tests/pending/run/t6814.check b/tests/pending/run/t6814.check new file mode 100644 index 000000000000..97ada7720284 --- /dev/null +++ b/tests/pending/run/t6814.check @@ -0,0 +1,7 @@ +List[Int] +scala.collection.immutable.List.type +object java.lang.RuntimeException is not a value +List[Int] +List +scala.collection.immutable.List.type +scala.collection.immutable.List.type does not take parameters diff --git a/tests/pending/run/t6814/Macros_1.scala b/tests/pending/run/t6814/Macros_1.scala new file mode 100644 index 000000000000..0257f451d602 --- /dev/null +++ b/tests/pending/run/t6814/Macros_1.scala @@ -0,0 +1,24 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + + def test(tree: Tree, mode: c.TypecheckMode): String = { + try c.typecheck(tree, mode, silent = false).tpe.toString + catch { case c.TypecheckException(_, msg) => msg } + } + + q""" + println(${test(q"List(1, 2)", c.TERMmode)}) + println(${test(q"List", c.TERMmode)}) + println(${test(q"RuntimeException", c.TERMmode)}) + println(${test(tq"List[Int]", c.TYPEmode)}) + println(${test(tq"List", c.TYPEmode)}) + println(${test(q"List", c.TYPEmode)}) + println(${test(q"List(1, 2)", c.TYPEmode)}) + """ + } + def foo: Unit = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t6814/Test_2.scala b/tests/pending/run/t6814/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/t6814/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/t6827.check b/tests/pending/run/t6827.check new file mode 100644 index 000000000000..3a3a71c67df2 --- /dev/null +++ b/tests/pending/run/t6827.check @@ -0,0 +1,15 @@ +start at -5: java.lang.IllegalArgumentException: requirement failed: start -5 out of range 10 +start at -1: java.lang.IllegalArgumentException: requirement failed: start -1 out of range 10 +start at limit: java.lang.IllegalArgumentException: requirement failed: start 10 out of range 10 +start at limit-1: ok +first 10: ok +read all: ok +test huge len: ok +5 from 5: ok +20 from 5: ok +test len overflow: ok +start beyond limit: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +read 0: ok +read -1: ok +invalid read 0: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +invalid read -1: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 diff --git a/tests/pending/run/t6827.scala b/tests/pending/run/t6827.scala new file mode 100644 index 000000000000..b7366c90a0f1 --- /dev/null +++ b/tests/pending/run/t6827.scala @@ -0,0 +1,34 @@ +object Test extends dotty.runtime.LegacyApp { + val ns = (0 until 20) + val arr = new Array[Int](10) + + def tryit(label: String, start: Int, len: Int): Unit = { + val status = try { + val it = ns.toIterator + it.copyToArray(arr, start, len) + "ok" + } catch { + case e: Exception => e.toString + } + println("%s: %s" format (label, status)) + } + + tryit("start at -5", -5, 10) + tryit("start at -1", -1, 10) + tryit("start at limit", 10, 10) + tryit("start at limit-1", 9, 10) + tryit("first 10", 0, 10) + tryit("read all", 0, 20) + tryit("test huge len", 0, Int.MaxValue) + tryit("5 from 5", 5, 10) + tryit("20 from 5", 5, 20) + tryit("test len overflow", 5, Int.MaxValue) + tryit("start beyond limit", 30, 10) + tryit("read 0", 0, 0) + tryit("read -1", 0, -1) + tryit("invalid read 0", 30, 0) + tryit("invalid read -1", 30, -1) + + // okay, see SI-7128 + "...".toIterator.copyToArray(new Array[Char](0), 0, 0) +} diff --git a/tests/pending/run/t6853.scala b/tests/pending/run/t6853.scala new file mode 100644 index 000000000000..352375c99c49 --- /dev/null +++ b/tests/pending/run/t6853.scala @@ -0,0 +1,18 @@ +// Test cases: the only place we can cut and paste without crying +// ourself to sleep. +object Test { + + def main(args: Array[String]): Unit = { + // First testing the basic operations + val m = collection.mutable.ListMap[String, Int]() + var i = 0 + while(i < 2) { m += ("foo" + i) -> i; i = i+1} + assert(m == Map("foo1"->1,"foo0"->0)) + m-= "foo0" + assert(m == Map("foo1"->1)) + // Now checking if it scales as described in SI-6853 + i = 0 + while(i < 80000) { m += ("foo" + i) -> i; i = i+1} + assert(m.size == 80000) + } +} diff --git a/tests/pending/run/t6860.check b/tests/pending/run/t6860.check new file mode 100644 index 000000000000..c96331f54008 --- /dev/null +++ b/tests/pending/run/t6860.check @@ -0,0 +1,4 @@ +Bippy[String] +Bippy[String] +throws[Nothing] +throws[RuntimeException] diff --git a/tests/pending/run/t6860.scala b/tests/pending/run/t6860.scala new file mode 100644 index 000000000000..c2f8db02c294 --- /dev/null +++ b/tests/pending/run/t6860.scala @@ -0,0 +1,20 @@ +class Bippy[T](val value: T) extends annotation.StaticAnnotation + +class A { + @Bippy("hi") def f1: Int = 1 + @Bippy[String]("hi") def f2: Int = 2 + + @throws("what do I throw?") def f3 = throw new RuntimeException + @throws[RuntimeException]("that's good to know!") def f4 = throw new RuntimeException +} + +object Test { + import scala.reflect.runtime.universe._ + + def main(args: Array[String]): Unit = { + val members = typeOf[A].decls.toList + val tpes = members flatMap (_.annotations) map (_.tree.tpe) + + tpes.map(_.toString).sorted foreach println + } +} diff --git a/tests/pending/run/t6863.check b/tests/pending/run/t6863.check new file mode 100644 index 000000000000..d4df5f7a74bc --- /dev/null +++ b/tests/pending/run/t6863.check @@ -0,0 +1,13 @@ +t6863.scala:38: warning: comparing values of types Unit and Unit using `==' will always yield true + assert({ () => x}.apply == ()) + ^ +t6863.scala:42: warning: comparing values of types Unit and Unit using `==' will always yield true + assert({ () => x}.apply == ()) + ^ +t6863.scala:46: warning: comparing values of types Unit and Unit using `==' will always yield true + assert({ () => x}.apply == ()) + ^ +t6863.scala:59: warning: comparing values of types Unit and Unit using `==' will always yield true + assert({ () => x }.apply == ()) + ^ +warning: there were four deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t6863.scala b/tests/pending/run/t6863.scala new file mode 100644 index 000000000000..2c3d124e2c3d --- /dev/null +++ b/tests/pending/run/t6863.scala @@ -0,0 +1,114 @@ +/** Make sure that when a variable is captured its initialization expression is handled properly */ +object Test { + def lazyVal() = { + // internally lazy vals become vars which are initialized with "_", so they need to be tested just like vars do + lazy val x = "42" + assert({ () => x }.apply == "42") + } + def ident() = { + val y = "42" + var x = y + assert({ () => x }.apply == "42") + } + def apply() = { + def y(x : Int) = x.toString + var x = y(42) + assert({ () => x }.apply == "42") + } + def literal() = { + var x = "42" + assert({ () => x }.apply == "42") + } + def `new`() = { + var x = new String("42") + assert({ () => x }.apply == "42") + } + def select() = { + object Foo{val bar = "42"} + var x = Foo.bar + assert({ () => x }.apply == "42") + } + def `throw`() = { + var x = if (true) "42" else throw new Exception("42") + assert({ () => x }.apply == "42") + } + def assign() = { + var y = 1 + var x = y = 42 + assert({ () => x}.apply == ()) + } + def valDef() = { + var x = {val y = 42} + assert({ () => x}.apply == ()) + } + def `return`(): String = { + var x = if (true) return "42" else () + assert({ () => x}.apply == ()) + "42" + } + def tryFinally() = { + var x = try { "42" } finally () + assert({ () => x }.apply == "42") + } + def tryCatch() = { + var x = try { "42" } catch { case _: Throwable => "43" } + assert({ () => x }.apply == "42") + } + def `if`() = { + var x = if (true) () + assert({ () => x }.apply == ()) + } + def ifElse() = { + var x = if(true) "42" else "43" + assert({ () => x }.apply == "42") + } + def matchCase() = { + var x = 100 match { + case 100 => "42" + case _ => "43" + } + assert({ () => x }.apply == "42") + } + def block() = { + var x = { + val y = 42 + "42" + } + assert({ () => x }.apply == "42") + } + def labelDef() = { + var x = 100 match { + case 100 => try "42" finally () + } + assert({ () => x }.apply == "42") + } + def nested() = { + var x = { + val y = 42 + if(true) try "42" catch {case _: Throwable => "43"} + else "44" + } + assert({ () => x }.apply == "42") + } + def main(args: Array[String]): Unit = { + lazyVal() + ident() + apply() + literal() + `new`() + select() + `throw`() + assign() + valDef() + `return`() + tryFinally() + tryCatch() + ifElse() + `if`() + matchCase() + block() + labelDef() + nested() + } +} + diff --git a/tests/pending/run/t6888.check b/tests/pending/run/t6888.check new file mode 100644 index 000000000000..4e8a2de2dbc7 --- /dev/null +++ b/tests/pending/run/t6888.check @@ -0,0 +1,3 @@ +2 +3 +3 diff --git a/tests/pending/run/t6888.scala b/tests/pending/run/t6888.scala new file mode 100644 index 000000000000..f58116c31c59 --- /dev/null +++ b/tests/pending/run/t6888.scala @@ -0,0 +1,19 @@ +class C { + val x = 1 + object $ { + val y = x + x + class abc$ { + def xy = x + y + } + object abc$ { + def xy = x + y + } + } +} + +object Test extends dotty.runtime.LegacyApp { + val c = new C() + println(c.$.y) + println(c.$.abc$.xy) + println(new c.$.abc$().xy) +} diff --git a/tests/pending/run/t6900.scala b/tests/pending/run/t6900.scala new file mode 100644 index 000000000000..5e4d8a7f0f84 --- /dev/null +++ b/tests/pending/run/t6900.scala @@ -0,0 +1,36 @@ +import annotation.tailrec + +trait Universe { + type T <: AnyRef +} + +final class Bug { + var i = 1 + def stop() = { i -= 1; i < 0 } + // the alias bypasses the fast path in erasures InfoTransformer + // predicated on `TypeMap.noChangeToSymbols` + type Alias = Any + + @tailrec + // So we get two symbols for `universe`, the original on the ValDef + // and a clone in the MethodType of `f`. + def f(universe: Universe, l: Alias): universe.T = { + if (stop()) null.asInstanceOf[universe.T] else f(universe, null) + } + + @tailrec + def g(universe: Universe)(l: Alias): universe.T = { + if (stop()) null.asInstanceOf[universe.T] else g(universe)(l) + } + + @tailrec + def h(universe: Universe)(l: List[universe.T]): List[universe.T] = { + if (stop()) Nil else h(universe)(l) + } +} + +object Test extends dotty.runtime.LegacyApp { + assert(new Bug().f(null, null) == null) + assert(new Bug().g(null)(null) == null) + assert(new Bug().h(null)(null) == Nil) +} diff --git a/tests/pending/run/t6908.scala b/tests/pending/run/t6908.scala new file mode 100644 index 000000000000..da37cb0bbde3 --- /dev/null +++ b/tests/pending/run/t6908.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val set = collection.mutable.Set("1", null, "3").par + assert( set exists (_ eq null) ) + } +} diff --git a/tests/pending/run/t6911.scala b/tests/pending/run/t6911.scala new file mode 100644 index 000000000000..dd81257a9656 --- /dev/null +++ b/tests/pending/run/t6911.scala @@ -0,0 +1,24 @@ +trait K { + case class CC(name: String) + case class DD[+A1, A2](x1: A1, x2: A2) +} + +object Test { + object Foo extends K + object Bar extends K + + val b1 = Foo.CC("b") + val b2 = Bar.CC("b") + val b3 = Foo.CC("b") + + val c1 = Foo.DD("a", 5) + val c2 = Bar.DD("a", 5) + val c3 = Foo.DD("a", 5) + + def main(args: Array[String]): Unit = { + assert(b1 != b2, ((b1, b2))) // false under 2.9, true under 2.10-RC5 + assert(b1 == b3, ((b1, b3))) + assert(c1 != c2, ((c1, c2))) + assert(c1 == c3, ((c1, c3))) + } +} diff --git a/tests/pending/run/t6928-run.check b/tests/pending/run/t6928-run.check new file mode 100644 index 000000000000..a640c3e5fd8c --- /dev/null +++ b/tests/pending/run/t6928-run.check @@ -0,0 +1 @@ +3 As diff --git a/tests/pending/run/t6928-run.scala b/tests/pending/run/t6928-run.scala new file mode 100644 index 000000000000..87a8884d60ec --- /dev/null +++ b/tests/pending/run/t6928-run.scala @@ -0,0 +1,10 @@ +abstract class A( val someAs: A* ) { + override def toString = someAs.length + " As" +} +object B extends A(null, null, null) + +object Test { + def main(args: Array[String]): Unit = { + println(B) + } +} diff --git a/tests/pending/run/t6935.check b/tests/pending/run/t6935.check new file mode 100644 index 000000000000..df1629dd7eb1 --- /dev/null +++ b/tests/pending/run/t6935.check @@ -0,0 +1 @@ +warning: there was one deprecation warning; re-run with -deprecation for details diff --git a/tests/pending/run/t6935.scala b/tests/pending/run/t6935.scala new file mode 100644 index 000000000000..fdaf02e5ce3b --- /dev/null +++ b/tests/pending/run/t6935.scala @@ -0,0 +1,14 @@ +object Test { + + def main(args: Array[String]): Unit = { + import java.io._ + val bytes = new ByteArrayOutputStream() + val out = new ObjectOutputStream(bytes) + out.writeObject(()) + out.close() + val buf = bytes.toByteArray + val in = new ObjectInputStream(new ByteArrayInputStream(buf)) + val unit = in.readObject() + assert(unit == ()) + } +} diff --git a/tests/pending/run/t6937.check b/tests/pending/run/t6937.check new file mode 100644 index 000000000000..5c5d4485b6a7 --- /dev/null +++ b/tests/pending/run/t6937.check @@ -0,0 +1,22 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{universe=>ru} + +scala> import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.runtime.{currentMirror=>cm} + +scala> import scala.reflect.api.{Universe => ApiUniverse} +import scala.reflect.api.{Universe=>ApiUniverse} + +scala> class A +defined class A + +scala> lazy val apiru = ru: ApiUniverse +apiru: scala.reflect.api.Universe = + +scala> apiru.typeTag[A].in(cm) +res0: reflect.runtime.universe.TypeTag[A] = TypeTag[A] + +scala> :quit diff --git a/tests/pending/run/t6937.scala b/tests/pending/run/t6937.scala new file mode 100644 index 000000000000..4b30894bf34b --- /dev/null +++ b/tests/pending/run/t6937.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.reflect.runtime.{universe => ru} + import scala.reflect.runtime.{currentMirror => cm} + import scala.reflect.api.{Universe => ApiUniverse} + class A + lazy val apiru = ru: ApiUniverse + apiru.typeTag[A].in(cm) + """ +} \ No newline at end of file diff --git a/tests/pending/run/t6955.scala b/tests/pending/run/t6955.scala new file mode 100644 index 000000000000..329af688e4da --- /dev/null +++ b/tests/pending/run/t6955.scala @@ -0,0 +1,34 @@ +import scala.tools.partest.IcodeComparison + +// this class should compile to code that uses switches (twice) +class Switches { + type Tag = Byte + + def switchBad(i: Tag): Int = i match { // notice type of i is Tag = Byte + case 1 => 1 + case 2 => 2 + case 3 => 3 + case _ => 0 + } + + // this worked before, should keep working + def switchOkay(i: Byte): Int = i match { + case 1 => 1 + case 2 => 2 + case 3 => 3 + case _ => 0 + } +} + +object Test extends IcodeComparison { + // ensure we get two switches out of this -- ignore the rest of the output for robustness + // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file) + override def show() = { + val expected = 2 + val actual = (collectIcode() filter { + x => x.indexOf("SWITCH ...") >= 0 && x.indexOf("CONSTANT(") == -1 + }).size + assert(actual == expected) + } +} + diff --git a/tests/pending/run/t6956.scala b/tests/pending/run/t6956.scala new file mode 100644 index 000000000000..3569adf483e6 --- /dev/null +++ b/tests/pending/run/t6956.scala @@ -0,0 +1,31 @@ +import scala.tools.partest.IcodeComparison + +class Switches { + private[this] final val ONE = 1 + + def switchBad(i: Byte): Int = i match { + case ONE => 1 + case 2 => 2 + case 3 => 3 + case _ => 0 + } + + def switchOkay(i: Byte): Int = i match { + case 1 => 1 + case 2 => 2 + case 3 => 3 + case _ => 0 + } +} + +object Test extends IcodeComparison { + // ensure we get two switches out of this -- ignore the rest of the output for robustness + // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file) + override def show() = { + val expected = 2 + val actual = (collectIcode() filter { + x => x.indexOf("SWITCH ...") >= 0 && x.indexOf("CONSTANT(") == -1 + }).size + assert(actual == expected) + } +} diff --git a/tests/pending/run/t6957.scala b/tests/pending/run/t6957.scala new file mode 100644 index 000000000000..4637d4337819 --- /dev/null +++ b/tests/pending/run/t6957.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + class Foo + class Parent(f:Foo) + class Child extends Parent({val x=new Foo{}; x}) + new Child + } +} diff --git a/tests/pending/run/t6968.check b/tests/pending/run/t6968.check new file mode 100644 index 000000000000..7a18941537ed --- /dev/null +++ b/tests/pending/run/t6968.check @@ -0,0 +1 @@ +1, 3, 5 diff --git a/tests/pending/run/t6968.scala b/tests/pending/run/t6968.scala new file mode 100644 index 000000000000..c4e47ba0eda8 --- /dev/null +++ b/tests/pending/run/t6968.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val mixedList = List(1,(1,2),4,(3,1),(5,4),6) + val as = for((a,b) <- mixedList) yield a + println(as.mkString(", ")) + } +} diff --git a/tests/pending/run/t6969.check b/tests/pending/run/t6969.check new file mode 100644 index 000000000000..78297812c946 --- /dev/null +++ b/tests/pending/run/t6969.check @@ -0,0 +1 @@ +All threads completed. diff --git a/tests/pending/run/t6969.scala b/tests/pending/run/t6969.scala new file mode 100644 index 000000000000..25791454e0c0 --- /dev/null +++ b/tests/pending/run/t6969.scala @@ -0,0 +1,32 @@ + + +import scala.language.{ reflectiveCalls } + +object Test { + private type Clearable = { def clear(): Unit } + private def choke() = { + try new Array[Object]((Runtime.getRuntime().maxMemory min Int.MaxValue).toInt) + catch { + case _: OutOfMemoryError => // what do you mean, out of memory? + case t: Throwable => println(t) + } + } + private def f(x: Clearable) = x.clear() + class Choker(id: Int) extends Thread { + private def g(iteration: Int) = { + val map = scala.collection.mutable.Map[Int, Int](1 -> 2) + try f(map) catch { case t: NullPointerException => println(s"Failed at $id/$iteration") ; throw t } + choke() + } + override def run(): Unit = { + 1 to 50 foreach g + } + } + + def main(args: Array[String]): Unit = { + val threads = 1 to 3 map (id => new Choker(id)) + threads foreach (_.start()) + threads foreach (_.join()) + println("All threads completed.") + } +} diff --git a/tests/pending/run/t6988.check b/tests/pending/run/t6988.check new file mode 100644 index 000000000000..5db04832d644 --- /dev/null +++ b/tests/pending/run/t6988.check @@ -0,0 +1,2 @@ +#1 13 +#2 13 diff --git a/tests/pending/run/t6988.scala b/tests/pending/run/t6988.scala new file mode 100644 index 000000000000..810d2c40619f --- /dev/null +++ b/tests/pending/run/t6988.scala @@ -0,0 +1,9 @@ +case class User() + +@SerialVersionUID(13l) case class IdentifyMessage1(userName: String, user: User, code: Int) +@SerialVersionUID(10l + 3l) case class IdentifyMessage2(userName: String, user: User, code: Int) + +object Test extends dotty.runtime.LegacyApp { + println("#1 " + java.io.ObjectStreamClass.lookup(IdentifyMessage1("hei", User(), 8).getClass).getSerialVersionUID) + println("#2 " + java.io.ObjectStreamClass.lookup(IdentifyMessage2("hei", User(), 8).getClass).getSerialVersionUID) +} diff --git a/tests/pending/run/t6989.check b/tests/pending/run/t6989.check new file mode 100644 index 000000000000..43d4bbaf020b --- /dev/null +++ b/tests/pending/run/t6989.check @@ -0,0 +1,240 @@ +============ +sym = class PackagePrivateJavaClass, signature = ClassInfoType(...), owner = package foo +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = constructor PackagePrivateJavaClass, signature = (x$1: Int, x$2: Int)foo.PackagePrivateJavaClass, owner = class PackagePrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = variable privateField, signature = Int, owner = class PackagePrivateJavaClass +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = method privateMethod, signature = ()Unit, owner = class PackagePrivateJavaClass +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = variable protectedField, signature = Int, owner = class PackagePrivateJavaClass +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +sym = method protectedMethod, signature = ()Unit, owner = class PackagePrivateJavaClass +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +sym = variable publicField, signature = Int, owner = class PackagePrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = method publicMethod, signature = ()Unit, owner = class PackagePrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = object PackagePrivateJavaClass, signature = foo.PackagePrivateJavaClass.type, owner = package foo +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = variable privateStaticField, signature = Int, owner = object PackagePrivateJavaClass +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = method privateStaticMethod, signature = ()Unit, owner = object PackagePrivateJavaClass +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = variable protectedStaticField, signature = Int, owner = object PackagePrivateJavaClass +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +sym = method protectedStaticMethod, signature = ()Unit, owner = object PackagePrivateJavaClass +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +sym = variable publicStaticField, signature = Int, owner = object PackagePrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = method publicStaticMethod, signature = ()Unit, owner = object PackagePrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = class JavaClass_1, signature = ClassInfoType(...), owner = package foo +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = class $PrivateJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = constructor $PrivateJavaClass, signature = ()JavaClass_1.this.$PrivateJavaClass, owner = class $PrivateJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = value this$0, signature = foo.JavaClass_1, owner = class $PrivateJavaClass +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = object $PrivateJavaClass, signature = JavaClass_1.this.$PrivateJavaClass.type, owner = class JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +isPrivate = false +isProtected = true +isPublic = false +privateWithin = package foo +============ +sym = constructor $ProtectedJavaClass, signature = ()JavaClass_1.this.$ProtectedJavaClass, owner = class $ProtectedJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = value this$0, signature = foo.JavaClass_1, owner = class $ProtectedJavaClass +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = object $ProtectedJavaClass, signature = JavaClass_1.this.$ProtectedJavaClass.type, owner = class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = constructor $PublicJavaClass, signature = (x$1: foo.JavaClass_1)JavaClass_1.this.$PublicJavaClass, owner = class $PublicJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = value this$0, signature = foo.JavaClass_1, owner = class $PublicJavaClass +isPrivate = false +isProtected = false +isPublic = false +privateWithin = package foo +============ +sym = object $PublicJavaClass, signature = JavaClass_1.this.$PublicJavaClass.type, owner = class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1 +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = constructor PrivateStaticJavaClass, signature = ()foo.JavaClass_1.PrivateStaticJavaClass, owner = class PrivateStaticJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = object PrivateStaticJavaClass, signature = foo.JavaClass_1.PrivateStaticJavaClass.type, owner = object JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = constructor ProtectedStaticJavaClass, signature = ()foo.JavaClass_1.ProtectedStaticJavaClass, owner = class ProtectedStaticJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = object ProtectedStaticJavaClass, signature = foo.JavaClass_1.ProtectedStaticJavaClass.type, owner = object JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = +============ +sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = constructor PublicStaticJavaClass, signature = ()foo.JavaClass_1.PublicStaticJavaClass, owner = class PublicStaticJavaClass +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = object PublicStaticJavaClass, signature = foo.JavaClass_1.PublicStaticJavaClass.type, owner = object JavaClass_1 +isPrivate = false +isProtected = false +isPublic = true +privateWithin = +============ +sym = variable staticField, signature = Int, owner = object JavaClass_1 +isPrivate = true +isProtected = false +isPublic = false +privateWithin = diff --git a/tests/pending/run/t6989/JavaClass_1.java b/tests/pending/run/t6989/JavaClass_1.java new file mode 100644 index 000000000000..72ec4d6ab643 --- /dev/null +++ b/tests/pending/run/t6989/JavaClass_1.java @@ -0,0 +1,43 @@ +package foo; + +// Originally composed to accommodate pull request feedback, this test has +// uncovered a handful of bugs in FromJavaClassCompleter, namely: +// * SI-7071 non-public ctors get lost +// * SI-7072 inner classes are read incorrectly + +// I'm leaving the incorrect results of FromJavaClassCompleters in the check +// file, so that we get notified when something changes there. +// ^^^ It's not clear what those incorrect results were, but the fix for SI-7359 +// (backport of fix for SI-6548) has probably resolved some of these. OP, please revisit this comment. + +class PackagePrivateJavaClass { + private int privateField = 0; + protected int protectedField = 1; + public int publicField = 2; + + private static int privateStaticField = 3; + protected static int protectedStaticField = 4; + public static int publicStaticField = 5; + + private void privateMethod() {} + protected void protectedMethod() {} + public void publicMethod() {} + + private static void privateStaticMethod() {} + protected static void protectedStaticMethod() {} + public static void publicStaticMethod() {} + + private PackagePrivateJavaClass() {} + protected PackagePrivateJavaClass(int x) {} + public PackagePrivateJavaClass(int x, int y) {} +} + +public class JavaClass_1 { + private class PrivateJavaClass {} + private static class PrivateStaticJavaClass {} + protected class ProtectedJavaClass {} + private static class ProtectedStaticJavaClass {} + public class PublicJavaClass {} + public static class PublicStaticJavaClass {} + private static int staticField = 0; +} \ No newline at end of file diff --git a/tests/pending/run/t6989/Test_2.scala b/tests/pending/run/t6989/Test_2.scala new file mode 100644 index 000000000000..891f8f6c2ee2 --- /dev/null +++ b/tests/pending/run/t6989/Test_2.scala @@ -0,0 +1,42 @@ +import scala.reflect.runtime.universe._ + +// Originally composed to accommodate pull request feedback, this test has +// uncovered a handful of bugs in FromJavaClassCompleter, namely: +// * SI-7071 non-public ctors get lost +// * SI-7072 inner classes are read incorrectly + +// I'm leaving the incorrect results of FromJavaClassCompleters in the check +// file, so that we get notified when something changes there. + +package object foo { + def testAll(): Unit = { + test(typeOf[foo.PackagePrivateJavaClass].typeSymbol) + test(typeOf[foo.PackagePrivateJavaClass].typeSymbol.companion) + test(typeOf[foo.JavaClass_1].typeSymbol) + test(typeOf[foo.JavaClass_1].typeSymbol.companion) + } + + def test(sym: Symbol): Unit = { + printSymbolDetails(sym) + if (sym.isClass || sym.isModule) { + sym.info.decls.toList.sortBy(_.name.toString) foreach test + } + } + + def printSymbolDetails(sym: Symbol): Unit = { + def stableSignature(sym: Symbol) = sym.info match { + case ClassInfoType(_, _, _) => "ClassInfoType(...)" + case tpe => tpe.toString + } + println("============") + println(s"sym = $sym, signature = ${stableSignature(sym)}, owner = ${sym.owner}") + println(s"isPrivate = ${sym.isPrivate}") + println(s"isProtected = ${sym.isProtected}") + println(s"isPublic = ${sym.isPublic}") + println(s"privateWithin = ${sym.privateWithin}") + } +} + +object Test extends dotty.runtime.LegacyApp { + foo.testAll() +} \ No newline at end of file diff --git a/tests/pending/run/t6992.check b/tests/pending/run/t6992.check new file mode 100644 index 000000000000..021f32ec95ac --- /dev/null +++ b/tests/pending/run/t6992.check @@ -0,0 +1,4 @@ +Test.foo.T +Int +42 +42 diff --git a/tests/pending/run/t6992/Macros_1.scala b/tests/pending/run/t6992/Macros_1.scala new file mode 100644 index 000000000000..f578f2b3c043 --- /dev/null +++ b/tests/pending/run/t6992/Macros_1.scala @@ -0,0 +1,75 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def foo(name: String): Any = macro foo_impl + def foo_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(Flag.FINAL), anon, Nil, Template( + Nil, noSelfType, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + TypeDef(Modifiers(), TypeName(lit), Nil, TypeTree(typeOf[Int])) + ) + ) + ), + Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) + )) + } + + def bar(name: String): Any = macro bar_impl + def bar_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(Flag.FINAL), anon, Nil, Template( + Nil, noSelfType, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + DefDef( + Modifiers(), TermName(lit), Nil, Nil, TypeTree(), + c.literal(42).tree + ) + ) + ) + ), + Apply(Select(New(Ident(anon)), termNames.CONSTRUCTOR), Nil) + )) + } + + def baz(name: String): Any = macro baz_impl + def baz_impl(c: Context)(name: c.Expr[String]) = { + import c.universe._ + + val Literal(Constant(lit: String)) = name.tree + val anon = newTypeName(c.fresh) + val wrapper = newTypeName(c.fresh) + + c.Expr(Block( + ClassDef( + Modifiers(), anon, Nil, Template( + Nil, emptyValDef, List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), + DefDef( + Modifiers(), TermName(lit), Nil, Nil, TypeTree(), + c.literal(42).tree + ) + ) + ) + ), + ClassDef( + Modifiers(Flag.FINAL), wrapper, Nil, + Template(Ident(anon) :: Nil, noSelfType, DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))) :: Nil) + ), + Apply(Select(New(Ident(wrapper)), termNames.CONSTRUCTOR), Nil) + )) + } +} \ No newline at end of file diff --git a/tests/pending/run/t6992/Test_2.scala b/tests/pending/run/t6992/Test_2.scala new file mode 100644 index 000000000000..5d1a64eac2c6 --- /dev/null +++ b/tests/pending/run/t6992/Test_2.scala @@ -0,0 +1,14 @@ +import scala.language.reflectiveCalls + +object Test extends dotty.runtime.LegacyApp { + val foo = Macros.foo("T") + val ttpe = scala.reflect.runtime.universe.weakTypeOf[foo.T] + println(ttpe) + println(ttpe.typeSymbol.info) + + val bar = Macros.bar("test") + println(bar.test) + + val baz = Macros.baz("test") + println(baz.test) +} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined.check b/tests/pending/run/t7008-scala-defined.check new file mode 100644 index 000000000000..84ed62619efb --- /dev/null +++ b/tests/pending/run/t7008-scala-defined.check @@ -0,0 +1,7 @@ +: List(throws[NullPointerException]("")) +bar: List(throws[E1]("")) +baz: List(throws[IllegalStateException]("")) +============= +: List(throws[NullPointerException]("")) +bar: List(throws[E1]("")) +baz: List(throws[IllegalStateException]("")) diff --git a/tests/pending/run/t7008-scala-defined.flags b/tests/pending/run/t7008-scala-defined.flags new file mode 100644 index 000000000000..49f2d2c4c833 --- /dev/null +++ b/tests/pending/run/t7008-scala-defined.flags @@ -0,0 +1 @@ +-Ybackend:GenASM diff --git a/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala b/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala new file mode 100644 index 000000000000..330db8da753b --- /dev/null +++ b/tests/pending/run/t7008-scala-defined/Impls_Macros_2.scala @@ -0,0 +1,13 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val decls = c.typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList + val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) + reify(println(c.Expr[String](Literal(Constant(s))).splice)) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala b/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala new file mode 100644 index 000000000000..7783c873ecff --- /dev/null +++ b/tests/pending/run/t7008-scala-defined/ScalaClassWithCheckedExceptions_1.scala @@ -0,0 +1,6 @@ +class ScalaClassWithCheckedExceptions_1[E1 <: Exception] @throws[NullPointerException]("") () { + @throws[E1]("") def bar() {} + @throws[IllegalStateException]("") def baz(x: Int) {} + // FIXME: SI-7066 + // @throws[E2]("") def foo[E2 <: Exception] {} +} \ No newline at end of file diff --git a/tests/pending/run/t7008-scala-defined/Test_3.scala b/tests/pending/run/t7008-scala-defined/Test_3.scala new file mode 100644 index 000000000000..23adb88b2473 --- /dev/null +++ b/tests/pending/run/t7008-scala-defined/Test_3.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + println("=============") + + val decls = typeOf[ScalaClassWithCheckedExceptions_1[_]].decls.toList + decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) +} \ No newline at end of file diff --git a/tests/pending/run/t7008.check b/tests/pending/run/t7008.check new file mode 100644 index 000000000000..ee077f90ffd4 --- /dev/null +++ b/tests/pending/run/t7008.check @@ -0,0 +1,9 @@ +: List(throws[NullPointerException](classOf[java.lang.NullPointerException])) +bar: List(throws[Exception](classOf[java.lang.Exception])) +baz: List(throws[IllegalStateException](classOf[java.lang.IllegalStateException])) +foo: List(throws[Exception](classOf[java.lang.Exception])) +============= +: List(throws[java.lang.NullPointerException](classOf[java.lang.NullPointerException])) +bar: List(throws[java.lang.Exception](classOf[java.lang.Exception])) +baz: List(throws[java.lang.IllegalStateException](classOf[java.lang.IllegalStateException])) +foo: List(throws[java.lang.Exception](classOf[java.lang.Exception])) diff --git a/tests/pending/run/t7008/Impls_Macros_2.scala b/tests/pending/run/t7008/Impls_Macros_2.scala new file mode 100644 index 000000000000..3c6fe116ce2e --- /dev/null +++ b/tests/pending/run/t7008/Impls_Macros_2.scala @@ -0,0 +1,13 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context) = { + import c.universe._ + val decls = c.typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList + val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL) + reify(println(c.Expr[String](Literal(Constant(s))).splice)) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java b/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java new file mode 100644 index 000000000000..dda212830257 --- /dev/null +++ b/tests/pending/run/t7008/JavaClassWithCheckedExceptions_1.java @@ -0,0 +1,7 @@ +class JavaClassWithCheckedExceptions_1 { + public JavaClassWithCheckedExceptions_1() throws NullPointerException {} + + public void bar() throws E1 {} + public void baz(int x) throws IllegalStateException {} + public void foo() throws E2 {} +} \ No newline at end of file diff --git a/tests/pending/run/t7008/Test_3.scala b/tests/pending/run/t7008/Test_3.scala new file mode 100644 index 000000000000..00e0eb684a12 --- /dev/null +++ b/tests/pending/run/t7008/Test_3.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + println("=============") + + val decls = typeOf[JavaClassWithCheckedExceptions_1[_]].decls.toList + decls sortBy (_.name.toString) foreach (decl => println(s"${decl.name}: ${decl.annotations}")) +} \ No newline at end of file diff --git a/tests/pending/run/t7015.check b/tests/pending/run/t7015.check new file mode 100644 index 000000000000..7651fe06b046 --- /dev/null +++ b/tests/pending/run/t7015.check @@ -0,0 +1,11 @@ +Method returns Null type: null +Method takes non Null type: null +call through method null +call through bridge null +fetch field: null +fetch field on companion: null +fetch local: null +fetch array element: null +method that takes object: null +method that takes anyref: null +method that takes any: null diff --git a/tests/pending/run/t7015.scala b/tests/pending/run/t7015.scala new file mode 100644 index 000000000000..af07f5f7ee2d --- /dev/null +++ b/tests/pending/run/t7015.scala @@ -0,0 +1,49 @@ +object Test { + def main(args : Array[String]) : Unit = { + println(s"Method returns Null type: $f") + println(s"Method takes non Null type: ${g(null)}") + + // pass things through the g function because it expects + // a string. If we haven't adapted properly then we'll + // get verify errors + val b = new B + println(s"call through method ${g(b.f(null))}") + println(s"call through bridge ${g((b: A).f(null))}") + + println(s"fetch field: ${g(b.nullField)}") + println(s"fetch field on companion: ${g(B.nullCompanionField)}") + + val x = f + println(s"fetch local: ${g(x)}") + + val nulls = Array(f, f, f) + println(s"fetch array element: ${g(nulls(0))}") + + println(s"method that takes object: ${q(f)}") + println(s"method that takes anyref: ${r(f)}") + println(s"method that takes any: ${s(f)}") + } + + def f: Null = null + + def g(x: String) = x + + def q(x: java.lang.Object) = x + def r(x: AnyRef) = x + def s(x: Any) = x +} + +abstract class A { + def f(x: String): String +} + +class B extends A { + val nullField = null + + // this forces a bridge method because the return type is different + override def f(x: String) : Null = null +} + +object B { + val nullCompanionField = null +} diff --git a/tests/pending/run/t7019.scala b/tests/pending/run/t7019.scala new file mode 100644 index 000000000000..5dcc09d2b604 --- /dev/null +++ b/tests/pending/run/t7019.scala @@ -0,0 +1,10 @@ +final class Foo(val i: Int) extends AnyVal { + def foo() = go(i) + private[this] def go(i: Int) = i * 2 +} + +object Test { + def main(args: Array[String]): Unit = { + assert(new Foo(1).foo() == 2) + } +} diff --git a/tests/pending/run/t7039.check b/tests/pending/run/t7039.check new file mode 100644 index 000000000000..954906040fa1 --- /dev/null +++ b/tests/pending/run/t7039.check @@ -0,0 +1 @@ +Matched! diff --git a/tests/pending/run/t7039.scala b/tests/pending/run/t7039.scala new file mode 100644 index 000000000000..869d3f36994d --- /dev/null +++ b/tests/pending/run/t7039.scala @@ -0,0 +1,11 @@ +object UnapplySeqTest { + def unapplySeq(any: Any): Option[(Int, Seq[Int])] = Some((5, List(1))) +} + +object Test extends dotty.runtime.LegacyApp { + null match { + case UnapplySeqTest(5) => println("uh-oh") + case UnapplySeqTest(5, 1) => println("Matched!") // compiles + case UnapplySeqTest(5, xs : _*) => println("toooo long: "+ (xs: Seq[Int])) + } +} diff --git a/tests/pending/run/t7044.check b/tests/pending/run/t7044.check new file mode 100644 index 000000000000..ab523873bfe9 --- /dev/null +++ b/tests/pending/run/t7044.check @@ -0,0 +1,14 @@ +compile-time +uninitialized File: +initialized File: +uninitialized BitSet: +initialized BitSet: +uninitialized C: Test_2.scala +initialized C: Test_2.scala +runtime +autoinitialized File: true +autoinitialized File: true +autoinitialized BitSet: true +autoinitialized BitSet: true +autoinitialized C: true +autoinitialized C: true diff --git a/tests/pending/run/t7044/Macros_1.scala b/tests/pending/run/t7044/Macros_1.scala new file mode 100644 index 000000000000..3b3f8c338581 --- /dev/null +++ b/tests/pending/run/t7044/Macros_1.scala @@ -0,0 +1,26 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(tpe: Type): Unit = { + val sym = tpe.typeSymbol + println(s"uninitialized ${sym.name}: ${sym.pos.source.file.name}") + internal.initialize(sym) + println(s"initialized ${sym.name}: ${sym.pos.source.file.name}") + } + + println("compile-time") + test(typeOf[java.io.File]) + test(typeOf[scala.collection.BitSet]) + test(c.mirror.staticClass("C").toType) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t7044/Test_2.scala b/tests/pending/run/t7044/Test_2.scala new file mode 100644 index 000000000000..e7a34d04ca2e --- /dev/null +++ b/tests/pending/run/t7044/Test_2.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C + +object Test extends dotty.runtime.LegacyApp { + def test(tpe: Type): Unit = { + val sym = tpe.typeSymbol + println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") + internal.initialize(sym) + println(s"autoinitialized ${sym.name}: ${sym.pos.source.file.name} ${sym.pos.source.file.sizeOption.nonEmpty}") + } + + Macros.foo + println("runtime") + test(typeOf[java.io.File]) + test(typeOf[scala.collection.BitSet]) + test(typeOf[C]) +} diff --git a/tests/pending/run/t7045.check b/tests/pending/run/t7045.check new file mode 100644 index 000000000000..28134535c865 --- /dev/null +++ b/tests/pending/run/t7045.check @@ -0,0 +1,2 @@ +D with C +D with C diff --git a/tests/pending/run/t7045.scala b/tests/pending/run/t7045.scala new file mode 100644 index 000000000000..330fa7fc6fab --- /dev/null +++ b/tests/pending/run/t7045.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +class C +class D { self: C => } + +object Test extends dotty.runtime.LegacyApp { + val d = cm.staticClass("D") + println(d.selfType) + d.info + println(d.selfType) +} diff --git a/tests/pending/run/t7046.check b/tests/pending/run/t7046.check new file mode 100644 index 000000000000..427f1ce610bc --- /dev/null +++ b/tests/pending/run/t7046.check @@ -0,0 +1,2 @@ +Set(class D, class E) +Set(class D, class E) diff --git a/tests/pending/run/t7046.scala b/tests/pending/run/t7046.scala new file mode 100644 index 000000000000..96a5d154e564 --- /dev/null +++ b/tests/pending/run/t7046.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +sealed class C +class D extends C +class E extends C + +object Test extends dotty.runtime.LegacyApp { + val c = cm.staticClass("C") + println(c.knownDirectSubclasses) + c.info + println(c.knownDirectSubclasses) +} diff --git a/tests/pending/run/t7047.check b/tests/pending/run/t7047.check new file mode 100644 index 000000000000..32bd58109493 --- /dev/null +++ b/tests/pending/run/t7047.check @@ -0,0 +1,3 @@ +Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + Macros.foo + ^ diff --git a/tests/pending/run/t7047/Impls_Macros_1.scala b/tests/pending/run/t7047/Impls_Macros_1.scala new file mode 100644 index 000000000000..787ea6cfe824 --- /dev/null +++ b/tests/pending/run/t7047/Impls_Macros_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +class Foo + +object Macros { + def impl(c: Context) = { + import c.universe._ + try { + c.inferImplicitValue(typeOf[Foo], silent = false) + c.abort(c.enclosingPosition, "silent=false is not working") + } catch { + case _: Exception => + } + c.Expr[Null](Literal(Constant(null))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t7047/Test_2.scala b/tests/pending/run/t7047/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/t7047/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/t7088.check b/tests/pending/run/t7088.check new file mode 100644 index 000000000000..1191247b6d9a --- /dev/null +++ b/tests/pending/run/t7088.check @@ -0,0 +1,2 @@ +1 +2 diff --git a/tests/pending/run/t7088.scala b/tests/pending/run/t7088.scala new file mode 100644 index 000000000000..3f51ed48ede7 --- /dev/null +++ b/tests/pending/run/t7088.scala @@ -0,0 +1,13 @@ +object Test { + type Tag[X] = {type Tag = X} + type TaggedArray[T] = Array[T] with Tag[Any] + + def method[T: scala.reflect.ClassTag](a: TaggedArray[T], value: T): Unit = { + a.update(0, value) + a foreach println + } + + def main(args: Array[String]): Unit = { + method(Array(1, 2).asInstanceOf[TaggedArray[Int]], 1) + } +} diff --git a/tests/pending/run/t7096.check b/tests/pending/run/t7096.check new file mode 100644 index 000000000000..6f1cef6c43f0 --- /dev/null +++ b/tests/pending/run/t7096.check @@ -0,0 +1,2 @@ +testing symbol List(method foo, class Base, package ano, package ), param value x, xRefs List(x) +testing symbol List(method foo, class Sub, package ano, package ), param value x, xRefs List(x) diff --git a/tests/pending/run/t7096.scala b/tests/pending/run/t7096.scala new file mode 100644 index 000000000000..872562dd4d21 --- /dev/null +++ b/tests/pending/run/t7096.scala @@ -0,0 +1,86 @@ +/* + * filter: inliner warning; re-run with -Yinline-warnings for details + */ +import scala.tools.partest._ +import scala.tools.nsc._ +import scala.reflect.runtime.{universe => ru} +import scala.language.implicitConversions + +// necessary to avoid bincompat with scala-partest compiled against the old compiler +abstract class CompilerTest extends DirectTest { + def check(source: String, unit: global.CompilationUnit): Unit + + lazy val global: Global = newCompiler() + lazy val units: List[global.CompilationUnit] = compilationUnits(global)(sources: _ *) + import global._ + import definitions.{ compilerTypeFromTag } + + override def extraSettings = "-usejavacp -d " + testOutput.path + + def show() = (sources, units).zipped foreach check + + // Override at least one of these... + def code = "" + def sources: List[String] = List(code) + + // Utility functions + class MkType(sym: Symbol) { + def apply[M](implicit t: ru.TypeTag[M]): Type = + if (sym eq NoSymbol) NoType + else appliedType(sym, compilerTypeFromTag(t)) + } + implicit def mkMkType(sym: Symbol) = new MkType(sym) + + def allMembers(root: Symbol): List[Symbol] = { + def loop(seen: Set[Symbol], roots: List[Symbol]): List[Symbol] = { + val latest = roots flatMap (_.info.members) filterNot (seen contains _) + if (latest.isEmpty) seen.toList.sortWith(_ isLess _) + else loop(seen ++ latest, latest) + } + loop(Set(), List(root)) + } + + class SymsInPackage(pkgName: String) { + def pkg = rootMirror.getPackage(TermName(pkgName)) + def classes = allMembers(pkg) filter (_.isClass) + def modules = allMembers(pkg) filter (_.isModule) + def symbols = classes ++ terms filterNot (_ eq NoSymbol) + def terms = allMembers(pkg) filter (s => s.isTerm && !s.isConstructor) + def tparams = classes flatMap (_.info.typeParams) + def tpes = symbols map (_.tpe) distinct + } +} + +object Test extends CompilerTest { + import global._ + import definitions._ + + override def code = """ +package ano + +class ann(x: Any) extends annotation.TypeConstraint + +abstract class Base { + def foo(x: String): String @ann(x.trim()) +} + +class Sub extends Base { + def foo(x: String): String @ann(x.trim()) = x +} + """ + + object syms extends SymsInPackage("ano") + import syms._ + + def check(source: String, unit: global.CompilationUnit) { + exitingTyper { + terms.filter(_.name.toString == "foo").foreach(sym => { + val xParam = sym.tpe.paramss.flatten.head + val annot = sym.tpe.finalResultType.annotations.head + val xRefs = annot.args.head.filter(t => t.symbol == xParam) + println(s"testing symbol ${sym.ownerChain}, param $xParam, xRefs $xRefs") + assert(xRefs.length == 1, xRefs) + }) + } + } +} diff --git a/tests/pending/run/t7106.check b/tests/pending/run/t7106.check new file mode 100644 index 000000000000..9a4bb430fdb5 --- /dev/null +++ b/tests/pending/run/t7106.check @@ -0,0 +1,6 @@ +[ok] q1 I private final +[ok] q3 I private final +[ok] (III)V public +[ok] bippy1 ()I public +[ok] bippy2 ()I public +[ok] bippy3 ()I public diff --git a/tests/pending/run/t7106/Analyzed_1.scala b/tests/pending/run/t7106/Analyzed_1.scala new file mode 100644 index 000000000000..a2ddebceedf1 --- /dev/null +++ b/tests/pending/run/t7106/Analyzed_1.scala @@ -0,0 +1,14 @@ + +abstract class Base0 { def p2: Int } +class Base(p1: Int, override val p2: Int) extends Base0 + +abstract class Sub1(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) { + def bippy1 = q1 + def bippy2 = q2 + def bippy3 = q3 +} +abstract class Sub2(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) { + def bippy1 = q1 + def bippy2 = p2 + def bippy3 = q3 +} diff --git a/tests/pending/run/t7106/test.scala b/tests/pending/run/t7106/test.scala new file mode 100644 index 000000000000..3584a272db45 --- /dev/null +++ b/tests/pending/run/t7106/test.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.BytecodeTest + +object Test extends BytecodeTest { + def show { + val node1 = loadClassNode("Sub1") + val node2 = loadClassNode("Sub2") + + sameMethodAndFieldSignatures(node1, node2) + } +} diff --git a/tests/pending/run/t7120.check b/tests/pending/run/t7120.check new file mode 100644 index 000000000000..45a4fb75db86 --- /dev/null +++ b/tests/pending/run/t7120.check @@ -0,0 +1 @@ +8 diff --git a/tests/pending/run/t7120/Base_1.scala b/tests/pending/run/t7120/Base_1.scala new file mode 100644 index 000000000000..be07b4f34f93 --- /dev/null +++ b/tests/pending/run/t7120/Base_1.scala @@ -0,0 +1,10 @@ +// This bug doesn't depend on separate compilation, +// in the interests of minimizing the log output during +// debugging this problem, I've split the compilation. + +case class Container( v: String ) + +trait Base[ T <: AnyRef ] { + type UserType = T + protected def defect: PartialFunction[ UserType, String ] +} diff --git a/tests/pending/run/t7120/Derived_2.scala b/tests/pending/run/t7120/Derived_2.scala new file mode 100644 index 000000000000..e0de629f82de --- /dev/null +++ b/tests/pending/run/t7120/Derived_2.scala @@ -0,0 +1,9 @@ +trait Derived extends Base[ Container ] { + protected def defect = { case c: Container => c.v.toString } +} + +// Erasure was ignoring the prefix `Derived#7001.this` when erasing +// A1, and consequently used `Object` rather than `Container`, which +// was only seen because that signature clashed with the bridge method. +// +// applyOrElse[A1 <: Derived#7001.this.UserType#7318, B1 >: String](x1: A1) diff --git a/tests/pending/run/t7120/Run_3.scala b/tests/pending/run/t7120/Run_3.scala new file mode 100644 index 000000000000..95e7f994fffc --- /dev/null +++ b/tests/pending/run/t7120/Run_3.scala @@ -0,0 +1,3 @@ +object Test extends Derived with App { + println( defect( Container( "8" ) ) ) +} diff --git a/tests/pending/run/t7120b.check b/tests/pending/run/t7120b.check new file mode 100644 index 000000000000..aa2f5e7c9f33 --- /dev/null +++ b/tests/pending/run/t7120b.check @@ -0,0 +1,2 @@ +public int C$D.foo(java.lang.String) +public int C$D.foo(java.lang.String) diff --git a/tests/pending/run/t7120b.scala b/tests/pending/run/t7120b.scala new file mode 100644 index 000000000000..e5b546a90e07 --- /dev/null +++ b/tests/pending/run/t7120b.scala @@ -0,0 +1,30 @@ + +import scala.language.higherKinds + +trait Base[A] { type B = A; } +class C extends Base[String] { + class D { + def foo[B1 <: B](b: B1) = 0 + } +} + +trait BaseHK[M[_], A] { type B = M[A]; } +object BaseHK { type Id[X] = X } +class CHK extends BaseHK[BaseHK.Id, String] { + class D { + def foo[B1 <: B](b: B1) = 0 + } +} + + +object Test extends dotty.runtime.LegacyApp { + val c = new C + val d = new c.D() + val meth = d.getClass.getMethods.find(_.getName == "foo").get + println(meth) + + val chk = new CHK + val dhk = new chk.D() + val methhk = d.getClass.getMethods.find(_.getName == "foo").get + println(methhk) +} diff --git a/tests/pending/run/t7151.check b/tests/pending/run/t7151.check new file mode 100644 index 000000000000..d532d9589fc7 --- /dev/null +++ b/tests/pending/run/t7151.check @@ -0,0 +1,6 @@ +class Test$InnerObject$ isFinal = false +class Test$InnerCase isFinal = true +class Test$InnerNonCase isFinal = true +class TopLevelObject$ isFinal = true +class TopLevelCase isFinal = true +class TopLevelNonCase isFinal = true diff --git a/tests/pending/run/t7151.scala b/tests/pending/run/t7151.scala new file mode 100644 index 000000000000..8500eb3c3909 --- /dev/null +++ b/tests/pending/run/t7151.scala @@ -0,0 +1,24 @@ +import java.lang.reflect.Modifier.isFinal + +object Test { + object InnerObject + final case class InnerCase() + final class InnerNonCase() + + def main(args: Array[String]): Unit = { + def checkFinal(clazz: Class[_]) = + println(s"${clazz} isFinal = ${isFinal(clazz.getModifiers())}") + + checkFinal(InnerObject.getClass) + checkFinal(classOf[InnerCase]) + checkFinal(classOf[InnerNonCase]) + + checkFinal(TopLevelObject.getClass) + checkFinal(classOf[TopLevelCase]) + checkFinal(classOf[TopLevelNonCase]) + } +} + +object TopLevelObject +final case class TopLevelCase() +final case class TopLevelNonCase() diff --git a/tests/pending/run/t7157.check b/tests/pending/run/t7157.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/t7157.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/t7157/Impls_Macros_1.scala b/tests/pending/run/t7157/Impls_Macros_1.scala new file mode 100644 index 000000000000..cc258b016aa3 --- /dev/null +++ b/tests/pending/run/t7157/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + object AImpl { + def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = { + import ctx.universe._ + ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1))))) + } + } + + implicit class A(context: StringContext) { + def a(args: Any*): Unit = macro AImpl.a + } +} \ No newline at end of file diff --git a/tests/pending/run/t7157/Test_2.scala b/tests/pending/run/t7157/Test_2.scala new file mode 100644 index 000000000000..be0d54d7537a --- /dev/null +++ b/tests/pending/run/t7157/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends dotty.runtime.LegacyApp { + a"" +} \ No newline at end of file diff --git a/tests/pending/run/t7171.check b/tests/pending/run/t7171.check new file mode 100644 index 000000000000..d826f6cb94a1 --- /dev/null +++ b/tests/pending/run/t7171.check @@ -0,0 +1,3 @@ +t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time. + final case class A() + ^ diff --git a/tests/pending/run/t7171.flags b/tests/pending/run/t7171.flags new file mode 100644 index 000000000000..c02e5f2461f4 --- /dev/null +++ b/tests/pending/run/t7171.flags @@ -0,0 +1 @@ +-unchecked diff --git a/tests/pending/run/t7171.scala b/tests/pending/run/t7171.scala new file mode 100644 index 000000000000..e7b7a7f1b03b --- /dev/null +++ b/tests/pending/run/t7171.scala @@ -0,0 +1,22 @@ +trait T { + final case class A() + + // Was: + // error: scrutinee is incompatible with pattern type; + // found : T.this.A + // required: T#A + def foo(a: T#A) = a match { + case _: A => true; case _ => false + } +} + +object Test extends dotty.runtime.LegacyApp { + val t1 = new T {} + val t2 = new T {} + val a1 = new t1.A() + val a2 = new t1.A() + assert(t1.foo(a1)) + // as noted in the unchecked warning (also tested in the corresponding neg test), + // the outer pointer isn't checked + assert(t1.foo(a2)) +} diff --git a/tests/pending/run/t7181.check b/tests/pending/run/t7181.check new file mode 100644 index 000000000000..e4b8e30dfe19 --- /dev/null +++ b/tests/pending/run/t7181.check @@ -0,0 +1,23 @@ +normal exit MainNormalExit +finally MainNormalExit +normal flow MainNormalExit + +return MainReturn +finally MainReturn + +uncaught exception MainUncaughtException +finally MainUncaughtException + +caught exception ExceptionNormalExit +normal exit ExceptionNormalExit +finally ExceptionNormalExit +normal flow ExceptionNormalExit + +caught exception ExceptionReturn +return ExceptionReturn +finally ExceptionReturn + +caught exception ExceptionUncaughtException +uncaught exception ExceptionUncaughtException +finally ExceptionUncaughtException + diff --git a/tests/pending/run/t7181.scala b/tests/pending/run/t7181.scala new file mode 100644 index 000000000000..a06f22bf4f5b --- /dev/null +++ b/tests/pending/run/t7181.scala @@ -0,0 +1,78 @@ +sealed abstract class Action +// exit the try body normally +case object MainNormalExit extends Action +// exit the try body with a 'return' +case object MainReturn extends Action +// exit the try body with an uncaught exception +case object MainUncaughtException extends Action +// exit the try body with a caught exception and exit the exception handler normally +case object ExceptionNormalExit extends Action +// exit the try body with a caught exception and exit the exception handler with a 'return' +case object ExceptionReturn extends Action +// exit the try body with a caught exception and exit the exception handler with an uncaught exception +case object ExceptionUncaughtException extends Action + +case class UncaughtException(action: Action) extends RuntimeException +case class CaughtException(action: Action) extends RuntimeException + +object Test extends dotty.runtime.LegacyApp { + def test(action: Action, expectException: Boolean = false): Unit = { + var gotException = false + val result = try + driver(action) + catch { + case UncaughtException(a) => + gotException = true + a + } + if (gotException) assert(expectException, "Got unexpected exception") + else assert(!expectException, "Did not get expected exception") + + assert(result == action, s"Expected $action but got $result") + println() + } + + def driver(action: Action): Action = { + val result = try { + action match { + case MainNormalExit => + println(s"normal exit $action") + action + case MainReturn => + println(s"return $action") + return action + case MainUncaughtException => + println(s"uncaught exception $action") + throw UncaughtException(action) + case _ => + println(s"caught exception $action") + throw CaughtException(action) + } + } catch { + case CaughtException(action) => action match { + case ExceptionNormalExit => + println(s"normal exit $action") + action + case ExceptionReturn => + println(s"return $action") + return action + case ExceptionUncaughtException => + println(s"uncaught exception $action") + throw UncaughtException(action) + case _ => + sys.error(s"unexpected $action in exception handler") + } + } finally { + println(s"finally $action") + } + println(s"normal flow $action") + result + } + + test(MainNormalExit) + test(MainReturn) + test(MainUncaughtException, true) + test(ExceptionNormalExit) + test(ExceptionReturn) + test(ExceptionUncaughtException, true) +} diff --git a/tests/pending/run/t7185.check b/tests/pending/run/t7185.check new file mode 100644 index 000000000000..e4f80a8ff957 --- /dev/null +++ b/tests/pending/run/t7185.check @@ -0,0 +1,32 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.tools.reflect.ToolBox +import scala.tools.reflect.ToolBox + +scala> import scala.reflect.runtime.universe._ +import scala.reflect.runtime.universe._ + +scala> object O { def apply() = 0 } +defined object O + +scala> val ORef = reify { O }.tree +ORef: reflect.runtime.universe.Tree = $read.O + +scala> val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) +tree: reflect.runtime.universe.Apply = +{ + { + $read.O + } +}() + +scala> {val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} +res0: Any = +{ + { + $read.O.apply() + } +} + +scala> :quit diff --git a/tests/pending/run/t7185.scala b/tests/pending/run/t7185.scala new file mode 100644 index 000000000000..62d64246bcab --- /dev/null +++ b/tests/pending/run/t7185.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ +import scala.tools.reflect.ToolBox +import scala.reflect.runtime.universe._ +object O { def apply() = 0 } +val ORef = reify { O }.tree +val tree = Apply(Block(Nil, Block(Nil, ORef)), Nil) +{val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any} +""" +} diff --git a/tests/pending/run/t7198.check b/tests/pending/run/t7198.check new file mode 100644 index 000000000000..6dad496f494e --- /dev/null +++ b/tests/pending/run/t7198.check @@ -0,0 +1,2 @@ +The quick brown fox jumped +And ran away with the vixen. diff --git a/tests/pending/run/t7198.scala b/tests/pending/run/t7198.scala new file mode 100644 index 000000000000..9390674cf583 --- /dev/null +++ b/tests/pending/run/t7198.scala @@ -0,0 +1,9 @@ +/* spew a few lines + * filter: Over the moon + */ +object Test extends dotty.runtime.LegacyApp { + Console println "The quick brown fox jumped" + Console println "Over the moon" + Console println "And ran away with the vixen." + Console println "Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28)." +} diff --git a/tests/pending/run/t7200.scala b/tests/pending/run/t7200.scala new file mode 100644 index 000000000000..8f33d016fefd --- /dev/null +++ b/tests/pending/run/t7200.scala @@ -0,0 +1,34 @@ +import language.higherKinds + +object Test extends dotty.runtime.LegacyApp { + + // Slice of comonad is where this came up + trait Foo[F[_]] { + def coflatMap[A, B](f: F[A] => B): F[A] => F[B] + } + + // A non-empty list + case class Nel[A](head: A, tail: List[A]) + + object NelFoo extends Foo[Nel] { + + // It appears that the return type for recursive calls is not inferred + // properly, yet no warning is issued. Providing a return type or + // type arguments for the recursive call fixes the problem. + + def coflatMap[A, B](f: Nel[A] => B) = // ok w/ return type + l => Nel(f(l), l.tail match { + case Nil => Nil + case h :: t => { + val r = coflatMap(f)(Nel(h, t)) // ok w/ type args + r.head :: r.tail + } + }) + } + + // Without a recursive call all is well, but with recursion we get a + // ClassCastException from Integer to Nothing + NelFoo.coflatMap[Int, Int](_.head + 1)(Nel(1, Nil)) // Ok + NelFoo.coflatMap[Int, Int](_.head + 1)(Nel(1, List(2))) // CCE + +} diff --git a/tests/pending/run/t7214.scala b/tests/pending/run/t7214.scala new file mode 100644 index 000000000000..d73fe6dd5f8f --- /dev/null +++ b/tests/pending/run/t7214.scala @@ -0,0 +1,57 @@ +// pattern matcher crashes here trying to synthesize an uneeded outer test. +// no-symbol does not have an owner +// at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49) +// at scala.tools.nsc.Global.abort(Global.scala:253) +// at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3248) +// at scala.reflect.internal.Symbols$Symbol.effectiveOwner(Symbols.scala:678) +// at scala.reflect.internal.Symbols$Symbol.isDefinedInPackage(Symbols.scala:664) +// at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:188) +// at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:124) +// at scala.tools.nsc.ast.TreeDSL$CODE$.REF(TreeDSL.scala:308) +// at scala.tools.nsc.typechecker.PatternMatching$TreeMakers$TypeTestTreeMaker$treeCondStrategy$.outerTest(PatternMatching.scala:1209) +class Crash { + type Alias = C#T + + val c = new C + val t = new c.T + + // Crash via a Typed Pattern... + (t: Any) match { + case e: Alias => + } + + // ... or via a Typed Extractor Pattern. + object Extractor { + def unapply(a: Alias): Option[Any] = None + } + (t: Any) match { + case Extractor(_) => + case _ => + } + + // checking that correct outer tests are applied when + // aliases for path dependent types are involved. + val c2 = new C + type CdotT = c.T + type C2dotT = c2.T + + val outerField = t.getClass.getDeclaredFields.find(_.getName contains ("outer")).get + outerField.setAccessible(true) + + (t: Any) match { + case _: C2dotT => + println(s"!!! wrong match. t.outer=${outerField.get(t)} / c2 = $c2") // this matches on 2.10.0 + case _: CdotT => + case _ => + println(s"!!! wrong match. t.outer=${outerField.get(t)} / c = $c") + } +} + +class C { + class T +} + +object Test extends dotty.runtime.LegacyApp { + new Crash +} + diff --git a/tests/pending/run/t7215.scala b/tests/pending/run/t7215.scala new file mode 100644 index 000000000000..7bc48de1f968 --- /dev/null +++ b/tests/pending/run/t7215.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + List[List[Any]]().transpose.isEmpty + Array[Array[Any]]().transpose.isEmpty + Vector[Vector[Any]]().transpose.isEmpty + Stream[Stream[Any]]().transpose.isEmpty +} diff --git a/tests/pending/run/t7223.check b/tests/pending/run/t7223.check new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tests/pending/run/t7223.check @@ -0,0 +1 @@ +0 diff --git a/tests/pending/run/t7223.scala b/tests/pending/run/t7223.scala new file mode 100644 index 000000000000..087667dc70a7 --- /dev/null +++ b/tests/pending/run/t7223.scala @@ -0,0 +1,11 @@ +class D(val a: () => Int => () => Any) { + a()(0)() +} + +object Crash extends D(() => { + (x: Int) => {() => { new { println(x.toString) } }} +}) + +object Test extends dotty.runtime.LegacyApp { + Crash +} diff --git a/tests/pending/run/t7231.check b/tests/pending/run/t7231.check new file mode 100644 index 000000000000..c1e4b6c175a3 --- /dev/null +++ b/tests/pending/run/t7231.check @@ -0,0 +1,2 @@ +null +null diff --git a/tests/pending/run/t7231.scala b/tests/pending/run/t7231.scala new file mode 100644 index 000000000000..63ed16097348 --- /dev/null +++ b/tests/pending/run/t7231.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + val bar: Null = null + + def foo(x: Array[Int]) = x + def baz(x: String) = x + + // first line was failing + println(foo(bar)) + // this line worked but good to have a double check + println(baz(bar)) +} diff --git a/tests/pending/run/t7235.check b/tests/pending/run/t7235.check new file mode 100644 index 000000000000..9cb9c55a0cbc --- /dev/null +++ b/tests/pending/run/t7235.check @@ -0,0 +1,4 @@ +C +List(C) +private val _ = _ +List() diff --git a/tests/pending/run/t7235.scala b/tests/pending/run/t7235.scala new file mode 100644 index 000000000000..2e6af545d0f4 --- /dev/null +++ b/tests/pending/run/t7235.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class C + +object Test extends dotty.runtime.LegacyApp { + val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C{} = ??? }.tree + println(tpt) + println(tpt.templ.parents) + println(tpt.templ.self) + println(tpt.templ.body) +} diff --git a/tests/pending/run/t7240/Macros_1.scala b/tests/pending/run/t7240/Macros_1.scala new file mode 100644 index 000000000000..b24b607d170d --- /dev/null +++ b/tests/pending/run/t7240/Macros_1.scala @@ -0,0 +1,48 @@ +package bakery + +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +trait FailureCake { + implicit def liftAnyFails[T: Manifest]: Any = ??? + + // This works + // implicit def liftAny[T]: Any = ??? +} + +object Bakery { + + def failure: Any = macro failureImpl + def failureImpl(c: Context): c.Expr[Any] = { + import c.universe._ + + def dslTrait(dslName: String) = { + val names = dslName.split("\\.").toList.reverse + assert(names.length >= 1, "DSL trait name must be in the valid format. DSL trait name is " + dslName) + + val tpeName = newTypeName(names.head) + names.tail.reverse match { + case head :: tail ⇒ + Select(tail.foldLeft[Tree](Ident(newTermName(head)))((tree, name) ⇒ Select(tree, newTermName(name))), tpeName) + case Nil ⇒ + Ident(tpeName) + } + } + + def composeDSL(transformedBody: Tree) = + ClassDef(Modifiers(), newTypeName("eval"), List(), Template( + List(dslTrait("bakery.FailureCake")), + emptyValDef, + List( + DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), + Block(List(Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), List())), Literal(Constant(())))), + DefDef(Modifiers(), newTermName("main"), List(), List(List()), Ident(newTypeName("Any")), transformedBody)))) + + def constructor = Apply(Select(New(Ident(newTypeName("eval"))), termNames.CONSTRUCTOR), List()) + + c.eval(c.Expr[Any]( + c.untypecheck(Block(composeDSL(Literal(Constant(1))), constructor)))) + + c.Expr[Any](Literal(Constant(1))) + } +} \ No newline at end of file diff --git a/tests/pending/run/t7240/Test_2.scala b/tests/pending/run/t7240/Test_2.scala new file mode 100644 index 000000000000..27d2893d3d9b --- /dev/null +++ b/tests/pending/run/t7240/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + val v = bakery.Bakery.failure +} diff --git a/tests/pending/run/t7242.scala b/tests/pending/run/t7242.scala new file mode 100644 index 000000000000..318a3b0ed51e --- /dev/null +++ b/tests/pending/run/t7242.scala @@ -0,0 +1,71 @@ +class CrashTest { + def foo = () + trait CrashTestTable { + def cols = foo + } + // This was leading to a class between the mixed in + // outer accessor and the outer accessor of this object. + object CrashTestTable extends CrashTestTable { + foo + cols + } +} + +class CrashTest1 { + def foo = () + class CrashTestTable { + def cols = foo + } + object CrashTestTable extends CrashTestTable { + foo + cols + } +} + +class CrashTest2 { + def foo = () + trait CrashTestTable { + def cols = foo + } + object Obj extends CrashTestTable { + foo + cols + } +} + +class CrashTest3 { + def foo = () + + def meth(): Unit = { + trait CrashTestTable { + def cols = foo + } + object Obj extends CrashTestTable { + foo + cols + } + Obj + } +} + +object Test extends dotty.runtime.LegacyApp { + { + val c = new CrashTest + c.CrashTestTable + } + + { + val c = new CrashTest1 + c.CrashTestTable + } + + { + val c = new CrashTest2 + c.Obj + } + + { + val c = new CrashTest3 + c.meth() + } +} diff --git a/tests/pending/run/t7246.check b/tests/pending/run/t7246.check new file mode 100755 index 000000000000..ce013625030b --- /dev/null +++ b/tests/pending/run/t7246.check @@ -0,0 +1 @@ +hello diff --git a/tests/pending/run/t7246/Outer.java b/tests/pending/run/t7246/Outer.java new file mode 100755 index 000000000000..163276fb3b6a --- /dev/null +++ b/tests/pending/run/t7246/Outer.java @@ -0,0 +1,4 @@ +public class Outer { + public class Inner { + } +} \ No newline at end of file diff --git a/tests/pending/run/t7246/Test.scala b/tests/pending/run/t7246/Test.scala new file mode 100755 index 000000000000..619583234245 --- /dev/null +++ b/tests/pending/run/t7246/Test.scala @@ -0,0 +1,16 @@ +object Test extends dotty.runtime.LegacyApp { + + val so = new SubOuter + val si = new so.SubInner + println(si.bar) +} + +class SubOuter extends Outer { + + val foo = "hello" + + class SubInner extends Inner { + def bar = foo + } + +} \ No newline at end of file diff --git a/tests/pending/run/t7246b.check b/tests/pending/run/t7246b.check new file mode 100755 index 000000000000..5073bd8617c0 --- /dev/null +++ b/tests/pending/run/t7246b.check @@ -0,0 +1,2 @@ +base +sub diff --git a/tests/pending/run/t7246b/Base.scala b/tests/pending/run/t7246b/Base.scala new file mode 100755 index 000000000000..4e71d3313dc5 --- /dev/null +++ b/tests/pending/run/t7246b/Base.scala @@ -0,0 +1,7 @@ +class Base { + val baseOuter = "base" + + class BaseInner { + val baseInner = baseOuter + } +} diff --git a/tests/pending/run/t7246b/Outer.java b/tests/pending/run/t7246b/Outer.java new file mode 100755 index 000000000000..53a79316ef84 --- /dev/null +++ b/tests/pending/run/t7246b/Outer.java @@ -0,0 +1,4 @@ +public class Outer extends Base { + public class Inner extends BaseInner { + } +} \ No newline at end of file diff --git a/tests/pending/run/t7246b/Test.scala b/tests/pending/run/t7246b/Test.scala new file mode 100755 index 000000000000..9c80403938f7 --- /dev/null +++ b/tests/pending/run/t7246b/Test.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + + val so = new SubOuter + val si = new so.SubInner + println(si.baseInner) + println(si.subInner) +} + +class SubOuter extends Outer { + val subOuter = "sub" + class SubInner extends Inner { + def subInner = subOuter + } +} diff --git a/tests/pending/run/t7249.check b/tests/pending/run/t7249.check new file mode 100644 index 000000000000..7777e0a5a29f --- /dev/null +++ b/tests/pending/run/t7249.check @@ -0,0 +1 @@ +Yup! diff --git a/tests/pending/run/t7249.scala b/tests/pending/run/t7249.scala new file mode 100644 index 000000000000..6858fce1c043 --- /dev/null +++ b/tests/pending/run/t7249.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + def bnToLambda(s: => String): () => String = () => s + var x: () => String = () => sys.error("Nope") + val y = bnToLambda { x() } + x = () => "Yup!" + println(y()) +} diff --git a/tests/pending/run/t7269.scala b/tests/pending/run/t7269.scala new file mode 100644 index 000000000000..d6e11f4f7c1e --- /dev/null +++ b/tests/pending/run/t7269.scala @@ -0,0 +1,32 @@ +import scala.collection.JavaConversions._ +import scala.collection.mutable + +object Test extends dotty.runtime.LegacyApp { + + def testMap(): Unit = { + val mapJ = new java.util.HashMap[Int, String] + val mapS: mutable.Map[Int, String] = mapJ + + (10 to 20).foreach(i => mapS += ((i, i.toString))) + assert(11 == mapS.size) + + // ConcurrentModificationException thrown in the following line + mapS.retain((i, str) => i % 2 == 0) + assert(6 == mapS.size) + } + + def testSet(): Unit = { + val mapJ = new java.util.HashSet[Int] + val mapS: mutable.Set[Int] = mapJ + + (10 to 20).foreach(i => mapS += i) + assert(11 == mapS.size) + + // ConcurrentModificationException thrown in the following line + mapS.retain((i) => i % 2 == 0) + assert(6 == mapS.size) + } + + testSet() + testMap() +} diff --git a/tests/pending/run/t7271.check b/tests/pending/run/t7271.check new file mode 100644 index 000000000000..f7a23018ca47 --- /dev/null +++ b/tests/pending/run/t7271.check @@ -0,0 +1,12 @@ +[[syntax trees at end of parser]] // newSource1.scala +[6]package [6] { + [6]class C extends [8][91]scala.AnyRef { + [8]def () = [8]{ + [NoPosition][NoPosition][NoPosition]super.(); + [8]() + }; + [20]def quote = [28][28][28][28]StringContext([30]"foo", [40]"baz").s([35]this); + [55]def tripleQuote = [69][69][69][69]StringContext([71]"foo", [81]"baz").s([76]this) + } +} + diff --git a/tests/pending/run/t7271.scala b/tests/pending/run/t7271.scala new file mode 100644 index 000000000000..69d5ea377ea4 --- /dev/null +++ b/tests/pending/run/t7271.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ +import scala.tools.nsc._ +import scala.tools.cmd.CommandLineParser +import scala.tools.nsc.{Global, Settings, CompilerCommand} +import scala.tools.nsc.reporters.ConsoleReporter +import scala.reflect.internal.Positions + +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 Positions + } +} diff --git a/tests/pending/run/t7290.check b/tests/pending/run/t7290.check new file mode 100644 index 000000000000..aff48abd4a57 --- /dev/null +++ b/tests/pending/run/t7290.check @@ -0,0 +1,6 @@ +t7290.scala:4: warning: Pattern contains duplicate alternatives: 0 + case 0 | 0 => 0 + ^ +t7290.scala:5: warning: Pattern contains duplicate alternatives: 2, 3 + case 2 | 2 | 2 | 3 | 2 | 3 => 0 + ^ diff --git a/tests/pending/run/t7290.scala b/tests/pending/run/t7290.scala new file mode 100644 index 000000000000..2fd9909e5b54 --- /dev/null +++ b/tests/pending/run/t7290.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + val y = (0: Int) match { + case 1 => 1 + case 0 | 0 => 0 + case 2 | 2 | 2 | 3 | 2 | 3 => 0 + case _ => -1 + } + assert(y == 0, y) +} diff --git a/tests/pending/run/t7291.check b/tests/pending/run/t7291.check new file mode 100644 index 000000000000..c07ba986a32f --- /dev/null +++ b/tests/pending/run/t7291.check @@ -0,0 +1,2 @@ +conjure +traversable diff --git a/tests/pending/run/t7291.scala b/tests/pending/run/t7291.scala new file mode 100644 index 000000000000..ee22b581e70a --- /dev/null +++ b/tests/pending/run/t7291.scala @@ -0,0 +1,22 @@ + +import scala.language.{ higherKinds, implicitConversions } + +trait Fooable[T] +object Fooable { + implicit def conjure[T]: Fooable[T] = { + println("conjure") + new Fooable[T]{} + } + +} + +object Test { + implicit def traversable[T, Coll[_] <: Traversable[_]](implicit +elem: Fooable[T]): Fooable[Coll[T]] = { + println("traversable") + new Fooable[Coll[T]]{} + } + def main(args: Array[String]): Unit = { + implicitly[Fooable[List[Any]]] + } +} diff --git a/tests/pending/run/t7300.check b/tests/pending/run/t7300.check new file mode 100644 index 000000000000..51993f072d58 --- /dev/null +++ b/tests/pending/run/t7300.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/tests/pending/run/t7300.scala b/tests/pending/run/t7300.scala new file mode 100644 index 000000000000..010eacc8867c --- /dev/null +++ b/tests/pending/run/t7300.scala @@ -0,0 +1,11 @@ +object Test extends dotty.runtime.LegacyApp { + // single line comment in multi line comment + /*//*/ val x = 1 */*/ + val x = 2 + println(x) + + // single line comment in nested multi line comment + /*/*//*/ val y = 1 */*/*/ + val y = 2 + println(y) +} diff --git a/tests/pending/run/t7319.check b/tests/pending/run/t7319.check new file mode 100644 index 000000000000..e35cfc90c099 --- /dev/null +++ b/tests/pending/run/t7319.check @@ -0,0 +1,43 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> class M[A] +defined class M + +scala> implicit def ma0[A](a: A): M[A] = null +warning: there was one feature warning; re-run with -feature for details +ma0: [A](a: A)M[A] + +scala> implicit def ma1[A](a: A): M[A] = null +warning: there was one feature warning; re-run with -feature for details +ma1: [A](a: A)M[A] + +scala> def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0 +warning: there was one feature warning; re-run with -feature for details +convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int + +scala> convert(Some[Int](0)) +:12: error: no type parameters for method convert: (builder: F[_ <: F[_]])Int exist so that it can be applied to arguments (Some[Int]) + --- because --- +argument expression's type is not compatible with formal parameter type; + found : Some[Int] + required: ?F[_$1] forSome { type _$1 <: ?F[_$2] forSome { type _$2 } } + convert(Some[Int](0)) + ^ +:12: error: type mismatch; + found : Some[Int] + required: F[_ <: F[_]] + convert(Some[Int](0)) + ^ + +scala> Range(1,2).toArray: Seq[_] +:11: error: polymorphic expression cannot be instantiated to expected type; + found : [B >: Int]Array[B] + required: Seq[_] + Range(1,2).toArray: Seq[_] + ^ + +scala> 0 +res2: Int = 0 + +scala> :quit diff --git a/tests/pending/run/t7319.scala b/tests/pending/run/t7319.scala new file mode 100644 index 000000000000..65a3ed922d1f --- /dev/null +++ b/tests/pending/run/t7319.scala @@ -0,0 +1,14 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // so we can provide the ambiguities, rather than relying in Predef implicits + override def extraSettings = "-Yno-predef" + override def code = """ +class M[A] +implicit def ma0[A](a: A): M[A] = null +implicit def ma1[A](a: A): M[A] = null +def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0 +convert(Some[Int](0)) +Range(1,2).toArray: Seq[_] +0""" // before the fix, this line, and all that followed, re-issued the implicit ambiguity error. +} diff --git a/tests/pending/run/t7325.check b/tests/pending/run/t7325.check new file mode 100644 index 000000000000..3c7652f42ca4 --- /dev/null +++ b/tests/pending/run/t7325.check @@ -0,0 +1,19 @@ +% +%% +%%% +%n +% + +%%n +%% + +%%%n +%%% + +0 +0%d +0%%d +0 + +0 + diff --git a/tests/pending/run/t7325.scala b/tests/pending/run/t7325.scala new file mode 100644 index 000000000000..253e8b238660 --- /dev/null +++ b/tests/pending/run/t7325.scala @@ -0,0 +1,25 @@ +object Test extends dotty.runtime.LegacyApp { + // 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") +} diff --git a/tests/pending/run/t7326.scala b/tests/pending/run/t7326.scala new file mode 100644 index 000000000000..3d6a711e510a --- /dev/null +++ b/tests/pending/run/t7326.scala @@ -0,0 +1,64 @@ +import scala.collection.immutable.ListSet +import scala.collection.immutable.HashSet + +object Test extends dotty.runtime.LegacyApp { + + def testCorrectness(): Unit = { + // a key that has many hashCode collisions + case class Collision(i: Int) { override def hashCode = i / 5 } + + def subsetTest[T](emptyA:Set[T], emptyB:Set[T], mkKey:Int => T, n:Int): Unit = { + val outside = mkKey(n + 1) + for(i <- 0 to n) { + val a = emptyA ++ (0 until i).map(mkKey) + // every set must be a subset of itself + require(a.subsetOf(a), "A set must be the subset of itself") + for(k <- 0 to i) { + // k <= i, so b is definitely a subset + val b = emptyB ++ (0 until k).map(mkKey) + // c has less elements than a, but contains a value that is not in a + // so it is not a subset, but that is not immediately obvious due to size + val c = b + outside + require(b.subsetOf(a), s"$b must be a subset of $a") + require(!c.subsetOf(a), s"$c must not be a subset of $a") + } + } + } + + // test the HashSet/HashSet case + subsetTest(HashSet.empty[Int], HashSet.empty[Int], identity, 100) + + // test the HashSet/other set case + subsetTest(HashSet.empty[Int], ListSet.empty[Int], identity, 100) + + // test the HashSet/HashSet case for Collision keys + subsetTest(HashSet.empty[Collision], HashSet.empty[Collision], Collision, 100) + + // test the HashSet/other set case for Collision keys + subsetTest(HashSet.empty[Collision], ListSet.empty[Collision], Collision, 100) + } + + /** + * A main performance benefit of the new subsetOf is that we do not have to call hashCode during subsetOf + * since we already have the hash codes in the HashSet1 nodes. + */ + def testNoHashCodeInvocationsDuringSubsetOf() = { + var count = 0 + + case class HashCodeCounter(i:Int) { + override def hashCode = { + count += 1 + i + } + } + + val a = HashSet.empty ++ (0 until 100).map(HashCodeCounter) + val b = HashSet.empty ++ (0 until 50).map(HashCodeCounter) + val count0 = count + val result = b.subsetOf(a) + require(count == count0, "key.hashCode must not be called during subsetOf of two HashSets") + result + } + testCorrectness() + testNoHashCodeInvocationsDuringSubsetOf() +} diff --git a/tests/pending/run/t7328.check b/tests/pending/run/t7328.check new file mode 100644 index 000000000000..e386fe70d9c7 --- /dev/null +++ b/tests/pending/run/t7328.check @@ -0,0 +1,4 @@ +Foo +Foo(3) +Foo(3) +Foo(5) diff --git a/tests/pending/run/t7328.scala b/tests/pending/run/t7328.scala new file mode 100644 index 000000000000..401a76e51174 --- /dev/null +++ b/tests/pending/run/t7328.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +case class Foo(x: Int) extends AnyVal +case class Bar(foo: Foo) + +object Test extends dotty.runtime.LegacyApp { + val foo = typeOf[Bar].decl(TermName("foo")).asMethod + println(foo.returnType) // Foo + + val bar = Bar(Foo(3)) + println(bar.foo) // Foo(3) + + val im = cm.reflect(bar) + println(im.reflectField(foo).get) // incorrectly gives java.lang.Integer(3) not Foo(3) + im.reflectField(foo).set(Foo(5)) // java.lang.IllegalArgumentException: Can not set int field Bar.foo to Foo + println(im.reflectMethod(foo)()) // incorrectly gives java.lang.Integer(3) not Foo(3) +} diff --git a/tests/pending/run/t7331a.check b/tests/pending/run/t7331a.check new file mode 100644 index 000000000000..a59b4003442f --- /dev/null +++ b/tests/pending/run/t7331a.check @@ -0,0 +1,2 @@ +source-,line-1,offset=0 +2 \ No newline at end of file diff --git a/tests/pending/run/t7331a.scala b/tests/pending/run/t7331a.scala new file mode 100644 index 000000000000..057713af8da4 --- /dev/null +++ b/tests/pending/run/t7331a.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val tree = tb.parse("x") + println(tree.pos) + println(tree.pos.source.content.length) +} diff --git a/tests/pending/run/t7331b.check b/tests/pending/run/t7331b.check new file mode 100644 index 000000000000..413c93aaf78c --- /dev/null +++ b/tests/pending/run/t7331b.check @@ -0,0 +1,3 @@ +reflective compilation has failed: + +')' expected but eof found. diff --git a/tests/pending/run/t7331b.scala b/tests/pending/run/t7331b.scala new file mode 100644 index 000000000000..0d55e558e8be --- /dev/null +++ b/tests/pending/run/t7331b.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + try tb.parse("f(x") + catch { + case ToolBoxError(msg, _) => println(msg) + } +} diff --git a/tests/pending/run/t7331c.check b/tests/pending/run/t7331c.check new file mode 100644 index 000000000000..a9dc6a7d0f5b --- /dev/null +++ b/tests/pending/run/t7331c.check @@ -0,0 +1,3 @@ +ClassDef(Modifiers(), TypeName("C"), List(), Template(List(Select(Ident(scala), TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(()))))))) +source-,line-1,offset=6 +NoPosition diff --git a/tests/pending/run/t7331c.scala b/tests/pending/run/t7331c.scala new file mode 100644 index 000000000000..ba6fbd01e7fe --- /dev/null +++ b/tests/pending/run/t7331c.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val tree = tb.parse("class C").asInstanceOf[ClassDef] + println(showRaw(tree)) + println(tree.pos) + println(tree.impl.self.pos) +} diff --git a/tests/pending/run/t7336.scala b/tests/pending/run/t7336.scala new file mode 100644 index 000000000000..e2f17e11504e --- /dev/null +++ b/tests/pending/run/t7336.scala @@ -0,0 +1,31 @@ +import scala.concurrent.Await +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent.Future +import scala.concurrent.duration.Duration + +/** This test uses recursive calls to Future.flatMap to create arrays whose + * combined size is slightly greater than the JVM heap size. A previous + * implementation of Future.flatMap would retain references to each array, + * resulting in a speedy OutOfMemoryError. Now, each array should be freed soon + * after it is created and the test should complete without problems. + */ +object Test { + def main(args: Array[String]): Unit = { + def loop(i: Int, arraySize: Int): Future[Unit] = { + val array = new Array[Byte](arraySize) + Future.successful(i).flatMap { i => + if (i == 0) { + Future.successful(()) + } else { + array.size // Force closure to refer to array + loop(i - 1, arraySize) + } + + } + } + + val arraySize = 1000000 + val tooManyArrays = (Runtime.getRuntime().totalMemory() / arraySize).toInt + 1 + Await.ready(loop(tooManyArrays, arraySize), Duration.Inf) + } +} diff --git a/tests/pending/run/t7337.check b/tests/pending/run/t7337.check new file mode 100644 index 000000000000..dd2b31f23c98 --- /dev/null +++ b/tests/pending/run/t7337.check @@ -0,0 +1 @@ +doesnotexist does not exist or is not a directory diff --git a/tests/pending/run/t7337.scala b/tests/pending/run/t7337.scala new file mode 100644 index 000000000000..9913f8ae45e1 --- /dev/null +++ b/tests/pending/run/t7337.scala @@ -0,0 +1,19 @@ +import scala.tools.partest._ +import scala.tools.nsc._ +import scala.tools.cmd.CommandLineParser + +object Test extends DirectTest { + override def code = "class C" + override def newCompiler(args: String*): Global = { + val settings = newSettings((CommandLineParser tokenize ("-d doesnotexist " + extraSettings)) ++ args.toList) + newCompiler(settings) + } + + override def show() { + try { + newCompiler() + } catch { + case fe: FatalError => println(fe.getMessage) + } + } +} diff --git a/tests/pending/run/t7341.flags b/tests/pending/run/t7341.flags new file mode 100755 index 000000000000..ae084460552a --- /dev/null +++ b/tests/pending/run/t7341.flags @@ -0,0 +1 @@ +-Xcheckinit \ No newline at end of file diff --git a/tests/pending/run/t7341.scala b/tests/pending/run/t7341.scala new file mode 100755 index 000000000000..812b316f9c94 --- /dev/null +++ b/tests/pending/run/t7341.scala @@ -0,0 +1,15 @@ +object Obj { + private var cache: Any = () + def returning(f: () => Unit) = () + def foo: Unit = { + returning(() => cache = ()) + } + + def apply(): Any = { + cache + } +} + +object Test extends dotty.runtime.LegacyApp { + Obj() +} diff --git a/tests/pending/run/t7359.check b/tests/pending/run/t7359.check new file mode 100644 index 000000000000..9766475a4185 --- /dev/null +++ b/tests/pending/run/t7359.check @@ -0,0 +1 @@ +ok diff --git a/tests/pending/run/t7359/Cyclic_1.java b/tests/pending/run/t7359/Cyclic_1.java new file mode 100644 index 000000000000..42b46c1aedd7 --- /dev/null +++ b/tests/pending/run/t7359/Cyclic_1.java @@ -0,0 +1,3 @@ +abstract class Cyclic { + static interface Inner { } +} \ No newline at end of file diff --git a/tests/pending/run/t7359/Test_2.scala b/tests/pending/run/t7359/Test_2.scala new file mode 100644 index 000000000000..c8e5788d5862 --- /dev/null +++ b/tests/pending/run/t7359/Test_2.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + typeOf[Cyclic].members + println("ok") +} \ No newline at end of file diff --git a/tests/pending/run/t7374.check b/tests/pending/run/t7374.check new file mode 100644 index 000000000000..4efa6f7af3a2 --- /dev/null +++ b/tests/pending/run/t7374.check @@ -0,0 +1,3 @@ +List(2, 3) +ParVector(1, 2, 3) +List(1, 2) diff --git a/tests/pending/run/t7374/Some.scala b/tests/pending/run/t7374/Some.scala new file mode 100644 index 000000000000..3266a5642e7b --- /dev/null +++ b/tests/pending/run/t7374/Some.scala @@ -0,0 +1,3 @@ +object SomeScala { + def list = List(1, 2, 3) +} diff --git a/tests/pending/run/t7374/Test.java b/tests/pending/run/t7374/Test.java new file mode 100644 index 000000000000..02f86146ca96 --- /dev/null +++ b/tests/pending/run/t7374/Test.java @@ -0,0 +1,7 @@ +public class Test { + public static void main(String[] args) { + System.out.println(SomeScala.list().tail()); + System.out.println(SomeScala.list().par()); + System.out.println(SomeScala.list().init()); + } +} diff --git a/tests/pending/run/t7375a.check b/tests/pending/run/t7375a.check new file mode 100644 index 000000000000..a0a15dfb2f44 --- /dev/null +++ b/tests/pending/run/t7375a.check @@ -0,0 +1,4 @@ +C1 +C2 +C1 +C2 diff --git a/tests/pending/run/t7375a.scala b/tests/pending/run/t7375a.scala new file mode 100644 index 000000000000..e46ad08f63a4 --- /dev/null +++ b/tests/pending/run/t7375a.scala @@ -0,0 +1,16 @@ +import scala.reflect.ClassTag + +class C1(val n: Int) extends AnyVal +class C2(val n: Int) extends AnyRef + +object Test { + type F1 = C1 + type F2 = C2 + + def main(args: Array[String]): Unit = { + println(implicitly[ClassTag[C1]]) + println(implicitly[ClassTag[C2]]) + println(implicitly[ClassTag[F1]]) + println(implicitly[ClassTag[F2]]) + } +} diff --git a/tests/pending/run/t7375b.check b/tests/pending/run/t7375b.check new file mode 100644 index 000000000000..d7578e28ba85 --- /dev/null +++ b/tests/pending/run/t7375b.check @@ -0,0 +1,4 @@ +Predef.this.classOf[C1] +Predef.this.classOf[C2] +Predef.this.classOf[C1] +Predef.this.classOf[C2] diff --git a/tests/pending/run/t7375b/Macros_1.scala b/tests/pending/run/t7375b/Macros_1.scala new file mode 100644 index 000000000000..b6090e730b3a --- /dev/null +++ b/tests/pending/run/t7375b/Macros_1.scala @@ -0,0 +1,18 @@ +import language.experimental.macros +import scala.reflect.macros.blackbox.Context + +class C1(val n: Int) extends AnyVal +class C2(val n: Int) extends AnyRef + +object Macros { + type F1 = C1 + type F2 = C2 + + def foo = macro impl + def impl(c: Context) = { + import c.universe._ + def test[T: c.TypeTag] = reify(println(c.Expr[String](Literal(Constant(c.reifyRuntimeClass(c.typeOf[T]).toString))).splice)).tree + def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(()))) + c.Expr[Unit](tests) + } +} \ No newline at end of file diff --git a/tests/pending/run/t7375b/Test_2.scala b/tests/pending/run/t7375b/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/t7375b/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/t7398.scala b/tests/pending/run/t7398.scala new file mode 100644 index 000000000000..4b4685076810 --- /dev/null +++ b/tests/pending/run/t7398.scala @@ -0,0 +1,26 @@ +import scala.tools.partest._ + +object Test extends CompilerTest { + import global._ + + override lazy val units: List[CompilationUnit] = { + // This test itself does not depend on JDK8. + javaCompilationUnits(global)(defaultMethodSource) + } + + private def defaultMethodSource = """ +public interface Iterator { + boolean hasNext(); + E next(); + default void remove() { + throw new UnsupportedOperationException("remove"); + } + default void forEachRemaining(Consumer action) { + throw new UnsupportedOperationException("forEachRemaining"); + } +} + """ + + // We're only checking we can compile it. + def check(source: String, unit: global.CompilationUnit): Unit = () +} diff --git a/tests/pending/run/t7406.check b/tests/pending/run/t7406.check new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/tests/pending/run/t7406.check @@ -0,0 +1 @@ +10 diff --git a/tests/pending/run/t7406.scala b/tests/pending/run/t7406.scala new file mode 100644 index 000000000000..a8b35c91c9f4 --- /dev/null +++ b/tests/pending/run/t7406.scala @@ -0,0 +1,14 @@ +class Arne[@specialized(Long) T](x: T) { + val regularVal = x + lazy val lazyVal = x + + def apply(f: (T, T) => T): T = f(regularVal, lazyVal) +} + +object Test { + val arne = new Arne(5L) + def f = arne(_ + _) + def main(args: Array[String]): Unit = { + println(f) + } +} diff --git a/tests/pending/run/t7407.check b/tests/pending/run/t7407.check new file mode 100644 index 000000000000..e965047ad7c5 --- /dev/null +++ b/tests/pending/run/t7407.check @@ -0,0 +1 @@ +Hello diff --git a/tests/pending/run/t7407.flags b/tests/pending/run/t7407.flags new file mode 100644 index 000000000000..c8547a27dc70 --- /dev/null +++ b/tests/pending/run/t7407.flags @@ -0,0 +1 @@ +-Ynooptimise -Ybackend:GenBCode diff --git a/tests/pending/run/t7407.scala b/tests/pending/run/t7407.scala new file mode 100644 index 000000000000..51fb2214ff77 --- /dev/null +++ b/tests/pending/run/t7407.scala @@ -0,0 +1,11 @@ +// SI-7407 +object Test { + + def main(args: Array[String]): Unit = { println(foo) } + + def foo: String = { + try return "Hello" finally 10 match {case x => ()} + } + +} + diff --git a/tests/pending/run/t7407b.check b/tests/pending/run/t7407b.check new file mode 100644 index 000000000000..f30294447b7e --- /dev/null +++ b/tests/pending/run/t7407b.check @@ -0,0 +1,2 @@ +Hello +abc diff --git a/tests/pending/run/t7407b.flags b/tests/pending/run/t7407b.flags new file mode 100644 index 000000000000..c8547a27dc70 --- /dev/null +++ b/tests/pending/run/t7407b.flags @@ -0,0 +1 @@ +-Ynooptimise -Ybackend:GenBCode diff --git a/tests/pending/run/t7407b.scala b/tests/pending/run/t7407b.scala new file mode 100644 index 000000000000..79f52a6fcba2 --- /dev/null +++ b/tests/pending/run/t7407b.scala @@ -0,0 +1,20 @@ +object Test { + + def main(args: Array[String]): Unit = { + println(foo(true)) + println(foo(false)) + } + + def foo(b: Boolean): String = { + try { + if(b) + return "Hello" + else + "abc" + } finally { + 10 match {case x => ()} + } + } + +} + diff --git a/tests/pending/run/t7436.scala b/tests/pending/run/t7436.scala new file mode 100644 index 000000000000..9627e38f5490 --- /dev/null +++ b/tests/pending/run/t7436.scala @@ -0,0 +1,9 @@ +class A(val p: Int*) + +class B(val p1: Int) extends A(p1) + +object Test { + def main(args: Array[String]): Unit = { + new B(1).p1 // threw java.lang.ClassCastException: scala.collection.mutable.WrappedArray$ofInt cannot be cast to java.lang.Integer + } +} diff --git a/tests/pending/run/t7439.check b/tests/pending/run/t7439.check new file mode 100644 index 000000000000..9ea09f9c4094 --- /dev/null +++ b/tests/pending/run/t7439.check @@ -0,0 +1,2 @@ +Recompiling after deleting t7439-run.obj/A_1.class +pos: NoPosition Class A_1 not found - continuing with a stub. WARNING diff --git a/tests/pending/run/t7439/A_1.java b/tests/pending/run/t7439/A_1.java new file mode 100644 index 000000000000..4accd95d576c --- /dev/null +++ b/tests/pending/run/t7439/A_1.java @@ -0,0 +1,3 @@ +public class A_1 { + +} \ No newline at end of file diff --git a/tests/pending/run/t7439/B_1.java b/tests/pending/run/t7439/B_1.java new file mode 100644 index 000000000000..5dd3b93d6f2f --- /dev/null +++ b/tests/pending/run/t7439/B_1.java @@ -0,0 +1,3 @@ +public class B_1 { + public void b(A_1[] a) {} +} diff --git a/tests/pending/run/t7439/Test_2.scala b/tests/pending/run/t7439/Test_2.scala new file mode 100644 index 000000000000..ce9b907145ca --- /dev/null +++ b/tests/pending/run/t7439/Test_2.scala @@ -0,0 +1,33 @@ +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 C = """ + class C { + new B_1 + } + """ + + def show(): Unit = { + //compileCode(C) + assert(filteredInfos.isEmpty, filteredInfos) + + // blow away the entire package + val a1Class = new File(testOutput.path, "A_1.class") + assert(a1Class.exists) + assert(a1Class.delete()) + // testIdent normalizes to separate names using '/' regardless of platform, drops all but last two parts + println(s"Recompiling after deleting ${a1Class.testIdent}") + + // bad symbolic reference error expected (but no stack trace!) + compileCode(C) + println(storeReporter.infos.mkString("\n")) // Included a NullPointerException before. + } +} diff --git a/tests/pending/run/t744.check b/tests/pending/run/t744.check new file mode 100644 index 000000000000..757bf0137049 --- /dev/null +++ b/tests/pending/run/t744.check @@ -0,0 +1,3 @@ +BEGIN +Hello from linked +END diff --git a/tests/pending/run/t744.scala b/tests/pending/run/t744.scala new file mode 100644 index 000000000000..4895e9baa079 --- /dev/null +++ b/tests/pending/run/t744.scala @@ -0,0 +1,20 @@ +trait Linked { + type File <: FileImpl; + trait FileImpl { + Console.println("Hello from linked"); + } +} +object Test { + class Test extends Linked { + trait FileImpl extends super.FileImpl { +// val x: int = 1 + } + class File extends FileImpl; + } + def main(args : Array[String]) : Unit = { + Console.println("BEGIN"); + val test = new Test; + val file = new test.File; + Console.println("END"); + } +} diff --git a/tests/pending/run/t7445.scala b/tests/pending/run/t7445.scala new file mode 100644 index 000000000000..25fc5d3885ce --- /dev/null +++ b/tests/pending/run/t7445.scala @@ -0,0 +1,6 @@ +import scala.collection.immutable.ListMap + +object Test extends dotty.runtime.LegacyApp { + val a = ListMap(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5); + require(a.tail == ListMap(2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5)); +} diff --git a/tests/pending/run/t7455.check b/tests/pending/run/t7455.check new file mode 100644 index 000000000000..0eb9342888be --- /dev/null +++ b/tests/pending/run/t7455.check @@ -0,0 +1,4 @@ +private[package ] def (x$1: String): Outer[E] +private[package ] def (): Outer$PrivateInner +private[package ] def (): Outer$PrivateStaticInner +private[package ] def (x$2: String): Outer$PublicInner diff --git a/tests/pending/run/t7455/Outer.java b/tests/pending/run/t7455/Outer.java new file mode 100644 index 000000000000..10c97a9150d6 --- /dev/null +++ b/tests/pending/run/t7455/Outer.java @@ -0,0 +1,31 @@ +public class Outer { + public void elements() { + new C() { + }; + } + + private Outer(String a) {} + + static class SubSelf extends Outer { + public SubSelf() { super(""); } + } + + private class PrivateInner { + } + class SubPrivateInner extends PrivateInner { + } + + private class PublicInner { + private PublicInner(String a) {} + } + class SubPublicInner extends PublicInner { + public SubPublicInner() { super(""); } + } + + private static class PrivateStaticInner { + } + public static class SubPrivateStaticInner extends PrivateStaticInner { + } +} + +class C {} diff --git a/tests/pending/run/t7455/Test.scala b/tests/pending/run/t7455/Test.scala new file mode 100644 index 000000000000..2cda9225f4fa --- /dev/null +++ b/tests/pending/run/t7455/Test.scala @@ -0,0 +1,30 @@ +import scala.tools.partest._ + +// javac adds dummy parameters of type Outer$1 to synthetic access constructors +// This test shows that we strip them from the signatures. If we don't, we trigger +// parsing of Outer$1 which can fail if it references type parameters of the Outer. +// +// OLD OUTPUT: +// private[package ] def (x$2: Outer$1): Outer$PrivateInner +// error: error while loading Outer$1, class file 't7455-run.obj/Outer$1.class' is broken +// (class java.util.NoSuchElementException/key not found: E) +// ... +object Test extends DirectTest { + override def code = "" + + def show { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + val compiler = newCompiler("-cp", classpath, "-d", testOutput.path) + import compiler._, definitions._ + new compiler.Run + + for { + name <- Seq("Outer", "Outer$PrivateInner", "Outer$PrivateStaticInner", "Outer$PublicInner") + clazz = compiler.rootMirror.staticClass(name) + constr <- clazz.info.member(termNames.CONSTRUCTOR).alternatives + } { + println(constr.defString) + fullyInitializeSymbol(constr) + } + } +} diff --git a/tests/pending/run/t7475b.check b/tests/pending/run/t7475b.check new file mode 100644 index 000000000000..51993f072d58 --- /dev/null +++ b/tests/pending/run/t7475b.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/tests/pending/run/t7475b.scala b/tests/pending/run/t7475b.scala new file mode 100644 index 000000000000..a205602b6d78 --- /dev/null +++ b/tests/pending/run/t7475b.scala @@ -0,0 +1,11 @@ +trait A { private val x = 1 } +trait B { val x = 2 } +trait C1 extends B with A { println(x) } +trait C2 extends A with B { println(x) } + +object Test { + def main(args: Array[String]): Unit = { + new C1 { } + new C2 { } + } +} diff --git a/tests/pending/run/t7482a.check b/tests/pending/run/t7482a.check new file mode 100644 index 000000000000..a21ef7b68fb4 --- /dev/null +++ b/tests/pending/run/t7482a.check @@ -0,0 +1,10 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5) +v: java.util.ArrayList[String] = [] + +scala> val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5) +v: java.util.ArrayList[String] = [] + +scala> :quit diff --git a/tests/pending/run/t7482a.scala b/tests/pending/run/t7482a.scala new file mode 100644 index 000000000000..d674558b9872 --- /dev/null +++ b/tests/pending/run/t7482a.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ + val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5) + val v: java.util.ArrayList[String] = new java.util.ArrayList[String](5) + """ +} \ No newline at end of file diff --git a/tests/pending/run/t7498.scala b/tests/pending/run/t7498.scala new file mode 100644 index 000000000000..cab598405766 --- /dev/null +++ b/tests/pending/run/t7498.scala @@ -0,0 +1,20 @@ + + + + + + + +object Test extends dotty.runtime.LegacyApp { + import scala.collection.concurrent.TrieMap + + class Collision(val idx: Int) { + override def hashCode = idx % 10 + } + + val tm = TrieMap[Collision, Unit]() + for (i <- 0 until 1000) tm(new Collision(i)) = () + + tm.par.foreach(kv => ()) +} + diff --git a/tests/pending/run/t7507.scala b/tests/pending/run/t7507.scala new file mode 100644 index 000000000000..51ee0518733c --- /dev/null +++ b/tests/pending/run/t7507.scala @@ -0,0 +1,35 @@ +trait Cake extends Slice + +// Minimization +trait Slice { self: Cake => // must have self type that extends `Slice` + private[this] val bippy = () // must be private[this] + locally(bippy) + class C1 { + locally(bippy) + locally(self.bippy) + } +} + +// Originally reported bug: +trait Cake1 extends Slice1 +trait Slice1 { self: Cake1 => + import java.lang.String // any import will do! + val Tuple2(x, y) = ((1, 2)) +} + + +// Nesting +trait Cake3 extends Outer.Slice3 + +// Minimization +object Outer { + private[this] val bippy = () + trait Slice3 { self: Cake3 => + locally(bippy) + } +} + +object Test extends dotty.runtime.LegacyApp { + val s1 = new Cake1 {} + assert((s1.x, s1.y) == (1, 2), (s1.x, s1.y)) +} diff --git a/tests/pending/run/t751.scala b/tests/pending/run/t751.scala new file mode 100644 index 000000000000..294d3af5c2b8 --- /dev/null +++ b/tests/pending/run/t751.scala @@ -0,0 +1,6 @@ +object Test { + def main(args: Array[String]): Unit = { + val map = Map(1 -> "a", 2 -> "b", 3 -> "c") + assert(map.filterKeys(_ % 2 == 0).isInstanceOf[scala.collection.immutable.Map[_,_]]) + } +} diff --git a/tests/pending/run/t7510/Ann_1.java b/tests/pending/run/t7510/Ann_1.java new file mode 100644 index 000000000000..c8c5b2035f92 --- /dev/null +++ b/tests/pending/run/t7510/Ann_1.java @@ -0,0 +1,4 @@ +package foo; + +public @interface Ann_1 { +} \ No newline at end of file diff --git a/tests/pending/run/t7510/Test_2.scala b/tests/pending/run/t7510/Test_2.scala new file mode 100644 index 000000000000..edb8bfba4253 --- /dev/null +++ b/tests/pending/run/t7510/Test_2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + tb.compile(tb.parse("@foo.Ann_1 class C")) +} + diff --git a/tests/pending/run/t7533.check b/tests/pending/run/t7533.check new file mode 100644 index 000000000000..fa5b3edc8ff0 --- /dev/null +++ b/tests/pending/run/t7533.check @@ -0,0 +1,30 @@ +Testing Symbol.isAbstract... +=======class C======= +class C => true +constructor C => false +value x1 => true +value x2 => false +value x2 => false +method y1 => true +method y2 => false +type T1 => true +type T2 => false +=======trait T======= +trait T => true +method $init$ => false +value z1 => true +value z2 => false +value z2 => false +method w1 => true +method w2 => false +type U1 => true +type U2 => false +=======class D======= +class D => false +constructor D => false +value x1 => false +value x1 => false +method y1 => false +=======object M======= +object M => false +constructor M => false diff --git a/tests/pending/run/t7533.scala b/tests/pending/run/t7533.scala new file mode 100644 index 000000000000..ac0c662e43d1 --- /dev/null +++ b/tests/pending/run/t7533.scala @@ -0,0 +1,38 @@ +import scala.reflect.runtime.universe._ + +abstract class C { + val x1: Int + val x2: Int = 2 + def y1: Int + def y2: Int = 2 + type T1 <: Int + type T2 = Int +} +trait T { + val z1: Int + val z2: Int = 2 + def w1: Int + def w2: Int = 2 + type U1 <: Int + type U2 = Int +} +class D extends C { + val x1 = 3 + def y1 = 3 +} +object M + +object Test extends dotty.runtime.LegacyApp { + println("Testing Symbol.isAbstract...") + def test[T: TypeTag] = { + val sym = typeOf[T].typeSymbol + println(s"=======$sym=======") + def printAbstract(sym: Symbol) = println(s"$sym => ${sym.isAbstract}") + printAbstract(sym) + sym.info.decls.sorted.foreach(printAbstract) + } + test[C] + test[T] + test[D] + test[M.type] +} diff --git a/tests/pending/run/t7556.check b/tests/pending/run/t7556.check new file mode 100644 index 000000000000..3328708a6d44 --- /dev/null +++ b/tests/pending/run/t7556.check @@ -0,0 +1,2 @@ +class annotations: List(scala.reflect.ScalaLongSignature) +3001 decls via runtime reflection diff --git a/tests/pending/run/t7556/Test_2.scala b/tests/pending/run/t7556/Test_2.scala new file mode 100644 index 000000000000..4dd482ff3596 --- /dev/null +++ b/tests/pending/run/t7556/Test_2.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test { + def main(args: Array[String]): Unit = { + val mc = new MegaClass + val anns = mc.getClass.getAnnotations.map(_.annotationType.getName).toList.sorted + println(s"class annotations: $anns") + val N = typeTag[MegaClass].tpe.decls.size // was: error reading Scala signature of MegaClass: 65935 + println(s"$N decls via runtime reflection") + } +} diff --git a/tests/pending/run/t7556/mega-class_1.scala b/tests/pending/run/t7556/mega-class_1.scala new file mode 100644 index 000000000000..dcc9ba8bcdc1 --- /dev/null +++ b/tests/pending/run/t7556/mega-class_1.scala @@ -0,0 +1,3002 @@ +class MegaClass { + def method0: Int = 0 + def method1: Int = 0 + def method2: Int = 0 + def method3: Int = 0 + def method4: Int = 0 + def method5: Int = 0 + def method6: Int = 0 + def method7: Int = 0 + def method8: Int = 0 + def method9: Int = 0 + def method10: Int = 0 + def method11: Int = 0 + def method12: Int = 0 + def method13: Int = 0 + def method14: Int = 0 + def method15: Int = 0 + def method16: Int = 0 + def method17: Int = 0 + def method18: Int = 0 + def method19: Int = 0 + def method20: Int = 0 + def method21: Int = 0 + def method22: Int = 0 + def method23: Int = 0 + def method24: Int = 0 + def method25: Int = 0 + def method26: Int = 0 + def method27: Int = 0 + def method28: Int = 0 + def method29: Int = 0 + def method30: Int = 0 + def method31: Int = 0 + def method32: Int = 0 + def method33: Int = 0 + def method34: Int = 0 + def method35: Int = 0 + def method36: Int = 0 + def method37: Int = 0 + def method38: Int = 0 + def method39: Int = 0 + def method40: Int = 0 + def method41: Int = 0 + def method42: Int = 0 + def method43: Int = 0 + def method44: Int = 0 + def method45: Int = 0 + def method46: Int = 0 + def method47: Int = 0 + def method48: Int = 0 + def method49: Int = 0 + def method50: Int = 0 + def method51: Int = 0 + def method52: Int = 0 + def method53: Int = 0 + def method54: Int = 0 + def method55: Int = 0 + def method56: Int = 0 + def method57: Int = 0 + def method58: Int = 0 + def method59: Int = 0 + def method60: Int = 0 + def method61: Int = 0 + def method62: Int = 0 + def method63: Int = 0 + def method64: Int = 0 + def method65: Int = 0 + def method66: Int = 0 + def method67: Int = 0 + def method68: Int = 0 + def method69: Int = 0 + def method70: Int = 0 + def method71: Int = 0 + def method72: Int = 0 + def method73: Int = 0 + def method74: Int = 0 + def method75: Int = 0 + def method76: Int = 0 + def method77: Int = 0 + def method78: Int = 0 + def method79: Int = 0 + def method80: Int = 0 + def method81: Int = 0 + def method82: Int = 0 + def method83: Int = 0 + def method84: Int = 0 + def method85: Int = 0 + def method86: Int = 0 + def method87: Int = 0 + def method88: Int = 0 + def method89: Int = 0 + def method90: Int = 0 + def method91: Int = 0 + def method92: Int = 0 + def method93: Int = 0 + def method94: Int = 0 + def method95: Int = 0 + def method96: Int = 0 + def method97: Int = 0 + def method98: Int = 0 + def method99: Int = 0 + def method100: Int = 0 + def method101: Int = 0 + def method102: Int = 0 + def method103: Int = 0 + def method104: Int = 0 + def method105: Int = 0 + def method106: Int = 0 + def method107: Int = 0 + def method108: Int = 0 + def method109: Int = 0 + def method110: Int = 0 + def method111: Int = 0 + def method112: Int = 0 + def method113: Int = 0 + def method114: Int = 0 + def method115: Int = 0 + def method116: Int = 0 + def method117: Int = 0 + def method118: Int = 0 + def method119: Int = 0 + def method120: Int = 0 + def method121: Int = 0 + def method122: Int = 0 + def method123: Int = 0 + def method124: Int = 0 + def method125: Int = 0 + def method126: Int = 0 + def method127: Int = 0 + def method128: Int = 0 + def method129: Int = 0 + def method130: Int = 0 + def method131: Int = 0 + def method132: Int = 0 + def method133: Int = 0 + def method134: Int = 0 + def method135: Int = 0 + def method136: Int = 0 + def method137: Int = 0 + def method138: Int = 0 + def method139: Int = 0 + def method140: Int = 0 + def method141: Int = 0 + def method142: Int = 0 + def method143: Int = 0 + def method144: Int = 0 + def method145: Int = 0 + def method146: Int = 0 + def method147: Int = 0 + def method148: Int = 0 + def method149: Int = 0 + def method150: Int = 0 + def method151: Int = 0 + def method152: Int = 0 + def method153: Int = 0 + def method154: Int = 0 + def method155: Int = 0 + def method156: Int = 0 + def method157: Int = 0 + def method158: Int = 0 + def method159: Int = 0 + def method160: Int = 0 + def method161: Int = 0 + def method162: Int = 0 + def method163: Int = 0 + def method164: Int = 0 + def method165: Int = 0 + def method166: Int = 0 + def method167: Int = 0 + def method168: Int = 0 + def method169: Int = 0 + def method170: Int = 0 + def method171: Int = 0 + def method172: Int = 0 + def method173: Int = 0 + def method174: Int = 0 + def method175: Int = 0 + def method176: Int = 0 + def method177: Int = 0 + def method178: Int = 0 + def method179: Int = 0 + def method180: Int = 0 + def method181: Int = 0 + def method182: Int = 0 + def method183: Int = 0 + def method184: Int = 0 + def method185: Int = 0 + def method186: Int = 0 + def method187: Int = 0 + def method188: Int = 0 + def method189: Int = 0 + def method190: Int = 0 + def method191: Int = 0 + def method192: Int = 0 + def method193: Int = 0 + def method194: Int = 0 + def method195: Int = 0 + def method196: Int = 0 + def method197: Int = 0 + def method198: Int = 0 + def method199: Int = 0 + def method200: Int = 0 + def method201: Int = 0 + def method202: Int = 0 + def method203: Int = 0 + def method204: Int = 0 + def method205: Int = 0 + def method206: Int = 0 + def method207: Int = 0 + def method208: Int = 0 + def method209: Int = 0 + def method210: Int = 0 + def method211: Int = 0 + def method212: Int = 0 + def method213: Int = 0 + def method214: Int = 0 + def method215: Int = 0 + def method216: Int = 0 + def method217: Int = 0 + def method218: Int = 0 + def method219: Int = 0 + def method220: Int = 0 + def method221: Int = 0 + def method222: Int = 0 + def method223: Int = 0 + def method224: Int = 0 + def method225: Int = 0 + def method226: Int = 0 + def method227: Int = 0 + def method228: Int = 0 + def method229: Int = 0 + def method230: Int = 0 + def method231: Int = 0 + def method232: Int = 0 + def method233: Int = 0 + def method234: Int = 0 + def method235: Int = 0 + def method236: Int = 0 + def method237: Int = 0 + def method238: Int = 0 + def method239: Int = 0 + def method240: Int = 0 + def method241: Int = 0 + def method242: Int = 0 + def method243: Int = 0 + def method244: Int = 0 + def method245: Int = 0 + def method246: Int = 0 + def method247: Int = 0 + def method248: Int = 0 + def method249: Int = 0 + def method250: Int = 0 + def method251: Int = 0 + def method252: Int = 0 + def method253: Int = 0 + def method254: Int = 0 + def method255: Int = 0 + def method256: Int = 0 + def method257: Int = 0 + def method258: Int = 0 + def method259: Int = 0 + def method260: Int = 0 + def method261: Int = 0 + def method262: Int = 0 + def method263: Int = 0 + def method264: Int = 0 + def method265: Int = 0 + def method266: Int = 0 + def method267: Int = 0 + def method268: Int = 0 + def method269: Int = 0 + def method270: Int = 0 + def method271: Int = 0 + def method272: Int = 0 + def method273: Int = 0 + def method274: Int = 0 + def method275: Int = 0 + def method276: Int = 0 + def method277: Int = 0 + def method278: Int = 0 + def method279: Int = 0 + def method280: Int = 0 + def method281: Int = 0 + def method282: Int = 0 + def method283: Int = 0 + def method284: Int = 0 + def method285: Int = 0 + def method286: Int = 0 + def method287: Int = 0 + def method288: Int = 0 + def method289: Int = 0 + def method290: Int = 0 + def method291: Int = 0 + def method292: Int = 0 + def method293: Int = 0 + def method294: Int = 0 + def method295: Int = 0 + def method296: Int = 0 + def method297: Int = 0 + def method298: Int = 0 + def method299: Int = 0 + def method300: Int = 0 + def method301: Int = 0 + def method302: Int = 0 + def method303: Int = 0 + def method304: Int = 0 + def method305: Int = 0 + def method306: Int = 0 + def method307: Int = 0 + def method308: Int = 0 + def method309: Int = 0 + def method310: Int = 0 + def method311: Int = 0 + def method312: Int = 0 + def method313: Int = 0 + def method314: Int = 0 + def method315: Int = 0 + def method316: Int = 0 + def method317: Int = 0 + def method318: Int = 0 + def method319: Int = 0 + def method320: Int = 0 + def method321: Int = 0 + def method322: Int = 0 + def method323: Int = 0 + def method324: Int = 0 + def method325: Int = 0 + def method326: Int = 0 + def method327: Int = 0 + def method328: Int = 0 + def method329: Int = 0 + def method330: Int = 0 + def method331: Int = 0 + def method332: Int = 0 + def method333: Int = 0 + def method334: Int = 0 + def method335: Int = 0 + def method336: Int = 0 + def method337: Int = 0 + def method338: Int = 0 + def method339: Int = 0 + def method340: Int = 0 + def method341: Int = 0 + def method342: Int = 0 + def method343: Int = 0 + def method344: Int = 0 + def method345: Int = 0 + def method346: Int = 0 + def method347: Int = 0 + def method348: Int = 0 + def method349: Int = 0 + def method350: Int = 0 + def method351: Int = 0 + def method352: Int = 0 + def method353: Int = 0 + def method354: Int = 0 + def method355: Int = 0 + def method356: Int = 0 + def method357: Int = 0 + def method358: Int = 0 + def method359: Int = 0 + def method360: Int = 0 + def method361: Int = 0 + def method362: Int = 0 + def method363: Int = 0 + def method364: Int = 0 + def method365: Int = 0 + def method366: Int = 0 + def method367: Int = 0 + def method368: Int = 0 + def method369: Int = 0 + def method370: Int = 0 + def method371: Int = 0 + def method372: Int = 0 + def method373: Int = 0 + def method374: Int = 0 + def method375: Int = 0 + def method376: Int = 0 + def method377: Int = 0 + def method378: Int = 0 + def method379: Int = 0 + def method380: Int = 0 + def method381: Int = 0 + def method382: Int = 0 + def method383: Int = 0 + def method384: Int = 0 + def method385: Int = 0 + def method386: Int = 0 + def method387: Int = 0 + def method388: Int = 0 + def method389: Int = 0 + def method390: Int = 0 + def method391: Int = 0 + def method392: Int = 0 + def method393: Int = 0 + def method394: Int = 0 + def method395: Int = 0 + def method396: Int = 0 + def method397: Int = 0 + def method398: Int = 0 + def method399: Int = 0 + def method400: Int = 0 + def method401: Int = 0 + def method402: Int = 0 + def method403: Int = 0 + def method404: Int = 0 + def method405: Int = 0 + def method406: Int = 0 + def method407: Int = 0 + def method408: Int = 0 + def method409: Int = 0 + def method410: Int = 0 + def method411: Int = 0 + def method412: Int = 0 + def method413: Int = 0 + def method414: Int = 0 + def method415: Int = 0 + def method416: Int = 0 + def method417: Int = 0 + def method418: Int = 0 + def method419: Int = 0 + def method420: Int = 0 + def method421: Int = 0 + def method422: Int = 0 + def method423: Int = 0 + def method424: Int = 0 + def method425: Int = 0 + def method426: Int = 0 + def method427: Int = 0 + def method428: Int = 0 + def method429: Int = 0 + def method430: Int = 0 + def method431: Int = 0 + def method432: Int = 0 + def method433: Int = 0 + def method434: Int = 0 + def method435: Int = 0 + def method436: Int = 0 + def method437: Int = 0 + def method438: Int = 0 + def method439: Int = 0 + def method440: Int = 0 + def method441: Int = 0 + def method442: Int = 0 + def method443: Int = 0 + def method444: Int = 0 + def method445: Int = 0 + def method446: Int = 0 + def method447: Int = 0 + def method448: Int = 0 + def method449: Int = 0 + def method450: Int = 0 + def method451: Int = 0 + def method452: Int = 0 + def method453: Int = 0 + def method454: Int = 0 + def method455: Int = 0 + def method456: Int = 0 + def method457: Int = 0 + def method458: Int = 0 + def method459: Int = 0 + def method460: Int = 0 + def method461: Int = 0 + def method462: Int = 0 + def method463: Int = 0 + def method464: Int = 0 + def method465: Int = 0 + def method466: Int = 0 + def method467: Int = 0 + def method468: Int = 0 + def method469: Int = 0 + def method470: Int = 0 + def method471: Int = 0 + def method472: Int = 0 + def method473: Int = 0 + def method474: Int = 0 + def method475: Int = 0 + def method476: Int = 0 + def method477: Int = 0 + def method478: Int = 0 + def method479: Int = 0 + def method480: Int = 0 + def method481: Int = 0 + def method482: Int = 0 + def method483: Int = 0 + def method484: Int = 0 + def method485: Int = 0 + def method486: Int = 0 + def method487: Int = 0 + def method488: Int = 0 + def method489: Int = 0 + def method490: Int = 0 + def method491: Int = 0 + def method492: Int = 0 + def method493: Int = 0 + def method494: Int = 0 + def method495: Int = 0 + def method496: Int = 0 + def method497: Int = 0 + def method498: Int = 0 + def method499: Int = 0 + def method500: Int = 0 + def method501: Int = 0 + def method502: Int = 0 + def method503: Int = 0 + def method504: Int = 0 + def method505: Int = 0 + def method506: Int = 0 + def method507: Int = 0 + def method508: Int = 0 + def method509: Int = 0 + def method510: Int = 0 + def method511: Int = 0 + def method512: Int = 0 + def method513: Int = 0 + def method514: Int = 0 + def method515: Int = 0 + def method516: Int = 0 + def method517: Int = 0 + def method518: Int = 0 + def method519: Int = 0 + def method520: Int = 0 + def method521: Int = 0 + def method522: Int = 0 + def method523: Int = 0 + def method524: Int = 0 + def method525: Int = 0 + def method526: Int = 0 + def method527: Int = 0 + def method528: Int = 0 + def method529: Int = 0 + def method530: Int = 0 + def method531: Int = 0 + def method532: Int = 0 + def method533: Int = 0 + def method534: Int = 0 + def method535: Int = 0 + def method536: Int = 0 + def method537: Int = 0 + def method538: Int = 0 + def method539: Int = 0 + def method540: Int = 0 + def method541: Int = 0 + def method542: Int = 0 + def method543: Int = 0 + def method544: Int = 0 + def method545: Int = 0 + def method546: Int = 0 + def method547: Int = 0 + def method548: Int = 0 + def method549: Int = 0 + def method550: Int = 0 + def method551: Int = 0 + def method552: Int = 0 + def method553: Int = 0 + def method554: Int = 0 + def method555: Int = 0 + def method556: Int = 0 + def method557: Int = 0 + def method558: Int = 0 + def method559: Int = 0 + def method560: Int = 0 + def method561: Int = 0 + def method562: Int = 0 + def method563: Int = 0 + def method564: Int = 0 + def method565: Int = 0 + def method566: Int = 0 + def method567: Int = 0 + def method568: Int = 0 + def method569: Int = 0 + def method570: Int = 0 + def method571: Int = 0 + def method572: Int = 0 + def method573: Int = 0 + def method574: Int = 0 + def method575: Int = 0 + def method576: Int = 0 + def method577: Int = 0 + def method578: Int = 0 + def method579: Int = 0 + def method580: Int = 0 + def method581: Int = 0 + def method582: Int = 0 + def method583: Int = 0 + def method584: Int = 0 + def method585: Int = 0 + def method586: Int = 0 + def method587: Int = 0 + def method588: Int = 0 + def method589: Int = 0 + def method590: Int = 0 + def method591: Int = 0 + def method592: Int = 0 + def method593: Int = 0 + def method594: Int = 0 + def method595: Int = 0 + def method596: Int = 0 + def method597: Int = 0 + def method598: Int = 0 + def method599: Int = 0 + def method600: Int = 0 + def method601: Int = 0 + def method602: Int = 0 + def method603: Int = 0 + def method604: Int = 0 + def method605: Int = 0 + def method606: Int = 0 + def method607: Int = 0 + def method608: Int = 0 + def method609: Int = 0 + def method610: Int = 0 + def method611: Int = 0 + def method612: Int = 0 + def method613: Int = 0 + def method614: Int = 0 + def method615: Int = 0 + def method616: Int = 0 + def method617: Int = 0 + def method618: Int = 0 + def method619: Int = 0 + def method620: Int = 0 + def method621: Int = 0 + def method622: Int = 0 + def method623: Int = 0 + def method624: Int = 0 + def method625: Int = 0 + def method626: Int = 0 + def method627: Int = 0 + def method628: Int = 0 + def method629: Int = 0 + def method630: Int = 0 + def method631: Int = 0 + def method632: Int = 0 + def method633: Int = 0 + def method634: Int = 0 + def method635: Int = 0 + def method636: Int = 0 + def method637: Int = 0 + def method638: Int = 0 + def method639: Int = 0 + def method640: Int = 0 + def method641: Int = 0 + def method642: Int = 0 + def method643: Int = 0 + def method644: Int = 0 + def method645: Int = 0 + def method646: Int = 0 + def method647: Int = 0 + def method648: Int = 0 + def method649: Int = 0 + def method650: Int = 0 + def method651: Int = 0 + def method652: Int = 0 + def method653: Int = 0 + def method654: Int = 0 + def method655: Int = 0 + def method656: Int = 0 + def method657: Int = 0 + def method658: Int = 0 + def method659: Int = 0 + def method660: Int = 0 + def method661: Int = 0 + def method662: Int = 0 + def method663: Int = 0 + def method664: Int = 0 + def method665: Int = 0 + def method666: Int = 0 + def method667: Int = 0 + def method668: Int = 0 + def method669: Int = 0 + def method670: Int = 0 + def method671: Int = 0 + def method672: Int = 0 + def method673: Int = 0 + def method674: Int = 0 + def method675: Int = 0 + def method676: Int = 0 + def method677: Int = 0 + def method678: Int = 0 + def method679: Int = 0 + def method680: Int = 0 + def method681: Int = 0 + def method682: Int = 0 + def method683: Int = 0 + def method684: Int = 0 + def method685: Int = 0 + def method686: Int = 0 + def method687: Int = 0 + def method688: Int = 0 + def method689: Int = 0 + def method690: Int = 0 + def method691: Int = 0 + def method692: Int = 0 + def method693: Int = 0 + def method694: Int = 0 + def method695: Int = 0 + def method696: Int = 0 + def method697: Int = 0 + def method698: Int = 0 + def method699: Int = 0 + def method700: Int = 0 + def method701: Int = 0 + def method702: Int = 0 + def method703: Int = 0 + def method704: Int = 0 + def method705: Int = 0 + def method706: Int = 0 + def method707: Int = 0 + def method708: Int = 0 + def method709: Int = 0 + def method710: Int = 0 + def method711: Int = 0 + def method712: Int = 0 + def method713: Int = 0 + def method714: Int = 0 + def method715: Int = 0 + def method716: Int = 0 + def method717: Int = 0 + def method718: Int = 0 + def method719: Int = 0 + def method720: Int = 0 + def method721: Int = 0 + def method722: Int = 0 + def method723: Int = 0 + def method724: Int = 0 + def method725: Int = 0 + def method726: Int = 0 + def method727: Int = 0 + def method728: Int = 0 + def method729: Int = 0 + def method730: Int = 0 + def method731: Int = 0 + def method732: Int = 0 + def method733: Int = 0 + def method734: Int = 0 + def method735: Int = 0 + def method736: Int = 0 + def method737: Int = 0 + def method738: Int = 0 + def method739: Int = 0 + def method740: Int = 0 + def method741: Int = 0 + def method742: Int = 0 + def method743: Int = 0 + def method744: Int = 0 + def method745: Int = 0 + def method746: Int = 0 + def method747: Int = 0 + def method748: Int = 0 + def method749: Int = 0 + def method750: Int = 0 + def method751: Int = 0 + def method752: Int = 0 + def method753: Int = 0 + def method754: Int = 0 + def method755: Int = 0 + def method756: Int = 0 + def method757: Int = 0 + def method758: Int = 0 + def method759: Int = 0 + def method760: Int = 0 + def method761: Int = 0 + def method762: Int = 0 + def method763: Int = 0 + def method764: Int = 0 + def method765: Int = 0 + def method766: Int = 0 + def method767: Int = 0 + def method768: Int = 0 + def method769: Int = 0 + def method770: Int = 0 + def method771: Int = 0 + def method772: Int = 0 + def method773: Int = 0 + def method774: Int = 0 + def method775: Int = 0 + def method776: Int = 0 + def method777: Int = 0 + def method778: Int = 0 + def method779: Int = 0 + def method780: Int = 0 + def method781: Int = 0 + def method782: Int = 0 + def method783: Int = 0 + def method784: Int = 0 + def method785: Int = 0 + def method786: Int = 0 + def method787: Int = 0 + def method788: Int = 0 + def method789: Int = 0 + def method790: Int = 0 + def method791: Int = 0 + def method792: Int = 0 + def method793: Int = 0 + def method794: Int = 0 + def method795: Int = 0 + def method796: Int = 0 + def method797: Int = 0 + def method798: Int = 0 + def method799: Int = 0 + def method800: Int = 0 + def method801: Int = 0 + def method802: Int = 0 + def method803: Int = 0 + def method804: Int = 0 + def method805: Int = 0 + def method806: Int = 0 + def method807: Int = 0 + def method808: Int = 0 + def method809: Int = 0 + def method810: Int = 0 + def method811: Int = 0 + def method812: Int = 0 + def method813: Int = 0 + def method814: Int = 0 + def method815: Int = 0 + def method816: Int = 0 + def method817: Int = 0 + def method818: Int = 0 + def method819: Int = 0 + def method820: Int = 0 + def method821: Int = 0 + def method822: Int = 0 + def method823: Int = 0 + def method824: Int = 0 + def method825: Int = 0 + def method826: Int = 0 + def method827: Int = 0 + def method828: Int = 0 + def method829: Int = 0 + def method830: Int = 0 + def method831: Int = 0 + def method832: Int = 0 + def method833: Int = 0 + def method834: Int = 0 + def method835: Int = 0 + def method836: Int = 0 + def method837: Int = 0 + def method838: Int = 0 + def method839: Int = 0 + def method840: Int = 0 + def method841: Int = 0 + def method842: Int = 0 + def method843: Int = 0 + def method844: Int = 0 + def method845: Int = 0 + def method846: Int = 0 + def method847: Int = 0 + def method848: Int = 0 + def method849: Int = 0 + def method850: Int = 0 + def method851: Int = 0 + def method852: Int = 0 + def method853: Int = 0 + def method854: Int = 0 + def method855: Int = 0 + def method856: Int = 0 + def method857: Int = 0 + def method858: Int = 0 + def method859: Int = 0 + def method860: Int = 0 + def method861: Int = 0 + def method862: Int = 0 + def method863: Int = 0 + def method864: Int = 0 + def method865: Int = 0 + def method866: Int = 0 + def method867: Int = 0 + def method868: Int = 0 + def method869: Int = 0 + def method870: Int = 0 + def method871: Int = 0 + def method872: Int = 0 + def method873: Int = 0 + def method874: Int = 0 + def method875: Int = 0 + def method876: Int = 0 + def method877: Int = 0 + def method878: Int = 0 + def method879: Int = 0 + def method880: Int = 0 + def method881: Int = 0 + def method882: Int = 0 + def method883: Int = 0 + def method884: Int = 0 + def method885: Int = 0 + def method886: Int = 0 + def method887: Int = 0 + def method888: Int = 0 + def method889: Int = 0 + def method890: Int = 0 + def method891: Int = 0 + def method892: Int = 0 + def method893: Int = 0 + def method894: Int = 0 + def method895: Int = 0 + def method896: Int = 0 + def method897: Int = 0 + def method898: Int = 0 + def method899: Int = 0 + def method900: Int = 0 + def method901: Int = 0 + def method902: Int = 0 + def method903: Int = 0 + def method904: Int = 0 + def method905: Int = 0 + def method906: Int = 0 + def method907: Int = 0 + def method908: Int = 0 + def method909: Int = 0 + def method910: Int = 0 + def method911: Int = 0 + def method912: Int = 0 + def method913: Int = 0 + def method914: Int = 0 + def method915: Int = 0 + def method916: Int = 0 + def method917: Int = 0 + def method918: Int = 0 + def method919: Int = 0 + def method920: Int = 0 + def method921: Int = 0 + def method922: Int = 0 + def method923: Int = 0 + def method924: Int = 0 + def method925: Int = 0 + def method926: Int = 0 + def method927: Int = 0 + def method928: Int = 0 + def method929: Int = 0 + def method930: Int = 0 + def method931: Int = 0 + def method932: Int = 0 + def method933: Int = 0 + def method934: Int = 0 + def method935: Int = 0 + def method936: Int = 0 + def method937: Int = 0 + def method938: Int = 0 + def method939: Int = 0 + def method940: Int = 0 + def method941: Int = 0 + def method942: Int = 0 + def method943: Int = 0 + def method944: Int = 0 + def method945: Int = 0 + def method946: Int = 0 + def method947: Int = 0 + def method948: Int = 0 + def method949: Int = 0 + def method950: Int = 0 + def method951: Int = 0 + def method952: Int = 0 + def method953: Int = 0 + def method954: Int = 0 + def method955: Int = 0 + def method956: Int = 0 + def method957: Int = 0 + def method958: Int = 0 + def method959: Int = 0 + def method960: Int = 0 + def method961: Int = 0 + def method962: Int = 0 + def method963: Int = 0 + def method964: Int = 0 + def method965: Int = 0 + def method966: Int = 0 + def method967: Int = 0 + def method968: Int = 0 + def method969: Int = 0 + def method970: Int = 0 + def method971: Int = 0 + def method972: Int = 0 + def method973: Int = 0 + def method974: Int = 0 + def method975: Int = 0 + def method976: Int = 0 + def method977: Int = 0 + def method978: Int = 0 + def method979: Int = 0 + def method980: Int = 0 + def method981: Int = 0 + def method982: Int = 0 + def method983: Int = 0 + def method984: Int = 0 + def method985: Int = 0 + def method986: Int = 0 + def method987: Int = 0 + def method988: Int = 0 + def method989: Int = 0 + def method990: Int = 0 + def method991: Int = 0 + def method992: Int = 0 + def method993: Int = 0 + def method994: Int = 0 + def method995: Int = 0 + def method996: Int = 0 + def method997: Int = 0 + def method998: Int = 0 + def method999: Int = 0 + def method1000: Int = 0 + def method1001: Int = 0 + def method1002: Int = 0 + def method1003: Int = 0 + def method1004: Int = 0 + def method1005: Int = 0 + def method1006: Int = 0 + def method1007: Int = 0 + def method1008: Int = 0 + def method1009: Int = 0 + def method1010: Int = 0 + def method1011: Int = 0 + def method1012: Int = 0 + def method1013: Int = 0 + def method1014: Int = 0 + def method1015: Int = 0 + def method1016: Int = 0 + def method1017: Int = 0 + def method1018: Int = 0 + def method1019: Int = 0 + def method1020: Int = 0 + def method1021: Int = 0 + def method1022: Int = 0 + def method1023: Int = 0 + def method1024: Int = 0 + def method1025: Int = 0 + def method1026: Int = 0 + def method1027: Int = 0 + def method1028: Int = 0 + def method1029: Int = 0 + def method1030: Int = 0 + def method1031: Int = 0 + def method1032: Int = 0 + def method1033: Int = 0 + def method1034: Int = 0 + def method1035: Int = 0 + def method1036: Int = 0 + def method1037: Int = 0 + def method1038: Int = 0 + def method1039: Int = 0 + def method1040: Int = 0 + def method1041: Int = 0 + def method1042: Int = 0 + def method1043: Int = 0 + def method1044: Int = 0 + def method1045: Int = 0 + def method1046: Int = 0 + def method1047: Int = 0 + def method1048: Int = 0 + def method1049: Int = 0 + def method1050: Int = 0 + def method1051: Int = 0 + def method1052: Int = 0 + def method1053: Int = 0 + def method1054: Int = 0 + def method1055: Int = 0 + def method1056: Int = 0 + def method1057: Int = 0 + def method1058: Int = 0 + def method1059: Int = 0 + def method1060: Int = 0 + def method1061: Int = 0 + def method1062: Int = 0 + def method1063: Int = 0 + def method1064: Int = 0 + def method1065: Int = 0 + def method1066: Int = 0 + def method1067: Int = 0 + def method1068: Int = 0 + def method1069: Int = 0 + def method1070: Int = 0 + def method1071: Int = 0 + def method1072: Int = 0 + def method1073: Int = 0 + def method1074: Int = 0 + def method1075: Int = 0 + def method1076: Int = 0 + def method1077: Int = 0 + def method1078: Int = 0 + def method1079: Int = 0 + def method1080: Int = 0 + def method1081: Int = 0 + def method1082: Int = 0 + def method1083: Int = 0 + def method1084: Int = 0 + def method1085: Int = 0 + def method1086: Int = 0 + def method1087: Int = 0 + def method1088: Int = 0 + def method1089: Int = 0 + def method1090: Int = 0 + def method1091: Int = 0 + def method1092: Int = 0 + def method1093: Int = 0 + def method1094: Int = 0 + def method1095: Int = 0 + def method1096: Int = 0 + def method1097: Int = 0 + def method1098: Int = 0 + def method1099: Int = 0 + def method1100: Int = 0 + def method1101: Int = 0 + def method1102: Int = 0 + def method1103: Int = 0 + def method1104: Int = 0 + def method1105: Int = 0 + def method1106: Int = 0 + def method1107: Int = 0 + def method1108: Int = 0 + def method1109: Int = 0 + def method1110: Int = 0 + def method1111: Int = 0 + def method1112: Int = 0 + def method1113: Int = 0 + def method1114: Int = 0 + def method1115: Int = 0 + def method1116: Int = 0 + def method1117: Int = 0 + def method1118: Int = 0 + def method1119: Int = 0 + def method1120: Int = 0 + def method1121: Int = 0 + def method1122: Int = 0 + def method1123: Int = 0 + def method1124: Int = 0 + def method1125: Int = 0 + def method1126: Int = 0 + def method1127: Int = 0 + def method1128: Int = 0 + def method1129: Int = 0 + def method1130: Int = 0 + def method1131: Int = 0 + def method1132: Int = 0 + def method1133: Int = 0 + def method1134: Int = 0 + def method1135: Int = 0 + def method1136: Int = 0 + def method1137: Int = 0 + def method1138: Int = 0 + def method1139: Int = 0 + def method1140: Int = 0 + def method1141: Int = 0 + def method1142: Int = 0 + def method1143: Int = 0 + def method1144: Int = 0 + def method1145: Int = 0 + def method1146: Int = 0 + def method1147: Int = 0 + def method1148: Int = 0 + def method1149: Int = 0 + def method1150: Int = 0 + def method1151: Int = 0 + def method1152: Int = 0 + def method1153: Int = 0 + def method1154: Int = 0 + def method1155: Int = 0 + def method1156: Int = 0 + def method1157: Int = 0 + def method1158: Int = 0 + def method1159: Int = 0 + def method1160: Int = 0 + def method1161: Int = 0 + def method1162: Int = 0 + def method1163: Int = 0 + def method1164: Int = 0 + def method1165: Int = 0 + def method1166: Int = 0 + def method1167: Int = 0 + def method1168: Int = 0 + def method1169: Int = 0 + def method1170: Int = 0 + def method1171: Int = 0 + def method1172: Int = 0 + def method1173: Int = 0 + def method1174: Int = 0 + def method1175: Int = 0 + def method1176: Int = 0 + def method1177: Int = 0 + def method1178: Int = 0 + def method1179: Int = 0 + def method1180: Int = 0 + def method1181: Int = 0 + def method1182: Int = 0 + def method1183: Int = 0 + def method1184: Int = 0 + def method1185: Int = 0 + def method1186: Int = 0 + def method1187: Int = 0 + def method1188: Int = 0 + def method1189: Int = 0 + def method1190: Int = 0 + def method1191: Int = 0 + def method1192: Int = 0 + def method1193: Int = 0 + def method1194: Int = 0 + def method1195: Int = 0 + def method1196: Int = 0 + def method1197: Int = 0 + def method1198: Int = 0 + def method1199: Int = 0 + def method1200: Int = 0 + def method1201: Int = 0 + def method1202: Int = 0 + def method1203: Int = 0 + def method1204: Int = 0 + def method1205: Int = 0 + def method1206: Int = 0 + def method1207: Int = 0 + def method1208: Int = 0 + def method1209: Int = 0 + def method1210: Int = 0 + def method1211: Int = 0 + def method1212: Int = 0 + def method1213: Int = 0 + def method1214: Int = 0 + def method1215: Int = 0 + def method1216: Int = 0 + def method1217: Int = 0 + def method1218: Int = 0 + def method1219: Int = 0 + def method1220: Int = 0 + def method1221: Int = 0 + def method1222: Int = 0 + def method1223: Int = 0 + def method1224: Int = 0 + def method1225: Int = 0 + def method1226: Int = 0 + def method1227: Int = 0 + def method1228: Int = 0 + def method1229: Int = 0 + def method1230: Int = 0 + def method1231: Int = 0 + def method1232: Int = 0 + def method1233: Int = 0 + def method1234: Int = 0 + def method1235: Int = 0 + def method1236: Int = 0 + def method1237: Int = 0 + def method1238: Int = 0 + def method1239: Int = 0 + def method1240: Int = 0 + def method1241: Int = 0 + def method1242: Int = 0 + def method1243: Int = 0 + def method1244: Int = 0 + def method1245: Int = 0 + def method1246: Int = 0 + def method1247: Int = 0 + def method1248: Int = 0 + def method1249: Int = 0 + def method1250: Int = 0 + def method1251: Int = 0 + def method1252: Int = 0 + def method1253: Int = 0 + def method1254: Int = 0 + def method1255: Int = 0 + def method1256: Int = 0 + def method1257: Int = 0 + def method1258: Int = 0 + def method1259: Int = 0 + def method1260: Int = 0 + def method1261: Int = 0 + def method1262: Int = 0 + def method1263: Int = 0 + def method1264: Int = 0 + def method1265: Int = 0 + def method1266: Int = 0 + def method1267: Int = 0 + def method1268: Int = 0 + def method1269: Int = 0 + def method1270: Int = 0 + def method1271: Int = 0 + def method1272: Int = 0 + def method1273: Int = 0 + def method1274: Int = 0 + def method1275: Int = 0 + def method1276: Int = 0 + def method1277: Int = 0 + def method1278: Int = 0 + def method1279: Int = 0 + def method1280: Int = 0 + def method1281: Int = 0 + def method1282: Int = 0 + def method1283: Int = 0 + def method1284: Int = 0 + def method1285: Int = 0 + def method1286: Int = 0 + def method1287: Int = 0 + def method1288: Int = 0 + def method1289: Int = 0 + def method1290: Int = 0 + def method1291: Int = 0 + def method1292: Int = 0 + def method1293: Int = 0 + def method1294: Int = 0 + def method1295: Int = 0 + def method1296: Int = 0 + def method1297: Int = 0 + def method1298: Int = 0 + def method1299: Int = 0 + def method1300: Int = 0 + def method1301: Int = 0 + def method1302: Int = 0 + def method1303: Int = 0 + def method1304: Int = 0 + def method1305: Int = 0 + def method1306: Int = 0 + def method1307: Int = 0 + def method1308: Int = 0 + def method1309: Int = 0 + def method1310: Int = 0 + def method1311: Int = 0 + def method1312: Int = 0 + def method1313: Int = 0 + def method1314: Int = 0 + def method1315: Int = 0 + def method1316: Int = 0 + def method1317: Int = 0 + def method1318: Int = 0 + def method1319: Int = 0 + def method1320: Int = 0 + def method1321: Int = 0 + def method1322: Int = 0 + def method1323: Int = 0 + def method1324: Int = 0 + def method1325: Int = 0 + def method1326: Int = 0 + def method1327: Int = 0 + def method1328: Int = 0 + def method1329: Int = 0 + def method1330: Int = 0 + def method1331: Int = 0 + def method1332: Int = 0 + def method1333: Int = 0 + def method1334: Int = 0 + def method1335: Int = 0 + def method1336: Int = 0 + def method1337: Int = 0 + def method1338: Int = 0 + def method1339: Int = 0 + def method1340: Int = 0 + def method1341: Int = 0 + def method1342: Int = 0 + def method1343: Int = 0 + def method1344: Int = 0 + def method1345: Int = 0 + def method1346: Int = 0 + def method1347: Int = 0 + def method1348: Int = 0 + def method1349: Int = 0 + def method1350: Int = 0 + def method1351: Int = 0 + def method1352: Int = 0 + def method1353: Int = 0 + def method1354: Int = 0 + def method1355: Int = 0 + def method1356: Int = 0 + def method1357: Int = 0 + def method1358: Int = 0 + def method1359: Int = 0 + def method1360: Int = 0 + def method1361: Int = 0 + def method1362: Int = 0 + def method1363: Int = 0 + def method1364: Int = 0 + def method1365: Int = 0 + def method1366: Int = 0 + def method1367: Int = 0 + def method1368: Int = 0 + def method1369: Int = 0 + def method1370: Int = 0 + def method1371: Int = 0 + def method1372: Int = 0 + def method1373: Int = 0 + def method1374: Int = 0 + def method1375: Int = 0 + def method1376: Int = 0 + def method1377: Int = 0 + def method1378: Int = 0 + def method1379: Int = 0 + def method1380: Int = 0 + def method1381: Int = 0 + def method1382: Int = 0 + def method1383: Int = 0 + def method1384: Int = 0 + def method1385: Int = 0 + def method1386: Int = 0 + def method1387: Int = 0 + def method1388: Int = 0 + def method1389: Int = 0 + def method1390: Int = 0 + def method1391: Int = 0 + def method1392: Int = 0 + def method1393: Int = 0 + def method1394: Int = 0 + def method1395: Int = 0 + def method1396: Int = 0 + def method1397: Int = 0 + def method1398: Int = 0 + def method1399: Int = 0 + def method1400: Int = 0 + def method1401: Int = 0 + def method1402: Int = 0 + def method1403: Int = 0 + def method1404: Int = 0 + def method1405: Int = 0 + def method1406: Int = 0 + def method1407: Int = 0 + def method1408: Int = 0 + def method1409: Int = 0 + def method1410: Int = 0 + def method1411: Int = 0 + def method1412: Int = 0 + def method1413: Int = 0 + def method1414: Int = 0 + def method1415: Int = 0 + def method1416: Int = 0 + def method1417: Int = 0 + def method1418: Int = 0 + def method1419: Int = 0 + def method1420: Int = 0 + def method1421: Int = 0 + def method1422: Int = 0 + def method1423: Int = 0 + def method1424: Int = 0 + def method1425: Int = 0 + def method1426: Int = 0 + def method1427: Int = 0 + def method1428: Int = 0 + def method1429: Int = 0 + def method1430: Int = 0 + def method1431: Int = 0 + def method1432: Int = 0 + def method1433: Int = 0 + def method1434: Int = 0 + def method1435: Int = 0 + def method1436: Int = 0 + def method1437: Int = 0 + def method1438: Int = 0 + def method1439: Int = 0 + def method1440: Int = 0 + def method1441: Int = 0 + def method1442: Int = 0 + def method1443: Int = 0 + def method1444: Int = 0 + def method1445: Int = 0 + def method1446: Int = 0 + def method1447: Int = 0 + def method1448: Int = 0 + def method1449: Int = 0 + def method1450: Int = 0 + def method1451: Int = 0 + def method1452: Int = 0 + def method1453: Int = 0 + def method1454: Int = 0 + def method1455: Int = 0 + def method1456: Int = 0 + def method1457: Int = 0 + def method1458: Int = 0 + def method1459: Int = 0 + def method1460: Int = 0 + def method1461: Int = 0 + def method1462: Int = 0 + def method1463: Int = 0 + def method1464: Int = 0 + def method1465: Int = 0 + def method1466: Int = 0 + def method1467: Int = 0 + def method1468: Int = 0 + def method1469: Int = 0 + def method1470: Int = 0 + def method1471: Int = 0 + def method1472: Int = 0 + def method1473: Int = 0 + def method1474: Int = 0 + def method1475: Int = 0 + def method1476: Int = 0 + def method1477: Int = 0 + def method1478: Int = 0 + def method1479: Int = 0 + def method1480: Int = 0 + def method1481: Int = 0 + def method1482: Int = 0 + def method1483: Int = 0 + def method1484: Int = 0 + def method1485: Int = 0 + def method1486: Int = 0 + def method1487: Int = 0 + def method1488: Int = 0 + def method1489: Int = 0 + def method1490: Int = 0 + def method1491: Int = 0 + def method1492: Int = 0 + def method1493: Int = 0 + def method1494: Int = 0 + def method1495: Int = 0 + def method1496: Int = 0 + def method1497: Int = 0 + def method1498: Int = 0 + def method1499: Int = 0 + def method1500: Int = 0 + def method1501: Int = 0 + def method1502: Int = 0 + def method1503: Int = 0 + def method1504: Int = 0 + def method1505: Int = 0 + def method1506: Int = 0 + def method1507: Int = 0 + def method1508: Int = 0 + def method1509: Int = 0 + def method1510: Int = 0 + def method1511: Int = 0 + def method1512: Int = 0 + def method1513: Int = 0 + def method1514: Int = 0 + def method1515: Int = 0 + def method1516: Int = 0 + def method1517: Int = 0 + def method1518: Int = 0 + def method1519: Int = 0 + def method1520: Int = 0 + def method1521: Int = 0 + def method1522: Int = 0 + def method1523: Int = 0 + def method1524: Int = 0 + def method1525: Int = 0 + def method1526: Int = 0 + def method1527: Int = 0 + def method1528: Int = 0 + def method1529: Int = 0 + def method1530: Int = 0 + def method1531: Int = 0 + def method1532: Int = 0 + def method1533: Int = 0 + def method1534: Int = 0 + def method1535: Int = 0 + def method1536: Int = 0 + def method1537: Int = 0 + def method1538: Int = 0 + def method1539: Int = 0 + def method1540: Int = 0 + def method1541: Int = 0 + def method1542: Int = 0 + def method1543: Int = 0 + def method1544: Int = 0 + def method1545: Int = 0 + def method1546: Int = 0 + def method1547: Int = 0 + def method1548: Int = 0 + def method1549: Int = 0 + def method1550: Int = 0 + def method1551: Int = 0 + def method1552: Int = 0 + def method1553: Int = 0 + def method1554: Int = 0 + def method1555: Int = 0 + def method1556: Int = 0 + def method1557: Int = 0 + def method1558: Int = 0 + def method1559: Int = 0 + def method1560: Int = 0 + def method1561: Int = 0 + def method1562: Int = 0 + def method1563: Int = 0 + def method1564: Int = 0 + def method1565: Int = 0 + def method1566: Int = 0 + def method1567: Int = 0 + def method1568: Int = 0 + def method1569: Int = 0 + def method1570: Int = 0 + def method1571: Int = 0 + def method1572: Int = 0 + def method1573: Int = 0 + def method1574: Int = 0 + def method1575: Int = 0 + def method1576: Int = 0 + def method1577: Int = 0 + def method1578: Int = 0 + def method1579: Int = 0 + def method1580: Int = 0 + def method1581: Int = 0 + def method1582: Int = 0 + def method1583: Int = 0 + def method1584: Int = 0 + def method1585: Int = 0 + def method1586: Int = 0 + def method1587: Int = 0 + def method1588: Int = 0 + def method1589: Int = 0 + def method1590: Int = 0 + def method1591: Int = 0 + def method1592: Int = 0 + def method1593: Int = 0 + def method1594: Int = 0 + def method1595: Int = 0 + def method1596: Int = 0 + def method1597: Int = 0 + def method1598: Int = 0 + def method1599: Int = 0 + def method1600: Int = 0 + def method1601: Int = 0 + def method1602: Int = 0 + def method1603: Int = 0 + def method1604: Int = 0 + def method1605: Int = 0 + def method1606: Int = 0 + def method1607: Int = 0 + def method1608: Int = 0 + def method1609: Int = 0 + def method1610: Int = 0 + def method1611: Int = 0 + def method1612: Int = 0 + def method1613: Int = 0 + def method1614: Int = 0 + def method1615: Int = 0 + def method1616: Int = 0 + def method1617: Int = 0 + def method1618: Int = 0 + def method1619: Int = 0 + def method1620: Int = 0 + def method1621: Int = 0 + def method1622: Int = 0 + def method1623: Int = 0 + def method1624: Int = 0 + def method1625: Int = 0 + def method1626: Int = 0 + def method1627: Int = 0 + def method1628: Int = 0 + def method1629: Int = 0 + def method1630: Int = 0 + def method1631: Int = 0 + def method1632: Int = 0 + def method1633: Int = 0 + def method1634: Int = 0 + def method1635: Int = 0 + def method1636: Int = 0 + def method1637: Int = 0 + def method1638: Int = 0 + def method1639: Int = 0 + def method1640: Int = 0 + def method1641: Int = 0 + def method1642: Int = 0 + def method1643: Int = 0 + def method1644: Int = 0 + def method1645: Int = 0 + def method1646: Int = 0 + def method1647: Int = 0 + def method1648: Int = 0 + def method1649: Int = 0 + def method1650: Int = 0 + def method1651: Int = 0 + def method1652: Int = 0 + def method1653: Int = 0 + def method1654: Int = 0 + def method1655: Int = 0 + def method1656: Int = 0 + def method1657: Int = 0 + def method1658: Int = 0 + def method1659: Int = 0 + def method1660: Int = 0 + def method1661: Int = 0 + def method1662: Int = 0 + def method1663: Int = 0 + def method1664: Int = 0 + def method1665: Int = 0 + def method1666: Int = 0 + def method1667: Int = 0 + def method1668: Int = 0 + def method1669: Int = 0 + def method1670: Int = 0 + def method1671: Int = 0 + def method1672: Int = 0 + def method1673: Int = 0 + def method1674: Int = 0 + def method1675: Int = 0 + def method1676: Int = 0 + def method1677: Int = 0 + def method1678: Int = 0 + def method1679: Int = 0 + def method1680: Int = 0 + def method1681: Int = 0 + def method1682: Int = 0 + def method1683: Int = 0 + def method1684: Int = 0 + def method1685: Int = 0 + def method1686: Int = 0 + def method1687: Int = 0 + def method1688: Int = 0 + def method1689: Int = 0 + def method1690: Int = 0 + def method1691: Int = 0 + def method1692: Int = 0 + def method1693: Int = 0 + def method1694: Int = 0 + def method1695: Int = 0 + def method1696: Int = 0 + def method1697: Int = 0 + def method1698: Int = 0 + def method1699: Int = 0 + def method1700: Int = 0 + def method1701: Int = 0 + def method1702: Int = 0 + def method1703: Int = 0 + def method1704: Int = 0 + def method1705: Int = 0 + def method1706: Int = 0 + def method1707: Int = 0 + def method1708: Int = 0 + def method1709: Int = 0 + def method1710: Int = 0 + def method1711: Int = 0 + def method1712: Int = 0 + def method1713: Int = 0 + def method1714: Int = 0 + def method1715: Int = 0 + def method1716: Int = 0 + def method1717: Int = 0 + def method1718: Int = 0 + def method1719: Int = 0 + def method1720: Int = 0 + def method1721: Int = 0 + def method1722: Int = 0 + def method1723: Int = 0 + def method1724: Int = 0 + def method1725: Int = 0 + def method1726: Int = 0 + def method1727: Int = 0 + def method1728: Int = 0 + def method1729: Int = 0 + def method1730: Int = 0 + def method1731: Int = 0 + def method1732: Int = 0 + def method1733: Int = 0 + def method1734: Int = 0 + def method1735: Int = 0 + def method1736: Int = 0 + def method1737: Int = 0 + def method1738: Int = 0 + def method1739: Int = 0 + def method1740: Int = 0 + def method1741: Int = 0 + def method1742: Int = 0 + def method1743: Int = 0 + def method1744: Int = 0 + def method1745: Int = 0 + def method1746: Int = 0 + def method1747: Int = 0 + def method1748: Int = 0 + def method1749: Int = 0 + def method1750: Int = 0 + def method1751: Int = 0 + def method1752: Int = 0 + def method1753: Int = 0 + def method1754: Int = 0 + def method1755: Int = 0 + def method1756: Int = 0 + def method1757: Int = 0 + def method1758: Int = 0 + def method1759: Int = 0 + def method1760: Int = 0 + def method1761: Int = 0 + def method1762: Int = 0 + def method1763: Int = 0 + def method1764: Int = 0 + def method1765: Int = 0 + def method1766: Int = 0 + def method1767: Int = 0 + def method1768: Int = 0 + def method1769: Int = 0 + def method1770: Int = 0 + def method1771: Int = 0 + def method1772: Int = 0 + def method1773: Int = 0 + def method1774: Int = 0 + def method1775: Int = 0 + def method1776: Int = 0 + def method1777: Int = 0 + def method1778: Int = 0 + def method1779: Int = 0 + def method1780: Int = 0 + def method1781: Int = 0 + def method1782: Int = 0 + def method1783: Int = 0 + def method1784: Int = 0 + def method1785: Int = 0 + def method1786: Int = 0 + def method1787: Int = 0 + def method1788: Int = 0 + def method1789: Int = 0 + def method1790: Int = 0 + def method1791: Int = 0 + def method1792: Int = 0 + def method1793: Int = 0 + def method1794: Int = 0 + def method1795: Int = 0 + def method1796: Int = 0 + def method1797: Int = 0 + def method1798: Int = 0 + def method1799: Int = 0 + def method1800: Int = 0 + def method1801: Int = 0 + def method1802: Int = 0 + def method1803: Int = 0 + def method1804: Int = 0 + def method1805: Int = 0 + def method1806: Int = 0 + def method1807: Int = 0 + def method1808: Int = 0 + def method1809: Int = 0 + def method1810: Int = 0 + def method1811: Int = 0 + def method1812: Int = 0 + def method1813: Int = 0 + def method1814: Int = 0 + def method1815: Int = 0 + def method1816: Int = 0 + def method1817: Int = 0 + def method1818: Int = 0 + def method1819: Int = 0 + def method1820: Int = 0 + def method1821: Int = 0 + def method1822: Int = 0 + def method1823: Int = 0 + def method1824: Int = 0 + def method1825: Int = 0 + def method1826: Int = 0 + def method1827: Int = 0 + def method1828: Int = 0 + def method1829: Int = 0 + def method1830: Int = 0 + def method1831: Int = 0 + def method1832: Int = 0 + def method1833: Int = 0 + def method1834: Int = 0 + def method1835: Int = 0 + def method1836: Int = 0 + def method1837: Int = 0 + def method1838: Int = 0 + def method1839: Int = 0 + def method1840: Int = 0 + def method1841: Int = 0 + def method1842: Int = 0 + def method1843: Int = 0 + def method1844: Int = 0 + def method1845: Int = 0 + def method1846: Int = 0 + def method1847: Int = 0 + def method1848: Int = 0 + def method1849: Int = 0 + def method1850: Int = 0 + def method1851: Int = 0 + def method1852: Int = 0 + def method1853: Int = 0 + def method1854: Int = 0 + def method1855: Int = 0 + def method1856: Int = 0 + def method1857: Int = 0 + def method1858: Int = 0 + def method1859: Int = 0 + def method1860: Int = 0 + def method1861: Int = 0 + def method1862: Int = 0 + def method1863: Int = 0 + def method1864: Int = 0 + def method1865: Int = 0 + def method1866: Int = 0 + def method1867: Int = 0 + def method1868: Int = 0 + def method1869: Int = 0 + def method1870: Int = 0 + def method1871: Int = 0 + def method1872: Int = 0 + def method1873: Int = 0 + def method1874: Int = 0 + def method1875: Int = 0 + def method1876: Int = 0 + def method1877: Int = 0 + def method1878: Int = 0 + def method1879: Int = 0 + def method1880: Int = 0 + def method1881: Int = 0 + def method1882: Int = 0 + def method1883: Int = 0 + def method1884: Int = 0 + def method1885: Int = 0 + def method1886: Int = 0 + def method1887: Int = 0 + def method1888: Int = 0 + def method1889: Int = 0 + def method1890: Int = 0 + def method1891: Int = 0 + def method1892: Int = 0 + def method1893: Int = 0 + def method1894: Int = 0 + def method1895: Int = 0 + def method1896: Int = 0 + def method1897: Int = 0 + def method1898: Int = 0 + def method1899: Int = 0 + def method1900: Int = 0 + def method1901: Int = 0 + def method1902: Int = 0 + def method1903: Int = 0 + def method1904: Int = 0 + def method1905: Int = 0 + def method1906: Int = 0 + def method1907: Int = 0 + def method1908: Int = 0 + def method1909: Int = 0 + def method1910: Int = 0 + def method1911: Int = 0 + def method1912: Int = 0 + def method1913: Int = 0 + def method1914: Int = 0 + def method1915: Int = 0 + def method1916: Int = 0 + def method1917: Int = 0 + def method1918: Int = 0 + def method1919: Int = 0 + def method1920: Int = 0 + def method1921: Int = 0 + def method1922: Int = 0 + def method1923: Int = 0 + def method1924: Int = 0 + def method1925: Int = 0 + def method1926: Int = 0 + def method1927: Int = 0 + def method1928: Int = 0 + def method1929: Int = 0 + def method1930: Int = 0 + def method1931: Int = 0 + def method1932: Int = 0 + def method1933: Int = 0 + def method1934: Int = 0 + def method1935: Int = 0 + def method1936: Int = 0 + def method1937: Int = 0 + def method1938: Int = 0 + def method1939: Int = 0 + def method1940: Int = 0 + def method1941: Int = 0 + def method1942: Int = 0 + def method1943: Int = 0 + def method1944: Int = 0 + def method1945: Int = 0 + def method1946: Int = 0 + def method1947: Int = 0 + def method1948: Int = 0 + def method1949: Int = 0 + def method1950: Int = 0 + def method1951: Int = 0 + def method1952: Int = 0 + def method1953: Int = 0 + def method1954: Int = 0 + def method1955: Int = 0 + def method1956: Int = 0 + def method1957: Int = 0 + def method1958: Int = 0 + def method1959: Int = 0 + def method1960: Int = 0 + def method1961: Int = 0 + def method1962: Int = 0 + def method1963: Int = 0 + def method1964: Int = 0 + def method1965: Int = 0 + def method1966: Int = 0 + def method1967: Int = 0 + def method1968: Int = 0 + def method1969: Int = 0 + def method1970: Int = 0 + def method1971: Int = 0 + def method1972: Int = 0 + def method1973: Int = 0 + def method1974: Int = 0 + def method1975: Int = 0 + def method1976: Int = 0 + def method1977: Int = 0 + def method1978: Int = 0 + def method1979: Int = 0 + def method1980: Int = 0 + def method1981: Int = 0 + def method1982: Int = 0 + def method1983: Int = 0 + def method1984: Int = 0 + def method1985: Int = 0 + def method1986: Int = 0 + def method1987: Int = 0 + def method1988: Int = 0 + def method1989: Int = 0 + def method1990: Int = 0 + def method1991: Int = 0 + def method1992: Int = 0 + def method1993: Int = 0 + def method1994: Int = 0 + def method1995: Int = 0 + def method1996: Int = 0 + def method1997: Int = 0 + def method1998: Int = 0 + def method1999: Int = 0 + def method2000: Int = 0 + def method2001: Int = 0 + def method2002: Int = 0 + def method2003: Int = 0 + def method2004: Int = 0 + def method2005: Int = 0 + def method2006: Int = 0 + def method2007: Int = 0 + def method2008: Int = 0 + def method2009: Int = 0 + def method2010: Int = 0 + def method2011: Int = 0 + def method2012: Int = 0 + def method2013: Int = 0 + def method2014: Int = 0 + def method2015: Int = 0 + def method2016: Int = 0 + def method2017: Int = 0 + def method2018: Int = 0 + def method2019: Int = 0 + def method2020: Int = 0 + def method2021: Int = 0 + def method2022: Int = 0 + def method2023: Int = 0 + def method2024: Int = 0 + def method2025: Int = 0 + def method2026: Int = 0 + def method2027: Int = 0 + def method2028: Int = 0 + def method2029: Int = 0 + def method2030: Int = 0 + def method2031: Int = 0 + def method2032: Int = 0 + def method2033: Int = 0 + def method2034: Int = 0 + def method2035: Int = 0 + def method2036: Int = 0 + def method2037: Int = 0 + def method2038: Int = 0 + def method2039: Int = 0 + def method2040: Int = 0 + def method2041: Int = 0 + def method2042: Int = 0 + def method2043: Int = 0 + def method2044: Int = 0 + def method2045: Int = 0 + def method2046: Int = 0 + def method2047: Int = 0 + def method2048: Int = 0 + def method2049: Int = 0 + def method2050: Int = 0 + def method2051: Int = 0 + def method2052: Int = 0 + def method2053: Int = 0 + def method2054: Int = 0 + def method2055: Int = 0 + def method2056: Int = 0 + def method2057: Int = 0 + def method2058: Int = 0 + def method2059: Int = 0 + def method2060: Int = 0 + def method2061: Int = 0 + def method2062: Int = 0 + def method2063: Int = 0 + def method2064: Int = 0 + def method2065: Int = 0 + def method2066: Int = 0 + def method2067: Int = 0 + def method2068: Int = 0 + def method2069: Int = 0 + def method2070: Int = 0 + def method2071: Int = 0 + def method2072: Int = 0 + def method2073: Int = 0 + def method2074: Int = 0 + def method2075: Int = 0 + def method2076: Int = 0 + def method2077: Int = 0 + def method2078: Int = 0 + def method2079: Int = 0 + def method2080: Int = 0 + def method2081: Int = 0 + def method2082: Int = 0 + def method2083: Int = 0 + def method2084: Int = 0 + def method2085: Int = 0 + def method2086: Int = 0 + def method2087: Int = 0 + def method2088: Int = 0 + def method2089: Int = 0 + def method2090: Int = 0 + def method2091: Int = 0 + def method2092: Int = 0 + def method2093: Int = 0 + def method2094: Int = 0 + def method2095: Int = 0 + def method2096: Int = 0 + def method2097: Int = 0 + def method2098: Int = 0 + def method2099: Int = 0 + def method2100: Int = 0 + def method2101: Int = 0 + def method2102: Int = 0 + def method2103: Int = 0 + def method2104: Int = 0 + def method2105: Int = 0 + def method2106: Int = 0 + def method2107: Int = 0 + def method2108: Int = 0 + def method2109: Int = 0 + def method2110: Int = 0 + def method2111: Int = 0 + def method2112: Int = 0 + def method2113: Int = 0 + def method2114: Int = 0 + def method2115: Int = 0 + def method2116: Int = 0 + def method2117: Int = 0 + def method2118: Int = 0 + def method2119: Int = 0 + def method2120: Int = 0 + def method2121: Int = 0 + def method2122: Int = 0 + def method2123: Int = 0 + def method2124: Int = 0 + def method2125: Int = 0 + def method2126: Int = 0 + def method2127: Int = 0 + def method2128: Int = 0 + def method2129: Int = 0 + def method2130: Int = 0 + def method2131: Int = 0 + def method2132: Int = 0 + def method2133: Int = 0 + def method2134: Int = 0 + def method2135: Int = 0 + def method2136: Int = 0 + def method2137: Int = 0 + def method2138: Int = 0 + def method2139: Int = 0 + def method2140: Int = 0 + def method2141: Int = 0 + def method2142: Int = 0 + def method2143: Int = 0 + def method2144: Int = 0 + def method2145: Int = 0 + def method2146: Int = 0 + def method2147: Int = 0 + def method2148: Int = 0 + def method2149: Int = 0 + def method2150: Int = 0 + def method2151: Int = 0 + def method2152: Int = 0 + def method2153: Int = 0 + def method2154: Int = 0 + def method2155: Int = 0 + def method2156: Int = 0 + def method2157: Int = 0 + def method2158: Int = 0 + def method2159: Int = 0 + def method2160: Int = 0 + def method2161: Int = 0 + def method2162: Int = 0 + def method2163: Int = 0 + def method2164: Int = 0 + def method2165: Int = 0 + def method2166: Int = 0 + def method2167: Int = 0 + def method2168: Int = 0 + def method2169: Int = 0 + def method2170: Int = 0 + def method2171: Int = 0 + def method2172: Int = 0 + def method2173: Int = 0 + def method2174: Int = 0 + def method2175: Int = 0 + def method2176: Int = 0 + def method2177: Int = 0 + def method2178: Int = 0 + def method2179: Int = 0 + def method2180: Int = 0 + def method2181: Int = 0 + def method2182: Int = 0 + def method2183: Int = 0 + def method2184: Int = 0 + def method2185: Int = 0 + def method2186: Int = 0 + def method2187: Int = 0 + def method2188: Int = 0 + def method2189: Int = 0 + def method2190: Int = 0 + def method2191: Int = 0 + def method2192: Int = 0 + def method2193: Int = 0 + def method2194: Int = 0 + def method2195: Int = 0 + def method2196: Int = 0 + def method2197: Int = 0 + def method2198: Int = 0 + def method2199: Int = 0 + def method2200: Int = 0 + def method2201: Int = 0 + def method2202: Int = 0 + def method2203: Int = 0 + def method2204: Int = 0 + def method2205: Int = 0 + def method2206: Int = 0 + def method2207: Int = 0 + def method2208: Int = 0 + def method2209: Int = 0 + def method2210: Int = 0 + def method2211: Int = 0 + def method2212: Int = 0 + def method2213: Int = 0 + def method2214: Int = 0 + def method2215: Int = 0 + def method2216: Int = 0 + def method2217: Int = 0 + def method2218: Int = 0 + def method2219: Int = 0 + def method2220: Int = 0 + def method2221: Int = 0 + def method2222: Int = 0 + def method2223: Int = 0 + def method2224: Int = 0 + def method2225: Int = 0 + def method2226: Int = 0 + def method2227: Int = 0 + def method2228: Int = 0 + def method2229: Int = 0 + def method2230: Int = 0 + def method2231: Int = 0 + def method2232: Int = 0 + def method2233: Int = 0 + def method2234: Int = 0 + def method2235: Int = 0 + def method2236: Int = 0 + def method2237: Int = 0 + def method2238: Int = 0 + def method2239: Int = 0 + def method2240: Int = 0 + def method2241: Int = 0 + def method2242: Int = 0 + def method2243: Int = 0 + def method2244: Int = 0 + def method2245: Int = 0 + def method2246: Int = 0 + def method2247: Int = 0 + def method2248: Int = 0 + def method2249: Int = 0 + def method2250: Int = 0 + def method2251: Int = 0 + def method2252: Int = 0 + def method2253: Int = 0 + def method2254: Int = 0 + def method2255: Int = 0 + def method2256: Int = 0 + def method2257: Int = 0 + def method2258: Int = 0 + def method2259: Int = 0 + def method2260: Int = 0 + def method2261: Int = 0 + def method2262: Int = 0 + def method2263: Int = 0 + def method2264: Int = 0 + def method2265: Int = 0 + def method2266: Int = 0 + def method2267: Int = 0 + def method2268: Int = 0 + def method2269: Int = 0 + def method2270: Int = 0 + def method2271: Int = 0 + def method2272: Int = 0 + def method2273: Int = 0 + def method2274: Int = 0 + def method2275: Int = 0 + def method2276: Int = 0 + def method2277: Int = 0 + def method2278: Int = 0 + def method2279: Int = 0 + def method2280: Int = 0 + def method2281: Int = 0 + def method2282: Int = 0 + def method2283: Int = 0 + def method2284: Int = 0 + def method2285: Int = 0 + def method2286: Int = 0 + def method2287: Int = 0 + def method2288: Int = 0 + def method2289: Int = 0 + def method2290: Int = 0 + def method2291: Int = 0 + def method2292: Int = 0 + def method2293: Int = 0 + def method2294: Int = 0 + def method2295: Int = 0 + def method2296: Int = 0 + def method2297: Int = 0 + def method2298: Int = 0 + def method2299: Int = 0 + def method2300: Int = 0 + def method2301: Int = 0 + def method2302: Int = 0 + def method2303: Int = 0 + def method2304: Int = 0 + def method2305: Int = 0 + def method2306: Int = 0 + def method2307: Int = 0 + def method2308: Int = 0 + def method2309: Int = 0 + def method2310: Int = 0 + def method2311: Int = 0 + def method2312: Int = 0 + def method2313: Int = 0 + def method2314: Int = 0 + def method2315: Int = 0 + def method2316: Int = 0 + def method2317: Int = 0 + def method2318: Int = 0 + def method2319: Int = 0 + def method2320: Int = 0 + def method2321: Int = 0 + def method2322: Int = 0 + def method2323: Int = 0 + def method2324: Int = 0 + def method2325: Int = 0 + def method2326: Int = 0 + def method2327: Int = 0 + def method2328: Int = 0 + def method2329: Int = 0 + def method2330: Int = 0 + def method2331: Int = 0 + def method2332: Int = 0 + def method2333: Int = 0 + def method2334: Int = 0 + def method2335: Int = 0 + def method2336: Int = 0 + def method2337: Int = 0 + def method2338: Int = 0 + def method2339: Int = 0 + def method2340: Int = 0 + def method2341: Int = 0 + def method2342: Int = 0 + def method2343: Int = 0 + def method2344: Int = 0 + def method2345: Int = 0 + def method2346: Int = 0 + def method2347: Int = 0 + def method2348: Int = 0 + def method2349: Int = 0 + def method2350: Int = 0 + def method2351: Int = 0 + def method2352: Int = 0 + def method2353: Int = 0 + def method2354: Int = 0 + def method2355: Int = 0 + def method2356: Int = 0 + def method2357: Int = 0 + def method2358: Int = 0 + def method2359: Int = 0 + def method2360: Int = 0 + def method2361: Int = 0 + def method2362: Int = 0 + def method2363: Int = 0 + def method2364: Int = 0 + def method2365: Int = 0 + def method2366: Int = 0 + def method2367: Int = 0 + def method2368: Int = 0 + def method2369: Int = 0 + def method2370: Int = 0 + def method2371: Int = 0 + def method2372: Int = 0 + def method2373: Int = 0 + def method2374: Int = 0 + def method2375: Int = 0 + def method2376: Int = 0 + def method2377: Int = 0 + def method2378: Int = 0 + def method2379: Int = 0 + def method2380: Int = 0 + def method2381: Int = 0 + def method2382: Int = 0 + def method2383: Int = 0 + def method2384: Int = 0 + def method2385: Int = 0 + def method2386: Int = 0 + def method2387: Int = 0 + def method2388: Int = 0 + def method2389: Int = 0 + def method2390: Int = 0 + def method2391: Int = 0 + def method2392: Int = 0 + def method2393: Int = 0 + def method2394: Int = 0 + def method2395: Int = 0 + def method2396: Int = 0 + def method2397: Int = 0 + def method2398: Int = 0 + def method2399: Int = 0 + def method2400: Int = 0 + def method2401: Int = 0 + def method2402: Int = 0 + def method2403: Int = 0 + def method2404: Int = 0 + def method2405: Int = 0 + def method2406: Int = 0 + def method2407: Int = 0 + def method2408: Int = 0 + def method2409: Int = 0 + def method2410: Int = 0 + def method2411: Int = 0 + def method2412: Int = 0 + def method2413: Int = 0 + def method2414: Int = 0 + def method2415: Int = 0 + def method2416: Int = 0 + def method2417: Int = 0 + def method2418: Int = 0 + def method2419: Int = 0 + def method2420: Int = 0 + def method2421: Int = 0 + def method2422: Int = 0 + def method2423: Int = 0 + def method2424: Int = 0 + def method2425: Int = 0 + def method2426: Int = 0 + def method2427: Int = 0 + def method2428: Int = 0 + def method2429: Int = 0 + def method2430: Int = 0 + def method2431: Int = 0 + def method2432: Int = 0 + def method2433: Int = 0 + def method2434: Int = 0 + def method2435: Int = 0 + def method2436: Int = 0 + def method2437: Int = 0 + def method2438: Int = 0 + def method2439: Int = 0 + def method2440: Int = 0 + def method2441: Int = 0 + def method2442: Int = 0 + def method2443: Int = 0 + def method2444: Int = 0 + def method2445: Int = 0 + def method2446: Int = 0 + def method2447: Int = 0 + def method2448: Int = 0 + def method2449: Int = 0 + def method2450: Int = 0 + def method2451: Int = 0 + def method2452: Int = 0 + def method2453: Int = 0 + def method2454: Int = 0 + def method2455: Int = 0 + def method2456: Int = 0 + def method2457: Int = 0 + def method2458: Int = 0 + def method2459: Int = 0 + def method2460: Int = 0 + def method2461: Int = 0 + def method2462: Int = 0 + def method2463: Int = 0 + def method2464: Int = 0 + def method2465: Int = 0 + def method2466: Int = 0 + def method2467: Int = 0 + def method2468: Int = 0 + def method2469: Int = 0 + def method2470: Int = 0 + def method2471: Int = 0 + def method2472: Int = 0 + def method2473: Int = 0 + def method2474: Int = 0 + def method2475: Int = 0 + def method2476: Int = 0 + def method2477: Int = 0 + def method2478: Int = 0 + def method2479: Int = 0 + def method2480: Int = 0 + def method2481: Int = 0 + def method2482: Int = 0 + def method2483: Int = 0 + def method2484: Int = 0 + def method2485: Int = 0 + def method2486: Int = 0 + def method2487: Int = 0 + def method2488: Int = 0 + def method2489: Int = 0 + def method2490: Int = 0 + def method2491: Int = 0 + def method2492: Int = 0 + def method2493: Int = 0 + def method2494: Int = 0 + def method2495: Int = 0 + def method2496: Int = 0 + def method2497: Int = 0 + def method2498: Int = 0 + def method2499: Int = 0 + def method2500: Int = 0 + def method2501: Int = 0 + def method2502: Int = 0 + def method2503: Int = 0 + def method2504: Int = 0 + def method2505: Int = 0 + def method2506: Int = 0 + def method2507: Int = 0 + def method2508: Int = 0 + def method2509: Int = 0 + def method2510: Int = 0 + def method2511: Int = 0 + def method2512: Int = 0 + def method2513: Int = 0 + def method2514: Int = 0 + def method2515: Int = 0 + def method2516: Int = 0 + def method2517: Int = 0 + def method2518: Int = 0 + def method2519: Int = 0 + def method2520: Int = 0 + def method2521: Int = 0 + def method2522: Int = 0 + def method2523: Int = 0 + def method2524: Int = 0 + def method2525: Int = 0 + def method2526: Int = 0 + def method2527: Int = 0 + def method2528: Int = 0 + def method2529: Int = 0 + def method2530: Int = 0 + def method2531: Int = 0 + def method2532: Int = 0 + def method2533: Int = 0 + def method2534: Int = 0 + def method2535: Int = 0 + def method2536: Int = 0 + def method2537: Int = 0 + def method2538: Int = 0 + def method2539: Int = 0 + def method2540: Int = 0 + def method2541: Int = 0 + def method2542: Int = 0 + def method2543: Int = 0 + def method2544: Int = 0 + def method2545: Int = 0 + def method2546: Int = 0 + def method2547: Int = 0 + def method2548: Int = 0 + def method2549: Int = 0 + def method2550: Int = 0 + def method2551: Int = 0 + def method2552: Int = 0 + def method2553: Int = 0 + def method2554: Int = 0 + def method2555: Int = 0 + def method2556: Int = 0 + def method2557: Int = 0 + def method2558: Int = 0 + def method2559: Int = 0 + def method2560: Int = 0 + def method2561: Int = 0 + def method2562: Int = 0 + def method2563: Int = 0 + def method2564: Int = 0 + def method2565: Int = 0 + def method2566: Int = 0 + def method2567: Int = 0 + def method2568: Int = 0 + def method2569: Int = 0 + def method2570: Int = 0 + def method2571: Int = 0 + def method2572: Int = 0 + def method2573: Int = 0 + def method2574: Int = 0 + def method2575: Int = 0 + def method2576: Int = 0 + def method2577: Int = 0 + def method2578: Int = 0 + def method2579: Int = 0 + def method2580: Int = 0 + def method2581: Int = 0 + def method2582: Int = 0 + def method2583: Int = 0 + def method2584: Int = 0 + def method2585: Int = 0 + def method2586: Int = 0 + def method2587: Int = 0 + def method2588: Int = 0 + def method2589: Int = 0 + def method2590: Int = 0 + def method2591: Int = 0 + def method2592: Int = 0 + def method2593: Int = 0 + def method2594: Int = 0 + def method2595: Int = 0 + def method2596: Int = 0 + def method2597: Int = 0 + def method2598: Int = 0 + def method2599: Int = 0 + def method2600: Int = 0 + def method2601: Int = 0 + def method2602: Int = 0 + def method2603: Int = 0 + def method2604: Int = 0 + def method2605: Int = 0 + def method2606: Int = 0 + def method2607: Int = 0 + def method2608: Int = 0 + def method2609: Int = 0 + def method2610: Int = 0 + def method2611: Int = 0 + def method2612: Int = 0 + def method2613: Int = 0 + def method2614: Int = 0 + def method2615: Int = 0 + def method2616: Int = 0 + def method2617: Int = 0 + def method2618: Int = 0 + def method2619: Int = 0 + def method2620: Int = 0 + def method2621: Int = 0 + def method2622: Int = 0 + def method2623: Int = 0 + def method2624: Int = 0 + def method2625: Int = 0 + def method2626: Int = 0 + def method2627: Int = 0 + def method2628: Int = 0 + def method2629: Int = 0 + def method2630: Int = 0 + def method2631: Int = 0 + def method2632: Int = 0 + def method2633: Int = 0 + def method2634: Int = 0 + def method2635: Int = 0 + def method2636: Int = 0 + def method2637: Int = 0 + def method2638: Int = 0 + def method2639: Int = 0 + def method2640: Int = 0 + def method2641: Int = 0 + def method2642: Int = 0 + def method2643: Int = 0 + def method2644: Int = 0 + def method2645: Int = 0 + def method2646: Int = 0 + def method2647: Int = 0 + def method2648: Int = 0 + def method2649: Int = 0 + def method2650: Int = 0 + def method2651: Int = 0 + def method2652: Int = 0 + def method2653: Int = 0 + def method2654: Int = 0 + def method2655: Int = 0 + def method2656: Int = 0 + def method2657: Int = 0 + def method2658: Int = 0 + def method2659: Int = 0 + def method2660: Int = 0 + def method2661: Int = 0 + def method2662: Int = 0 + def method2663: Int = 0 + def method2664: Int = 0 + def method2665: Int = 0 + def method2666: Int = 0 + def method2667: Int = 0 + def method2668: Int = 0 + def method2669: Int = 0 + def method2670: Int = 0 + def method2671: Int = 0 + def method2672: Int = 0 + def method2673: Int = 0 + def method2674: Int = 0 + def method2675: Int = 0 + def method2676: Int = 0 + def method2677: Int = 0 + def method2678: Int = 0 + def method2679: Int = 0 + def method2680: Int = 0 + def method2681: Int = 0 + def method2682: Int = 0 + def method2683: Int = 0 + def method2684: Int = 0 + def method2685: Int = 0 + def method2686: Int = 0 + def method2687: Int = 0 + def method2688: Int = 0 + def method2689: Int = 0 + def method2690: Int = 0 + def method2691: Int = 0 + def method2692: Int = 0 + def method2693: Int = 0 + def method2694: Int = 0 + def method2695: Int = 0 + def method2696: Int = 0 + def method2697: Int = 0 + def method2698: Int = 0 + def method2699: Int = 0 + def method2700: Int = 0 + def method2701: Int = 0 + def method2702: Int = 0 + def method2703: Int = 0 + def method2704: Int = 0 + def method2705: Int = 0 + def method2706: Int = 0 + def method2707: Int = 0 + def method2708: Int = 0 + def method2709: Int = 0 + def method2710: Int = 0 + def method2711: Int = 0 + def method2712: Int = 0 + def method2713: Int = 0 + def method2714: Int = 0 + def method2715: Int = 0 + def method2716: Int = 0 + def method2717: Int = 0 + def method2718: Int = 0 + def method2719: Int = 0 + def method2720: Int = 0 + def method2721: Int = 0 + def method2722: Int = 0 + def method2723: Int = 0 + def method2724: Int = 0 + def method2725: Int = 0 + def method2726: Int = 0 + def method2727: Int = 0 + def method2728: Int = 0 + def method2729: Int = 0 + def method2730: Int = 0 + def method2731: Int = 0 + def method2732: Int = 0 + def method2733: Int = 0 + def method2734: Int = 0 + def method2735: Int = 0 + def method2736: Int = 0 + def method2737: Int = 0 + def method2738: Int = 0 + def method2739: Int = 0 + def method2740: Int = 0 + def method2741: Int = 0 + def method2742: Int = 0 + def method2743: Int = 0 + def method2744: Int = 0 + def method2745: Int = 0 + def method2746: Int = 0 + def method2747: Int = 0 + def method2748: Int = 0 + def method2749: Int = 0 + def method2750: Int = 0 + def method2751: Int = 0 + def method2752: Int = 0 + def method2753: Int = 0 + def method2754: Int = 0 + def method2755: Int = 0 + def method2756: Int = 0 + def method2757: Int = 0 + def method2758: Int = 0 + def method2759: Int = 0 + def method2760: Int = 0 + def method2761: Int = 0 + def method2762: Int = 0 + def method2763: Int = 0 + def method2764: Int = 0 + def method2765: Int = 0 + def method2766: Int = 0 + def method2767: Int = 0 + def method2768: Int = 0 + def method2769: Int = 0 + def method2770: Int = 0 + def method2771: Int = 0 + def method2772: Int = 0 + def method2773: Int = 0 + def method2774: Int = 0 + def method2775: Int = 0 + def method2776: Int = 0 + def method2777: Int = 0 + def method2778: Int = 0 + def method2779: Int = 0 + def method2780: Int = 0 + def method2781: Int = 0 + def method2782: Int = 0 + def method2783: Int = 0 + def method2784: Int = 0 + def method2785: Int = 0 + def method2786: Int = 0 + def method2787: Int = 0 + def method2788: Int = 0 + def method2789: Int = 0 + def method2790: Int = 0 + def method2791: Int = 0 + def method2792: Int = 0 + def method2793: Int = 0 + def method2794: Int = 0 + def method2795: Int = 0 + def method2796: Int = 0 + def method2797: Int = 0 + def method2798: Int = 0 + def method2799: Int = 0 + def method2800: Int = 0 + def method2801: Int = 0 + def method2802: Int = 0 + def method2803: Int = 0 + def method2804: Int = 0 + def method2805: Int = 0 + def method2806: Int = 0 + def method2807: Int = 0 + def method2808: Int = 0 + def method2809: Int = 0 + def method2810: Int = 0 + def method2811: Int = 0 + def method2812: Int = 0 + def method2813: Int = 0 + def method2814: Int = 0 + def method2815: Int = 0 + def method2816: Int = 0 + def method2817: Int = 0 + def method2818: Int = 0 + def method2819: Int = 0 + def method2820: Int = 0 + def method2821: Int = 0 + def method2822: Int = 0 + def method2823: Int = 0 + def method2824: Int = 0 + def method2825: Int = 0 + def method2826: Int = 0 + def method2827: Int = 0 + def method2828: Int = 0 + def method2829: Int = 0 + def method2830: Int = 0 + def method2831: Int = 0 + def method2832: Int = 0 + def method2833: Int = 0 + def method2834: Int = 0 + def method2835: Int = 0 + def method2836: Int = 0 + def method2837: Int = 0 + def method2838: Int = 0 + def method2839: Int = 0 + def method2840: Int = 0 + def method2841: Int = 0 + def method2842: Int = 0 + def method2843: Int = 0 + def method2844: Int = 0 + def method2845: Int = 0 + def method2846: Int = 0 + def method2847: Int = 0 + def method2848: Int = 0 + def method2849: Int = 0 + def method2850: Int = 0 + def method2851: Int = 0 + def method2852: Int = 0 + def method2853: Int = 0 + def method2854: Int = 0 + def method2855: Int = 0 + def method2856: Int = 0 + def method2857: Int = 0 + def method2858: Int = 0 + def method2859: Int = 0 + def method2860: Int = 0 + def method2861: Int = 0 + def method2862: Int = 0 + def method2863: Int = 0 + def method2864: Int = 0 + def method2865: Int = 0 + def method2866: Int = 0 + def method2867: Int = 0 + def method2868: Int = 0 + def method2869: Int = 0 + def method2870: Int = 0 + def method2871: Int = 0 + def method2872: Int = 0 + def method2873: Int = 0 + def method2874: Int = 0 + def method2875: Int = 0 + def method2876: Int = 0 + def method2877: Int = 0 + def method2878: Int = 0 + def method2879: Int = 0 + def method2880: Int = 0 + def method2881: Int = 0 + def method2882: Int = 0 + def method2883: Int = 0 + def method2884: Int = 0 + def method2885: Int = 0 + def method2886: Int = 0 + def method2887: Int = 0 + def method2888: Int = 0 + def method2889: Int = 0 + def method2890: Int = 0 + def method2891: Int = 0 + def method2892: Int = 0 + def method2893: Int = 0 + def method2894: Int = 0 + def method2895: Int = 0 + def method2896: Int = 0 + def method2897: Int = 0 + def method2898: Int = 0 + def method2899: Int = 0 + def method2900: Int = 0 + def method2901: Int = 0 + def method2902: Int = 0 + def method2903: Int = 0 + def method2904: Int = 0 + def method2905: Int = 0 + def method2906: Int = 0 + def method2907: Int = 0 + def method2908: Int = 0 + def method2909: Int = 0 + def method2910: Int = 0 + def method2911: Int = 0 + def method2912: Int = 0 + def method2913: Int = 0 + def method2914: Int = 0 + def method2915: Int = 0 + def method2916: Int = 0 + def method2917: Int = 0 + def method2918: Int = 0 + def method2919: Int = 0 + def method2920: Int = 0 + def method2921: Int = 0 + def method2922: Int = 0 + def method2923: Int = 0 + def method2924: Int = 0 + def method2925: Int = 0 + def method2926: Int = 0 + def method2927: Int = 0 + def method2928: Int = 0 + def method2929: Int = 0 + def method2930: Int = 0 + def method2931: Int = 0 + def method2932: Int = 0 + def method2933: Int = 0 + def method2934: Int = 0 + def method2935: Int = 0 + def method2936: Int = 0 + def method2937: Int = 0 + def method2938: Int = 0 + def method2939: Int = 0 + def method2940: Int = 0 + def method2941: Int = 0 + def method2942: Int = 0 + def method2943: Int = 0 + def method2944: Int = 0 + def method2945: Int = 0 + def method2946: Int = 0 + def method2947: Int = 0 + def method2948: Int = 0 + def method2949: Int = 0 + def method2950: Int = 0 + def method2951: Int = 0 + def method2952: Int = 0 + def method2953: Int = 0 + def method2954: Int = 0 + def method2955: Int = 0 + def method2956: Int = 0 + def method2957: Int = 0 + def method2958: Int = 0 + def method2959: Int = 0 + def method2960: Int = 0 + def method2961: Int = 0 + def method2962: Int = 0 + def method2963: Int = 0 + def method2964: Int = 0 + def method2965: Int = 0 + def method2966: Int = 0 + def method2967: Int = 0 + def method2968: Int = 0 + def method2969: Int = 0 + def method2970: Int = 0 + def method2971: Int = 0 + def method2972: Int = 0 + def method2973: Int = 0 + def method2974: Int = 0 + def method2975: Int = 0 + def method2976: Int = 0 + def method2977: Int = 0 + def method2978: Int = 0 + def method2979: Int = 0 + def method2980: Int = 0 + def method2981: Int = 0 + def method2982: Int = 0 + def method2983: Int = 0 + def method2984: Int = 0 + def method2985: Int = 0 + def method2986: Int = 0 + def method2987: Int = 0 + def method2988: Int = 0 + def method2989: Int = 0 + def method2990: Int = 0 + def method2991: Int = 0 + def method2992: Int = 0 + def method2993: Int = 0 + def method2994: Int = 0 + def method2995: Int = 0 + def method2996: Int = 0 + def method2997: Int = 0 + def method2998: Int = 0 + def method2999: Int = 0 +} diff --git a/tests/pending/run/t7558.scala b/tests/pending/run/t7558.scala new file mode 100644 index 000000000000..26163555f0ba --- /dev/null +++ b/tests/pending/run/t7558.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + val cm = reflect.runtime.currentMirror + val u = cm.universe + import scala.tools.reflect.ToolBox + val tb = cm.mkToolBox() + val t = { var x = "ab".toList; u.reify { x = x.reverse; x }.tree } + val evaluated = tb.eval(t) + assert(evaluated == "ba".toList, evaluated) +} diff --git a/tests/pending/run/t7569.check b/tests/pending/run/t7569.check new file mode 100644 index 000000000000..98513c3ab209 --- /dev/null +++ b/tests/pending/run/t7569.check @@ -0,0 +1,12 @@ +source-newSource1.scala,line-3,offset=49 A.this.one +source-newSource1.scala,line-3,offset=49 A.this +source-newSource1.scala,line-4,offset=67 A.super.() +source-newSource1.scala,line-4,offset=67 A.super. +source-newSource1.scala,line-4,offset=67 this +source-newSource1.scala,line-3,offset=49 A.this.one +source-newSource1.scala,line-3,offset=49 A.this +RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString() +RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString +RangePosition(newSource1.scala, 55, 55, 56) scala.Int.box(1) +NoPosition scala.Int.box +NoPosition scala.Int diff --git a/tests/pending/run/t7569.scala b/tests/pending/run/t7569.scala new file mode 100644 index 000000000000..b1b1443a1818 --- /dev/null +++ b/tests/pending/run/t7569.scala @@ -0,0 +1,19 @@ +import scala.tools.partest._ +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -Yrangepos" + override def sources = List( + """|import scala.language.postfixOps + |class A { + | val one = 1 toString + |}""".stripMargin + ) + def check(source: String, unit: CompilationUnit) { + for (ClassDef(_, _, _, Template(_, _, stats)) <- unit.body ; stat <- stats ; t <- stat) { + t match { + case _: Select | _ : Apply | _:This => println("%-15s %s".format(t.pos.toString, t)) + case _ => + } + } + } +} diff --git a/tests/pending/run/t7570a.check b/tests/pending/run/t7570a.check new file mode 100644 index 000000000000..3cc58df83752 --- /dev/null +++ b/tests/pending/run/t7570a.check @@ -0,0 +1 @@ +C diff --git a/tests/pending/run/t7570a.scala b/tests/pending/run/t7570a.scala new file mode 100644 index 000000000000..1e01488d91fb --- /dev/null +++ b/tests/pending/run/t7570a.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import definitions._ +import Flag._ + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val csym = tb.define(q"""class C { override def toString = "C" }""") + println(tb.eval(q"new $csym")) +} diff --git a/tests/pending/run/t7570b.check b/tests/pending/run/t7570b.check new file mode 100644 index 000000000000..0c28247025a1 --- /dev/null +++ b/tests/pending/run/t7570b.check @@ -0,0 +1 @@ +compilation failed: reflective toolbox has failed: cannot have free terms in a top-level definition diff --git a/tests/pending/run/t7570b.scala b/tests/pending/run/t7570b.scala new file mode 100644 index 000000000000..8c149853176b --- /dev/null +++ b/tests/pending/run/t7570b.scala @@ -0,0 +1,18 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import definitions._ +import Flag._ +import internal._ + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val msg = internal.reificationSupport.newFreeTerm("msg", "C") + internal.reificationSupport.setInfo(msg, typeOf[String]) + try { + val csym = tb.define(q"""class C { override def toString = $msg }""") + println(tb.eval(q"new $csym")) + } catch { + case ToolBoxError(message, _) => println(s"compilation failed: $message") + } +} diff --git a/tests/pending/run/t7570c.check b/tests/pending/run/t7570c.check new file mode 100644 index 000000000000..61e659d9e0a5 --- /dev/null +++ b/tests/pending/run/t7570c.check @@ -0,0 +1,2 @@ +(class C,true,false,false) +(object D,false,true,false) diff --git a/tests/pending/run/t7570c.scala b/tests/pending/run/t7570c.scala new file mode 100644 index 000000000000..9fa3ac8b1daa --- /dev/null +++ b/tests/pending/run/t7570c.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, ToolBoxError} +import definitions._ +import Flag._ + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + val csym = tb.define(q"""class C { override def toString = "C" }""") + println((csym, csym.isClass, csym.isModule, csym.isModuleClass)) + val dsym = tb.define(q"""object D { override def toString = "D" }""".asInstanceOf[ModuleDef]) + println((dsym, dsym.isClass, dsym.isModule, dsym.isModuleClass)) +} diff --git a/tests/pending/run/t7571.scala b/tests/pending/run/t7571.scala new file mode 100644 index 000000000000..fd4babee34ef --- /dev/null +++ b/tests/pending/run/t7571.scala @@ -0,0 +1,12 @@ +class Foo(val a: Int) extends AnyVal { + def foo = { {case x => x + a}: PartialFunction[Int, Int]} + + def bar = (new {}).toString +} + +object Test extends dotty.runtime.LegacyApp { + val x = new Foo(1).foo.apply(2) + assert(x == 3, x) + val s = new Foo(1).bar + assert(s.nonEmpty, s) +} diff --git a/tests/pending/run/t7582-private-within.check b/tests/pending/run/t7582-private-within.check new file mode 100644 index 000000000000..b2743ffa06af --- /dev/null +++ b/tests/pending/run/t7582-private-within.check @@ -0,0 +1,12 @@ +private[package pack] class JavaPackagePrivate +private[package pack] module JavaPackagePrivate +private[package pack] module class JavaPackagePrivate +private[package pack] field field +private[package pack] primary constructor +private[package pack] method meth +private[package pack] field staticField +private[package pack] method staticMeth +private[package pack] method +private[package pack] field staticField +private[package pack] method staticMeth +private[package pack] method diff --git a/tests/pending/run/t7582-private-within/JavaPackagePrivate.java b/tests/pending/run/t7582-private-within/JavaPackagePrivate.java new file mode 100644 index 000000000000..672d19b57e6e --- /dev/null +++ b/tests/pending/run/t7582-private-within/JavaPackagePrivate.java @@ -0,0 +1,8 @@ +package pack; + +class JavaPackagePrivate { + int field = 0; + static int staticField = 0; + void meth() { } + static void staticMeth() { } +} diff --git a/tests/pending/run/t7582-private-within/Test.scala b/tests/pending/run/t7582-private-within/Test.scala new file mode 100644 index 000000000000..3d581f063b25 --- /dev/null +++ b/tests/pending/run/t7582-private-within/Test.scala @@ -0,0 +1,22 @@ +import scala.tools.partest.DirectTest + +// Testing that the `privateWithin` field is correctly populated on all +// the related symbols (e.g. module class) under separate compilation. +object Test extends DirectTest { + def code = ??? + + def show(): Unit = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + val global = newCompiler("-usejavacp", "-cp", classpath, "-d", testOutput.path) + import global._ + withRun(global) { _ => + def check(sym: Symbol) = { + sym.initialize + println(f"${sym.accessString}%12s ${sym.accurateKindString} ${sym.name.decode}") // we want to see private[pack] for all of these. + } + val sym = rootMirror.getRequiredClass("pack.JavaPackagePrivate") + val syms = Seq(sym, sym.companionModule, sym.companionModule.moduleClass) + (syms ++ syms.flatMap(_.info.decls)).foreach(check) + } + } +} diff --git a/tests/pending/run/t7582.check b/tests/pending/run/t7582.check new file mode 100644 index 000000000000..cd951d8d4f62 --- /dev/null +++ b/tests/pending/run/t7582.check @@ -0,0 +1,2 @@ +warning: there was one inliner warning; re-run with -Yinline-warnings for details +2 diff --git a/tests/pending/run/t7582.flags b/tests/pending/run/t7582.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t7582.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t7582/InlineHolder.scala b/tests/pending/run/t7582/InlineHolder.scala new file mode 100644 index 000000000000..a18b9effaa21 --- /dev/null +++ b/tests/pending/run/t7582/InlineHolder.scala @@ -0,0 +1,16 @@ +package p1 { + object InlineHolder { + @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1 + } +} + +object O { + @noinline + def x = p1.InlineHolder.inlinable +} + +object Test { + def main(args: Array[String]) { + println(O.x) + } +} diff --git a/tests/pending/run/t7582/PackageProtectedJava.java b/tests/pending/run/t7582/PackageProtectedJava.java new file mode 100644 index 000000000000..b7ea2a7676bc --- /dev/null +++ b/tests/pending/run/t7582/PackageProtectedJava.java @@ -0,0 +1,6 @@ +package p1; + +// public class, protected method +public class PackageProtectedJava { + static final int protectedMethod() { return 1; } +} diff --git a/tests/pending/run/t7582b.check b/tests/pending/run/t7582b.check new file mode 100644 index 000000000000..cd951d8d4f62 --- /dev/null +++ b/tests/pending/run/t7582b.check @@ -0,0 +1,2 @@ +warning: there was one inliner warning; re-run with -Yinline-warnings for details +2 diff --git a/tests/pending/run/t7582b.flags b/tests/pending/run/t7582b.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t7582b.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t7582b/InlineHolder.scala b/tests/pending/run/t7582b/InlineHolder.scala new file mode 100644 index 000000000000..a18b9effaa21 --- /dev/null +++ b/tests/pending/run/t7582b/InlineHolder.scala @@ -0,0 +1,16 @@ +package p1 { + object InlineHolder { + @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1 + } +} + +object O { + @noinline + def x = p1.InlineHolder.inlinable +} + +object Test { + def main(args: Array[String]) { + println(O.x) + } +} diff --git a/tests/pending/run/t7582b/PackageProtectedJava.java b/tests/pending/run/t7582b/PackageProtectedJava.java new file mode 100644 index 000000000000..55a44b79f965 --- /dev/null +++ b/tests/pending/run/t7582b/PackageProtectedJava.java @@ -0,0 +1,6 @@ +package p1; + +// protected class, public method +class PackageProtectedJava { + public static final int protectedMethod() { return 1; } +} diff --git a/tests/pending/run/t7584.check b/tests/pending/run/t7584.check new file mode 100644 index 000000000000..9f53e5dde5e9 --- /dev/null +++ b/tests/pending/run/t7584.check @@ -0,0 +1,6 @@ +no calls +call A +a +call B twice +b +b diff --git a/tests/pending/run/t7584.flags b/tests/pending/run/t7584.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/t7584.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/t7584.scala b/tests/pending/run/t7584.scala new file mode 100644 index 000000000000..f134b04a5ead --- /dev/null +++ b/tests/pending/run/t7584.scala @@ -0,0 +1,14 @@ +// Test case added to show the behaviour of functions with +// by-name parameters. The evaluation behaviour was already correct. +// +// We did flush out a spurious "pure expression does nothing in statement position" +// warning, hence -Xfatal-warnings in the flags file. +object Test extends dotty.runtime.LegacyApp { + def foo(f: (=> Int, => Int) => Unit) = f({println("a"); 0}, {println("b"); 1}) + println("no calls") + foo((a, b) => ()) + println("call A") + foo((a, b) => a) + println("call B twice") + foo((a, b) => {b; b}) +} diff --git a/tests/pending/run/t7584b.scala b/tests/pending/run/t7584b.scala new file mode 100644 index 000000000000..bf7afdc0bbda --- /dev/null +++ b/tests/pending/run/t7584b.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + def fold[A, B](f: (A, => B) => B) = (b: B) => f(null.asInstanceOf[A], b) + def f[A, B](x: A, y: B): B = y + def bip[A, B] = fold[A, B]((x, y) => f(x, y)) + def bop[A, B] = fold[A, B](f(_, _)) + + // these work: + fold[Int, Int]((x, y) => f(x, y))(0) + fold[Int, Int](f(_, _))(0) + + // Used to throw a ClassCastException. Since the fix for SI-7899, these issue type errors. + // fold[Int, Int](f _)(0) + // fold[Int, Int](f)(0) +} diff --git a/tests/pending/run/t7617a.check b/tests/pending/run/t7617a.check new file mode 100644 index 000000000000..94954abda49d --- /dev/null +++ b/tests/pending/run/t7617a.check @@ -0,0 +1,2 @@ +hello +world diff --git a/tests/pending/run/t7617a/Macros_1.scala b/tests/pending/run/t7617a/Macros_1.scala new file mode 100644 index 000000000000..77b18c20e282 --- /dev/null +++ b/tests/pending/run/t7617a/Macros_1.scala @@ -0,0 +1,22 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +object Macros { + def getValueImpl[T](c: Context): c.Expr[T] = { + import c.universe._ + c.Expr[T](Apply(Select(c.prefix.tree, newTermName("getVal")), Nil)) + } + def setValueImpl[T](c: Context)(value: c.Expr[T]): c.Expr[Unit] = { + import c.universe._ + c.Expr[Unit](Apply(Select(c.prefix.tree, newTermName("setVal")), List(value.tree))) + } +} + +object Module { + private var _val: String = "hello" + def setVal(value: String): Unit = this._val = value + def getVal(): String = this._val + + def value: String = macro Macros.getValueImpl[String] + def value_=(value: String): Unit = macro Macros.setValueImpl[String] +} diff --git a/tests/pending/run/t7617a/Test_2.scala b/tests/pending/run/t7617a/Test_2.scala new file mode 100644 index 000000000000..aaf268a8c043 --- /dev/null +++ b/tests/pending/run/t7617a/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(Module.value) + Module.value = "world" + println(Module.value) +} \ No newline at end of file diff --git a/tests/pending/run/t7617b.check b/tests/pending/run/t7617b.check new file mode 100644 index 000000000000..81ec7e8b7425 --- /dev/null +++ b/tests/pending/run/t7617b.check @@ -0,0 +1 @@ +foo = 2 diff --git a/tests/pending/run/t7617b/Macros_1.scala b/tests/pending/run/t7617b/Macros_1.scala new file mode 100644 index 000000000000..90fcfda47d82 --- /dev/null +++ b/tests/pending/run/t7617b/Macros_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.macros.blackbox.Context + +object Macros { + def impl(c: Context)(name: c.Expr[String])(value: c.Expr[Any]) = { + import c.universe._ + reify(println(s"${name.splice} = ${value.splice}")) + } +} \ No newline at end of file diff --git a/tests/pending/run/t7617b/Test_2.scala b/tests/pending/run/t7617b/Test_2.scala new file mode 100644 index 000000000000..0ce77a1c7f10 --- /dev/null +++ b/tests/pending/run/t7617b/Test_2.scala @@ -0,0 +1,11 @@ +import scala.language.dynamics +import language.experimental.macros + +class C extends Dynamic { + def updateDynamic(name: String)(value: Any): Unit = macro Macros.impl +} + +object Test extends dotty.runtime.LegacyApp { + val c = new C + c.foo = 2 +} \ No newline at end of file diff --git a/tests/pending/run/t7634.check b/tests/pending/run/t7634.check new file mode 100644 index 000000000000..9c6b8b47ddc6 --- /dev/null +++ b/tests/pending/run/t7634.check @@ -0,0 +1,8 @@ +Type in expressions to have them evaluated. +Type :help for more information. + + +scala> .lines +res1: List[String] = List(shello, world.) + +scala> :quit diff --git a/tests/pending/run/t7634.scala b/tests/pending/run/t7634.scala new file mode 100644 index 000000000000..aeb6a5e671bc --- /dev/null +++ b/tests/pending/run/t7634.scala @@ -0,0 +1,22 @@ +import java.io.File +import scala.tools.partest.ReplTest +import scala.util.Properties.propOrElse + +/** +* filter out absolute path to java +* filter: java +*/ +object Test extends ReplTest { + def java = propOrElse("javacmd", "java") + def code = s""":sh $java -classpath $testOutput hello.Hello + |.lines""".stripMargin +} + +package hello { + object Hello { + def main(a: Array[String]) { + System.out.println("shello, world.") + } + } +} + diff --git a/tests/pending/run/t7657.check b/tests/pending/run/t7657.check new file mode 100644 index 000000000000..c25d8d1c1baf --- /dev/null +++ b/tests/pending/run/t7657.check @@ -0,0 +1,3 @@ +() +() +() diff --git a/tests/pending/run/t7657/Macros_1.scala b/tests/pending/run/t7657/Macros_1.scala new file mode 100644 index 000000000000..a883f76bc363 --- /dev/null +++ b/tests/pending/run/t7657/Macros_1.scala @@ -0,0 +1,8 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +trait T { def t(): Unit } +abstract class A extends T { override def t(): Unit = () } + +object Macro { def t(c: Context)(): c.Expr[Unit] = c.universe.reify(()) } +class C extends A { override def t(): Unit = macro Macro.t } diff --git a/tests/pending/run/t7657/Test_2.scala b/tests/pending/run/t7657/Test_2.scala new file mode 100644 index 000000000000..68dfb5c8bdb0 --- /dev/null +++ b/tests/pending/run/t7657/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + val c = new C() + println(c.t()) + println((c: T).t()) + println((c: A).t()) +} diff --git a/tests/pending/run/t7700.check b/tests/pending/run/t7700.check new file mode 100644 index 000000000000..ca8e686984fb --- /dev/null +++ b/tests/pending/run/t7700.check @@ -0,0 +1,2 @@ +public abstract java.lang.Object C.bar(java.lang.Object) +public abstract java.lang.Object C.foo(java.lang.Object) diff --git a/tests/pending/run/t7700.scala b/tests/pending/run/t7700.scala new file mode 100644 index 000000000000..ce4e00010eb5 --- /dev/null +++ b/tests/pending/run/t7700.scala @@ -0,0 +1,17 @@ +import scala.annotation._ + +trait C[@specialized U] { + @unspecialized + def foo(u: U): U + @unspecialized + def bar[A](u: U) = u +} + +object Test extends dotty.runtime.LegacyApp { + val declared = classOf[C[_]].getDeclaredMethods.sortBy(_.getName) + println(declared.mkString("\n")) + object CInt extends C[Int] { def foo(i: Int) = i } + object CAny extends C[Any] { def foo(a: Any) = a } + assert(CInt.foo(1) == 1) + assert(CAny.foo("") == "") +} diff --git a/tests/pending/run/t7711-script-args.check b/tests/pending/run/t7711-script-args.check new file mode 100644 index 000000000000..d107590a8a27 --- /dev/null +++ b/tests/pending/run/t7711-script-args.check @@ -0,0 +1,2 @@ +Hello, scripted test! +What good news have you for me today? diff --git a/tests/pending/run/t7711-script-args.scala b/tests/pending/run/t7711-script-args.scala new file mode 100644 index 000000000000..02535aa9549d --- /dev/null +++ b/tests/pending/run/t7711-script-args.scala @@ -0,0 +1,7 @@ + +import scala.tools.partest.ScriptTest + +object Test extends ScriptTest { + override def extraSettings = s"${super.extraSettings} -Xlint" + override def argv = Seq("good", "news") +} diff --git a/tests/pending/run/t7711-script-args.script b/tests/pending/run/t7711-script-args.script new file mode 100644 index 000000000000..19b7a7492423 --- /dev/null +++ b/tests/pending/run/t7711-script-args.script @@ -0,0 +1,12 @@ +#!/bin/bash +exec ${SCALA_HOME}/bin/scala "$0" "$@" 2>&1 +!# + +Console println s"Hello, scripted test!" +Console println s"What ${args mkString " "} have you for me today?" + +//def unused = 88 +//newSource1.scala:8: warning: private method in <$anon: AnyRef> is never used +//Console println s"Hello, $argv, are you still here?" +//newSource1.scala:9: error: not found: value argv + diff --git a/tests/pending/run/t7715.check b/tests/pending/run/t7715.check new file mode 100644 index 000000000000..592d7fe2eaa5 --- /dev/null +++ b/tests/pending/run/t7715.check @@ -0,0 +1,3 @@ +6 +4 +4 diff --git a/tests/pending/run/t7715.scala b/tests/pending/run/t7715.scala new file mode 100644 index 000000000000..948014d758c4 --- /dev/null +++ b/tests/pending/run/t7715.scala @@ -0,0 +1,24 @@ + +import PartialFunction.cond +import util._ + +object Test extends dotty.runtime.LegacyApp { + + object I { def unapply(x: String): Option[Int] = Try(x.toInt).toOption } + implicit class RX(val sc: StringContext) { + def rx = sc.parts.mkString("(.+)").r + } + + Console println ("2 by 4" match { + case rx"${I(a)} by ${I(b)}" => a+b + case _ => -1 + }) + Console println ("2 by 4" match { + case rx"${_} by ${I(b)}" => b // pattern placeholder + case _ => -1 + }) + Console println ("2 by 4" match { + case rx"$_ by ${I(b)}" => b // is permitted this way, too + case _ => -1 + }) +} diff --git a/tests/pending/run/t7747-repl.check b/tests/pending/run/t7747-repl.check new file mode 100644 index 000000000000..105b238d01d6 --- /dev/null +++ b/tests/pending/run/t7747-repl.check @@ -0,0 +1,286 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> var x = 10 +x: Int = 10 + +scala> var y = 11 +y: Int = 11 + +scala> x = 12 +x: Int = 12 + +scala> y = 13 +y: Int = 13 + +scala> val z = x * y +z: Int = 156 + +scala> 2 ; 3 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 2 ;; + ^ +res0: Int = 3 + +scala> { 2 ; 3 } +:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + { 2 ; 3 } + ^ +res1: Int = 3 + +scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + 1 + + 2 + + 3 } ; bippy+88+11 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + ^ +defined object Cow +defined class Moo +bippy: Int +res2: Int = 105 + +scala> + +scala> object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy +defined object Bovine +defined class Ruminant +res3: Int = 216 + +scala> Bovine.x = List(Ruminant(5), Cow, new Moo) +Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo) + +scala> Bovine.x +res4: List[Any] = List(Ruminant(5), Cow, Moooooo) + +scala> + +scala> (2) +res5: Int = 2 + +scala> (2 + 2) +res6: Int = 4 + +scala> ((2 + 2)) +res7: Int = 4 + +scala> ((2 + 2)) +res8: Int = 4 + +scala> ( (2 + 2)) +res9: Int = 4 + +scala> ( (2 + 2 ) ) +res10: Int = 4 + +scala> 5 ; ( (2 + 2 ) ) ; ((5)) +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 5 ; ( (2 + 2 ) ) ;; + ^ +res11: Int = 5 + +scala> (((2 + 2)), ((2 + 2))) +res12: (Int, Int) = (4,4) + +scala> (((2 + 2)), ((2 + 2)), 2) +res13: (Int, Int, Int) = (4,4,2) + +scala> (((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString) +res14: String = 4423 + +scala> + +scala> 55 ; ((2 + 2)) ; (1, 2, 3) +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; ((2 + 2)) ;; + ^ +res15: (Int, Int, Int) = (1,2,3) + +scala> 55 ; (x: Int) => x + 1 ; () => ((5)) +:8: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ; (x: Int) => x + 1 ;; + ^ +res16: () => Int = + +scala> + +scala> () => 5 +res17: () => Int = + +scala> 55 ; () => 5 +:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 55 ;; + ^ +res18: () => Int = + +scala> () => { class X ; new X } +res19: () => AnyRef = + +scala> + +scala> def foo(x: Int)(y: Int)(z: Int) = x+y+z +foo: (x: Int)(y: Int)(z: Int)Int + +scala> foo(5)(10)(15)+foo(5)(10)(15) +res20: Int = 60 + +scala> + +scala> List(1) ++ List('a') +res21: List[AnyVal] = List(1, a) + +scala> + +scala> 1 to 100 map (_ + 1) +res22: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) + +scala> val x1 = 1 +x1: Int = 1 + +scala> val x2 = 2 +x2: Int = 2 + +scala> val x3 = 3 +x3: Int = 3 + +scala> case class BippyBungus() +defined class BippyBungus + +scala> x1 + x2 + x3 +res23: Int = 6 + +scala> :reset +Resetting interpreter state. +Forgetting this session history: + +var x = 10 +var y = 11 +x = 12 +y = 13 +val z = x * y +2 ; 3 +{ 2 ; 3 } +5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + 1 + + 2 + + 3 } ; bippy+88+11 +object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy +Bovine.x = List(Ruminant(5), Cow, new Moo) +Bovine.x +(2) +(2 + 2) +((2 + 2)) + ((2 + 2)) + ( (2 + 2)) + ( (2 + 2 ) ) +5 ; ( (2 + 2 ) ) ; ((5)) +(((2 + 2)), ((2 + 2))) +(((2 + 2)), ((2 + 2)), 2) +(((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString) +55 ; ((2 + 2)) ; (1, 2, 3) +55 ; (x: Int) => x + 1 ; () => ((5)) +() => 5 +55 ; () => 5 +() => { class X ; new X } +def foo(x: Int)(y: Int)(z: Int) = x+y+z +foo(5)(10)(15)+foo(5)(10)(15) +List(1) ++ List('a') +1 to 100 map (_ + 1) +val x1 = 1 +val x2 = 2 +val x3 = 3 +case class BippyBungus() +x1 + x2 + x3 + +Forgetting all expression results and named terms: $intp, BippyBungus, Bovine, Cow, Ruminant, bippy, foo, x, x1, x2, x3, y, z +Forgetting defined types: BippyBungus, Moo, Ruminant + +scala> x1 + x2 + x3 +:8: error: not found: value x1 + x1 + x2 + x3 + ^ +:8: error: not found: value x2 + x1 + x2 + x3 + ^ +:8: error: not found: value x3 + x1 + x2 + x3 + ^ + +scala> val x1 = 4 +x1: Int = 4 + +scala> new BippyBungus +:8: error: not found: type BippyBungus + new BippyBungus + ^ + +scala> class BippyBungus() { def f = 5 } +defined class BippyBungus + +scala> { new BippyBungus ; x1 } +res2: Int = 4 + +scala> object x {class y { case object z } } +defined object x + +scala> case class BippyBups() +defined class BippyBups + +scala> case class PuppyPups() +defined class PuppyPups + +scala> case class Bingo() +defined class Bingo + +scala> List(BippyBups(), PuppyPups(), Bingo()) // show +class $read extends Serializable { + def () = { + super.; + () + }; + class $iw extends Serializable { + def () = { + super.; + () + }; + import $line44.$read.$iw.$iw.BippyBups; + import $line44.$read.$iw.$iw.BippyBups; + import $line45.$read.$iw.$iw.PuppyPups; + import $line45.$read.$iw.$iw.PuppyPups; + import $line46.$read.$iw.$iw.Bingo; + import $line46.$read.$iw.$iw.Bingo; + class $iw extends Serializable { + def () = { + super.; + () + }; + val res3 = List(BippyBups, PuppyPups, Bingo) + }; + val $iw = new $iw. + }; + val $iw = new $iw. +} +object $read extends $read { + def () = { + super.; + () + } +} +res3: List[Product with Serializable] = List(BippyBups(), PuppyPups(), Bingo()) + +scala> :quit diff --git a/tests/pending/run/t7747-repl.scala b/tests/pending/run/t7747-repl.scala new file mode 100644 index 000000000000..0e6421046075 --- /dev/null +++ b/tests/pending/run/t7747-repl.scala @@ -0,0 +1,69 @@ +import scala.tools.partest.ReplTest +import scala.tools.nsc.Settings + +object Test extends ReplTest { + + override def transformSettings(s: Settings): Settings = { + s.Yreplclassbased.value = true + s + } + + def code = """ + |var x = 10 + |var y = 11 + |x = 12 + |y = 13 + |val z = x * y + |2 ; 3 + |{ 2 ; 3 } + |5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { + | 1 + + | 2 + + | 3 } ; bippy+88+11 + | + |object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy + |Bovine.x = List(Ruminant(5), Cow, new Moo) + |Bovine.x + | + |(2) + |(2 + 2) + |((2 + 2)) + | ((2 + 2)) + | ( (2 + 2)) + | ( (2 + 2 ) ) + |5 ; ( (2 + 2 ) ) ; ((5)) + |(((2 + 2)), ((2 + 2))) + |(((2 + 2)), ((2 + 2)), 2) + |(((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3)).mkString) + | + |55 ; ((2 + 2)) ; (1, 2, 3) + |55 ; (x: Int) => x + 1 ; () => ((5)) + | + |() => 5 + |55 ; () => 5 + |() => { class X ; new X } + | + |def foo(x: Int)(y: Int)(z: Int) = x+y+z + |foo(5)(10)(15)+foo(5)(10)(15) + | + |List(1) ++ List('a') + | + |1 to 100 map (_ + 1) + |val x1 = 1 + |val x2 = 2 + |val x3 = 3 + |case class BippyBungus() + |x1 + x2 + x3 + |:reset + |x1 + x2 + x3 + |val x1 = 4 + |new BippyBungus + |class BippyBungus() { def f = 5 } + |{ new BippyBungus ; x1 } + |object x {class y { case object z } } + |case class BippyBups() + |case class PuppyPups() + |case class Bingo() + |List(BippyBups(), PuppyPups(), Bingo()) // show + |""".stripMargin +} diff --git a/tests/pending/run/t7763.scala b/tests/pending/run/t7763.scala new file mode 100644 index 000000000000..a76f52b74878 --- /dev/null +++ b/tests/pending/run/t7763.scala @@ -0,0 +1,20 @@ +object Test { + class A; class B + def main(args: Array[String]): Unit = { + def noExpectedType(): Unit = { + a().asInstanceOf[B] // cast elided! + } + def withExpectedType(): B = { + a().asInstanceOf[B] + } + def test(a: => Any) = try { + a + sys.error("no CCE!") + } catch {case _: ClassCastException => } + + test(noExpectedType()) + test(withExpectedType()) + } + + def a(): Object = new A +} diff --git a/tests/pending/run/t7775.scala b/tests/pending/run/t7775.scala new file mode 100644 index 000000000000..bc6a67d0e129 --- /dev/null +++ b/tests/pending/run/t7775.scala @@ -0,0 +1,17 @@ +import scala.concurrent.{duration, Future, Await, ExecutionContext} +import scala.tools.nsc.Settings +import ExecutionContext.Implicits.global + +// Was failing pretty regularly with a ConcurrentModificationException as +// WrappedProperties#systemProperties iterated directly over the mutable +// global system properties map. +object Test { + def main(args: Array[String]): Unit = { + val tries = 1000 // YMMV + val compiler = Future { + for(_ <- 1 to tries) new Settings(_ => {}) + } + for(i <- 1 to tries * 10) System.setProperty(s"foo$i", i.toString) + Await.result(compiler, duration.Duration.Inf) + } +} diff --git a/tests/pending/run/t7777.check b/tests/pending/run/t7777.check new file mode 100644 index 000000000000..162ff2d2a238 --- /dev/null +++ b/tests/pending/run/t7777.check @@ -0,0 +1,7 @@ +foo(1, 2) +bar(4, 5) +foo(3) +bar(7) +apply(6) +apply(9) +foo(8) diff --git a/tests/pending/run/t7777/Macros_1.scala b/tests/pending/run/t7777/Macros_1.scala new file mode 100644 index 000000000000..1dc6d6740c78 --- /dev/null +++ b/tests/pending/run/t7777/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.language.experimental.macros +import scala.language.dynamics +import scala.reflect.macros.whitebox.Context + +class DynMacro extends Dynamic { + def applyDynamic(s: String)(xs: Any*): DynMacro = + macro DynMacro.applyDynamicMacro +} + +object DynMacro extends DynMacro { + def applyDynamicMacro(c: Context)(s: c.Expr[String])(xs: c.Expr[Any]*): c.Expr[DynMacro] = { + import c.universe._ + val Literal(Constant(n: String)) = s.tree + val args = xs.map(_.tree.toString).mkString("(", ", ", ")") + c.Expr(q"println(${ n + args }); ${c.prefix.tree}") + } +} \ No newline at end of file diff --git a/tests/pending/run/t7777/Test_2.scala b/tests/pending/run/t7777/Test_2.scala new file mode 100644 index 000000000000..7f84f64e432f --- /dev/null +++ b/tests/pending/run/t7777/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + DynMacro.foo(1, 2) // prints "foo(1, 2)" + DynMacro.foo(3).bar(4, 5) // prints "bar(4, 5)", then "foo(3)" + DynMacro(6).bar(7) // prints "bar(7)", then "apply(6)" + DynMacro.foo(8)(9) // Fails! +} \ No newline at end of file diff --git a/tests/pending/run/t7779.scala b/tests/pending/run/t7779.scala new file mode 100644 index 000000000000..bc92403a9c36 --- /dev/null +++ b/tests/pending/run/t7779.scala @@ -0,0 +1,67 @@ +// -Xmax-classfile-length doesn't compress top-level classes. +// class ::::::::::::::::::::::::::::::::::::::::::::::::: + +trait Marker + +class Short extends Marker + +// We just test with member classes +object O { + object ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker +} +class C { + class D { + class ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker + } +} + +package pack { + // abbreviates to: $colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon to $read$$iw$$iw$$colon$colon$colon$colon$colon$colon$colon$colon$$$$c39b3f245029fbed9732fc888d44231b$$$$on$colon$colon$colon$colon$colon$colon$colon$colon$colon$colon + // class ::::::::::::::::::::::::::::::::::::::::::::::::: + + class Short extends Marker + + // We just test with member classes + object O { + object ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker + } + class C { + class D { + class ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker + } + } + package p2 { + class Short extends Marker + + object O { + object ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker + } + class C { + class D { + class ::::::::::::::::::::::::::::::::::::::::::::::::: extends Marker + } + } + } +} + + +object Test extends dotty.runtime.LegacyApp { + import reflect.runtime.universe._ + def test[T: TypeTag] = { + val tt = typeTag[T] + val clz = tt.mirror.runtimeClass(tt.tpe) + assert(classOf[Marker].isAssignableFrom(clz), clz.toString) + } + + test[Short] + test[O.:::::::::::::::::::::::::::::::::::::::::::::::::.type] + test[C#D#`:::::::::::::::::::::::::::::::::::::::::::::::::`] + + test[pack.Short] + test[pack.O.:::::::::::::::::::::::::::::::::::::::::::::::::.type] + test[pack.C#D#`:::::::::::::::::::::::::::::::::::::::::::::::::`] + + test[pack.p2.Short] + test[pack.p2.O.:::::::::::::::::::::::::::::::::::::::::::::::::.type] + test[pack.p2.C#D#`:::::::::::::::::::::::::::::::::::::::::::::::::`] +} diff --git a/tests/pending/run/t7791-script-linenums.check b/tests/pending/run/t7791-script-linenums.check new file mode 100644 index 000000000000..b7d969564a17 --- /dev/null +++ b/tests/pending/run/t7791-script-linenums.check @@ -0,0 +1 @@ +hello, scripted test diff --git a/tests/pending/run/t7791-script-linenums.scala b/tests/pending/run/t7791-script-linenums.scala new file mode 100644 index 000000000000..d89b8d4c6388 --- /dev/null +++ b/tests/pending/run/t7791-script-linenums.scala @@ -0,0 +1,16 @@ + +import scala.tools.partest.ScriptTest + +object Test extends ScriptTest { + object ExceptionLine { + def unapply(e: Exception) = Some(e.getStackTrace()(0).getLineNumber) + } + override def show() = { + import util._ + Try(super.show()) match { + case Failure(ExceptionLine(7)) => () + case Failure(e) => e.printStackTrace() + case Success(_) => Console println "Expected error" + } + } +} diff --git a/tests/pending/run/t7791-script-linenums.script b/tests/pending/run/t7791-script-linenums.script new file mode 100644 index 000000000000..403dcc2d28ca --- /dev/null +++ b/tests/pending/run/t7791-script-linenums.script @@ -0,0 +1,8 @@ +#!/bin/bash +exec ${SCALA_HOME}/bin/scala "$0" "$@" 2>&1 +!# + +Console println s"hello, scripted test" + +throw new RuntimeException("failing") // line 7 + diff --git a/tests/pending/run/t7801.check b/tests/pending/run/t7801.check new file mode 100644 index 000000000000..e0b656b78420 --- /dev/null +++ b/tests/pending/run/t7801.check @@ -0,0 +1,11 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> val g: scala.reflect.internal.SymbolTable = null; import g.abort +g: scala.reflect.internal.SymbolTable = null +import g.abort + +scala> class C(val a: Any) extends AnyVal +defined class C + +scala> :quit diff --git a/tests/pending/run/t7801.scala b/tests/pending/run/t7801.scala new file mode 100644 index 000000000000..3a3cc97a51a7 --- /dev/null +++ b/tests/pending/run/t7801.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +// was crashing due to a subtle interaction of the Namer entering packages into +// enclosing packages by mutating the scope in place without invalidating later +// entries in the enclosing package class symbols type history. +// +// Sadly, I couldn't whittle the test case down further. +object Test extends ReplTest { + override def code = """val g: scala.reflect.internal.SymbolTable = null; import g.abort + |class C(val a: Any) extends AnyVal""".stripMargin + +} diff --git a/tests/pending/run/t7805-repl-i.check b/tests/pending/run/t7805-repl-i.check new file mode 100644 index 000000000000..7f66c06a111a --- /dev/null +++ b/tests/pending/run/t7805-repl-i.check @@ -0,0 +1,11 @@ +Loading t7805-repl-i.script... +import util._ + +Welcome to Scala +Type in expressions to have them evaluated. +Type :help for more information. + +scala> Console println Try(8) +Success(8) + +scala> :quit diff --git a/tests/pending/run/t7805-repl-i.scala b/tests/pending/run/t7805-repl-i.scala new file mode 100644 index 000000000000..208cb5da1397 --- /dev/null +++ b/tests/pending/run/t7805-repl-i.scala @@ -0,0 +1,42 @@ + +import scala.tools.partest.{ ReplTest, Welcoming } +import scala.tools.nsc.{ GenericRunnerSettings, Settings } +import scala.tools.nsc.settings.MutableSettings + +object Test extends ReplTest with HangingRepl with Welcoming { + def script = testPath changeExtension "script" + override def transformSettings(s: Settings) = s match { + case m: MutableSettings => + val t = new GenericRunnerSettings(s.errorFn) + m copyInto t + t processArgumentString s"-i $script" + t + case _ => s + } + def code = "Console println Try(8)" +} + +object Resulting { + import scala.concurrent._ + import scala.concurrent.duration._ + implicit class AwaitResult[A](val f: Future[A]) extends AnyVal { + def resultWithin(d: Duration): A = Await.result(f, d) + } +} + +/** Test that hangs the REPL. + * Usually that is the "before" case. + */ +trait HangingRepl extends ReplTest { + import scala.language.postfixOps + import scala.util._ + import scala.concurrent._ + import scala.concurrent.duration._ + import ExecutionContext.Implicits._ + import Resulting._ + def timeout = 120 seconds + def hanging[A](a: =>A): A = Future(a) resultWithin timeout + override def show() = Try(hanging(super.show())) recover { + case e => e.printStackTrace() + } +} diff --git a/tests/pending/run/t7805-repl-i.script b/tests/pending/run/t7805-repl-i.script new file mode 100644 index 000000000000..eb2b8705f362 --- /dev/null +++ b/tests/pending/run/t7805-repl-i.script @@ -0,0 +1 @@ +import util._ diff --git a/tests/pending/run/t7817-tree-gen.check b/tests/pending/run/t7817-tree-gen.check new file mode 100644 index 000000000000..4ed4b0d94a83 --- /dev/null +++ b/tests/pending/run/t7817-tree-gen.check @@ -0,0 +1,104 @@ + + +Joint Compilation: + + typer [ O] - O.this + pickler [ O] - O.this + refchecks [ O] - O.this + uncurry [ O] - O.this + specialize [ O] - O.this + explicitouter [ O] - O.this + erasure [ O] - O.this + posterasure [ O] - C.this.O() + flatten [ O] - C.this.O() + mixin [ O] - test.O() + cleanup [ O] - test.O() + + typer [ P] - P.this + pickler [ P] - P.this + refchecks [ P] - P.this + uncurry [ P] - P.this + specialize [ P] - P.this + explicitouter [ P] - P.this + erasure [ P] - P.this + posterasure [ P] - D.this.P() + flatten [ P] - D.this.P() + mixin [ P] - P() + cleanup [ P] - P() + + typer [ test2.PO] - PO.this + pickler [ test2.PO] - PO.this + refchecks [ test2.PO] - PO.this + uncurry [ test2.PO] - PO.this + specialize [ test2.PO] - PO.this + explicitouter [ test2.PO] - PO.this + erasure [ test2.PO] - PO.this + posterasure [ test2.PO] - test2.`package`.PO + flatten [ test2.PO] - test2.`package`.PO + mixin [ test2.PO] - test2.package$PO + cleanup [ test2.PO] - test2.package$PO + + typer [ test2.bar] - `package`.this.bar + pickler [ test2.bar] - `package`.this.bar + refchecks [ test2.bar] - `package`.this.bar + uncurry [ test2.bar] - `package`.this.bar + specialize [ test2.bar] - `package`.this.bar + explicitouter [ test2.bar] - `package`.this.bar + erasure [ test2.bar] - `package`.this.bar + posterasure [ test2.bar] - test2.`package`.bar + flatten [ test2.bar] - test2.`package`.bar + mixin [ test2.bar] - test2.`package`.bar + cleanup [ test2.bar] - test2.`package`.bar + + + +Separate Compilation: + + typer [ O] - O.this + pickler [ O] - O.this + refchecks [ O] - O.this + uncurry [ O] - O.this + specialize [ O] - O.this + explicitouter [ O] - O.this + erasure [ O] - O.this + posterasure [ O] - C.this.O() + flatten [ O] - C.this.O() + mixin [ O] - testSep.O() + cleanup [ O] - testSep.O() + + typer [ P] - P.this + pickler [ P] - P.this + refchecks [ P] - P.this + uncurry [ P] - P.this + specialize [ P] - P.this + explicitouter [ P] - P.this + erasure [ P] - P.this + posterasure [ P] - DSep.this.P() + flatten [ P] - DSep.this.P() + mixin [ P] - P() + cleanup [ P] - P() + + typer [ PO] - PO.this + pickler [ PO] - PO.this + refchecks [ PO] - PO.this + uncurry [ PO] - PO.this + specialize [ PO] - PO.this + explicitouter [ PO] - PO.this + erasure [ PO] - PO.this + posterasure [ PO] - test2.`package`.PO + flatten [ PO] - test2.`package`.PO + mixin [ PO] - test2.package$PO + cleanup [ PO] - test2.package$PO + + typer [testSep2.bar] - `package`.this.bar + pickler [testSep2.bar] - `package`.this.bar + refchecks [testSep2.bar] - `package`.this.bar + uncurry [testSep2.bar] - `package`.this.bar + specialize [testSep2.bar] - `package`.this.bar + explicitouter [testSep2.bar] - `package`.this.bar + erasure [testSep2.bar] - `package`.this.bar + posterasure [testSep2.bar] - test2.`package`.bar + flatten [testSep2.bar] - test2.`package`.bar + mixin [testSep2.bar] - test2.`package`.bar + cleanup [testSep2.bar] - test2.`package`.bar + diff --git a/tests/pending/run/t7817-tree-gen.flags b/tests/pending/run/t7817-tree-gen.flags new file mode 100644 index 000000000000..ce6e93b3da37 --- /dev/null +++ b/tests/pending/run/t7817-tree-gen.flags @@ -0,0 +1 @@ +-Ynooptimise \ No newline at end of file diff --git a/tests/pending/run/t7817-tree-gen.scala b/tests/pending/run/t7817-tree-gen.scala new file mode 100644 index 000000000000..a8317fda6eff --- /dev/null +++ b/tests/pending/run/t7817-tree-gen.scala @@ -0,0 +1,65 @@ +import scala.tools.partest._ + +// Testing that `mkAttributedRef` doesn't incude the package object test.`package`, +// under joint and separate compilation. + +package testSep { class C { object O } } +package testSep2 { object `package` { object PO; def bar = 0 } } +class DSep { object P } + +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -d " + testOutput.path + override def sources = List( + """ + package test { class C { object O } } + class D { object P } + package test2 { object `package` { object PO; def bar = 0 } } + """ + ) + def check(source: String, unit: CompilationUnit) = enteringTyper { + def checkTree(msg: String, t: => Tree) = { + val run = currentRun + import run._ + val phases = List(typerPhase, picklerPhase, refchecksPhase, uncurryPhase, specializePhase, + explicitouterPhase, erasurePhase, posterasurePhase, flattenPhase, mixinPhase, cleanupPhase) + for (phase <- phases) { + enteringPhase(phase) { + val error = t.exists(t => t.symbol == NoSymbol) + val errorStr = if (error) "!!!" else " - " + println(f"$phase%18s [$msg%12s] $errorStr $t") + } + } + println("") + } + import rootMirror._ + + println("\n\nJoint Compilation:\n") + + { + val c = staticClass("test.C") + val o = c.info.decl(TermName("O")) + checkTree("O", gen.mkAttributedQualifier(o.moduleClass.thisType)) + val d = staticClass("D") + val p = d.info.decl(TermName("P")) + checkTree("P", gen.mkAttributedQualifier(p.moduleClass.thisType)) + val po = staticModule("test2.package").moduleClass.info.decl(TermName("PO")) + checkTree("test2.PO", gen.mkAttributedQualifier(po.moduleClass.thisType)) + checkTree("test2.bar", gen.mkAttributedRef(po.owner.info.decl(TermName("bar")))) + } + + println("\n\nSeparate Compilation:\n") + + { + val c = typeOf[testSep.C].typeSymbol + val o = c.info.decl(TermName("O")) + checkTree("O", gen.mkAttributedQualifier(o.moduleClass.thisType)) + val d = staticClass("DSep") + val p = d.info.decl(TermName("P")) + checkTree("P", gen.mkAttributedQualifier(p.moduleClass.thisType)) + val po = staticModule("test2.package").moduleClass.info.decl(TermName("PO")) + checkTree("PO", gen.mkAttributedQualifier(po.moduleClass.thisType)) + checkTree("testSep2.bar", gen.mkAttributedRef(po.owner.info.decl(TermName("bar")))) + } + } +} diff --git a/tests/pending/run/t7817.scala b/tests/pending/run/t7817.scala new file mode 100644 index 000000000000..547ec9d846a6 --- /dev/null +++ b/tests/pending/run/t7817.scala @@ -0,0 +1,31 @@ +import language.reflectiveCalls + +package test { + class C1 { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } + trait T { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } + object O1 extends T + + object O2 { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } +} + +object Test extends dotty.runtime.LegacyApp { + object fooable { def foo = "foo" } + def check(result: Any) = assert(result == "foo", result.toString) + + val s = new test.C1 + check(s.O.struct(fooable)) + check(test.O1.O.struct(fooable)) + check(test.O2.O.struct(fooable)) +} diff --git a/tests/pending/run/t7825.scala b/tests/pending/run/t7825.scala new file mode 100644 index 000000000000..65ca06fdfc09 --- /dev/null +++ b/tests/pending/run/t7825.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ + +object Test extends CompilerTest { + import global._ + + override lazy val units: List[CompilationUnit] = { + // We can test this on JDK6. + javaCompilationUnits(global)(defaultMethodSource) ++ compilationUnits(global)(scalaExtendsDefault) + } + + private def defaultMethodSource = """ +public interface Iterator { + boolean hasNext(); + E next(); + default void remove() { + throw new UnsupportedOperationException("remove"); + } +} + """ + + private def scalaExtendsDefault = """ +object Test { + object X extends Iterator[String] { + def hasNext = true + def next = "!" + } +} + """ + + // We're only checking we that the Scala compilation unit passes refchecks + // No further checks are needed here. + def check(source: String, unit: global.CompilationUnit): Unit = { + } +} diff --git a/tests/pending/run/t7843-jsr223-service.check b/tests/pending/run/t7843-jsr223-service.check new file mode 100644 index 000000000000..a668df3567bb --- /dev/null +++ b/tests/pending/run/t7843-jsr223-service.check @@ -0,0 +1,2 @@ +n: Object = 10 +12345678910 diff --git a/tests/pending/run/t7843-jsr223-service.scala b/tests/pending/run/t7843-jsr223-service.scala new file mode 100644 index 000000000000..2874edb4c00d --- /dev/null +++ b/tests/pending/run/t7843-jsr223-service.scala @@ -0,0 +1,8 @@ +import scala.tools.nsc.interpreter.IMain + +object Test extends dotty.runtime.LegacyApp { + val engine = new IMain.Factory getScriptEngine() + engine.asInstanceOf[IMain].settings.usejavacp.value = true + engine put ("n", 10) + engine eval "1 to n.asInstanceOf[Int] foreach print" +} diff --git a/tests/pending/run/t7852.flags b/tests/pending/run/t7852.flags new file mode 100644 index 000000000000..f6262fd3e0b0 --- /dev/null +++ b/tests/pending/run/t7852.flags @@ -0,0 +1 @@ +-Ynooptimise diff --git a/tests/pending/run/t7852.scala b/tests/pending/run/t7852.scala new file mode 100644 index 000000000000..167906751042 --- /dev/null +++ b/tests/pending/run/t7852.scala @@ -0,0 +1,39 @@ +import scala.tools.partest.BytecodeTest +import scala.tools.asm +import scala.tools.asm.util._ +import scala.tools.nsc.util.stringFromWriter +import scala.collection.JavaConverters._ + +object Test extends BytecodeTest { + val nullChecks = Set(asm.Opcodes.IFNONNULL, asm.Opcodes.IFNULL) + + def show: Unit = { + def test(methodName: String, expected: Int) { + val classNode = loadClassNode("Lean") + val methodNode = getMethod(classNode, methodName) + val got = countNullChecks(methodNode.instructions) + assert(got == expected, s"$methodName: expected $expected but got $got comparisons") + } + test("string", expected = 0) + test("module", expected = 0) + test("moduleIndirect", expected = 2) + } + + def countNullChecks(insnList: asm.tree.InsnList): Int = + insnList.iterator.asScala.map(_.getOpcode).count(nullChecks) +} + +class Lean { + def string { + "" == toString + } + + def module { + Nil == (toString: Any) + } + + def moduleIndirect { + val n: Nil.type = null + n == (toString: Any) // still need null checks here. + } +} diff --git a/tests/pending/run/t7859/A_1.scala b/tests/pending/run/t7859/A_1.scala new file mode 100644 index 000000000000..74f0709d4db7 --- /dev/null +++ b/tests/pending/run/t7859/A_1.scala @@ -0,0 +1,11 @@ +class A(private val x: Int) extends AnyVal + +object A { + val Const = new A(0) +} + +class A1(protected val x: Int) extends AnyVal + +package p { + class A2(private[p] val x: Int) extends AnyVal +} diff --git a/tests/pending/run/t7859/B_2.scala b/tests/pending/run/t7859/B_2.scala new file mode 100644 index 000000000000..052322ef634d --- /dev/null +++ b/tests/pending/run/t7859/B_2.scala @@ -0,0 +1,47 @@ +class B private (private val b: Int) extends AnyVal +object B { + val Const = new B(0) +} + +// These tests will require erasure to unbox the value class. +// We need to test under joint and separate compilation to check +// that the 'notPRIVATE' flag on the param accessor is pickled. +// +// See also SI-6601. +object Test { + def main(args: Array[String]): Unit = { + unboxA + unboxA1 + unboxA2 + unboxB + } + + def unboxA: Unit = { + val o: Some[A] = Some(A.Const) + val a = o.get + def id(a: A): A = a + id(a) + } + + def unboxA1: Unit = { + val o: Some[A1] = Some(new A1(0)) + val a = o.get + def id(a: A1): A1 = a + id(a) + } + + def unboxA2: Unit = { + import p.A2 + val o: Some[A2] = Some(new A2(0)) + val a = o.get + def id(a: A2): A2 = a + id(a) + } + + def unboxB: Unit = { + val o: Some[B] = Some(B.Const) + val b = o.get + def id(b: B): B = b + id(b) + } +} diff --git a/tests/pending/run/t7868.scala b/tests/pending/run/t7868.scala new file mode 100644 index 000000000000..799447f1ef1d --- /dev/null +++ b/tests/pending/run/t7868.scala @@ -0,0 +1,13 @@ +object A { + def unapply(n: Int): Option[Int] = Some(n) + + def run = (0: Short) match { + case A(_) => + case _ => + } +} + + +object Test extends dotty.runtime.LegacyApp { + A.run +} diff --git a/tests/pending/run/t7868b.check b/tests/pending/run/t7868b.check new file mode 100644 index 000000000000..6577c4bc4e37 --- /dev/null +++ b/tests/pending/run/t7868b.check @@ -0,0 +1,6 @@ +Expr[Int]({ + val x = (0: Short): @unchecked match { + case A((x @ _)) => x + }; + x +}) diff --git a/tests/pending/run/t7868b.scala b/tests/pending/run/t7868b.scala new file mode 100644 index 000000000000..33d33f10a29f --- /dev/null +++ b/tests/pending/run/t7868b.scala @@ -0,0 +1,11 @@ +object A { + def unapply(n: Int): Option[Int] = Some(1) +} + +object Test extends dotty.runtime.LegacyApp { + import reflect.runtime.universe._ + println(reify { + val A(x) = (0: Short) + x + }) +} diff --git a/tests/pending/run/t7871.check b/tests/pending/run/t7871.check new file mode 100644 index 000000000000..ce6efd812d76 --- /dev/null +++ b/tests/pending/run/t7871.check @@ -0,0 +1 @@ +(SomeTree,SomeTree) diff --git a/tests/pending/run/t7871/Macros_1.scala b/tests/pending/run/t7871/Macros_1.scala new file mode 100644 index 000000000000..dca2508128cb --- /dev/null +++ b/tests/pending/run/t7871/Macros_1.scala @@ -0,0 +1,27 @@ +import scala.reflect.macros.whitebox.Context +import language.experimental.macros + +trait Tree +case object SomeTree extends Tree + +object NewQuasiquotes { + implicit class QuasiquoteInterpolation(c: StringContext) { + object nq { + def unapply(t: Tree): Any = macro QuasiquoteMacros.unapplyImpl + } + } +} + +object QuasiquoteMacros { + def unapplyImpl(c: Context)(t: c.Tree) = { + import c.universe._ + q""" + new { + def unapply(t: Tree) = t match { + case SomeTree => Some((SomeTree, SomeTree)) + case _ => None + } + }.unapply($t) + """ + } +} diff --git a/tests/pending/run/t7871/Test_2.scala b/tests/pending/run/t7871/Test_2.scala new file mode 100644 index 000000000000..55a8320b3333 --- /dev/null +++ b/tests/pending/run/t7871/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + import NewQuasiquotes._ + SomeTree match { + case nq"$x + $y" => println((x, y)) + } +} diff --git a/tests/pending/run/t7876.scala b/tests/pending/run/t7876.scala new file mode 100644 index 000000000000..aeec8c8cce0c --- /dev/null +++ b/tests/pending/run/t7876.scala @@ -0,0 +1,26 @@ +import scala.tools.partest._ + +// Type constructors for FunctionN and TupleN should not be considered as function type / tuple types. +object Test extends DirectTest { + override def extraSettings: String = "-usejavacp" + + def code = "" + + def show() { + val global = newCompiler() + new global.Run() + import global._, definitions._ + val function0TC = FunctionClass(0).typeConstructor + val tuple1TC = TupleClass(1).typeConstructor + FunctionClass.seq.foreach { sym => + val tc = sym.typeConstructor + assert(!isFunctionType(tc), s"$tc") + assert(!isFunctionTypeDirect(tc), s"$tc (direct)") + } + TupleClass.seq.foreach { sym => + val tc = sym.typeConstructor + assert(!isTupleType(tc), s"$sym") + assert(!isTupleTypeDirect(tc), s"$tc (direct)") + } + } +} diff --git a/tests/pending/run/t7880.scala b/tests/pending/run/t7880.scala new file mode 100644 index 000000000000..106047bc8fff --- /dev/null +++ b/tests/pending/run/t7880.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + // This should terminate in one way or another, but it shouldn't loop forever. + try { + val buffer = collection.mutable.ArrayBuffer.fill(Int.MaxValue / 2 + 1)(0) + buffer append 1 + } catch { case _: OutOfMemoryError => } +} diff --git a/tests/pending/run/t7899-regression.check b/tests/pending/run/t7899-regression.check new file mode 100644 index 000000000000..602b03a1d114 --- /dev/null +++ b/tests/pending/run/t7899-regression.check @@ -0,0 +1 @@ +warning: -Yinfer-by-name is deprecated: This flag is scheduled for removal in 2.12. If you have a case where you need this flag then please report a bug. diff --git a/tests/pending/run/t7899-regression.flags b/tests/pending/run/t7899-regression.flags new file mode 100644 index 000000000000..553a27eafde1 --- /dev/null +++ b/tests/pending/run/t7899-regression.flags @@ -0,0 +1 @@ +-Yinfer-by-name -deprecation diff --git a/tests/pending/run/t7899-regression.scala b/tests/pending/run/t7899-regression.scala new file mode 100644 index 000000000000..67d38cdd1d37 --- /dev/null +++ b/tests/pending/run/t7899-regression.scala @@ -0,0 +1,24 @@ +import language.higherKinds + +object Test { + trait Monad[M[_]] { + def foo[A](ma: M[A])(f: M[A] => Any) = f(ma) + } + implicit def function1Covariant[T]: Monad[({type l[a] = (T => a)})#l] = + new Monad[({type l[a] = (T => a)})#l] {} + + def main(args: Array[String]) { + // inference of T = (=> Any) here was outlawed by SI-7899 / 8ed7099 + // but this pattern is used in Scalaz in just a few places and caused + // a regression. + // + // Inference of a by-name type doesn't *always* lead to a ClassCastException, + // it only gets there if a method in generic code accepts a parameter of + // that type. + // + // We need to introduce the stricter inference rules gradually, probably + // with a warning. + val m = implicitly[Monad[({type f[+x] = (=> Any) => x})#f]] + assert(m.foo[Int]((x => 0))(f => f(???)) == 0) + } +} diff --git a/tests/pending/run/t7899.scala b/tests/pending/run/t7899.scala new file mode 100644 index 000000000000..2720cb89cef3 --- /dev/null +++ b/tests/pending/run/t7899.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + def id[A](a: => A): A = null.asInstanceOf[A] + def foo(f: (=> Int) => Int) = () => f(???) + foo(id)() // should be allowed and not throw ??? +} diff --git a/tests/pending/run/t7912.scala b/tests/pending/run/t7912.scala new file mode 100644 index 000000000000..3d603e0e97eb --- /dev/null +++ b/tests/pending/run/t7912.scala @@ -0,0 +1,16 @@ +case object A { override def toString = ??? } + +object Test { + def foo: Int = (A: Any) match { + case 0 => 0 + } + def main(args: Array[String]): Unit = { + try { + foo + sys.error("no exception") + } catch { + case me: MatchError => assert(me.getMessage == "an instance of class A$", me.getMessage) + case ex: Throwable => sys.error("not a match error: " + ex.getClass) + } + } +} diff --git a/tests/pending/run/t7932.check b/tests/pending/run/t7932.check new file mode 100644 index 000000000000..3f0a0c4f6271 --- /dev/null +++ b/tests/pending/run/t7932.check @@ -0,0 +1,3 @@ +warning: there was one feature warning; re-run with -feature for details +public Category C.category() +public Category C.category1() diff --git a/tests/pending/run/t7932.scala b/tests/pending/run/t7932.scala new file mode 100644 index 000000000000..2aaa493fa78e --- /dev/null +++ b/tests/pending/run/t7932.scala @@ -0,0 +1,11 @@ +class Category[M[_, _]] +trait M[F] { + type X[a, b] = F + def category: Category[X] = null + def category1: Category[Tuple2] = null +} +abstract class C extends M[Float] +object Test extends dotty.runtime.LegacyApp { + val ms = classOf[C].getMethods.filter(_.getName.startsWith("category")) + println(ms.map(_.toGenericString).sorted.mkString("\n")) +} diff --git a/tests/pending/run/t7933.check b/tests/pending/run/t7933.check new file mode 100644 index 000000000000..317e9677c3bc --- /dev/null +++ b/tests/pending/run/t7933.check @@ -0,0 +1,2 @@ +hello +hello diff --git a/tests/pending/run/t7933.scala b/tests/pending/run/t7933.scala new file mode 100644 index 000000000000..c82f9002ffca --- /dev/null +++ b/tests/pending/run/t7933.scala @@ -0,0 +1,11 @@ +import scala.tools.nsc.interpreter.IMain + +object Test extends dotty.runtime.LegacyApp { + val engine = new IMain.Factory getScriptEngine() + engine.asInstanceOf[IMain].settings.usejavacp.value = true + val res2 = engine.asInstanceOf[javax.script.Compilable] + res2 compile "8" eval() + val res5 = res2 compile """println("hello") ; 8""" + res5 eval() + res5 eval() +} diff --git a/tests/pending/run/t7974.check b/tests/pending/run/t7974.check new file mode 100644 index 000000000000..d8152d3286ee --- /dev/null +++ b/tests/pending/run/t7974.check @@ -0,0 +1,75 @@ +public class Symbols { + + + + + // access flags 0x12 + private final Lscala/Symbol; someSymbol3 + + // access flags 0xA + private static Lscala/Symbol; symbol$1 + + // access flags 0xA + private static Lscala/Symbol; symbol$2 + + // access flags 0xA + private static Lscala/Symbol; symbol$3 + + // access flags 0x9 + public static ()V + GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$; + LDC "Symbolic1" + INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol; + PUTSTATIC Symbols.symbol$1 : Lscala/Symbol; + GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$; + LDC "Symbolic2" + INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol; + PUTSTATIC Symbols.symbol$2 : Lscala/Symbol; + GETSTATIC scala/Symbol$.MODULE$ : Lscala/Symbol$; + LDC "Symbolic3" + INVOKEVIRTUAL scala/Symbol$.apply (Ljava/lang/String;)Lscala/Symbol; + PUTSTATIC Symbols.symbol$3 : Lscala/Symbol; + RETURN + MAXSTACK = 2 + MAXLOCALS = 0 + + // access flags 0x1 + public someSymbol1()Lscala/Symbol; + GETSTATIC Symbols.symbol$1 : Lscala/Symbol; + ARETURN + MAXSTACK = 1 + MAXLOCALS = 1 + + // access flags 0x1 + public someSymbol2()Lscala/Symbol; + GETSTATIC Symbols.symbol$2 : Lscala/Symbol; + ARETURN + MAXSTACK = 1 + MAXLOCALS = 1 + + // access flags 0x1 + public sameSymbol1()Lscala/Symbol; + GETSTATIC Symbols.symbol$1 : Lscala/Symbol; + ARETURN + MAXSTACK = 1 + MAXLOCALS = 1 + + // access flags 0x1 + public someSymbol3()Lscala/Symbol; + ALOAD 0 + GETFIELD Symbols.someSymbol3 : Lscala/Symbol; + ARETURN + MAXSTACK = 1 + MAXLOCALS = 1 + + // access flags 0x1 + public ()V + ALOAD 0 + INVOKESPECIAL java/lang/Object. ()V + ALOAD 0 + GETSTATIC Symbols.symbol$3 : Lscala/Symbol; + PUTFIELD Symbols.someSymbol3 : Lscala/Symbol; + RETURN + MAXSTACK = 2 + MAXLOCALS = 1 +} diff --git a/tests/pending/run/t7974.flags b/tests/pending/run/t7974.flags new file mode 100644 index 000000000000..5fc2a0389474 --- /dev/null +++ b/tests/pending/run/t7974.flags @@ -0,0 +1 @@ +-Xcheckinit:false diff --git a/tests/pending/run/t7974/Symbols.scala b/tests/pending/run/t7974/Symbols.scala new file mode 100644 index 000000000000..2363b724eb5a --- /dev/null +++ b/tests/pending/run/t7974/Symbols.scala @@ -0,0 +1,6 @@ +class Symbols { + def someSymbol1 = 'Symbolic1 + def someSymbol2 = 'Symbolic2 + def sameSymbol1 = 'Symbolic1 + val someSymbol3 = 'Symbolic3 +} diff --git a/tests/pending/run/t7974/Test.scala b/tests/pending/run/t7974/Test.scala new file mode 100644 index 000000000000..29d2b9cb6453 --- /dev/null +++ b/tests/pending/run/t7974/Test.scala @@ -0,0 +1,20 @@ +import java.io.PrintWriter; + +import scala.tools.partest.BytecodeTest +import scala.tools.asm.util._ +import scala.tools.nsc.util.stringFromWriter + +object Test extends BytecodeTest { + def show { + val classNode = loadClassNode("Symbols", skipDebugInfo = true) + val textifier = new Textifier + classNode.accept(new TraceClassVisitor(null, textifier, null)) + + val classString = stringFromWriter(w => textifier.print(w)) + val result = + classString.split('\n') + .dropWhile(elem => elem != "public class Symbols {") + .filterNot(elem => elem.startsWith(" @Lscala/reflect/ScalaSignature") || elem.startsWith(" ATTRIBUTE ScalaSig")) + result foreach println + } +} diff --git a/tests/pending/run/t7985.scala b/tests/pending/run/t7985.scala new file mode 100644 index 000000000000..3d8a9d51c5c3 --- /dev/null +++ b/tests/pending/run/t7985.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Array(1) match { case _: Array[scala.Int] => } +} diff --git a/tests/pending/run/t7985b.scala b/tests/pending/run/t7985b.scala new file mode 100644 index 000000000000..ea7a255db1c8 --- /dev/null +++ b/tests/pending/run/t7985b.scala @@ -0,0 +1,5 @@ +class a { type X = Int } + +object Test extends dotty.runtime.LegacyApp { + Array(1) match { case _: Array[a#X] => } +} diff --git a/tests/pending/run/t7992.scala b/tests/pending/run/t7992.scala new file mode 100644 index 000000000000..9753765c0b27 --- /dev/null +++ b/tests/pending/run/t7992.scala @@ -0,0 +1,20 @@ +class C { + def foo: Int = 0 +} + +class D extends C { + override def foo: Int = { + val f = () => { + class C // comment this line to fix. + D.super.foo // no super accessor generated here! + // java.lang.VerifyError: (class: D$$anonfun$1, method: apply$mcI$sp signature: ()I) Illegal use of nonvirtual function call + } + f() + } +} + +object Test { + def main(args: Array[String]): Unit = { + new D().foo + } +} diff --git a/tests/pending/run/t7992b.scala b/tests/pending/run/t7992b.scala new file mode 100644 index 000000000000..78891fd69d73 --- /dev/null +++ b/tests/pending/run/t7992b.scala @@ -0,0 +1,18 @@ +class C { + def foo: Int = 0 +} + +class E extends C { + override def foo: Int = { + (None: Option[Int]).getOrElse { + class C + E.super.foo + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + new E().foo + } +} diff --git a/tests/pending/run/t8002.scala b/tests/pending/run/t8002.scala new file mode 100644 index 000000000000..c27e83a46010 --- /dev/null +++ b/tests/pending/run/t8002.scala @@ -0,0 +1,19 @@ +object Test extends dotty.runtime.LegacyApp { + val a: Any = { + class A private () { private def x = 0; A.y }; + object A { + def a = new A().x + private def y = 0 + } + A.a + } + def b: Any = { + object A { + def a = new A().x + private def y = 0 + } + class A private () { private def x = 0; A.y }; + A.a + } + b +} diff --git a/tests/pending/run/t8010.scala b/tests/pending/run/t8010.scala new file mode 100644 index 000000000000..39d1d92847a3 --- /dev/null +++ b/tests/pending/run/t8010.scala @@ -0,0 +1,22 @@ +trait Base { + def t = 1 + def t(n: Int) = n + def bt = 2 + def bt(n: Int) = n +} +trait Derived extends Base { + // was: double defintion error + override def t = 1 + super.t + override def t(n: Int) = 1 + super.t(n) + override def bt = 1 + super.bt + override def bt(n: Int) = 1 + super.bt(n) +} + +object Test extends dotty.runtime.LegacyApp { + val d = new Derived {} + // not the focus of thie bug, but let's just check the runtime behaviour while we're here. + assert(d.t == 2) + assert(d.t(1) == 2) + assert(d.bt == 3) + assert(d.bt(1) == 2) +} diff --git a/tests/pending/run/t8015-ffc.scala b/tests/pending/run/t8015-ffc.scala new file mode 100644 index 000000000000..f458cc2acb46 --- /dev/null +++ b/tests/pending/run/t8015-ffc.scala @@ -0,0 +1,7 @@ + +object Test extends dotty.runtime.LegacyApp { + val ms = """This is a long multiline string + with \u000d\u000a CRLF embedded.""" + assert(ms.lines.size == 3, s"lines.size ${ms.lines.size}") + assert(ms contains "\r\n CRLF", "no CRLF") +} diff --git a/tests/pending/run/t8017.flags b/tests/pending/run/t8017.flags new file mode 100644 index 000000000000..48b438ddf86a --- /dev/null +++ b/tests/pending/run/t8017.flags @@ -0,0 +1 @@ +-Ydelambdafy:method diff --git a/tests/pending/run/t8017/value-class-lambda.scala b/tests/pending/run/t8017/value-class-lambda.scala new file mode 100644 index 000000000000..f247e35f60af --- /dev/null +++ b/tests/pending/run/t8017/value-class-lambda.scala @@ -0,0 +1,40 @@ +object Test { + def testC: Unit = { + val f1 = (c: C) => c.value + val f2 = (x: Int) => new C(x) + val f3 = (c1: C) => (c2: C) => (c1, c2) + val r1 = f2(2) + val r2 = f2(2) + val r3 = f3(r1)(r2) + val result = f1(r3._2) + assert(result == 2) + } + + def testD: Unit = { + val f1 = (c: D) => c.value + val f2 = (x: String) => new D(x) + val f3 = (c1: D) => (c2: D) => (c1, c2) + val r1 = f2("2") + val r2 = f2("2") + val r3 = f3(r1)(r2) + val result = f1(r3._2) + assert(result == "2") + } + + def testE: Unit = { + val f1 = (c: E[Int]) => c.value + val f2 = (x: Int) => new E(x) + val f3 = (c1: E[Int]) => (c2: E[Int]) => (c1, c2) + val r1 = f2(2) + val r2 = f2(2) + val r3 = f3(r1)(r2) + val result = f1(r3._2) + assert(result == 2) + } + + def main(args: Array[String]): Unit = { + testC + testD + testE + } +} diff --git a/tests/pending/run/t8017/value-class.scala b/tests/pending/run/t8017/value-class.scala new file mode 100644 index 000000000000..821239305f4c --- /dev/null +++ b/tests/pending/run/t8017/value-class.scala @@ -0,0 +1,3 @@ +class C(val value: Int) extends AnyVal +class D(val value: String) extends AnyVal +class E[A](val value: A) extends AnyVal diff --git a/tests/pending/run/t8029.scala b/tests/pending/run/t8029.scala new file mode 100644 index 000000000000..dbd5c41387d7 --- /dev/null +++ b/tests/pending/run/t8029.scala @@ -0,0 +1,57 @@ +import scala.tools.partest._ +import scala.tools.nsc._ + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -nowarn -Ystop-after:typer" + + override def code = "" // not used + + def code1 = """ +package object p1 { + trait A + object A +} + """ + + def code2 = """ +package object p2 { + class A + object A +} + """ + + def code3 = """ +package object p3 { + object A + trait A +} + """ + + def code4 = """ +package object p4 { + object A + trait A +} + """ + + def show() { + val global = newCompiler() + import global._ + def typecheck(code: String): Unit = { + val r = new Run + val sourceFile = newSources(code).head + global.reporter.reset() + r.compileSources(sourceFile :: Nil) + assert(!global.reporter.hasErrors) + } + + def typecheckTwice(code: String): Unit = { + typecheck(code) + typecheck(code) + } + + // was: illegal cyclic reference involving package ... + Seq(code1, code2, code3, code4) foreach typecheckTwice + } +} diff --git a/tests/pending/run/t8046.check b/tests/pending/run/t8046.check new file mode 100644 index 000000000000..905b0b35ca1d --- /dev/null +++ b/tests/pending/run/t8046.check @@ -0,0 +1,2 @@ +List(trait Op, trait Function1, class Object, class Any) +BTS(T,Three.this.Op[Int],Int => Int,Object,Any) diff --git a/tests/pending/run/t8046/Test.scala b/tests/pending/run/t8046/Test.scala new file mode 100644 index 000000000000..f6b525d1b5a1 --- /dev/null +++ b/tests/pending/run/t8046/Test.scala @@ -0,0 +1,18 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + override def code = "" + override def extraSettings: String = "-usejavacp" + + override def show() { + val c = newCompiler() + new c.Run + import c._ + + val f4 = typeOf[Three].member(newTermName("f4")) + val f4ParamInfo = f4.paramss.head.head.info + println(f4ParamInfo.baseClasses) + println(f4ParamInfo.baseTypeSeq) + } +} + diff --git a/tests/pending/run/t8046/t8046c.scala b/tests/pending/run/t8046/t8046c.scala new file mode 100644 index 000000000000..0b484da53070 --- /dev/null +++ b/tests/pending/run/t8046/t8046c.scala @@ -0,0 +1,13 @@ +import language._ + +trait One { + type Op[A] + type Alias[A] = Op[A] +} + +trait Three extends One { + trait Op[A] extends (A => A) + + def f4[T <: Alias[Int]](f: T) = 0 +} + diff --git a/tests/pending/run/t8047.check b/tests/pending/run/t8047.check new file mode 100644 index 000000000000..a6b83a4a16f4 --- /dev/null +++ b/tests/pending/run/t8047.check @@ -0,0 +1,7 @@ +doWhile$1(){ + 1; + if (true) + doWhile$1() + else + () +} diff --git a/tests/pending/run/t8047.scala b/tests/pending/run/t8047.scala new file mode 100644 index 000000000000..9139ce01c4cc --- /dev/null +++ b/tests/pending/run/t8047.scala @@ -0,0 +1,31 @@ +object Test extends dotty.runtime.LegacyApp { + import scala.reflect.runtime.universe._ + // + // x's owner is outer Test scope. Previosly the quasiquote expansion + // looked like: + // + // object Test { + // build.withFreshTermName("doWhile")(n => + // LabelDef(n, List(), + // Block( + // List({ val x = 1; x }), + // If(Literal(Constant(true)), Apply(Ident(n), List()), Literal(Constant(()))))) + // } + // + // Here the proper owner is anonymous function, not the Test. Hence + // symbol corruption. In new encoding this is represented as: + // + // object Test { + // { + // val n = build.freshTermName("doWhile") + // LabelDef(n, List(), + // Block( + // List({ val x = 1; x }), + // If(Literal(Constant(true)), Apply(Ident(n), List()), Literal(Constant(())))) + // } + // } + // + // Owner stays the same and life is good again. + // + println(q"do ${ val x = 1; x } while(true)") +} diff --git a/tests/pending/run/t8048a.check b/tests/pending/run/t8048a.check new file mode 100644 index 000000000000..8fb9e26e8437 --- /dev/null +++ b/tests/pending/run/t8048a.check @@ -0,0 +1 @@ +Some(2) diff --git a/tests/pending/run/t8048a/Macros_1.scala b/tests/pending/run/t8048a/Macros_1.scala new file mode 100644 index 000000000000..d13e851d90c5 --- /dev/null +++ b/tests/pending/run/t8048a/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox.Context +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + q"if (true) Some(2) else None" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t8048a/Test_2.scala b/tests/pending/run/t8048a/Test_2.scala new file mode 100644 index 000000000000..623a22a3aad0 --- /dev/null +++ b/tests/pending/run/t8048a/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x: Option[Int] = Macros.foo + println(x) +} \ No newline at end of file diff --git a/tests/pending/run/t8048b.check b/tests/pending/run/t8048b.check new file mode 100644 index 000000000000..083edaac2489 --- /dev/null +++ b/tests/pending/run/t8048b.check @@ -0,0 +1,3 @@ +2 +2 +2 diff --git a/tests/pending/run/t8048b/Macros_1.scala b/tests/pending/run/t8048b/Macros_1.scala new file mode 100644 index 000000000000..520a6fac06cd --- /dev/null +++ b/tests/pending/run/t8048b/Macros_1.scala @@ -0,0 +1,37 @@ +// see the following discussions to understand what's being tested here: +// * https://issues.scala-lang.org/browse/SI-6992 +// * https://issues.scala-lang.org/browse/SI-8048 +// * http://stackoverflow.com/questions/14370842/getting-a-structural-type-with-an-anonymous-classs-methods-from-a-macro +// * http://stackoverflow.com/questions/18480707/method-cannot-be-accessed-in-macro-generated-class/18485004#18485004 +// * https://groups.google.com/forum/#!topic/scala-internals/eXQt-BPm4i8 + +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl1(c: Context) = { + import c.universe._ + q""" + trait Foo { def x = 2 } + new Foo {} + """ + } + def foo1: Any = macro impl1 + + def impl2(c: Context) = { + import c.universe._ + q""" + class Foo { def x = 2 } + new Foo + """ + } + def foo2: Any = macro impl2 + + def impl3(c: Context) = { + import c.universe._ + q""" + new { def x = 2 } + """ + } + def foo3: Any = macro impl3 +} \ No newline at end of file diff --git a/tests/pending/run/t8048b/Test_2.scala b/tests/pending/run/t8048b/Test_2.scala new file mode 100644 index 000000000000..8474a34ec2b5 --- /dev/null +++ b/tests/pending/run/t8048b/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo1.x) + println(Macros.foo2.x) + println(Macros.foo3.x) +} \ No newline at end of file diff --git a/tests/pending/run/t8087.scala b/tests/pending/run/t8087.scala new file mode 100644 index 000000000000..7306039c6509 --- /dev/null +++ b/tests/pending/run/t8087.scala @@ -0,0 +1,12 @@ +trait Foo { + @volatile private[this] var x: String = "" + @volatile private var y: String = "" +} + +class Bar extends Foo + +object Test extends dotty.runtime.LegacyApp { + classOf[Bar].getDeclaredFields.foreach(f => { + assert(java.lang.reflect.Modifier.isVolatile(f.getModifiers), f.getName) + }) +} diff --git a/tests/pending/run/t8091.check b/tests/pending/run/t8091.check new file mode 100644 index 000000000000..4c4e91774f5f --- /dev/null +++ b/tests/pending/run/t8091.check @@ -0,0 +1 @@ +börk börk diff --git a/tests/pending/run/t8091.scala b/tests/pending/run/t8091.scala new file mode 100644 index 000000000000..35d0e50ba49e --- /dev/null +++ b/tests/pending/run/t8091.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val result = "börk börk" flatMap (ch ⇒ if (ch > 127) f"&#x${ch}%04x;" else "" + ch) + println(result) +} diff --git a/tests/pending/run/t8100.check b/tests/pending/run/t8100.check new file mode 100644 index 000000000000..cdd927fd88fb --- /dev/null +++ b/tests/pending/run/t8100.check @@ -0,0 +1 @@ +Success(0) diff --git a/tests/pending/run/t8100.scala b/tests/pending/run/t8100.scala new file mode 100644 index 000000000000..b9d0fe50031c --- /dev/null +++ b/tests/pending/run/t8100.scala @@ -0,0 +1,8 @@ +object Test { + import scala.util.Try + + def main(args: Array[String]): Unit = { + def stream = Stream.from(0).take(100000).map(n => None) + println(Try(stream.flatten.length)) + } +} diff --git a/tests/pending/run/t8104.check b/tests/pending/run/t8104.check new file mode 100644 index 000000000000..40523a28688c --- /dev/null +++ b/tests/pending/run/t8104.check @@ -0,0 +1,2 @@ +WeakTypeTag[.this.Repr] +(Int, Int) diff --git a/tests/pending/run/t8104/Macros_1.scala b/tests/pending/run/t8104/Macros_1.scala new file mode 100644 index 000000000000..e135bd807b11 --- /dev/null +++ b/tests/pending/run/t8104/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox.Context + +object Macros { + def impl[T](c: Context)(implicit T: c.WeakTypeTag[T]) = { + import c.universe._ + import definitions._ + val fields = T.tpe.decls.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x } + val Repr = appliedType(TupleClass(fields.length).asType.toType, fields.map(_.info)) + q"new Generic[$T]{ type Repr = $Repr }" + } +} \ No newline at end of file diff --git a/tests/pending/run/t8104/Test_2.scala b/tests/pending/run/t8104/Test_2.scala new file mode 100644 index 000000000000..4e97cdf9d29d --- /dev/null +++ b/tests/pending/run/t8104/Test_2.scala @@ -0,0 +1,19 @@ +trait Generic[T] { type Repr } +object Generic { + type Aux[T, Repr0] = Generic[T] { type Repr = Repr0 } + import scala.language.experimental.macros + implicit def materializeGeneric[T, Repr]: Generic.Aux[T, Repr] = macro Macros.impl[T] +} + +object Test extends dotty.runtime.LegacyApp { + case class C(x: Int, y: Int) + + import scala.reflect.runtime.universe._ + def reprify[T, Repr](x: T)(implicit generic: Generic.Aux[T, Repr], tag: WeakTypeTag[Repr]) = { + println(tag) + println(tag.tpe.typeSymbol.info) + } + reprify(C(40, 2)) + + implicitly[Generic.Aux[C, (Int, Int)]] +} diff --git a/tests/pending/run/t8133/A_1.scala b/tests/pending/run/t8133/A_1.scala new file mode 100644 index 000000000000..a2836cdb3afc --- /dev/null +++ b/tests/pending/run/t8133/A_1.scala @@ -0,0 +1,5 @@ +// a.scala +package object pkg { + class AnyOps(val x: Any) extends AnyVal + def AnyOps(x: Any) = new AnyOps(x) +} diff --git a/tests/pending/run/t8133/B_2.scala b/tests/pending/run/t8133/B_2.scala new file mode 100644 index 000000000000..b80e10952d14 --- /dev/null +++ b/tests/pending/run/t8133/B_2.scala @@ -0,0 +1,15 @@ +package pkg { + package object other + package other { + class Crash { + AnyOps(0) + () + } + } +} + +object Test { + def main(args: Array[String]): Unit = { + new pkg.other.Crash + } +} diff --git a/tests/pending/run/t8133b/A_1.scala b/tests/pending/run/t8133b/A_1.scala new file mode 100644 index 000000000000..24bbfc118dc0 --- /dev/null +++ b/tests/pending/run/t8133b/A_1.scala @@ -0,0 +1,4 @@ +package object pkg { + def foo(x: Int): String = "a" + def foo(x: String): String = "b" +} diff --git a/tests/pending/run/t8133b/B_2.scala b/tests/pending/run/t8133b/B_2.scala new file mode 100644 index 000000000000..865ca0c0b058 --- /dev/null +++ b/tests/pending/run/t8133b/B_2.scala @@ -0,0 +1,9 @@ +// b.scala +package pkg { + package object other + package other { class Crash { foo("") } } +} + +object Test { + def main(args: Array[String]): Unit = new pkg.other.Crash +} diff --git a/tests/pending/run/t8153.check b/tests/pending/run/t8153.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t8153.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t8153.scala b/tests/pending/run/t8153.scala new file mode 100644 index 000000000000..0cbfb5b5a6cf --- /dev/null +++ b/tests/pending/run/t8153.scala @@ -0,0 +1,14 @@ +object Test { + def f() = { + val lb = scala.collection.mutable.ListBuffer[Int](1, 2) + val it = lb.iterator + if (it.hasNext) it.next + val xs = lb.toList + lb += 3 + it.mkString + } + + def main(args: Array[String]): Unit = { + println(f()) + } +} diff --git a/tests/pending/run/t8177f.scala b/tests/pending/run/t8177f.scala new file mode 100644 index 000000000000..6f9a68c11b75 --- /dev/null +++ b/tests/pending/run/t8177f.scala @@ -0,0 +1,20 @@ +trait Thing { type A; var p: A = _ } +class A[T](final val x: Thing { type A = T }) { + type Q = T + + def x1: T = x.p + def x2: Q = x.p + def x3: x.A = x.p +} +// all result types should be inferred as Int +class B extends A[Int](null) { + def y1 = x1 + def y2 = x2 + val y3 = x3 // before SI-8177, this lead to a signature that erased to java.lang.Object +} + + +object Test extends dotty.runtime.LegacyApp { + val methods = classOf[B].getDeclaredMethods.sortBy(_.getName) + assert(methods.forall(_.toGenericString.startsWith("public int"))) +} diff --git a/tests/pending/run/t8188.scala b/tests/pending/run/t8188.scala new file mode 100644 index 000000000000..9ee542f2ae1a --- /dev/null +++ b/tests/pending/run/t8188.scala @@ -0,0 +1,25 @@ +object Test { + def main(args: Array[String]): Unit = { + import java.io.ByteArrayInputStream + import java.io.ByteArrayOutputStream + import java.io.ObjectInputStream + import java.io.ObjectOutputStream + import scala.collection.concurrent.TrieMap + + def ser[T](o: T): Array[Byte] = { + val baos = new ByteArrayOutputStream() + new ObjectOutputStream(baos).writeObject(o) + baos.toByteArray() + } + + def deser[T](bs: Array[Byte]): T = + new ObjectInputStream(new ByteArrayInputStream(bs)).readObject().asInstanceOf[T] + + def cloneViaSerialization[T](t: T): T = deser(ser(t)) + + val f = cloneViaSerialization(_: TrieMap[Int, Int]) + val tm = TrieMap(1 -> 2) + assert( f(f(tm)) == tm ) + assert( ser(tm).length == ser(f(tm)).length ) + } +} diff --git a/tests/pending/run/t8190.check b/tests/pending/run/t8190.check new file mode 100644 index 000000000000..d117bf329479 --- /dev/null +++ b/tests/pending/run/t8190.check @@ -0,0 +1,91 @@ +Annotation +Constant +Mirror +Name +TermName +TypeName +Position +Scope +MemberScope +Symbol +TermSymbol +TypeSymbol +MethodSymbol +ModuleSymbol +ClassSymbol +FreeTermSymbol +FreeTypeSymbol +Type +SingletonType +ThisType +SingleType +SuperType +ConstantType +TypeRef +CompoundType +RefinedType +ClassInfoType +MethodType +NullaryMethodType +PolyType +ExistentialType +AnnotatedType +TypeBounds +BoundedWildcardType +Tree +TermTree +TypTree +SymTree +NameTree +RefTree +DefTree +MemberDef +PackageDef +ImplDef +ClassDef +ModuleDef +ValOrDefDef +ValDef +DefDef +TypeDef +LabelDef +ImportSelector +Import +Template +Block +CaseDef +Alternative +Star +Bind +UnApply +Function +Assign +AssignOrNamedArg +If +Match +Return +Try +Throw +New +Typed +GenericApply +TypeApply +Apply +Super +This +Select +Ident +ReferenceToBoxed +Literal +Annotated +SingletonTypeTree +SelectFromTypeTree +CompoundTypeTree +AppliedTypeTree +TypeBoundsTree +ExistentialTypeTree +TypeTree +Modifiers +TreeCopier +checking exhaustiveness in scala.reflect.api.Universe... +uncovered type members: List() diff --git a/tests/pending/run/t8190.scala b/tests/pending/run/t8190.scala new file mode 100644 index 000000000000..4e6f7c462b1e --- /dev/null +++ b/tests/pending/run/t8190.scala @@ -0,0 +1,210 @@ +import scala.reflect.runtime.universe._ + +trait Overloads { + // makes sure noone erases to Any or AnyRef + def test(x: AnyRef) = "AnyRef" + def test(x: Annotation) = "Annotation" + def test(x: Constant) = "Constant" + def test(x: Mirror) = "Mirror" + def test(x: Name) = "Name" + def test(x: TermName) = "TermName" + def test(x: TypeName) = "TypeName" + def test(x: Position) = "Position" + def test(x: Scope) = "Scope" + def test(x: MemberScope) = "MemberScope" + def test(x: Symbol) = "Symbol" + def test(x: TermSymbol) = "TermSymbol" + def test(x: TypeSymbol) = "TypeSymbol" + def test(x: MethodSymbol) = "MethodSymbol" + def test(x: ModuleSymbol) = "ModuleSymbol" + def test(x: ClassSymbol) = "ClassSymbol" + def test(x: FreeTermSymbol) = "FreeTermSymbol" + def test(x: FreeTypeSymbol) = "FreeTypeSymbol" + def test(x: Type) = "Type" + def test(x: SingletonType) = "SingletonType" + def test(x: ThisType) = "ThisType" + def test(x: SingleType) = "SingleType" + def test(x: SuperType) = "SuperType" + def test(x: ConstantType) = "ConstantType" + def test(x: TypeRef) = "TypeRef" + def test(x: CompoundType) = "CompoundType" + def test(x: RefinedType) = "RefinedType" + def test(x: ClassInfoType) = "ClassInfoType" + def test(x: MethodType) = "MethodType" + def test(x: NullaryMethodType) = "NullaryMethodType" + def test(x: PolyType) = "PolyType" + def test(x: ExistentialType) = "ExistentialType" + def test(x: AnnotatedType) = "AnnotatedType" + def test(x: TypeBounds) = "TypeBounds" + def test(x: BoundedWildcardType) = "BoundedWildcardType" + def test(x: Tree) = "Tree" + def test(x: TermTree) = "TermTree" + def test(x: TypTree) = "TypTree" + def test(x: SymTree) = "SymTree" + def test(x: NameTree) = "NameTree" + def test(x: RefTree) = "RefTree" + def test(x: DefTree) = "DefTree" + def test(x: MemberDef) = "MemberDef" + def test(x: PackageDef) = "PackageDef" + def test(x: ImplDef) = "ImplDef" + def test(x: ClassDef) = "ClassDef" + def test(x: ModuleDef) = "ModuleDef" + def test(x: ValOrDefDef) = "ValOrDefDef" + def test(x: ValDef) = "ValDef" + def test(x: DefDef) = "DefDef" + def test(x: TypeDef) = "TypeDef" + def test(x: LabelDef) = "LabelDef" + def test(x: ImportSelector) = "ImportSelector" + def test(x: Import) = "Import" + def test(x: Template) = "Template" + def test(x: Block) = "Block" + def test(x: CaseDef) = "CaseDef" + def test(x: Alternative) = "Alternative" + def test(x: Star) = "Star" + def test(x: Bind) = "Bind" + def test(x: UnApply) = "UnApply" + def test(x: Function) = "Function" + def test(x: Assign) = "Assign" + def test(x: AssignOrNamedArg) = "AssignOrNamedArg" + def test(x: If) = "If" + def test(x: Match) = "Match" + def test(x: Return) = "Return" + def test(x: Try) = "Try" + def test(x: Throw) = "Throw" + def test(x: New) = "New" + def test(x: Typed) = "Typed" + def test(x: GenericApply) = "GenericApply" + def test(x: TypeApply) = "TypeApply" + def test(x: Apply) = "Apply" + def test(x: Super) = "Super" + def test(x: This) = "This" + def test(x: Select) = "Select" + def test(x: Ident) = "Ident" + def test(x: ReferenceToBoxed) = "ReferenceToBoxed" + def test(x: Literal) = "Literal" + def test(x: Annotated) = "Annotated" + def test(x: SingletonTypeTree) = "SingletonTypeTree" + def test(x: SelectFromTypeTree) = "SelectFromTypeTree" + def test(x: CompoundTypeTree) = "CompoundTypeTree" + def test(x: AppliedTypeTree) = "AppliedTypeTree" + def test(x: TypeBoundsTree) = "TypeBoundsTree" + def test(x: ExistentialTypeTree) = "ExistentialTypeTree" + def test(x: TypeTree) = "TypeTree" + def test(x: Modifiers) = "Modifiers" + def test(x: TreeCopier) = "TreeCopier" +} + +object Test extends dotty.runtime.LegacyApp with Overloads { + val buf = scala.collection.mutable.ListBuffer[String]() + def record(result: String): Unit = { + println(result) + buf += result + } + def check(): Unit = { + println("checking exhaustiveness in scala.reflect.api.Universe...") + var types = typeOf[scala.reflect.api.Universe].members.filter(sym => sym.isType && !sym.isClass).map(_.name.toString) + types = types.filter(_ != "ModifiersCreator") // type ModifiersCreator = ModifiersExtractor + types = types.filter(_ != "FlagSet") // type FlagSet + types = types.filter(_ != "RuntimeClass") // type RuntimeClass = java.lang.Class[_] + types = types.filter(_ != "JavaArgument") // deprecated + types = types.filter(_ != "LiteralArgument") // deprecated + types = types.filter(_ != "ArrayArgument") // deprecated + types = types.filter(_ != "NestedArgument") // deprecated + types = types.filter(_ != "Importer") // deprecated + types = types.filter(_ != "Internal") // internal + types = types.filter(_ != "Compat") // internal + types = types.filter(_ != "BuildApi") // deprecated + val diff = types.toList diff buf.toList + println("uncovered type members: " + diff) + } + record(test(null: Annotation)) + record(test(null: Constant)) + record(test(null: Mirror)) + record(test(null: Name)) + record(test(null: TermName)) + record(test(null: TypeName)) + record(test(null: Position)) + record(test(null: Scope)) + record(test(null: MemberScope)) + record(test(null: Symbol)) + record(test(null: TermSymbol)) + record(test(null: TypeSymbol)) + record(test(null: MethodSymbol)) + record(test(null: ModuleSymbol)) + record(test(null: ClassSymbol)) + record(test(null: FreeTermSymbol)) + record(test(null: FreeTypeSymbol)) + record(test(null: Type)) + record(test(null: SingletonType)) + record(test(null: ThisType)) + record(test(null: SingleType)) + record(test(null: SuperType)) + record(test(null: ConstantType)) + record(test(null: TypeRef)) + record(test(null: CompoundType)) + record(test(null: RefinedType)) + record(test(null: ClassInfoType)) + record(test(null: MethodType)) + record(test(null: NullaryMethodType)) + record(test(null: PolyType)) + record(test(null: ExistentialType)) + record(test(null: AnnotatedType)) + record(test(null: TypeBounds)) + record(test(null: BoundedWildcardType)) + record(test(null: Tree)) + record(test(null: TermTree)) + record(test(null: TypTree)) + record(test(null: SymTree)) + record(test(null: NameTree)) + record(test(null: RefTree)) + record(test(null: DefTree)) + record(test(null: MemberDef)) + record(test(null: PackageDef)) + record(test(null: ImplDef)) + record(test(null: ClassDef)) + record(test(null: ModuleDef)) + record(test(null: ValOrDefDef)) + record(test(null: ValDef)) + record(test(null: DefDef)) + record(test(null: TypeDef)) + record(test(null: LabelDef)) + record(test(null: ImportSelector)) + record(test(null: Import)) + record(test(null: Template)) + record(test(null: Block)) + record(test(null: CaseDef)) + record(test(null: Alternative)) + record(test(null: Star)) + record(test(null: Bind)) + record(test(null: UnApply)) + record(test(null: Function)) + record(test(null: Assign)) + record(test(null: AssignOrNamedArg)) + record(test(null: If)) + record(test(null: Match)) + record(test(null: Return)) + record(test(null: Try)) + record(test(null: Throw)) + record(test(null: New)) + record(test(null: Typed)) + record(test(null: GenericApply)) + record(test(null: TypeApply)) + record(test(null: Apply)) + record(test(null: Super)) + record(test(null: This)) + record(test(null: Select)) + record(test(null: Ident)) + record(test(null: ReferenceToBoxed)) + record(test(null: Literal)) + record(test(null: Annotated)) + record(test(null: SingletonTypeTree)) + record(test(null: SelectFromTypeTree)) + record(test(null: CompoundTypeTree)) + record(test(null: AppliedTypeTree)) + record(test(null: TypeBoundsTree)) + record(test(null: ExistentialTypeTree)) + record(test(null: TypeTree)) + record(test(null: Modifiers)) + record(test(null: TreeCopier)) + check() +} diff --git a/tests/pending/run/t8192.check b/tests/pending/run/t8192.check new file mode 100644 index 000000000000..2423a7acbf13 --- /dev/null +++ b/tests/pending/run/t8192.check @@ -0,0 +1,32 @@ +compile-time +package scala +primary constructor: NoSymbol +object List +primary constructor: def (): scala.collection.immutable.List.type => true +def (): scala.collection.immutable.List.type => true +trait Product1 +primary constructor: def $init$(): Unit => true +class UninitializedFieldError +primary constructor: def (msg: String): UninitializedFieldError => true +def (msg: String): UninitializedFieldError => true +def (obj: Any): UninitializedFieldError => false +class C +primary constructor: def (x: Int): C => true +def (x: Int): C => true +def (x: String): C => false +runtime +package scala +primary constructor: NoSymbol +object List +primary constructor: def (): scala.collection.immutable.List.type => true +def (): scala.collection.immutable.List.type => true +trait Product1 +primary constructor: def $init$(): Unit => true +class UninitializedFieldError +primary constructor: def (msg: String): UninitializedFieldError => true +def (msg: String): UninitializedFieldError => true +def (obj: Any): UninitializedFieldError => false +class C +primary constructor: def (x: Int): C => true +def (x: Int): C => true +def (x: String): C => false diff --git a/tests/pending/run/t8192/Macros_1.scala b/tests/pending/run/t8192/Macros_1.scala new file mode 100644 index 000000000000..72fb2cf31384 --- /dev/null +++ b/tests/pending/run/t8192/Macros_1.scala @@ -0,0 +1,45 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros +import java.io._ + +object Macros { + def impl(c: Context) = { + var messages = List[String]() + def println(msg: String) = messages :+= msg + + import c.universe._ + def test(sym: ClassSymbol): Unit = { + def fullyInitializeSymbol(sym: Symbol): Unit = { + val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] + internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) + } + def defString(sym: Symbol): String = { + val internal = c.universe.asInstanceOf[scala.reflect.internal.SymbolTable] + sym.asInstanceOf[internal.Symbol].defString + } + def showCtor(sym: Symbol): String = { + fullyInitializeSymbol(sym) + if (sym == NoSymbol) "NoSymbol" + else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" + } + sym.info + println(sym.toString) + println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") + val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) + ctors.toList.sorted.foreach(println) + } + + println("compile-time") + // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out + // test(typeOf[File].typeSymbol.asClass) + test(definitions.ScalaPackageClass) + test(definitions.ListModule.moduleClass.asClass) + test(typeOf[Product1[_]].typeSymbol.asClass) + test(typeOf[UninitializedFieldError].typeSymbol.asClass) + test(c.mirror.staticClass("C").asClass) + + q"..${messages.map(msg => q"println($msg)")}" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/t8192/Test_2.scala b/tests/pending/run/t8192/Test_2.scala new file mode 100644 index 000000000000..dec90ab6616f --- /dev/null +++ b/tests/pending/run/t8192/Test_2.scala @@ -0,0 +1,40 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} + +class C(x: Int) { + def this(x: String) = this(x.toInt) +} + +object Test extends dotty.runtime.LegacyApp { + def test(sym: ClassSymbol): Unit = { + def fullyInitializeSymbol(sym: Symbol): Unit = { + val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] + internal.definitions.fullyInitializeSymbol(sym.asInstanceOf[internal.Symbol]) + } + def defString(sym: Symbol): String = { + val internal = ru.asInstanceOf[scala.reflect.internal.SymbolTable] + sym.asInstanceOf[internal.Symbol].defString + } + def showCtor(sym: Symbol): String = { + fullyInitializeSymbol(sym) + if (sym == NoSymbol) "NoSymbol" + else s"${defString(sym)} => ${sym.asMethod.isPrimaryConstructor}" + } + sym.info + println(sym.toString) + println(s"primary constructor: ${showCtor(sym.primaryConstructor)}") + val ctors = sym.info.members.filter(_.name == termNames.CONSTRUCTOR).map(sym => showCtor(sym)) + ctors.toList.sorted.foreach(println) + } + + Macros.foo + println("runtime") + // SI-8367 primaryConstructor for Java-defined classes is unstable, so I'm commenting this out + // test(typeOf[File].typeSymbol.asClass) + test(definitions.ScalaPackageClass) + test(definitions.ListModule.moduleClass.asClass) + test(typeOf[Product1[_]].typeSymbol.asClass) + test(typeOf[UninitializedFieldError].typeSymbol.asClass) + test(typeOf[C].typeSymbol.asClass) +} diff --git a/tests/pending/run/t8196.check b/tests/pending/run/t8196.check new file mode 100644 index 000000000000..d11dc27e68d9 --- /dev/null +++ b/tests/pending/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 two feature warnings; re-run with -feature for details +Scope{ + final private val f1: Int +} diff --git a/tests/pending/run/t8196.scala b/tests/pending/run/t8196.scala new file mode 100644 index 000000000000..bb40aa205973 --- /dev/null +++ b/tests/pending/run/t8196.scala @@ -0,0 +1,51 @@ +import scala.reflect.runtime.{ universe => ru } + +object Test extends dotty.runtime.LegacyApp { + + 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/tests/pending/run/t8197.scala b/tests/pending/run/t8197.scala new file mode 100644 index 000000000000..b510f96f1b38 --- /dev/null +++ b/tests/pending/run/t8197.scala @@ -0,0 +1,16 @@ +// SI-8197, see also SI-4592 and SI-4728 +class A +class B + +class Foo(val x: A = null) { + def this(bla: B*) = { + this(new A) + } +} + +object Test extends dotty.runtime.LegacyApp { + // both constructors of `Foo` are applicable. Overloading resolution + // will eliminate the alternative that uses a default argument, therefore + // the vararg constructor is chosen. + assert((new Foo).x != null) +} diff --git a/tests/pending/run/t8197b.scala b/tests/pending/run/t8197b.scala new file mode 100644 index 000000000000..a9012ddf9de4 --- /dev/null +++ b/tests/pending/run/t8197b.scala @@ -0,0 +1,8 @@ +object O { + def foo[T](t: T) = 0 + def foo(s: String)(implicit i: DummyImplicit = null) = 1 +} + +object Test extends dotty.runtime.LegacyApp { + assert(O.foo("") == 1) +} diff --git a/tests/pending/run/t8199.scala b/tests/pending/run/t8199.scala new file mode 100644 index 000000000000..d84f6fc72a54 --- /dev/null +++ b/tests/pending/run/t8199.scala @@ -0,0 +1,105 @@ +class reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname { +object obj0 +object obj01 +object obj012 +object obj0123 +object obj01234 +object obj012345 +object obj0123456 +object obj01234567 +object obj012345678 +object obj0123456789 +object obj01234567890 +class cls0 +class cls01 +class cls012 +class cls0123 +class cls01234 +class cls012345 +class cls0123456 +class cls01234567 +class cls012345678 +class cls0123456789 +class cls01234567890 +trait trt0 { def x = Test.checkCallerImplClassName() } +trait trt01 { def x = Test.checkCallerImplClassName() } +trait trt012 { def x = Test.checkCallerImplClassName() } +trait trt0123 { def x = Test.checkCallerImplClassName() } +trait trt01234 { def x = Test.checkCallerImplClassName() } +trait trt012345 { def x = Test.checkCallerImplClassName() } +trait trt0123456 { def x = Test.checkCallerImplClassName() } +trait trt01234567 { def x = Test.checkCallerImplClassName() } +trait trt012345678 { def x = Test.checkCallerImplClassName() } +trait trt0123456789 { def x = Test.checkCallerImplClassName() } +trait trt01234567890 { def x = Test.checkCallerImplClassName() } +} + +object Test extends dotty.runtime.LegacyApp { + def check(c: Class[_]): Unit = { + checkClassName(c.getName) + } + def checkClassName(name: String): Unit = { + val defaultMaxClassFileLength = 255 + assert((name + ".class").length <= defaultMaxClassFileLength, name) + } + def checkCallerImplClassName(): Unit = { + val name = Thread.currentThread.getStackTrace.apply(2).getClassName + assert(name.contains("$class")) + Test.checkClassName(name) + } + + val c = new reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname + import c._ + + check(obj0.getClass) + check(obj01.getClass) + check(obj012.getClass) + check(obj0123.getClass) + check(obj01234.getClass) + check(obj012345.getClass) + check(obj0123456.getClass) + check(obj01234567.getClass) + check(obj012345678.getClass) + check(obj0123456789.getClass) + check(obj01234567890.getClass) + + check(classOf[cls0]) + check(classOf[cls01]) + check(classOf[cls012]) + check(classOf[cls0123]) + check(classOf[cls01234]) + check(classOf[cls012345]) + check(classOf[cls0123456]) + check(classOf[cls01234567]) + check(classOf[cls012345678]) + check(classOf[cls0123456789]) + check(classOf[cls01234567890]) + + // interface facets + check(classOf[trt0]) + check(classOf[trt01]) + check(classOf[trt012]) + check(classOf[trt0123]) + check(classOf[trt01234]) + check(classOf[trt012345]) + check(classOf[trt0123456]) + check(classOf[trt01234567]) + check(classOf[trt012345678]) + check(classOf[trt0123456789]) + check(classOf[trt01234567890]) + + // impl classes are harder to find the names of to test! + (new trt0 {}).x + (new trt01 {}).x + (new trt012 {}).x + (new trt0123 {}).x + (new trt01234 {}).x + (new trt012345 {}).x + (new trt0123456 {}).x + (new trt01234567 {}).x + (new trt012345678 {}).x + (new trt0123456789 {}).x + (new trt01234567890 {}).x +} + +// filename too long: reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname$obj012345$.class diff --git a/tests/pending/run/t8233-bcode.flags b/tests/pending/run/t8233-bcode.flags new file mode 100644 index 000000000000..c30091d3de5d --- /dev/null +++ b/tests/pending/run/t8233-bcode.flags @@ -0,0 +1 @@ +-Ybackend:GenBCode diff --git a/tests/pending/run/t8233-bcode.scala b/tests/pending/run/t8233-bcode.scala new file mode 100644 index 000000000000..771e4cf0c1b0 --- /dev/null +++ b/tests/pending/run/t8233-bcode.scala @@ -0,0 +1,31 @@ +object Test { + def bar(s: String) = s; + val o: Option[Null] = None + def nullReference: Unit = { + val a: Null = o.get + bar(a) // Was: VerifyError under GenICode + } + + def literal: Unit = { + val a: Null = null + bar(a) + } + + /** Check SI-8330 for details */ + def expectedUnitInABranch(b: Boolean): Boolean = { + if (b) { + val x = 12 + () + } else { + // here expected type is (unboxed) Unit + null + } + true + } + + def main(args: Array[String]): Unit = { + try { nullReference } catch { case _: NoSuchElementException => } + literal + expectedUnitInABranch(true) + } +} diff --git a/tests/pending/run/t8233.scala b/tests/pending/run/t8233.scala new file mode 100644 index 000000000000..3896a7cc6b12 --- /dev/null +++ b/tests/pending/run/t8233.scala @@ -0,0 +1,31 @@ +object Test { + def bar(s: String) = s; + val o: Option[Null] = None + def nullReference: Unit = { + val a: Null = o.get + bar(a) // Was: VerifyError under GenICode + } + + def literal: Unit = { + val a: Null = null + bar(a) + } + + /** Check SI-8330 for details */ + def expectedUnitInABranch(b: Boolean): Boolean = { + if (b) { + val x = 12 + () + } else { + // here expected type is (unboxed) Unit + null + } + true + } + + def main(args: Array[String]): Unit = { + try { nullReference } catch { case _: NoSuchElementException => } + literal + expectedUnitInABranch(true) // Was: VerifyError under GenICode + } +} diff --git a/tests/pending/run/t8245.scala b/tests/pending/run/t8245.scala new file mode 100644 index 000000000000..5a6fb9ff74fd --- /dev/null +++ b/tests/pending/run/t8245.scala @@ -0,0 +1,14 @@ +object Test { + def foo(o: Option[Int]): Int = { + lazy val i: Int = { + def local: Int = {if ("".isEmpty) return 42; -42} + assert(local == 42) + o.getOrElse(return -1) + } + i + 1 + } + + def main(args: Array[String]): Unit = { + assert(foo(None) == -1) + } +} diff --git a/tests/pending/run/t8266-octal-interp.check b/tests/pending/run/t8266-octal-interp.check new file mode 100644 index 000000000000..66ecafddc2ac --- /dev/null +++ b/tests/pending/run/t8266-octal-interp.check @@ -0,0 +1,30 @@ +t8266-octal-interp.scala:4: warning: Octal escape literals are deprecated, use \b instead. + f"a\10c", + ^ +t8266-octal-interp.scala:5: warning: Octal escape literals are deprecated, use \t instead. + f"a\11c", + ^ +t8266-octal-interp.scala:6: warning: Octal escape literals are deprecated, use \n instead. + f"a\12c", + ^ +t8266-octal-interp.scala:7: warning: Octal escape literals are deprecated, use \r instead. + f"a\15c", + ^ +t8266-octal-interp.scala:8: warning: Octal escape literals are deprecated, use ${'"'} or a triple-quoted literal """with embedded " or \u0022""" instead. + f"a\42c", + ^ +t8266-octal-interp.scala:9: warning: Octal escape literals are deprecated, use \\ instead. + f"a\134c", + ^ +t8266-octal-interp.scala:10: warning: Octal escape literals are deprecated, use \u0069 instead. + f"a\15151515c" + ^ +ac +a c +a +c +a +c +a"c +a\c +ai51515c diff --git a/tests/pending/run/t8266-octal-interp.flags b/tests/pending/run/t8266-octal-interp.flags new file mode 100644 index 000000000000..dcc59ebe32ef --- /dev/null +++ b/tests/pending/run/t8266-octal-interp.flags @@ -0,0 +1 @@ +-deprecation diff --git a/tests/pending/run/t8266-octal-interp.scala b/tests/pending/run/t8266-octal-interp.scala new file mode 100644 index 000000000000..8163ad585f01 --- /dev/null +++ b/tests/pending/run/t8266-octal-interp.scala @@ -0,0 +1,16 @@ + +trait X { + def f = Seq( + f"a\10c", + f"a\11c", + f"a\12c", + f"a\15c", + f"a\42c", + f"a\134c", + f"a\15151515c" + ) +} + +object Test extends dotty.runtime.LegacyApp with X { + f foreach println +} diff --git a/tests/pending/run/t8280.check b/tests/pending/run/t8280.check new file mode 100644 index 000000000000..ed392841c7ce --- /dev/null +++ b/tests/pending/run/t8280.check @@ -0,0 +1,9 @@ +Int +Int +Int +Int +Int +Int +Int +Int +Int diff --git a/tests/pending/run/t8280.scala b/tests/pending/run/t8280.scala new file mode 100644 index 000000000000..0734d63b6ea4 --- /dev/null +++ b/tests/pending/run/t8280.scala @@ -0,0 +1,82 @@ +import scala.language.implicitConversions + +object Test { + def main(args: Array[String]): Unit = { + Moop1.ob1 + Moop1.ob2 + Moop1.ob3 + Moop2.ob1 + Moop2.ob2 + Moop2.ob3 + Moop3.ob1 + Moop3.ob2 + Moop3.ob3 + } +} + +// int object vs. +object Moop1 { + object ob1 { + implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } + implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } + + println(5: String) + } + object ob2 { + implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } + implicit def f2(x: Long): String = "Long" + + println(5: String) + } + object ob3 { + implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } + implicit val f2: Long => String = _ => "Long" + + println(5: String) + } +} + +// int def vs. +object Moop2 { + object ob1 { + implicit def f1(x: Int): String = "Int" + implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } + + println(5: String) + } + object ob2 { + implicit def f1(x: Int): String = "Int" + implicit def f2(x: Long): String = "Long" + + println(5: String) + } + object ob3 { + implicit def f1(x: Int): String = "Int" + implicit val f2: Long => String = _ => "Long" + + println(5: String) + } +} + +// int val vs. +object Moop3 { + object ob1 { + implicit val f1: Int => String = _ => "Int" + implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" } + + println(5: String) + } + object ob2 { + implicit val f1: Int => String = _ => "Int" + implicit def f2(x: Long): String = "Long" + + println(5: String) + } + object ob3 { + implicit val f1: Int => String = _ => "Int" + implicit val f2: Long => String = _ => "Long" + + println(5: String) + } +} + diff --git a/tests/pending/run/t8321.check b/tests/pending/run/t8321.check new file mode 100644 index 000000000000..0cfbf08886fc --- /dev/null +++ b/tests/pending/run/t8321.check @@ -0,0 +1 @@ +2 diff --git a/tests/pending/run/t8321/Macros_1.scala b/tests/pending/run/t8321/Macros_1.scala new file mode 100644 index 000000000000..70e44fc7614f --- /dev/null +++ b/tests/pending/run/t8321/Macros_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +class Bundle(val c: Context) { + import c.universe._ + def impl = q"new { val x = 2 }" +} + +object Macros { + def foo: Any = macro Bundle.impl +} \ No newline at end of file diff --git a/tests/pending/run/t8321/Test_2.scala b/tests/pending/run/t8321/Test_2.scala new file mode 100644 index 000000000000..d4944211727e --- /dev/null +++ b/tests/pending/run/t8321/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.foo.x) +} \ No newline at end of file diff --git a/tests/pending/run/t8346.check b/tests/pending/run/t8346.check new file mode 100644 index 000000000000..1ba5c31abe42 --- /dev/null +++ b/tests/pending/run/t8346.check @@ -0,0 +1,6 @@ +BitSet: List(invariant, invariant, invariant, invariant) +HashSet: List(covariant (true), covariant (true), covariant (true), covariant (true)) +ListSet: List(covariant (true), covariant (true), covariant (true), covariant (true)) +SortedSet: List(invariant, invariant, invariant, invariant) +TreeSet: List(invariant, invariant, invariant, invariant) +ValueSet: invariant diff --git a/tests/pending/run/t8346.scala b/tests/pending/run/t8346.scala new file mode 100644 index 000000000000..1c34ab35f749 --- /dev/null +++ b/tests/pending/run/t8346.scala @@ -0,0 +1,34 @@ +object Test extends dotty.runtime.LegacyApp { + import reflect.ClassTag + + object SomeEnum extends Enumeration { + val one, two, three, four = Value + } + + def sctor[A <: Set[Int]](f: Int => A)(implicit A: ClassTag[A]) + : (String, Int => Set[Int]) = + (A.runtimeClass.getSimpleName, f) + + val inits: Seq[(String, Int => Set[Int])] = { + import collection.immutable.{Seq => _, _} + Seq(sctor(BitSet(_)), + sctor(HashSet(_)), + sctor(ListSet(_)), + sctor(SortedSet(_)), + sctor(TreeSet(_))) + } + + def sVarInfo[A](sa: Set[A]): String = { + val saa = sa.toSet[Any] + if (sa eq saa) s"""covariant (${(saa + "hi") contains "hi"})""" + else "invariant" + } + + inits foreach {case (name, singleton) => + print(s"${name}: ") + val one = singleton(1) + println(Seq(2,3,4).scanLeft(one)(_ + _) map sVarInfo toList) + } + + println(s"ValueSet: ${sVarInfo(SomeEnum.values)}") +} diff --git a/tests/pending/run/t8395.scala b/tests/pending/run/t8395.scala new file mode 100644 index 000000000000..f2b687e2b561 --- /dev/null +++ b/tests/pending/run/t8395.scala @@ -0,0 +1,9 @@ + object Test { + def baz(x: Object) = { + val s @ (_s: String) = x + x + } + def main(args: Array[String]): Unit = { + assert(baz("1") == "1") + } +} diff --git a/tests/pending/run/t8425.check b/tests/pending/run/t8425.check new file mode 100644 index 000000000000..8379fa0a7425 --- /dev/null +++ b/tests/pending/run/t8425.check @@ -0,0 +1 @@ +List(fresh$macro$1, $macro$2) diff --git a/tests/pending/run/t8425/Macros_1.scala b/tests/pending/run/t8425/Macros_1.scala new file mode 100644 index 000000000000..71a96518e8ac --- /dev/null +++ b/tests/pending/run/t8425/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.language.experimental.macros +import scala.reflect.macros.blackbox.Context + +object Macros { + def foo: Unit = macro impl + def impl(c: Context) = { + import c.universe._ + val test1 = c.freshName() + val test2 = c.freshName("$") + q"println(List($test1, $test2))" + } +} \ No newline at end of file diff --git a/tests/pending/run/t8425/Test_2.scala b/tests/pending/run/t8425/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/t8425/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/t8428.scala b/tests/pending/run/t8428.scala new file mode 100644 index 000000000000..d79a698d4ca8 --- /dev/null +++ b/tests/pending/run/t8428.scala @@ -0,0 +1,12 @@ +object Test extends dotty.runtime.LegacyApp { + val xs = List.tabulate(4)(List(_)) + val i = xs.map(_.iterator).reduce { (a,b) => + a.hasNext + a ++ b + } + + val r1 = i.toList + val r2 = xs.flatten.toList + + assert(r1 == r2, r1) +} diff --git a/tests/pending/run/t8437.check b/tests/pending/run/t8437.check new file mode 100644 index 000000000000..fd3c81a4d763 --- /dev/null +++ b/tests/pending/run/t8437.check @@ -0,0 +1,2 @@ +5 +5 diff --git a/tests/pending/run/t8437/Macros_1.scala b/tests/pending/run/t8437/Macros_1.scala new file mode 100644 index 000000000000..6286ea2a8c44 --- /dev/null +++ b/tests/pending/run/t8437/Macros_1.scala @@ -0,0 +1,18 @@ +import scala.language.experimental.macros +import scala.reflect.macros._ + +abstract class AbstractBundle(val c: blackbox.Context) { + import c.Expr + import c.universe._ + def foo: Expr[Int] = Expr[Int](q"5") +} + +class ConcreteBundle(override val c: blackbox.Context) extends AbstractBundle(c) { + import c.Expr + val bar: Expr[Int] = foo +} + +object InvokeBundle { + def foo: Int = macro ConcreteBundle.foo // nope + def bar: Int = macro ConcreteBundle.bar // yep +} \ No newline at end of file diff --git a/tests/pending/run/t8437/Test_2.scala b/tests/pending/run/t8437/Test_2.scala new file mode 100644 index 000000000000..fef54005f1f9 --- /dev/null +++ b/tests/pending/run/t8437/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + println(InvokeBundle.foo) + println(InvokeBundle.bar) +} \ No newline at end of file diff --git a/tests/pending/run/t8442.check b/tests/pending/run/t8442.check new file mode 100644 index 000000000000..ce9e8b52ff21 --- /dev/null +++ b/tests/pending/run/t8442.check @@ -0,0 +1 @@ +pos: NoPosition Class A_1 not found - continuing with a stub. WARNING diff --git a/tests/pending/run/t8442/A_1.java b/tests/pending/run/t8442/A_1.java new file mode 100644 index 000000000000..227451eecdd5 --- /dev/null +++ b/tests/pending/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/tests/pending/run/t8442/B_1.java b/tests/pending/run/t8442/B_1.java new file mode 100644 index 000000000000..1680684495d4 --- /dev/null +++ b/tests/pending/run/t8442/B_1.java @@ -0,0 +1,3 @@ +public class B_1 { + @A_1 public String get() { return ""; } +} diff --git a/tests/pending/run/t8442/C_2.scala b/tests/pending/run/t8442/C_2.scala new file mode 100644 index 000000000000..d75d4bd9106c --- /dev/null +++ b/tests/pending/run/t8442/C_2.scala @@ -0,0 +1,5 @@ +class C_2 { + def foo(b: B_1) { + b.get() + } +} diff --git a/tests/pending/run/t8442/Test.scala b/tests/pending/run/t8442/Test.scala new file mode 100644 index 000000000000..ff6da4e20645 --- /dev/null +++ b/tests/pending/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/tests/pending/run/t8445.check b/tests/pending/run/t8445.check new file mode 100644 index 000000000000..41fd6d3ed194 --- /dev/null +++ b/tests/pending/run/t8445.check @@ -0,0 +1 @@ +warning: there was one feature warning; re-run with -feature for details diff --git a/tests/pending/run/t8445.scala b/tests/pending/run/t8445.scala new file mode 100644 index 000000000000..72116d8e5f86 --- /dev/null +++ b/tests/pending/run/t8445.scala @@ -0,0 +1,11 @@ +object X { + class Y + def y = new Y { + class Z + def z = classOf[Z] + } +} + +object Test extends dotty.runtime.LegacyApp { + assert(X.y.z.getEnclosingClass.getName == "X$$anon$1") +} diff --git a/tests/pending/run/t8549.check b/tests/pending/run/t8549.check new file mode 100644 index 000000000000..a9ecc29fea08 --- /dev/null +++ b/tests/pending/run/t8549.check @@ -0,0 +1 @@ +warning: there were two deprecation warnings; re-run with -deprecation for details diff --git a/tests/pending/run/t8549.scala b/tests/pending/run/t8549.scala new file mode 100644 index 000000000000..c124d99bca69 --- /dev/null +++ b/tests/pending/run/t8549.scala @@ -0,0 +1,189 @@ +import javax.xml.bind.DatatypeConverter._ +import scala.reflect.io.File + +// This test is self-modifying when run as follows: +// +// (export V=v2.10.4 +// scalac-hash $V test/files/run/t8549.scala +// scala-hash $V -Doverwrite.source=test/files/run/t8549.scala Test +// ) +// +// Use this to re-establish a baseline for serialization compatibility. +object Test extends dotty.runtime.LegacyApp { + val overwrite: Option[File] = sys.props.get("overwrite.source").map(s => new File(new java.io.File(s))) + + def serialize(o: AnyRef): String = { + val bos = new java.io.ByteArrayOutputStream() + val out = new java.io.ObjectOutputStream(bos) + out.writeObject(o) + out.flush() + printBase64Binary(bos.toByteArray()) + } + + def amend(file: File)(f: String => String): Unit = { + file.writeAll(f(file.slurp)) + } + def quote(s: String) = List("\"", s, "\"").mkString + + def patch(file: File, line: Int, prevResult: String, result: String): Unit = { + amend(file) { + content => + content.lines.toList.zipWithIndex.map { + case (content, i) if i == line - 1 => + val newContent = content.replaceAllLiterally(quote(prevResult), quote(result)) + if (newContent != content) + println(s"- $content\n+ $newContent\n") + newContent + case (content, _) => content + }.mkString("\n") + } + } + + def updateComment(file: File): Unit = { + val timestamp = { + import java.text.SimpleDateFormat + val sdf = new SimpleDateFormat("yyyyMMdd-HH:mm:ss") + sdf.format(new java.util.Date) + } + val newComment = s" // Generated on $timestamp with Scala ${scala.util.Properties.versionString})" + amend(file) { + content => + content.lines.toList.map { + f => f.replaceAll("""^ +// Generated on.*""", newComment) + }.mkString("\n") + } + } + + def deserialize(string: String): AnyRef = { + val bis = new java.io.ByteArrayInputStream(parseBase64Binary(string)) + val in = new java.io.ObjectInputStream(bis) + in.readObject() + } + + def checkRoundTrip[T <: AnyRef](instance: T)(f: T => AnyRef): Unit = { + val result = serialize(instance) + val reconstituted = deserialize(result).asInstanceOf[T] + assert(f(instance) == f(reconstituted), (f(instance), f(reconstituted))) + } + + def check[T <: AnyRef](instance: => T)(prevResult: String, f: T => AnyRef = (x: T) => x): Unit = { + val result = serialize(instance) + overwrite match { + case Some(f) => + val lineNumberOfLiteralString = Thread.currentThread.getStackTrace.apply(2).getLineNumber + patch(f, lineNumberOfLiteralString, prevResult, result) + case None => + checkRoundTrip(instance)(f) + assert(f(deserialize(prevResult).asInstanceOf[T]) == f(instance), s"$instance != f(deserialize(prevResult))") + assert(prevResult == result, s"instance = $instance : ${instance.getClass}\n serialization unstable: ${prevResult}\n found: ${result}") + } + } + + // Generated on 20141010-14:01:28 with Scala version 2.11.2) + overwrite.foreach(updateComment) + + check(Some(1))("rO0ABXNyAApzY2FsYS5Tb21lESLyaV6hi3QCAAFMAAF4dAASTGphdmEvbGFuZy9PYmplY3Q7eHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAQ==") + check(None)("rO0ABXNyAAtzY2FsYS5Ob25lJEZQJPZTypSsAgAAeHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHA=") + + check(List(1, 2, 3))( "rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHg=") + check(Nil)( "rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgAsc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdFNlcmlhbGl6ZUVuZCSKXGNb91MLbQIAAHhweA==") + + // TODO SI-8576 unstable under -Xcheckinit + // check(Vector(1))( "rO0ABXNyACFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5WZWN0b3Lkd3dcHq6PXAIAC0kABWRlcHRoWgAFZGlydHlJAAhlbmRJbmRleEkABWZvY3VzSQAKc3RhcnRJbmRleFsACGRpc3BsYXkwdAATW0xqYXZhL2xhbmcvT2JqZWN0O1sACGRpc3BsYXkxcQB+AAFbAAhkaXNwbGF5MnEAfgABWwAIZGlzcGxheTNxAH4AAVsACGRpc3BsYXk0cQB+AAFbAAhkaXNwbGF5NXEAfgABeHAAAAABAAAAAAEAAAAAAAAAAHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAACBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcA==") + // check(Vector())( "rO0ABXNyACFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5WZWN0b3Lkd3dcHq6PXAIAC0kABWRlcHRoWgAFZGlydHlJAAhlbmRJbmRleEkABWZvY3VzSQAKc3RhcnRJbmRleFsACGRpc3BsYXkwdAATW0xqYXZhL2xhbmcvT2JqZWN0O1sACGRpc3BsYXkxcQB+AAFbAAhkaXNwbGF5MnEAfgABWwAIZGlzcGxheTNxAH4AAVsACGRpc3BsYXk0cQB+AAFbAAhkaXNwbGF5NXEAfgABeHAAAAAAAAAAAAAAAAAAAAAAAHBwcHBwcA==") + + import collection.{ mutable, immutable } + + class C + check(reflect.classTag[C])("rO0ABXNyAB5zY2FsYS5yZWZsZWN0LkNsYXNzVGFnJCRhbm9uJDG7ePPrmQBkhgIAAUwAD3J1bnRpbWVDbGFzczEkMXQAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAGVGVzdCRDAAAAAAAAAAAAAAB4cA==") + check(reflect.classTag[Int])("rO0ABXNyACVzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSQkYW5vbiQ5zfmiSVNjtVICAAB4cgAcc2NhbGEucmVmbGVjdC5BbnlWYWxNYW5pZmVzdAAAAAAAAAABAgABTAAIdG9TdHJpbmd0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAA0ludA==") + check(reflect.classTag[String])("rO0ABXNyAB5zY2FsYS5yZWZsZWN0LkNsYXNzVGFnJCRhbm9uJDG7ePPrmQBkhgIAAUwAD3J1bnRpbWVDbGFzczEkMXQAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAQamF2YS5sYW5nLlN0cmluZ6DwpDh6O7NCAgAAeHA=") + check(reflect.classTag[Object])("rO0ABXNyACVzY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSQkYW5vbiQymPrtq/Ci1gsCAAB4cgAtc2NhbGEucmVmbGVjdC5NYW5pZmVzdEZhY3RvcnkkUGhhbnRvbU1hbmlmZXN0rzigP7KRh/kCAAFMAAh0b1N0cmluZ3QAEkxqYXZhL2xhbmcvU3RyaW5nO3hyAC9zY2FsYS5yZWZsZWN0Lk1hbmlmZXN0RmFjdG9yeSRDbGFzc1R5cGVNYW5pZmVzdFq6NWvfTgYFAgADTAAGcHJlZml4dAAOTHNjYWxhL09wdGlvbjtMAAxydW50aW1lQ2xhc3N0ABFMamF2YS9sYW5nL0NsYXNzO0wADXR5cGVBcmd1bWVudHN0ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDt4cHNyAAtzY2FsYS5Ob25lJEZQJPZTypSsAgAAeHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHB2cgAQamF2YS5sYW5nLk9iamVjdAAAAAAAAAAAAAAAeHBzcgAyc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdCRTZXJpYWxpemF0aW9uUHJveHkAAAAAAAAAAQMAAHhwc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHh0AAZPYmplY3Q=") + + // TODO SI-8576 unstable under -Xcheckinit + // check(Enum)( "rO0ABXNyAApUZXN0JEVudW0ketCIyQ8C23MCAAJMAAJWMXQAGUxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZTtMAAJWMnQAF0xzY2FsYS9FbnVtZXJhdGlvbiRWYWw7eHIAEXNjYWxhLkVudW1lcmF0aW9udaDN3ZgOWY4CAAhJAAZuZXh0SWRJABtzY2FsYSRFbnVtZXJhdGlvbiQkYm90dG9tSWRJABhzY2FsYSRFbnVtZXJhdGlvbiQkdG9wSWRMABRWYWx1ZU9yZGVyaW5nJG1vZHVsZXQAIkxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZU9yZGVyaW5nJDtMAA9WYWx1ZVNldCRtb2R1bGV0AB1Mc2NhbGEvRW51bWVyYXRpb24kVmFsdWVTZXQkO0wACG5leHROYW1ldAAbTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmF0b3I7TAAXc2NhbGEkRW51bWVyYXRpb24kJG5tYXB0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDtMABdzY2FsYSRFbnVtZXJhdGlvbiQkdm1hcHEAfgAHeHAAAAArAAAAAAAAACtwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHNxAH4ACXcNAAAC7gAAAAEAAAAEAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAqc3IAFXNjYWxhLkVudW1lcmF0aW9uJFZhbM9pZ6/J/O1PAgACSQAYc2NhbGEkRW51bWVyYXRpb24kVmFsJCRpTAAEbmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO3hyABdzY2FsYS5FbnVtZXJhdGlvbiRWYWx1ZWJpfC/tIR1RAgACTAAGJG91dGVydAATTHNjYWxhL0VudW1lcmF0aW9uO0wAHHNjYWxhJEVudW1lcmF0aW9uJCRvdXRlckVudW1xAH4AEnhwcQB+AAhxAH4ACAAAACpweHNyABFUZXN0JEVudW0kJGFub24kMVlIjlmE1sXaAgAAeHEAfgARcQB+AAhxAH4ACHEAfgAT") + // check(Enum.V1)( "rO0ABXNyABFUZXN0JEVudW0kJGFub24kMVlIjlmE1sXaAgAAeHIAF3NjYWxhLkVudW1lcmF0aW9uJFZhbHVlYml8L+0hHVECAAJMAAYkb3V0ZXJ0ABNMc2NhbGEvRW51bWVyYXRpb247TAAcc2NhbGEkRW51bWVyYXRpb24kJG91dGVyRW51bXEAfgACeHBzcgAKVGVzdCRFbnVtJHrQiMkPAttzAgACTAACVjF0ABlMc2NhbGEvRW51bWVyYXRpb24kVmFsdWU7TAACVjJ0ABdMc2NhbGEvRW51bWVyYXRpb24kVmFsO3hyABFzY2FsYS5FbnVtZXJhdGlvbnWgzd2YDlmOAgAISQAGbmV4dElkSQAbc2NhbGEkRW51bWVyYXRpb24kJGJvdHRvbUlkSQAYc2NhbGEkRW51bWVyYXRpb24kJHRvcElkTAAUVmFsdWVPcmRlcmluZyRtb2R1bGV0ACJMc2NhbGEvRW51bWVyYXRpb24kVmFsdWVPcmRlcmluZyQ7TAAPVmFsdWVTZXQkbW9kdWxldAAdTHNjYWxhL0VudW1lcmF0aW9uJFZhbHVlU2V0JDtMAAhuZXh0TmFtZXQAG0xzY2FsYS9jb2xsZWN0aW9uL0l0ZXJhdG9yO0wAF3NjYWxhJEVudW1lcmF0aW9uJCRubWFwdAAeTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9NYXA7TAAXc2NhbGEkRW51bWVyYXRpb24kJHZtYXBxAH4AC3hwAAAAKwAAAAAAAAArcHBwc3IAIHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5IYXNoTWFwAAAAAAAAAAEDAAB4cHcNAAAC7gAAAAAAAAAEAHhzcQB+AA13DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAKnNyABVzY2FsYS5FbnVtZXJhdGlvbiRWYWzPaWevyfztTwIAAkkAGHNjYWxhJEVudW1lcmF0aW9uJFZhbCQkaUwABG5hbWV0ABJMamF2YS9sYW5nL1N0cmluZzt4cQB+AAFxAH4ADHEAfgAMAAAAKnB4cQB+AANxAH4AFXEAfgAM") + // check(Enum.V2)( "rO0ABXNyABVzY2FsYS5FbnVtZXJhdGlvbiRWYWzPaWevyfztTwIAAkkAGHNjYWxhJEVudW1lcmF0aW9uJFZhbCQkaUwABG5hbWV0ABJMamF2YS9sYW5nL1N0cmluZzt4cgAXc2NhbGEuRW51bWVyYXRpb24kVmFsdWViaXwv7SEdUQIAAkwABiRvdXRlcnQAE0xzY2FsYS9FbnVtZXJhdGlvbjtMABxzY2FsYSRFbnVtZXJhdGlvbiQkb3V0ZXJFbnVtcQB+AAN4cHNyAApUZXN0JEVudW0ketCIyQ8C23MCAAJMAAJWMXQAGUxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZTtMAAJWMnQAF0xzY2FsYS9FbnVtZXJhdGlvbiRWYWw7eHIAEXNjYWxhLkVudW1lcmF0aW9udaDN3ZgOWY4CAAhJAAZuZXh0SWRJABtzY2FsYSRFbnVtZXJhdGlvbiQkYm90dG9tSWRJABhzY2FsYSRFbnVtZXJhdGlvbiQkdG9wSWRMABRWYWx1ZU9yZGVyaW5nJG1vZHVsZXQAIkxzY2FsYS9FbnVtZXJhdGlvbiRWYWx1ZU9yZGVyaW5nJDtMAA9WYWx1ZVNldCRtb2R1bGV0AB1Mc2NhbGEvRW51bWVyYXRpb24kVmFsdWVTZXQkO0wACG5leHROYW1ldAAbTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmF0b3I7TAAXc2NhbGEkRW51bWVyYXRpb24kJG5tYXB0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDtMABdzY2FsYSRFbnVtZXJhdGlvbiQkdm1hcHEAfgAMeHAAAAArAAAAAAAAACtwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHNxAH4ADncNAAAC7gAAAAEAAAAEAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAqcQB+AAR4c3IAEVRlc3QkRW51bSQkYW5vbiQxWUiOWYTWxdoCAAB4cQB+AAJxAH4ADXEAfgANcQB+AARxAH4ADQAAACpw") + + // IndexedSeqLike#Elements + // TODO SI-8576 throws scala.UnitializedFieldError under -Xcheckinit + // check(new immutable.Range(0, 1, 1).iterator)("rO0ABXNyAChzY2FsYS5jb2xsZWN0aW9uLkluZGV4ZWRTZXFMaWtlJEVsZW1lbnRzGF+1cBwmcx0CAANJAANlbmRJAAVpbmRleEwABiRvdXRlcnQAIUxzY2FsYS9jb2xsZWN0aW9uL0luZGV4ZWRTZXFMaWtlO3hwAAAAAQAAAABzcgAgc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuUmFuZ2Vpu6NUqxUyDQIAB0kAA2VuZFoAB2lzRW1wdHlJAAtsYXN0RWxlbWVudEkAEG51bVJhbmdlRWxlbWVudHNJAAVzdGFydEkABHN0ZXBJAA90ZXJtaW5hbEVsZW1lbnR4cAAAAAEAAAAAAAAAAAEAAAAAAAAAAQAAAAE=" + // , _.toList) + + // check(new collection.concurrent.TrieMap[Any, Any]())( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmNvbmN1cnJlbnQuVHJpZU1hcKckxpgOIYHPAwAETAALZXF1YWxpdHlvYmp0ABJMc2NhbGEvbWF0aC9FcXVpdjtMAApoYXNoaW5nb2JqdAAcTHNjYWxhL3V0aWwvaGFzaGluZy9IYXNoaW5nO0wABHJvb3R0ABJMamF2YS9sYW5nL09iamVjdDtMAAtyb290dXBkYXRlcnQAOUxqYXZhL3V0aWwvY29uY3VycmVudC9hdG9taWMvQXRvbWljUmVmZXJlbmNlRmllbGRVcGRhdGVyO3hwc3IAMnNjYWxhLmNvbGxlY3Rpb24uY29uY3VycmVudC5UcmllTWFwJE1hbmdsZWRIYXNoaW5nhTBoJQ/mgb0CAAB4cHNyABhzY2FsYS5tYXRoLkVxdWl2JCRhbm9uJDLBbyx4dy/qGwIAAHhwc3IANHNjYWxhLmNvbGxlY3Rpb24uY29uY3VycmVudC5UcmllTWFwU2VyaWFsaXphdGlvbkVuZCSbjdgbbGCt2gIAAHhweA==") + // not sure why this one needs stable serialization. + + // TODO SI-8576 unstable under -Xcheckinit + check(collection.convert.Wrappers)( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcA==") + + check(immutable.BitSet(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5CaXRTZXQkQml0U2V0MR9dg8JGRI8UAgABSgAFZWxlbXN4cgAhc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuQml0U2V0Flz5Ms3qxsoCAAB4cAAAAAAAAAAO") + check(immutable.HashMap())( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAB4") + check(immutable.HashMap(1 -> 2))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAFzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4") + check(immutable.HashMap(1 -> 2, 3 -> 4))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAJzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADc3EAfgACAAAABHg=") + // TODO provoke HashMapCollision1 + + check(immutable.HashSet())( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAB4") + check(immutable.HashSet(1))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAFzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXg=") + check(immutable.HashSet(1, 2))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAJzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4") + check(immutable.HashSet(1, 2, 3))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==") + // TODO provoke HashSetCollision1 + + check(immutable.ListMap())( "rO0ABXNyADBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwJEVtcHR5TGlzdE1hcCSNalsvpBZeDgIAAHhyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwBC1gfIkUSKsCAAB4cA==") + check(immutable.ListMap(1 -> 2))( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0TWFwJE5vZGWmciM1Yav+8gIAA0wABiRvdXRlcnQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9MaXN0TWFwO0wAA2tleXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABXZhbHVlcQB+AAJ4cgAic2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdE1hcAQtYHyJFEirAgAAeHBzcgAwc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdE1hcCRFbXB0eUxpc3RNYXAkjWpbL6QWXg4CAAB4cQB+AANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABwAAAAI=") + check(immutable.Queue())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5RdWV1ZZY146W3qSuhAgACTAACaW50ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDtMAANvdXRxAH4AAXhwc3IAMnNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3QkU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAEDAAB4cHNyACxzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2VyaWFsaXplRW5kJIpcY1v3UwttAgAAeHB4cQB+AAQ=") + check(immutable.Queue(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5RdWV1ZZY146W3qSuhAgACTAACaW50ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDtMAANvdXRxAH4AAXhwc3IAMnNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3QkU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAEDAAB4cHNyACxzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0U2VyaWFsaXplRW5kJIpcY1v3UwttAgAAeHB4c3EAfgADc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAgAAAACc3EAfgAIAAAAA3EAfgAGeA==") + + // TODO SI-8576 throws scala.UnitializedFieldError under -Xcheckinit + // check(new immutable.Range(0, 1, 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5SYW5nZWm7o1SrFTINAgAHSQADZW5kWgAHaXNFbXB0eUkAC2xhc3RFbGVtZW50SQAQbnVtUmFuZ2VFbGVtZW50c0kABXN0YXJ0SQAEc3RlcEkAD3Rlcm1pbmFsRWxlbWVudHhwAAAAAQAAAAAAAAAAAQAAAAAAAAABAAAAAQ==") + + check(immutable.Set())( "rO0ABXNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkRW1wdHlTZXQk8Hk3TFN0uDYCAAB4cA==") + check(immutable.Set(1))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0MREd3c4yqtWTAgABTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDt4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAB") + check(immutable.Set(1, 2))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0MqaV02sZQzV0AgACTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgABeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAwAAAAI=") + check(immutable.Set(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0M84syT0560SgAgADTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgABTAAFZWxlbTNxAH4AAXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAMAAAACc3EAfgADAAAAAw==") + check(immutable.Set(1, 2, 3, 4))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0NM26psRRbei1AgAETAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgABTAAFZWxlbTNxAH4AAUwABWVsZW00cQB+AAF4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgADAAAAAnNxAH4AAwAAAANzcQB+AAMAAAAE") + check(immutable.Set(1, 2, 3, 4, 5))( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoU2V0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAVzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAABXNxAH4AAgAAAAFzcQB+AAIAAAACc3EAfgACAAAAA3NxAH4AAgAAAAR4") + + check(immutable.Stack(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TdGFjaxtt3qEbMvq+AgABTAAFZWxlbXN0ACFMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvTGlzdDt4cHNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABQAAAAJzcQB+AAUAAAADc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHg=") + + // TODO SI-8576 Uninitialized field: IndexedSeqLike.scala: 56 + // check(immutable.Stream(1, 2, 3))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TdHJlYW0kQ29uc/ekjBXM3TlFAgADTAACaGR0ABJMamF2YS9sYW5nL09iamVjdDtMAAV0bEdlbnQAEUxzY2FsYS9GdW5jdGlvbjA7TAAFdGxWYWx0ACNMc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvU3RyZWFtO3hyACFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TdHJlYW0552RDntM42gIAAHhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcgAtc2NhbGEuY29sbGVjdGlvbi5JdGVyYXRvciQkYW5vbmZ1biR0b1N0cmVhbSQxRWR4We0SX0UCAAFMAAYkb3V0ZXJ0ABtMc2NhbGEvY29sbGVjdGlvbi9JdGVyYXRvcjt4cHNyAChzY2FsYS5jb2xsZWN0aW9uLkluZGV4ZWRTZXFMaWtlJEVsZW1lbnRzGF+1cBwmcx0CAANJAANlbmRJAAVpbmRleEwABiRvdXRlcnQAIUxzY2FsYS9jb2xsZWN0aW9uL0luZGV4ZWRTZXFMaWtlO3hwAAAAAwAAAAFzcgArc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLldyYXBwZWRBcnJheSRvZkludMmRLBcI15VjAgABWwAFYXJyYXl0AAJbSXhwdXIAAltJTbpgJnbqsqUCAAB4cAAAAAMAAAABAAAAAgAAAANw") + + check(immutable.TreeSet[Int]())( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V0sRdVIDjbWAsCAAJMAAhvcmRlcmluZ3QAFUxzY2FsYS9tYXRoL09yZGVyaW5nO0wABHRyZWV0AC5Mc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHA=") + + // TODO SI-8576 unstable under -Xcheckinit + // check(immutable.TreeSet(1, 2, 3))( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5UcmVlU2V0sRdVIDjbWAsCAAJMAAhvcmRlcmluZ3QAFUxzY2FsYS9tYXRoL09yZGVyaW5nO0wABHRyZWV0AC5Mc2NhbGEvY29sbGVjdGlvbi9pbW11dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyADFzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5SZWRCbGFja1RyZWUkQmxhY2tUcmVlzRxnCKenVAECAAB4cgAsc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWVrqCSyHJbsMgIABUkABWNvdW50TAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgACTAAFcmlnaHRxAH4AAkwABXZhbHVlcQB+AAh4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAnNxAH4ABgAAAAFzcQB+AAoAAAABcHBzcgAXc2NhbGEucnVudGltZS5Cb3hlZFVuaXR0pn1HHezLmgIAAHhwc3EAfgAGAAAAAXNxAH4ACgAAAANwcHEAfgAQcQB+ABA=") + + // TODO SI-8576 Uninitialized field under -Xcheckinit + // check(mutable.ArrayBuffer(1, 2, 3))( "rO0ABXNyACRzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlCdWZmZXIVOLBTg4KOcwIAA0kAC2luaXRpYWxTaXplSQAFc2l6ZTBbAAVhcnJheXQAE1tMamF2YS9sYW5nL09iamVjdDt4cAAAABAAAAADdXIAE1tMamF2YS5sYW5nLk9iamVjdDuQzlifEHMpbAIAAHhwAAAAEHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAFAAAAAnNxAH4ABQAAAANwcHBwcHBwcHBwcHBw") + // TODO SI-8576 Uninitialized field under -Xcheckinit + // check(mutable.ArraySeq(1, 2, 3))( "rO0ABXNyACFzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlTZXEVPD3SKEkOcwIAAkkABmxlbmd0aFsABWFycmF5dAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwAAAAA3VyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABQAAAAJzcQB+AAUAAAAD") + check(mutable.ArrayStack(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlTdGFja3bdxXbcnLBeAgACSQAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJEFycmF5U3RhY2skJGluZGV4WwAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJEFycmF5U3RhY2skJHRhYmxldAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwAAAAA3VyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAA3NxAH4ABQAAAAJzcQB+AAUAAAAB") + check(mutable.DoubleLinkedList(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuRG91YmxlTGlua2VkTGlzdI73LKsKRr1RAgADTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NlcTtMAARwcmV2cQB+AAJ4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAAc3EAfgAEAAAAAnNxAH4AAHNxAH4ABAAAAANzcQB+AABwcQB+AAtxAH4ACXEAfgAHcQB+AANw") + + check(mutable.HashMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4") + check(mutable.HashMap(1 -> 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXEAfgAEeA==") + check(mutable.HashSet(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==") + // TODO SI-8576 Uninitialized field under -Xcheckinit + // check(new mutable.History())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGlzdG9yeUhuXxDIFJrsAgACSQAKbWF4SGlzdG9yeUwAA2xvZ3QAIExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUXVldWU7eHAAAAPoc3IAHnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5RdWV1ZbjMURVfOuHHAgAAeHIAJHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5NdXRhYmxlTGlzdFJpnjJ+gFbAAgADSQADbGVuTAAGZmlyc3QwdAAlTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9MaW5rZWRMaXN0O0wABWxhc3QwcQB+AAV4cAAAAABzcgAjc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkxpbmtlZExpc3Sak+nGCZHaUQIAAkwABGVsZW10ABJMamF2YS9sYW5nL09iamVjdDtMAARuZXh0dAAeTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9TZXE7eHBwcQB+AApxAH4ACg==") + check(mutable.LinkedHashMap(1 -> 2))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4") + check(mutable.LinkedHashSet(1, 2, 3))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAu4AAAADAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==") + check(mutable.LinkedList(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkTGlzdJqT6cYJkdpRAgACTAAEZWxlbXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABG5leHR0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NlcTt4cHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAAc3EAfgAEAAAAAnNxAH4AAHNxAH4ABAAAAANzcQB+AABwcQB+AAs=") + + // TODO SI-8576 unstable under -Xcheckinit + // check(mutable.ListBuffer(1, 2, 3))( "rO0ABXNyACNzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlzdEJ1ZmZlci9y9I7QyWzGAwAEWgAIZXhwb3J0ZWRJAANsZW5MAAVsYXN0MHQAKUxzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS8kY29sb24kY29sb247TAAqc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJExpc3RCdWZmZXIkJHN0YXJ0dAAhTHNjYWxhL2NvbGxlY3Rpb24vaW1tdXRhYmxlL0xpc3Q7eHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABAAAAAJzcQB+AAQAAAADc3IALHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLkxpc3RTZXJpYWxpemVFbmQkilxjW/dTC20CAAB4cHcFAAAAAAN4") + check(new mutable.StringBuilder(new java.lang.StringBuilder("123")))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuU3RyaW5nQnVpbGRlcomvqgGv1tTxAgABTAAKdW5kZXJseWluZ3QAGUxqYXZhL2xhbmcvU3RyaW5nQnVpbGRlcjt4cHNyABdqYXZhLmxhbmcuU3RyaW5nQnVpbGRlcjzV+xRaTGrLAwAAeHB3BAAAAAN1cgACW0OwJmaw4l2ErAIAAHhwAAAAEwAxADIAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeA==") + check(mutable.UnrolledBuffer[Int]())( "rO0ABXNyACdzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVW5yb2xsZWRCdWZmZXIAAAAAAAAAAQMAAUwAA3RhZ3QAGExzY2FsYS9yZWZsZWN0L0NsYXNzVGFnO3hwc3IAJXNjYWxhLnJlZmxlY3QuTWFuaWZlc3RGYWN0b3J5JCRhbm9uJDnN+aJJU2O1UgIAAHhyABxzY2FsYS5yZWZsZWN0LkFueVZhbE1hbmlmZXN0AAAAAAAAAAECAAFMAAh0b1N0cmluZ3QAEkxqYXZhL2xhbmcvU3RyaW5nO3hwdAADSW50dwQAAAAAeA==") + + import collection.parallel + check(parallel.immutable.ParHashMap(1 -> 2))( "rO0ABXNyAC5zY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLmltbXV0YWJsZS5QYXJIYXNoTWFwAAAAAAAAAAECAANMAA9TY2FuTGVhZiRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2NhbkxlYWYkO0wAD1NjYW5Ob2RlJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL3BhcmFsbGVsL1Bhckl0ZXJhYmxlTGlrZSRTY2FuTm9kZSQ7TAAEdHJpZXQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9IYXNoTWFwO3hwcHBzcgA1c2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuSGFzaE1hcCRTZXJpYWxpemF0aW9uUHJveHkAAAAAAAAAAgMAAHhwdwQAAAABc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAcAAAACeA==") + check(parallel.immutable.ParHashSet(1, 2, 3))( "rO0ABXNyAC5zY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLmltbXV0YWJsZS5QYXJIYXNoU2V0AAAAAAAAAAECAANMAA9TY2FuTGVhZiRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2NhbkxlYWYkO0wAD1NjYW5Ob2RlJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL3BhcmFsbGVsL1Bhckl0ZXJhYmxlTGlrZSRTY2FuTm9kZSQ7TAAEdHJpZXQAJExzY2FsYS9jb2xsZWN0aW9uL2ltbXV0YWJsZS9IYXNoU2V0O3hwcHBzcgA1c2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuSGFzaFNldCRTZXJpYWxpemF0aW9uUHJveHkAAAAAAAAAAgMAAHhwdwQAAAADc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAcAAAACc3EAfgAHAAAAA3g=") + // TODO SI-8576 Uninitialized field under -Xcheckinit + // check(new parallel.immutable.ParRange(new Range(0, 1, 2)))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLmltbXV0YWJsZS5QYXJSYW5nZQAAAAAAAAABAgAETAAXUGFyUmFuZ2VJdGVyYXRvciRtb2R1bGV0AEBMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9pbW11dGFibGUvUGFyUmFuZ2UkUGFyUmFuZ2VJdGVyYXRvciQ7TAAPU2NhbkxlYWYkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vcGFyYWxsZWwvUGFySXRlcmFibGVMaWtlJFNjYW5MZWFmJDtMAA9TY2FuTm9kZSRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2Nhbk5vZGUkO0wABXJhbmdldAAiTHNjYWxhL2NvbGxlY3Rpb24vaW1tdXRhYmxlL1JhbmdlO3hwcHBwc3IAIHNjYWxhLmNvbGxlY3Rpb24uaW1tdXRhYmxlLlJhbmdlabujVKsVMg0CAAdJAANlbmRaAAdpc0VtcHR5SQALbGFzdEVsZW1lbnRJABBudW1SYW5nZUVsZW1lbnRzSQAFc3RhcnRJAARzdGVwSQAPdGVybWluYWxFbGVtZW50eHAAAAABAAAAAAAAAAABAAAAAAAAAAIAAAAC") + // TODO SI-8576 unstable under -Xcheckinit + // check(parallel.mutable.ParArray(1, 2, 3))( "rO0ABXNyACpzY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLm11dGFibGUuUGFyQXJyYXkAAAAAAAAAAQMABEwAF1BhckFycmF5SXRlcmF0b3IkbW9kdWxldAA+THNjYWxhL2NvbGxlY3Rpb24vcGFyYWxsZWwvbXV0YWJsZS9QYXJBcnJheSRQYXJBcnJheUl0ZXJhdG9yJDtMAA9TY2FuTGVhZiRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2NhbkxlYWYkO0wAD1NjYW5Ob2RlJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL3BhcmFsbGVsL1Bhckl0ZXJhYmxlTGlrZSRTY2FuTm9kZSQ7TAAIYXJyYXlzZXF0ACNMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL0FycmF5U2VxO3hwcHBwc3IAMXNjYWxhLmNvbGxlY3Rpb24ucGFyYWxsZWwubXV0YWJsZS5FeHBvc2VkQXJyYXlTZXGx2OTefAodSQIAAkkABmxlbmd0aFsABWFycmF5dAATW0xqYXZhL2xhbmcvT2JqZWN0O3hyACFzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuQXJyYXlTZXEVPD3SKEkOcwIAAkkABmxlbmd0aFsABWFycmF5cQB+AAd4cAAAAAN1cgATW0xqYXZhLmxhbmcuT2JqZWN0O5DOWJ8QcylsAgAAeHAAAAADcHBwAAAAA3VxAH4ACgAAABBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ADQAAAAJzcQB+AA0AAAADcHBwcHBwcHBwcHBwcHg=") + check(parallel.mutable.ParHashMap(1 -> 2))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLm11dGFibGUuUGFySGFzaE1hcAAAAAAAAAABAwACTAAPU2NhbkxlYWYkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vcGFyYWxsZWwvUGFySXRlcmFibGVMaWtlJFNjYW5MZWFmJDtMAA9TY2FuTm9kZSRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2Nhbk5vZGUkO3hwcHB3DQAAAu4AAAABAAAABAFzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABAAAAAJ4") + check(parallel.mutable.ParHashSet(1, 2, 3))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLnBhcmFsbGVsLm11dGFibGUuUGFySGFzaFNldAAAAAAAAAABAwACTAAPU2NhbkxlYWYkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vcGFyYWxsZWwvUGFySXRlcmFibGVMaWtlJFNjYW5MZWFmJDtMAA9TY2FuTm9kZSRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9wYXJhbGxlbC9QYXJJdGVyYWJsZUxpa2UkU2Nhbk5vZGUkO3hwcHB3DQAAAcIAAAADAAAAGwFzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4ABAAAAAJzcQB+AAQAAAADeA==") + + check("...".r)("rO0ABXNyABlzY2FsYS51dGlsLm1hdGNoaW5nLlJlZ2V44u3Vap7wIb8CAAJMAAdwYXR0ZXJudAAZTGphdmEvdXRpbC9yZWdleC9QYXR0ZXJuO0wAJXNjYWxhJHV0aWwkbWF0Y2hpbmckUmVnZXgkJGdyb3VwTmFtZXN0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXE7eHBzcgAXamF2YS51dGlsLnJlZ2V4LlBhdHRlcm5GZ9VrbkkCDQIAAkkABWZsYWdzTAAHcGF0dGVybnQAEkxqYXZhL2xhbmcvU3RyaW5nO3hwAAAAAHQAAy4uLnNyADJzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5MaXN0JFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAABAwAAeHBzcgAsc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdFNlcmlhbGl6ZUVuZCSKXGNb91MLbQIAAHhweA==", + r => (r.toString)) +} diff --git a/tests/pending/run/t8549b.scala b/tests/pending/run/t8549b.scala new file mode 100644 index 000000000000..da0c16135a42 --- /dev/null +++ b/tests/pending/run/t8549b.scala @@ -0,0 +1,16 @@ + +@SerialVersionUID(42) +class C + +@SerialVersionUID(43 - 1) +class D + + +object Test extends dotty.runtime.LegacyApp { + def checkId(cls: Class[_]): Unit = { + val id = cls.getDeclaredField("serialVersionUID").get(null) + assert(id == 42, (cls, id)) + } + checkId(classOf[C]) + checkId(classOf[D]) +} diff --git a/tests/pending/run/t8570.flags b/tests/pending/run/t8570.flags new file mode 100644 index 000000000000..3d1ee4760af6 --- /dev/null +++ b/tests/pending/run/t8570.flags @@ -0,0 +1 @@ +-Xcheckinit diff --git a/tests/pending/run/t8570.scala b/tests/pending/run/t8570.scala new file mode 100644 index 000000000000..f1f75260270a --- /dev/null +++ b/tests/pending/run/t8570.scala @@ -0,0 +1,10 @@ +trait Trait40_1 { + val value37_2 = () + def run = { value37_2 } +} + +object Test { + def main(args: Array[String]): Unit = { + (new Trait40_1 {}).run + } +} diff --git a/tests/pending/run/t8570a.check b/tests/pending/run/t8570a.check new file mode 100644 index 000000000000..6a452c185a8c --- /dev/null +++ b/tests/pending/run/t8570a.check @@ -0,0 +1 @@ +() diff --git a/tests/pending/run/t8570a.flags b/tests/pending/run/t8570a.flags new file mode 100644 index 000000000000..3d1ee4760af6 --- /dev/null +++ b/tests/pending/run/t8570a.flags @@ -0,0 +1 @@ +-Xcheckinit diff --git a/tests/pending/run/t8570a.scala b/tests/pending/run/t8570a.scala new file mode 100644 index 000000000000..b36c3403724b --- /dev/null +++ b/tests/pending/run/t8570a.scala @@ -0,0 +1,14 @@ +trait Trait40_1 { + val value37_2 = () + def run = { value37_2 } +} + +trait T1 extends Trait40_1 { + override val value37_2 = () +} + +object Test { + def main(args: Array[String]): Unit = { + println((new T1 {}).run) + } +} diff --git a/tests/pending/run/t8574.scala b/tests/pending/run/t8574.scala new file mode 100644 index 000000000000..e241868c1c18 --- /dev/null +++ b/tests/pending/run/t8574.scala @@ -0,0 +1,27 @@ +import annotation._ + +@SerialVersionUID(42) @strictfp class Foo[@specialized(Int) T] extends Serializable { + def foo(t: T) = t +} + +object Test extends dotty.runtime.LegacyApp { + def checkUID(cls: Class[_], expected: Long) = { + val actual = java.io.ObjectStreamClass.lookup(cls).getSerialVersionUID + assert(actual == expected, s"$actual != expected for ${cls}") + } + def checkStrictFp(cls: Class[_]) = { + import java.lang.reflect._ + for (m <- cls.getDeclaredMethods) { + val isStrict = Modifier.isStrict(m.getModifiers) + assert(isStrict, cls) + } + } + def check(x: AnyRef): Unit = { + checkUID(x.getClass, 42) + checkStrictFp(x.getClass) + } + + check(new Foo[String]) + check(new Foo[Int]) +} + diff --git a/tests/pending/run/t8601-closure-elim.flags b/tests/pending/run/t8601-closure-elim.flags new file mode 100644 index 000000000000..2b5fd8a7b2a2 --- /dev/null +++ b/tests/pending/run/t8601-closure-elim.flags @@ -0,0 +1 @@ +-optimize -Ydelambdafy:inline diff --git a/tests/pending/run/t8601-closure-elim.scala b/tests/pending/run/t8601-closure-elim.scala new file mode 100644 index 000000000000..2c5b03af772a --- /dev/null +++ b/tests/pending/run/t8601-closure-elim.scala @@ -0,0 +1,26 @@ +import scala.tools.partest.BytecodeTest +import scala.tools.asm +import scala.tools.asm.util._ +import scala.collection.JavaConverters._ + +object Test extends BytecodeTest { + val nullChecks = Set(asm.Opcodes.NEW) + + def show: Unit = { + def test(methodName: String) { + val classNode = loadClassNode("Foo") + val methodNode = getMethod(classNode, "b") + val ops = methodNode.instructions.iterator.asScala.map(_.getOpcode).toList + assert(!ops.contains(asm.Opcodes.NEW), ops)// should be allocation free if the closure is eliminiated + } + test("b") + } +} + +class Foo { + @inline final def a(x: Int => Int) = x(1) + final def b { + val delta = 0 + a(x => delta + 1) + } +} diff --git a/tests/pending/run/t8601.flags b/tests/pending/run/t8601.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t8601.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t8601.scala b/tests/pending/run/t8601.scala new file mode 100644 index 000000000000..feea6e6c33f2 --- /dev/null +++ b/tests/pending/run/t8601.scala @@ -0,0 +1,15 @@ +object Test { + def idiv(x: Int): Unit = x / 0 + def ldiv(x: Long): Unit = x / 0 + def irem(x: Int): Unit = x % 0 + def lrem(x: Long): Unit = x % 0 + + def check(x: => Any) = try { x; sys.error("failed to throw divide by zero!") } catch { case _: ArithmeticException => } + + def main(args: Array[String]): Unit = { + check(idiv(1)) + check(ldiv(1L)) + check(irem(1)) + check(lrem(1L)) + } +} diff --git a/tests/pending/run/t8601b.flags b/tests/pending/run/t8601b.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t8601b.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t8601b.scala b/tests/pending/run/t8601b.scala new file mode 100644 index 000000000000..3816e0b83f31 --- /dev/null +++ b/tests/pending/run/t8601b.scala @@ -0,0 +1,14 @@ +object Test { + def len(x: Array[String]): Unit = x.length + def load(x: Array[String]): Unit = x(0) + def newarray(i: Int): Unit = new Array[Int](i) + + def check(x: => Any) = try { x; sys.error("failed to throw NPE!") } catch { case _: NullPointerException => } + def checkNegSize(x: => Any) = try { x; sys.error("failed to throw NegativeArraySizeException!") } catch { case _: NegativeArraySizeException => } + + def main(args: Array[String]): Unit = { + check(len(null)) // bug: did not NPE + check(load(null)) + checkNegSize(newarray(-1)) + } +} diff --git a/tests/pending/run/t8601c.flags b/tests/pending/run/t8601c.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t8601c.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t8601c.scala b/tests/pending/run/t8601c.scala new file mode 100644 index 000000000000..946a4d4b69b1 --- /dev/null +++ b/tests/pending/run/t8601c.scala @@ -0,0 +1,12 @@ +object Test { + def loadField(x: scala.runtime.IntRef): Unit = x.elem + def storeField(x: scala.runtime.IntRef): Unit = x.elem = 42 + + def check(x: => Any) = try { x; sys.error("failed to throw NPE!") } catch { case _: NullPointerException => } + + def main(args: Array[String]): Unit = { + check(loadField(null)) // bug: did not NPE under -Ydead-code + check(storeField(null)) + + } +} diff --git a/tests/pending/run/t8601d.flags b/tests/pending/run/t8601d.flags new file mode 100644 index 000000000000..1182725e8633 --- /dev/null +++ b/tests/pending/run/t8601d.flags @@ -0,0 +1 @@ +-optimize \ No newline at end of file diff --git a/tests/pending/run/t8601d.scala b/tests/pending/run/t8601d.scala new file mode 100644 index 000000000000..a6962847cb83 --- /dev/null +++ b/tests/pending/run/t8601d.scala @@ -0,0 +1,8 @@ +object Test { + def monitor(x: AnyRef): Unit = {x.synchronized(()); ()} + def check(x: => Any) = try { x; sys.error("failed to throw NPE") } catch { case _: NullPointerException => } + + def main(args: Array[String]): Unit = { + check(monitor(null)) + } +} diff --git a/tests/pending/run/t8601e.flags b/tests/pending/run/t8601e.flags new file mode 100644 index 000000000000..49d036a8879c --- /dev/null +++ b/tests/pending/run/t8601e.flags @@ -0,0 +1 @@ +-optimize diff --git a/tests/pending/run/t8601e/StaticInit.java b/tests/pending/run/t8601e/StaticInit.java new file mode 100644 index 000000000000..7543ed98b806 --- /dev/null +++ b/tests/pending/run/t8601e/StaticInit.java @@ -0,0 +1,8 @@ +public class StaticInit { + static { + if ("".isEmpty()) { + throw new RuntimeException(); + } + } + public static int fld = 42; +} diff --git a/tests/pending/run/t8601e/Test.scala b/tests/pending/run/t8601e/Test.scala new file mode 100644 index 000000000000..efeaafb15f4f --- /dev/null +++ b/tests/pending/run/t8601e/Test.scala @@ -0,0 +1,12 @@ +class C { + def foo: Unit = {StaticInit.fld} +} + +object Test extends dotty.runtime.LegacyApp { + try { + new C().foo + sys.error("StaticInit. was not run!") + } catch { + case t: ExceptionInInitializerError => + } +} diff --git a/tests/pending/run/t8607.scala b/tests/pending/run/t8607.scala new file mode 100644 index 000000000000..5ee7e57d52e4 --- /dev/null +++ b/tests/pending/run/t8607.scala @@ -0,0 +1,36 @@ +package p1 { + private[p1] trait B extends Any { + def a: Any = "" + } + + class C(val value: Int) extends AnyVal with B { + // def b = "" + } +} + +object Test { + def main(args: Array[String]): Unit = { + val c = new p1.C(42) + c.a + /* + new p1.C.( + c.$asInstanceOf[scala.this.Int]() + ).a(); + + + new p1.C.( + new p1.C.( + c.$asInstanceOf[scala.this.Int]() + ).$asInstanceOf[ErasedValueType(class C, scala.this.Int)]() + .$asInstanceOf[scala.this.Int]() + ).a(); + + new p1.C.( + new p1.C.(c) + .$asInstanceOf[scala.this.Int]() + .$asInstanceOf[scala.this.Int]() + ).a(); + + */ + } +} diff --git a/tests/pending/run/t8608-no-format.scala b/tests/pending/run/t8608-no-format.scala new file mode 100644 index 000000000000..71c369a7eac0 --- /dev/null +++ b/tests/pending/run/t8608-no-format.scala @@ -0,0 +1,15 @@ + +import scala.tools.partest.JavapTest + +object Test extends JavapTest { + def code = """ + |f"hello, world" + |:javap -prv - + """.stripMargin + + // no format + override def yah(res: Seq[String]) = { + // note: avoid the word "information" + res forall (!_.contains("StringOps.format")) + } +} diff --git a/tests/pending/run/t8610.check b/tests/pending/run/t8610.check new file mode 100644 index 000000000000..b3ab7a9cefcf --- /dev/null +++ b/tests/pending/run/t8610.check @@ -0,0 +1,7 @@ +t8610.scala:6: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. + signature: X.f(p: (Int, Int)): Int + given arguments: 3, 4 + after adaptation: X.f((3, 4): (Int, Int)) + def g = f(3, 4) // adapted + ^ +Hi, $name diff --git a/tests/pending/run/t8610.flags b/tests/pending/run/t8610.flags new file mode 100644 index 000000000000..4195dec3835a --- /dev/null +++ b/tests/pending/run/t8610.flags @@ -0,0 +1 @@ +-Xlint:adapted-args diff --git a/tests/pending/run/t8610.scala b/tests/pending/run/t8610.scala new file mode 100644 index 000000000000..978900d42d09 --- /dev/null +++ b/tests/pending/run/t8610.scala @@ -0,0 +1,13 @@ + +// flags don't warn on u +case class X(name: String) { + def x = "Hi, $name" // missing interp + def f(p: (Int, Int)): Int = p._1 * p._2 + def g = f(3, 4) // adapted + def u: Unit = () // unitarian universalist +} + +object Test extends dotty.runtime.LegacyApp { + // poignant demonstration + Console println X("Bob").x +} diff --git a/tests/pending/run/t8611a.flags b/tests/pending/run/t8611a.flags new file mode 100644 index 000000000000..85d8eb2ba295 --- /dev/null +++ b/tests/pending/run/t8611a.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/tests/pending/run/t8611a.scala b/tests/pending/run/t8611a.scala new file mode 100644 index 000000000000..4a0d6fb57cb2 --- /dev/null +++ b/tests/pending/run/t8611a.scala @@ -0,0 +1,16 @@ +trait K +trait L + +object O { + type LK = K with L + val A: LK = new K with L + val B: LK = new K with L +} + +object Test extends dotty.runtime.LegacyApp { + val scrut: O.LK = O.B + scrut match { + case O.A => ??? + case O.B => // spurious unreachable + } +} diff --git a/tests/pending/run/t8611b.flags b/tests/pending/run/t8611b.flags new file mode 100644 index 000000000000..85d8eb2ba295 --- /dev/null +++ b/tests/pending/run/t8611b.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/tests/pending/run/t8611b.scala b/tests/pending/run/t8611b.scala new file mode 100644 index 000000000000..75114c2ae39d --- /dev/null +++ b/tests/pending/run/t8611b.scala @@ -0,0 +1,54 @@ +sealed trait KrafsDescription + +abstract class NotWorkingEnum extends Enumeration { + + type ExtendedValue = Value with KrafsDescription + + def Enum(inDescription: String): ExtendedValue = { + new Val(nextId) with KrafsDescription { + } + } +} + +abstract class WorkingEnum extends Enumeration { + + type ExtendedValue = Value + + def Enum(inDescription: String): ExtendedValue = { + new Val(nextId) { + } + } +} + +object NotWorkingTab extends NotWorkingEnum { + val a = Enum("A") + val b = Enum("B") +} + +object WorkingTab extends WorkingEnum { + val a = Enum("A") + val b = Enum("B") +} + +object Test extends dotty.runtime.LegacyApp { + testGris() + testWorking() + + def testGris(): Unit = { + val pipp = NotWorkingTab.b + pipp match { + case NotWorkingTab.a => ??? + case NotWorkingTab.b => + case _ => ??? + } + } + + def testWorking(): Unit = { + val stuff = WorkingTab.a + stuff match { + case WorkingTab.a => + case WorkingTab.b => ??? + case _ => ??? + } + } +} diff --git a/tests/pending/run/t8611c.flags b/tests/pending/run/t8611c.flags new file mode 100644 index 000000000000..85d8eb2ba295 --- /dev/null +++ b/tests/pending/run/t8611c.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/tests/pending/run/t8611c.scala b/tests/pending/run/t8611c.scala new file mode 100644 index 000000000000..325070f4ca6a --- /dev/null +++ b/tests/pending/run/t8611c.scala @@ -0,0 +1,21 @@ +trait K +trait L + +object O { + type LK = K with L +} + +object Test extends dotty.runtime.LegacyApp { + local + + def local = { + val A: O.LK = new K with L + val B: O.LK = new K with L + val scrut: O.LK = A + scrut match { + case B if "".isEmpty => ??? + case A => + case B => ??? + } + } +} diff --git a/tests/pending/run/t8637.check b/tests/pending/run/t8637.check new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/pending/run/t8637.scala b/tests/pending/run/t8637.scala new file mode 100644 index 000000000000..16c042b9ac2a --- /dev/null +++ b/tests/pending/run/t8637.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.currentMirror +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val tb = currentMirror.mkToolBox() + tb.compile(q"true > true") + tb.typecheck(q"true > true") +} diff --git a/tests/pending/run/t8680.scala b/tests/pending/run/t8680.scala new file mode 100644 index 000000000000..3c4bc8e7dc25 --- /dev/null +++ b/tests/pending/run/t8680.scala @@ -0,0 +1,53 @@ +object Test extends dotty.runtime.LegacyApp { + def pre(n: Int) = (-n to -1).toStream + + def cyc(m: Int) = { + lazy val s: Stream[Int] = (0 until m).toStream #::: s + s + } + + def precyc(n: Int, m: Int) = pre(n) #::: cyc(m) + + def str(s: Stream[Int]) = { + val b = new StringBuilder + s.addString(b, "", "", "") + b.toString + } + + def goal(n: Int, m: Int) = (-n until m).mkString + "..." + + // Check un-forced cyclic and non-cyclic streams + assert(str(pre(2)) == pre(2).take(1).toList.mkString + "?") + assert(str(cyc(2)) == cyc(2).take(1).toList.mkString + "?") + assert(str(precyc(2,2)) == precyc(2,2).take(1).toList.mkString + "?") + assert(!pre(2).hasDefiniteSize) + assert(!cyc(2).hasDefiniteSize) + assert(!precyc(2,2).hasDefiniteSize) + + // Check forced cyclic and non-cyclic streams + assert(str(pre(2).force) == (-2 to -1).mkString) + assert(str(cyc(2).force) == (0 until 2).mkString + "...") + assert(str(precyc(2,2).force) == (-2 until 2).mkString + "...") + assert(pre(2).force.hasDefiniteSize) + assert(!cyc(2).force.hasDefiniteSize) + assert(!precyc(2,2).force.hasDefiniteSize) + + // Special cases + assert(str(cyc(1).force) == goal(0,1)) + assert(str(precyc(1,6).force) == goal(1,6)) + assert(str(precyc(6,1).force) == goal(6,1)) + + // Make sure there are no odd/even problems + for (n <- 3 to 4; m <- 3 to 4) { + assert(precyc(n,m).mkString == goal(n,m), s"mkString $n $m") + assert(!precyc(n,m).force.hasDefiniteSize, s"hasDef $n$m") + } + + // Make sure there are no cycle/prefix modulus problems + for (i <- 6 to 8) { + assert(precyc(i,3).mkString == goal(i,3), s"mkString $i 3") + assert(precyc(3,i).mkString == goal(3,i), s"mkString 3 $i") + assert(!precyc(i,3).force.hasDefiniteSize, s"hasDef $i 3") + assert(!precyc(3,i).force.hasDefiniteSize, s"hasDef 3 $i") + } +} diff --git a/tests/pending/run/t8690.check b/tests/pending/run/t8690.check new file mode 100644 index 000000000000..72f076c4d88e --- /dev/null +++ b/tests/pending/run/t8690.check @@ -0,0 +1,2 @@ +non-empty iterator +abcdef diff --git a/tests/pending/run/t8690.scala b/tests/pending/run/t8690.scala new file mode 100644 index 000000000000..cfa47b0e48fa --- /dev/null +++ b/tests/pending/run/t8690.scala @@ -0,0 +1,12 @@ +import scala.io.Source +import java.io.ByteArrayInputStream + +object Test extends dotty.runtime.LegacyApp { + val txt = "abcdef" + + val in = new ByteArrayInputStream(txt.getBytes()); + val source = Source.fromInputStream(in); + println(source.toString) // forces the BufferedSource to look at the head of the input + + println(source.mkString) // used to return "bcdef" ... +} diff --git a/tests/pending/run/t8708_b.check b/tests/pending/run/t8708_b.check new file mode 100644 index 000000000000..30be62a3078e --- /dev/null +++ b/tests/pending/run/t8708_b.check @@ -0,0 +1,8 @@ +Scope{ + def : ; + sealed abstract trait T extends ; + def foo: +} +Scope{ + def f: +} diff --git a/tests/pending/run/t8708_b/A_1.scala b/tests/pending/run/t8708_b/A_1.scala new file mode 100644 index 000000000000..e767420f9e88 --- /dev/null +++ b/tests/pending/run/t8708_b/A_1.scala @@ -0,0 +1,8 @@ +package p + +class C { + + sealed trait T { def f: Int } + + def foo: T = new T { def f = 1 } +} diff --git a/tests/pending/run/t8708_b/Test_2.scala b/tests/pending/run/t8708_b/Test_2.scala new file mode 100644 index 000000000000..c9784906090b --- /dev/null +++ b/tests/pending/run/t8708_b/Test_2.scala @@ -0,0 +1,21 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -cp " + testOutput.path + + override def code = "" + + override def show(): Unit = { + val g = newCompiler() + withRun(g)(r => { + val c = g.rootMirror.getRequiredClass("p.C") + println(c.info.decls) + val t = c.info.member(g.newTypeName("T")) + // this test ensrues that the dummy class symbol is not entered in the + // scope of trait T during unpickling. + println(t.info.decls) + }) + } +} diff --git a/tests/pending/run/t8738.scala b/tests/pending/run/t8738.scala new file mode 100644 index 000000000000..1683b93b597f --- /dev/null +++ b/tests/pending/run/t8738.scala @@ -0,0 +1,16 @@ +object Test { + def check(a: Range, b: Range) = (a == b) == (a.toList == b.toList) + def main(args: Array[String]): Unit = { + val lo = -2 to 2 + val hi = lo + val step = List(-6,-2,-1,1,2,6) + for (i <- lo; j <- hi; n <- step; k <- lo; l <- hi; m <- step) { + assert( + check(i until j by n, k until l by m) && + check(i until j by n, k to l by m) && + check(i to j by n, k until l by m) && + check(i to j by n, k to l by m) + ) + } + } +} diff --git a/tests/pending/run/t874.check b/tests/pending/run/t874.check new file mode 100644 index 000000000000..91de7e0a032d --- /dev/null +++ b/tests/pending/run/t874.check @@ -0,0 +1,2 @@ +U created with xyz and 2 +U created with abc and 1 diff --git a/tests/pending/run/t874.scala b/tests/pending/run/t874.scala new file mode 100644 index 000000000000..b077859ef317 --- /dev/null +++ b/tests/pending/run/t874.scala @@ -0,0 +1,19 @@ + +import scala.language.{ reflectiveCalls } +object Test { + abstract class Base { + val U: { + def apply[A](x1: A)(x2: Int): Any + } + U("xyz")(2) + } + class Mix extends Base { + case class U[A](x1: A)(x2: Int) { + Console.println("U created with "+x1+" and "+x2) + } + } + def main(args : Array[String]) : Unit = { + val obvious: Base = new Mix; + obvious.U("abc")(1) + } +} diff --git a/tests/pending/run/t8764.check b/tests/pending/run/t8764.check new file mode 100644 index 000000000000..6260069602ae --- /dev/null +++ b/tests/pending/run/t8764.check @@ -0,0 +1,5 @@ +IntOnly: should return an unboxed int +Int: int +IntAndDouble: should just box and return Anyval +Double: class java.lang.Double +Int: class java.lang.Integer diff --git a/tests/pending/run/t8764.flags b/tests/pending/run/t8764.flags new file mode 100644 index 000000000000..48fd867160ba --- /dev/null +++ b/tests/pending/run/t8764.flags @@ -0,0 +1 @@ +-Xexperimental diff --git a/tests/pending/run/t8764.scala b/tests/pending/run/t8764.scala new file mode 100644 index 000000000000..fc4c23e450b4 --- /dev/null +++ b/tests/pending/run/t8764.scala @@ -0,0 +1,16 @@ +object Test extends dotty.runtime.LegacyApp { +case class IntOnly(i: Int, j: Int) + +println("IntOnly: should return an unboxed int") +val a = IntOnly(1, 2) +val i: Int = a.productElement(0) +println(s"Int: ${a.productElement(0).getClass}") + +case class IntAndDouble(i: Int, d: Double) + +println("IntAndDouble: should just box and return Anyval") +val b = IntAndDouble(1, 2.0) +val j: AnyVal = b.productElement(0) +println(s"Double: ${b.productElement(1).getClass}") +println(s"Int: ${b.productElement(0).getClass}") +} diff --git a/tests/pending/run/t8803.check b/tests/pending/run/t8803.check new file mode 100644 index 000000000000..bd26a0fb14aa --- /dev/null +++ b/tests/pending/run/t8803.check @@ -0,0 +1,16 @@ +a +b +b +c +a +b +b +c +a +b +b +c +a +b +b +c diff --git a/tests/pending/run/t8803.scala b/tests/pending/run/t8803.scala new file mode 100644 index 000000000000..8596408dea7c --- /dev/null +++ b/tests/pending/run/t8803.scala @@ -0,0 +1,57 @@ +class A { + def m = "a" + protected def n = "a" +} + +trait B { + def m = "b" + protected def n = "b" +} + +class C extends A with B { + override def m = "c" + override protected def n = "c" + + val f1 = () => super[A].m + val f2 = () => super[B].m + val f3 = () => super.m + val f4 = () => this.m + + val g1 = new runtime.AbstractFunction0[String] { def apply() = C.super[A].m } + val g2 = new runtime.AbstractFunction0[String] { def apply() = C.super[B].m } + val g3 = new runtime.AbstractFunction0[String] { def apply() = C.super.m } + val g4 = new runtime.AbstractFunction0[String] { def apply() = C.this.m } + + val h1 = () => super[A].n + val h2 = () => super[B].n + val h3 = () => super.n + val h4 = () => this.n + + val i1 = new runtime.AbstractFunction0[String] { def apply() = C.super[A].n } + val i2 = new runtime.AbstractFunction0[String] { def apply() = C.super[B].n } + val i3 = new runtime.AbstractFunction0[String] { def apply() = C.super.n } + val i4 = new runtime.AbstractFunction0[String] { def apply() = C.this.n } +} + +object Test extends dotty.runtime.LegacyApp { + val c = new C + println(c.f1()) + println(c.f2()) + println(c.f3()) + println(c.f4()) + + println(c.g1()) + println(c.g2()) + println(c.g3()) + println(c.g4()) + + println(c.h1()) + println(c.h2()) + println(c.h3()) + println(c.h4()) + + println(c.i1()) + println(c.i2()) + println(c.i3()) + println(c.i4()) +} diff --git a/tests/pending/run/t8823.scala b/tests/pending/run/t8823.scala new file mode 100644 index 000000000000..06e3bff69dd1 --- /dev/null +++ b/tests/pending/run/t8823.scala @@ -0,0 +1,10 @@ +class Tuple2Int(val encoding: Long) extends AnyVal with Product2[Int, Int] { + def canEqual(that: Any) = false + def _1: Int = 1 + def _2: Int = 2 +} + +object Test extends dotty.runtime.LegacyApp { + assert(new Tuple2Int(0)._1 == 1) + assert(new Tuple2Int(0)._2 == 2) +} diff --git a/tests/pending/run/t8843-repl-xlat.scala b/tests/pending/run/t8843-repl-xlat.scala new file mode 100644 index 000000000000..6426dbe7d418 --- /dev/null +++ b/tests/pending/run/t8843-repl-xlat.scala @@ -0,0 +1,33 @@ + +import scala.tools.partest.SessionTest + +// Handy hamburger helper for repl resources +object Test extends SessionTest { + def session = +"""Type in expressions to have them evaluated. +Type :help for more information. + +scala> $intp.isettings.unwrapStrings = false +$intp.isettings.unwrapStrings: Boolean = false + +scala> class Bippy +defined class Bippy + +scala> $intp.classLoader getResource "Bippy.class" +res0: java.net.URL = memory:(memory)/$line4/$read$$iw$$iw$Bippy.class + +scala> ($intp.classLoader getResources "Bippy.class").nextElement +res1: java.net.URL = memory:(memory)/$line4/$read$$iw$$iw$Bippy.class + +scala> ($intp.classLoader classBytes "Bippy").nonEmpty +res2: Boolean = true + +scala> ($intp.classLoader classAsStream "Bippy") != null +res3: Boolean = true + +scala> $intp.classLoader getResource "Bippy" +res4: java.net.URL = null + +scala> :quit""" +} + diff --git a/tests/pending/run/t8845.flags b/tests/pending/run/t8845.flags new file mode 100644 index 000000000000..aada25f80d6f --- /dev/null +++ b/tests/pending/run/t8845.flags @@ -0,0 +1 @@ +-Ybackend:GenBCode -Ynooptimize diff --git a/tests/pending/run/t8845.scala b/tests/pending/run/t8845.scala new file mode 100644 index 000000000000..bb68142e568d --- /dev/null +++ b/tests/pending/run/t8845.scala @@ -0,0 +1,17 @@ +// crashes compiler under GenASM, works under GenBCode. +object Interpreter { + def mkDataProp(i: Int) = i + def break(n: Int): Unit = + try { + n match { + case _ => + val newDesc = mkDataProp(n) + n match { case _ => return } + } + } catch { case e: Throwable => } + finally { } +} + +object Test extends dotty.runtime.LegacyApp { + Interpreter.break(0) +} diff --git a/tests/pending/run/t8852a.scala b/tests/pending/run/t8852a.scala new file mode 100644 index 000000000000..cbff8ab75b91 --- /dev/null +++ b/tests/pending/run/t8852a.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ + +// Test that static methods in Java interfaces (new in Java 8) +// are callable from jointly compiler Scala code. +object Test extends CompilerTest { + import global._ + + override lazy val units: List[CompilationUnit] = { + // This test itself does not depend on JDK8. + javaCompilationUnits(global)(staticMethodInInterface) ++ + compilationUnits(global)(scalaClient) + } + + private def staticMethodInInterface = """ +public interface Interface { + public static int staticMethod() { + return 42; + } +} + + """ + + private def scalaClient = """ +object Test { + val x: Int = Interface.staticMethod() +} + +class C extends Interface // expect no errors about unimplemented members. + + """ + + // We're only checking we can compile it. + def check(source: String, unit: global.CompilationUnit): Unit = () +} diff --git a/tests/pending/run/t8888.flags b/tests/pending/run/t8888.flags new file mode 100644 index 000000000000..48b438ddf86a --- /dev/null +++ b/tests/pending/run/t8888.flags @@ -0,0 +1 @@ +-Ydelambdafy:method diff --git a/tests/pending/run/t8888.scala b/tests/pending/run/t8888.scala new file mode 100644 index 000000000000..0ddc2ae82578 --- /dev/null +++ b/tests/pending/run/t8888.scala @@ -0,0 +1,12 @@ +class C { + final def resume: Unit = (this: Any) match { + case x : C => (x: Any) match { + case y : C => + () => (x, y) // used to trigger a ClassFormatError under -Ydelambdafy:method + } + } +} + +object Test extends dotty.runtime.LegacyApp { + new C().resume +} diff --git a/tests/pending/run/t889.check b/tests/pending/run/t889.check new file mode 100644 index 000000000000..67ca2bf46734 --- /dev/null +++ b/tests/pending/run/t889.check @@ -0,0 +1 @@ +first: a, rest: List() diff --git a/tests/pending/run/t889.scala b/tests/pending/run/t889.scala new file mode 100644 index 000000000000..8e5d82412813 --- /dev/null +++ b/tests/pending/run/t889.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + + val a = List("a") + + a match { + case Seq("a", "b", rest : _*) => println("a, b, " + rest) + case Seq(first, rest : _*) => println("first: " + first + ", rest: " + rest) + } +} diff --git a/tests/pending/run/t8893.scala b/tests/pending/run/t8893.scala new file mode 100644 index 000000000000..5178226dec02 --- /dev/null +++ b/tests/pending/run/t8893.scala @@ -0,0 +1,40 @@ +import annotation.tailrec + +object Test { + def a(): Option[String] = Some("a") + + def test1: Any = { + a() match { + case Some(b1) => + a() match { + case Some(b2) => + @tailrec + def tick(i: Int): Unit = if (i < 0) () else tick(i - 1) + tick(10000000) // testing that this doesn't SOE + case None => None + } + case None => None + } + } + + def test2: Any = { + a() match { + case Some(b1) => + a() match { + case Some(b2) => + @tailrec + def tick(i: Int): Unit = if (i < 0) () else tick(i - 1) + tick(10000000) // testing that this doesn't SOE + case None => test1 + } + case None => + test1 // not a tail call + test1 + } + } + + def main(args: Array[String]): Unit = { + test1 + test2 + } +} diff --git a/tests/pending/run/t8893b.scala b/tests/pending/run/t8893b.scala new file mode 100644 index 000000000000..19120871aa84 --- /dev/null +++ b/tests/pending/run/t8893b.scala @@ -0,0 +1,15 @@ +// Testing that recursive calls in tail positions are replaced with +// jumps, even though the method contains recursive calls outside +// of the tail position. +object Test { + def tick(i : Int): Unit = + if (i == 0) () + else if (i == 42) { + tick(0) /*not in tail posiiton*/ + tick(i - 1) + } else tick(i - 1) + + def main(args: Array[String]): Unit = { + tick(1000000) + } +} diff --git a/tests/pending/run/t8907.scala b/tests/pending/run/t8907.scala new file mode 100644 index 000000000000..7952ac82d994 --- /dev/null +++ b/tests/pending/run/t8907.scala @@ -0,0 +1,39 @@ +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 show(): Unit = { + compileCode(""" + class C { class Inner } + + class D { + object O { + def foo(c: C)(i: c.Inner): c.Inner = ??? + } + } + """) + assert(filteredInfos.isEmpty, filteredInfos) + deleteClass("C") + compileCode(""" + class E { + def foo = { + (null: D).toString + } + } + """) + assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n")) // Included a MissingRequirementError before. + } + + def deleteClass(name: String) { + val classFile = new File(testOutput.path, name + ".class") + assert(classFile.exists) + assert(classFile.delete()) + } +} diff --git a/tests/pending/run/t8931.check b/tests/pending/run/t8931.check new file mode 100644 index 000000000000..d08546b5a9cd --- /dev/null +++ b/tests/pending/run/t8931.check @@ -0,0 +1 @@ +List(interface B) diff --git a/tests/pending/run/t8931.scala b/tests/pending/run/t8931.scala new file mode 100644 index 000000000000..e5e12ae8a75a --- /dev/null +++ b/tests/pending/run/t8931.scala @@ -0,0 +1,15 @@ + +trait A + +trait B extends A + +class C extends A with B + +object Test extends dotty.runtime.LegacyApp { + val c = classOf[C] + + println(c.getGenericInterfaces.toList) + + assert(c.getGenericInterfaces.length == c.getInterfaces.length, + s"mismatch between ${c.getGenericInterfaces} and ${c.getInterfaces}") +} diff --git a/tests/pending/run/t8933.check b/tests/pending/run/t8933.check new file mode 100644 index 000000000000..d5ef468b987e --- /dev/null +++ b/tests/pending/run/t8933.check @@ -0,0 +1 @@ +'traitSymbol diff --git a/tests/pending/run/t8933/A_1.scala b/tests/pending/run/t8933/A_1.scala new file mode 100644 index 000000000000..996e3b4a2cf4 --- /dev/null +++ b/tests/pending/run/t8933/A_1.scala @@ -0,0 +1,6 @@ +class MotherClass + +trait MixinWithSymbol { + self: MotherClass => + def symbolFromTrait: Symbol = 'traitSymbol +} diff --git a/tests/pending/run/t8933/Test_2.scala b/tests/pending/run/t8933/Test_2.scala new file mode 100644 index 000000000000..c506a7c51f53 --- /dev/null +++ b/tests/pending/run/t8933/Test_2.scala @@ -0,0 +1,10 @@ +class MotherClass extends MixinWithSymbol { + val classSymbol = 'classSymbol +} + +object Test { + def main(args: Array[String]) { + val symbol = (new MotherClass).symbolFromTrait + println(symbol) + } +} diff --git a/tests/pending/run/t8933b/A.scala b/tests/pending/run/t8933b/A.scala new file mode 100644 index 000000000000..d25d893c6f47 --- /dev/null +++ b/tests/pending/run/t8933b/A.scala @@ -0,0 +1,4 @@ +trait MixinWithSymbol { + self: MotherClass => + def symbolFromTrait: Any = 'traitSymbol +} diff --git a/tests/pending/run/t8933b/Test.scala b/tests/pending/run/t8933b/Test.scala new file mode 100644 index 000000000000..7ce239b7d16b --- /dev/null +++ b/tests/pending/run/t8933b/Test.scala @@ -0,0 +1,9 @@ +class MotherClass extends MixinWithSymbol { + def foo = 'sym1 +} + +object Test { + def main(args: Array[String]): Unit = { + (new MotherClass).symbolFromTrait + } +} diff --git a/tests/pending/run/t8933c.scala b/tests/pending/run/t8933c.scala new file mode 100644 index 000000000000..22011bc323fa --- /dev/null +++ b/tests/pending/run/t8933c.scala @@ -0,0 +1,14 @@ +object Test { + def main(args: Array[String]): Unit = { + try { + {throw T; Symbol}.apply("a") + assert(false, "exception not thrown") + } catch { + case T => // ok + case t: Throwable => + assert(false, "wrong not thrown: " + t) + } + } +} + +object T extends Throwable diff --git a/tests/pending/run/t8960.scala b/tests/pending/run/t8960.scala new file mode 100644 index 000000000000..adecd85139ea --- /dev/null +++ b/tests/pending/run/t8960.scala @@ -0,0 +1,72 @@ +object Test extends dotty.runtime.LegacyApp { + def test(o: AnyRef, sp: Boolean = false) = { + val isSpecialized = o.getClass.getSuperclass.getName contains "$sp" + val isDelambdafyMethod = o.getClass.getName contains "$lambda$" + assert( + // delambdafy:method doesn't currently emit specialized anonymous function classes + if (sp) (isSpecialized || isDelambdafyMethod) else !isSpecialized, + o.getClass.getName) + + val Some(f) = o.getClass.getDeclaredFields.find(_.getName == "serialVersionUID") + assert(f.getLong(null) == 0l) + } + + test(() => (), sp = true) + test(() => 1, sp = true) + test(() => "") + + test((x: Int) => x, sp = true) + test((x: Boolean) => x) + test((x: Int) => "") + + test((x1: Int, x2: Int) => 0d, sp = true) + test((x1: Int, x2: AnyRef) => 0d) + test((x1: Any, x2: Any) => x1) + + // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" test((", ", ", ") => x1)")).mkString("\n")) + + test((x1: Int, x2: Int, x3: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1) + test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1) + + test({ + case x: Int => x + }: PartialFunction[Int, Int], sp = true) + + test({ + case x: Int => x + }: PartialFunction[Any, Any]) + + test({ + case x: Int => () + }: PartialFunction[Int, Unit], sp = true) + + test({ + case x: String => 1 + }: PartialFunction[String, Int]) + + test({ + case x: String => () + }: PartialFunction[String, Unit]) + + test({ + case x: String => x + }: PartialFunction[String, String]) +} diff --git a/tests/pending/run/t9003.flags b/tests/pending/run/t9003.flags new file mode 100644 index 000000000000..49d036a8879c --- /dev/null +++ b/tests/pending/run/t9003.flags @@ -0,0 +1 @@ +-optimize diff --git a/tests/pending/run/t9003.scala b/tests/pending/run/t9003.scala new file mode 100644 index 000000000000..4f2471220196 --- /dev/null +++ b/tests/pending/run/t9003.scala @@ -0,0 +1,71 @@ +object Single { + var i = 0 + def isEmpty = false + def get = i + def unapply(a: Single.type) = this +} + +object Product { + var i = 0 + def _1: Int = i + def _2: String = ??? + def productArity = 2 + def unapply(a: Product.type) = this + def isEmpty = false + def get: this.type = this +} + +object Sequence { + var i = 0 + def apply(n: Int): Int = i + def length = 2 + def unapplySeq(a: Sequence.type) = this + def isEmpty = false + def get = this +} + +object Test { + def main(args: Array[String]): Unit = { + def assertZero(i: Int) = assert(i == 0) + + Single match { + case Single(i) => + Single.i = 1 + assertZero(i) // fails under -optimize + } + + Product match { + case Product(i, _) => + Product.i = 1 + assertZero(i) // fails under -optimize + } + + Sequence match { + case Sequence(i, _ @ _*) => + Sequence.i = 1 + assertZero(i) // okay + } + + Sequence.i = 0 + Sequence match { + case Sequence(_, i) => + Sequence.i = 1 + assertZero(i) // okay + } + + val buffer = collection.mutable.Buffer(0, 0) + buffer match { + case Seq(_, i) => + buffer(1) = 1 + assertZero(i) // failed + } + + case class CaseSequence(as: Int*) + val buffer1 = collection.mutable.Buffer(0, 0) + CaseSequence(buffer1: _*) match { + case CaseSequence(_, i) => + buffer1(1) = 1 + assertZero(i) // failed + } + } +} diff --git a/tests/pending/run/t920.check b/tests/pending/run/t920.check new file mode 100644 index 000000000000..76018072e09c --- /dev/null +++ b/tests/pending/run/t920.check @@ -0,0 +1 @@ +baz diff --git a/tests/pending/run/t920.scala b/tests/pending/run/t920.scala new file mode 100644 index 000000000000..6a7f122d55d5 --- /dev/null +++ b/tests/pending/run/t920.scala @@ -0,0 +1,20 @@ +object Test { + trait A; + trait Foo0 { def foo : A; } + trait Baz extends Foo0; + trait B extends A { + def initialize = { + trait Foo extends Test.Foo0 { + def foo : B.this.type = B.this; + } + class baz extends Baz with Foo { + override def toString = "baz" + } + Console.println(new baz); + } + } + object b extends B; + def main(args : Array[String]) : Unit = { + b.initialize; + } +} diff --git a/tests/pending/run/t949.scala b/tests/pending/run/t949.scala new file mode 100644 index 000000000000..9363f60c6d58 --- /dev/null +++ b/tests/pending/run/t949.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + + private def f = new T { val state = State.A } + + private object State extends Enumeration { + val A, B = Value + } + + f +} + +trait T { +} + diff --git a/tests/pending/run/t978.scala b/tests/pending/run/t978.scala new file mode 100644 index 000000000000..e87e7054aefd --- /dev/null +++ b/tests/pending/run/t978.scala @@ -0,0 +1,38 @@ +class Foo(val n: Int) { + override def hashCode = n % 2 // pretty bad hash + override def equals(other: Any): Boolean = other match { + case f: Foo => f.n == n + case _ => false + } + + override def toString = "" + n +} + +object Test extends dotty.runtime.LegacyApp { + val set = new collection.mutable.HashSet[Foo] +// val set = new collection.jcl.HashSet[Foo] + + val max = 200 + for (x <- 1 to max) + set += new Foo(x) + + testRemove(2) + testExists(2) + + def testRemove(m: Int): Unit = { + for (x <- 1 to max; if x % m == 0) { + val f = new Foo(x) + set -= f + assert(!(set contains f)) + testExists(m) + } + } + + def testExists(m: Int): Unit = { + for (x <- 1 to max; if x % m == 1) { + val f = new Foo(x) + assert(set contains f, "For element: " + f + " set: " + set) + } + } + +} diff --git a/tests/pending/run/tailcalls.check b/tests/pending/run/tailcalls.check new file mode 100644 index 000000000000..92d4f8a3c863 --- /dev/null +++ b/tests/pending/run/tailcalls.check @@ -0,0 +1,116 @@ +#partest !avian +test Object .f was successful +test Final .f was successful +test Class .f raised exception java.lang.StackOverflowError +test SubClass .f was successful +test Sealed .f raised exception java.lang.StackOverflowError +test SubSealed.f was successful + +test O .f was successful +test c .f was successful +test O.O .f was successful +test O.c .f was successful +test c.O .f was successful +test c.c .f was successful +test O.O.O .f was successful +test O.O.c .f was successful +test O.c.O .f was successful +test O.c.c .f was successful +test c.O.O .f was successful +test c.O.c .f was successful +test c.c.O .f was successful +test c.c.c .f was successful +test O.O.O.O.f was successful +test O.O.O.c.f was successful +test O.O.c.O.f was successful +test O.O.c.c.f was successful +test O.c.O.O.f was successful +test O.c.O.c.f was successful +test O.c.c.O.f was successful +test O.c.c.c.f was successful +test c.O.O.O.f was successful +test c.O.O.c.f was successful +test c.O.c.O.f was successful +test c.O.c.c.f was successful +test c.c.O.O.f was successful +test c.c.O.c.f was successful +test c.c.c.O.f was successful +test c.c.c.c.f was successful + +test TailCall.f1 was successful +test TailCall.f2 was successful +test TailCall.f3 was successful +test TailCall.g1 was successful +test TailCall.g2 was successful +test TailCall.g3 was successful +test TailCall.h1 was successful + +test NonTailCall.f1 0 1 2 was successful +test NonTailCall.f2 +test TailCall.b1 was successful +test TailCall.b2 was successful +test FancyTailCalls.tcTryLocal was successful +test FancyTailCalls.tcInBooleanExprFirstOp was successful +test FancyTailCalls.tcInBooleanExprSecondOp was successful +test FancyTailCalls.tcInIfCond was successful +test FancyTailCalls.tcInPatternGuard was successful +test FancyTailCalls.differentInstance was successful +test PolyObject.tramp was successful +#partest avian +test Object .f was successful +test Final .f was successful +test Class .f was successful +test SubClass .f was successful +test Sealed .f was successful +test SubSealed.f was successful + +test O .f was successful +test c .f was successful +test O.O .f was successful +test O.c .f was successful +test c.O .f was successful +test c.c .f was successful +test O.O.O .f was successful +test O.O.c .f was successful +test O.c.O .f was successful +test O.c.c .f was successful +test c.O.O .f was successful +test c.O.c .f was successful +test c.c.O .f was successful +test c.c.c .f was successful +test O.O.O.O.f was successful +test O.O.O.c.f was successful +test O.O.c.O.f was successful +test O.O.c.c.f was successful +test O.c.O.O.f was successful +test O.c.O.c.f was successful +test O.c.c.O.f was successful +test O.c.c.c.f was successful +test c.O.O.O.f was successful +test c.O.O.c.f was successful +test c.O.c.O.f was successful +test c.O.c.c.f was successful +test c.c.O.O.f was successful +test c.c.O.c.f was successful +test c.c.c.O.f was successful +test c.c.c.c.f was successful + +test TailCall.f1 was successful +test TailCall.f2 was successful +test TailCall.f3 was successful +test TailCall.g1 was successful +test TailCall.g2 was successful +test TailCall.g3 was successful +test TailCall.h1 was successful + +test NonTailCall.f1 0 1 2 was successful +test NonTailCall.f2 +test TailCall.b1 was successful +test TailCall.b2 was successful +test FancyTailCalls.tcTryLocal was successful +test FancyTailCalls.tcInBooleanExprFirstOp was successful +test FancyTailCalls.tcInBooleanExprSecondOp was successful +test FancyTailCalls.tcInIfCond was successful +test FancyTailCalls.tcInPatternGuard was successful +test FancyTailCalls.differentInstance was successful +test PolyObject.tramp was successful diff --git a/tests/pending/run/tailcalls.scala b/tests/pending/run/tailcalls.scala new file mode 100644 index 000000000000..d89a89b41bfa --- /dev/null +++ b/tests/pending/run/tailcalls.scala @@ -0,0 +1,442 @@ +//############################################################################ +// Tail Calls +//############################################################################ + +//############################################################################ +// Calibration + +class Calibrator { + def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); +} + +//############################################################################ +// Tail calls in different contexts + +class Class { + def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); +} + +class SubClass extends Class { + override def f(n: Int, v: Int): Int = v; +} + +sealed class Sealed { + def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); +} + +class SubSealed extends Sealed { + override def f(n: Int, v: Int): Int = v; +} + +final class Final { + def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); +} + +object Object { + def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); +} + +//############################################################################ +// Tail calls in nested objects/classes + +object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + val c: C = new C; + } + val c: C = new C; +} + +class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + object O { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + class C { + final def f(n: Int, v: Int): Int = if (n == 0) v else f(n - 1, v - 1); + } + val c: C = new C; + } + val c: C = new C; + } + val c: C = new C; +} + +//############################################################################ +// Tail calls with different signatures + +class TailCall[S](s: S) { + def getS: S = s; + + final def f1(n: Int, v: Int): Int = + if (n == 0) v else f1(n - 1, v - 1); + final def f2[T](n: Int, v: Int): Int = + if (n == 0) v else f2[T](n - 1, v - 1); + final def f3[T](n: Int, v: Int, ls: List[T]): Int = + if (n == 0) v else f3(n - 1, v - 1, ls); + + final def g1(x: Int, y: Int): Int = { + def aux(n: Int, v: Int): Int = + if (n == 0) v else aux(n - 1, v - 1); + aux(x, y); + } + final def g2[T](x: Int, y: Int): Int = { + def aux[U](n: Int, v: Int): Int = + if (n == 0) v else aux[U](n - 1, v - 1); + aux[T](x, y); + } + final def g3[T](x: Int, y: Int, zs: List[T]): Int = { + def aux[U](n: Int, v: Int, ls: List[Tuple2[T,U]]): Int = + if (n == 0) v else aux(n - 1, v - 1, ls); + aux(x, y, Nil); + } + + final def b1(x: Int): Boolean = + (x == 1) || b1(x - 1) + final def b2(x: Int): Boolean = + (x > 0) && ((x == 1) || b1(x - 1)) + + def h1(n: Int, v: Int): Int = hP(n, v); + private def hP(n: Int, v: Int): Int = if (n == 0) v else hP(n - 1, v - 1); + + // !!! test return in non-tail-call position + // !!! test non-same-instance calls + // !!! test non-same-type calls + +} + +object FancyTailCalls { + val f1 = new FancyTailCalls + val f2 = new FancyTailCalls +} + +object PolyObject extends dotty.runtime.LegacyApp { + def tramp[A](x: Int): Int = + if (x > 0) + tramp[A](x - 1) + else + 0 +} + + +class FancyTailCalls { + + def tcTryLocal(x: Int, v: Int): Int = { + try { + def loop(n: Int): Int = { + if (n == 0) v else loop(n - 1) + } + loop(x) + } finally {} + } + + def tcInBooleanExprFirstOp(x: Int, v: Int): Boolean = { + { + def loop(n: Int): Int = if (n == 0) v else loop(n - 1) + loop(x) + } == v && true + } + def tcInBooleanExprSecondOp(x: Int, v: Int): Boolean = { + true && { + def loop(n: Int): Int = if (n == 0) v else loop(n - 1) + loop(x) + } == v + } + def tcInIfCond(x: Int, v: Int): Boolean = { + if ({ + def loop(n: Int): Int = if (n == 0) v else loop(n - 1) + loop(x) + } == v) true else false + } + def tcInPatternGuard(x: Int, v: Int): Boolean = + v match { + case _ if + { + def loop(n: Int): Int = if (n == 0) v else loop(n - 1) + loop(x) == v + } => true + } + + import FancyTailCalls._ + final def differentInstance(n: Int, v: Int): Int = { + if (n == 0) v + else if ((n % 2) == 0) f1.differentInstance(n - 1, v) + else f2.differentInstance(n - 1, v) + } +} + +class NonTailCall { + final def f1(n: Int): Int = try { + if (n == 0) 0 + else f1(n - 1) + } finally { + Console.print(" " + n) + } + + final def f2(n: Int): Int = synchronized { + if (n == 0) 0 + else f2(n - 1) + } + +} + +//############################################################################ +// Test code + +object Test { + def check_success(name: String, closure: => Int, expected: Int) { + print("test " + name) + try { + val actual: Int = closure + if (actual == expected) { + print(" was successful") + } else { + print(" failed: expected "+ expected +", found "+ actual) + } + } catch { + case exception: Throwable => { + print(" raised exception " + exception) + } + } + println + } + + def check_success_b(name: String, closure: => Boolean, expected: Boolean) { + print("test " + name) + try { + val actual: Boolean = closure + if (actual == expected) { + print(" was successful") + } else { + print(" failed: expected "+ expected +", found "+ actual) + } + } catch { + case exception: Throwable => { + Console.print(" raised exception " + exception); + } + } + println + } + + def check_overflow(name: String, closure: => Int) { + print("test " + name) + try { + val actual: Int = closure; + } catch { + case exception: compat.Platform.StackOverflowError => + println(" was successful") + case exception: Throwable => { + print(" raised exception " + exception) + } + } + println + } + + def calibrate: Int = { + val calibrator = new Calibrator(); + var stop = false; + var n = 1; + while (!stop) { + try { + calibrator.f(n, n); + if (n >= Int.MaxValue / 2) sys.error("calibration failure"); + n = 2 * n; + } catch { + case exception: compat.Platform.StackOverflowError => stop = true + } + } + 4 * n + } + + def main(args: Array[String]) { + // compute min and max iteration number + val min = 16; + val max = if (scala.tools.partest.utils.Properties.isAvian) 10000 else calibrate + + // test tail calls in different contexts + val Final = new Final() + val Class = new Class() + val SubClass = new SubClass() + val Sealed = new Sealed() + val SubSealed = new SubSealed() + check_success("Object .f", Object .f(max, max), 0) + check_success("Final .f", Final .f(max, max), 0) + check_success("Class .f", Class .f(max, max), 0) + check_success("SubClass .f", SubClass .f(max, max), max) + check_success("Sealed .f", Sealed .f(max, max), 0) + check_success("SubSealed.f", SubSealed.f(max, max), max) + println + + // test tail calls in nested classes/objects + val c: C = new C + check_success("O .f", O .f(max, max), 0) + check_success("c .f", c .f(max, max), 0) + check_success("O.O .f", O.O .f(max, max), 0) + check_success("O.c .f", O.c .f(max, max), 0) + check_success("c.O .f", c.O .f(max, max), 0) + check_success("c.c .f", c.c .f(max, max), 0) + check_success("O.O.O .f", O.O.O .f(max, max), 0) + check_success("O.O.c .f", O.O.c .f(max, max), 0) + check_success("O.c.O .f", O.c.O .f(max, max), 0) + check_success("O.c.c .f", O.c.c .f(max, max), 0) + check_success("c.O.O .f", c.O.O .f(max, max), 0) + check_success("c.O.c .f", c.O.c .f(max, max), 0) + check_success("c.c.O .f", c.c.O .f(max, max), 0) + check_success("c.c.c .f", c.c.c .f(max, max), 0) + check_success("O.O.O.O.f", O.O.O.O.f(max, max), 0) + check_success("O.O.O.c.f", O.O.O.c.f(max, max), 0) + check_success("O.O.c.O.f", O.O.c.O.f(max, max), 0) + check_success("O.O.c.c.f", O.O.c.c.f(max, max), 0) + check_success("O.c.O.O.f", O.c.O.O.f(max, max), 0) + check_success("O.c.O.c.f", O.c.O.c.f(max, max), 0) + check_success("O.c.c.O.f", O.c.c.O.f(max, max), 0) + check_success("O.c.c.c.f", O.c.c.c.f(max, max), 0) + check_success("c.O.O.O.f", c.O.O.O.f(max, max), 0) + check_success("c.O.O.c.f", c.O.O.c.f(max, max), 0) + check_success("c.O.c.O.f", c.O.c.O.f(max, max), 0) + check_success("c.O.c.c.f", c.O.c.c.f(max, max), 0) + check_success("c.c.O.O.f", c.c.O.O.f(max, max), 0) + check_success("c.c.O.c.f", c.c.O.c.f(max, max), 0) + check_success("c.c.c.O.f", c.c.c.O.f(max, max), 0) + check_success("c.c.c.c.f", c.c.c.c.f(max, max), 0) + println + + // test tail calls with different signatures + val TailCall = new TailCall("S") + check_success("TailCall.f1", TailCall.f1(max, max ), 0) + check_success("TailCall.f2", TailCall.f2(max, max ), 0) + check_success("TailCall.f3", TailCall.f3(max, max, Nil), 0) + check_success("TailCall.g1", TailCall.g1(max, max ), 0) + check_success("TailCall.g2", TailCall.g2(max, max ), 0) + check_success("TailCall.g3", TailCall.g3(max, max, Nil), 0) + check_success("TailCall.h1", TailCall.h1(max, max ), 0) + println + + val NonTailCall = new NonTailCall + check_success("NonTailCall.f1", NonTailCall.f1(2), 0) + check_overflow("NonTailCall.f2", NonTailCall.f2(max)) + + check_success_b("TailCall.b1", TailCall.b1(max), true) + check_success_b("TailCall.b2", TailCall.b2(max), true) + + val FancyTailCalls = new FancyTailCalls; + check_success("FancyTailCalls.tcTryLocal", FancyTailCalls.tcTryLocal(max, max), max) + check_success_b("FancyTailCalls.tcInBooleanExprFirstOp", FancyTailCalls.tcInBooleanExprFirstOp(max, max), true) + check_success_b("FancyTailCalls.tcInBooleanExprSecondOp", FancyTailCalls.tcInBooleanExprSecondOp(max, max), true) + check_success_b("FancyTailCalls.tcInIfCond", FancyTailCalls.tcInIfCond(max, max), true) + check_success_b("FancyTailCalls.tcInPatternGuard", FancyTailCalls.tcInPatternGuard(max, max), true) + check_success("FancyTailCalls.differentInstance", FancyTailCalls.differentInstance(max, 42), 42) + check_success("PolyObject.tramp", PolyObject.tramp[Int](max), 0) + } + + // testing explicit tailcalls. + + import scala.util.control.TailCalls._ + + def isEven(xs: List[Int]): TailRec[Boolean] = + if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) + + def isOdd(xs: List[Int]): TailRec[Boolean] = + if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) + + def fib(n: Int): TailRec[Int] = + if (n < 2) done(n) else for { + x <- tailcall(fib(n - 1)) + y <- tailcall(fib(n - 2)) + } yield (x + y) + + def rec(n: Int): TailRec[Int] = + if (n == 1) done(n) else for { + x <- tailcall(rec(n - 1)) + } yield x + + assert(isEven((1 to 100000).toList).result) + //assert(fib(40).result == 102334155) // Commented out, as it takes a long time + assert(rec(100000).result == 1) + +} + +//############################################################################ diff --git a/tests/pending/run/takeAndDrop.scala b/tests/pending/run/takeAndDrop.scala new file mode 100644 index 000000000000..8d2dff0bfa83 --- /dev/null +++ b/tests/pending/run/takeAndDrop.scala @@ -0,0 +1,14 @@ +object Test { + def main(args: Array[String]): Unit = { + val range = 1 to 10 + val target = (3 to 8).toList + val confirm = (xs: Seq[Int]) => assert(xs.toList == target, xs) + + confirm(range drop 2 dropRight 2) + confirm(range drop 1 dropRight 1 drop 1 dropRight 1) + confirm(range take 8 drop 2) + confirm(range takeRight 8 dropRight 2) + confirm(range drop 2 take 6) + confirm(range dropRight 1 take 8 takeRight 7 drop 1) + } +} diff --git a/tests/pending/run/tcpoly_monads.check b/tests/pending/run/tcpoly_monads.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/tcpoly_monads.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/tcpoly_monads.scala b/tests/pending/run/tcpoly_monads.scala new file mode 100644 index 000000000000..978f8895907e --- /dev/null +++ b/tests/pending/run/tcpoly_monads.scala @@ -0,0 +1,45 @@ + +import scala.language.{ higherKinds, implicitConversions } + +trait Monads { + /** + * class Monad m where + * (>>=) :: m a -> (a -> m b) -> m b + * return :: a -> m a + * + * MonadTC encodes the above Haskell type class, + * an instance of MonadTC corresponds to a method dictionary. + * (see http://lampwww.epfl.ch/~odersky/talks/wg2.8-boston06.pdf) + * + * Note that the identity (`this') of the method dictionary does not really correspond + * to the instance of m[x] (`self') that is `wrapped': e.g., unit does not use `self' (which + * corresponds to the argument of the implicit conversion that encodes an instance of this type class) + */ + trait MonadTC[m[x], a] { + def unit[a](orig: a): m[a] + + // >>='s first argument comes from the implicit definition constructing this "method dictionary" + def >>=[b](fun: a => m[b]): m[b] + } +} + +/** + * instance Monad Maybe where + * (Just x) >>= k = k x + * Nothing >>= _ = Nothing + */ +trait OptionMonad extends Monads { + // this implicit method encodes the Monad type class instance for Option + implicit def OptionInstOfMonad[a](self: Option[a]): MonadTC[Option, a] + = new MonadTC[Option, a] { + def unit[a](orig: a) = Some(orig) + def >>=[b](fun: a => Option[b]): Option[b] = self match { + case Some(x) => fun(x) + case None => None + } + } +} + +object Test extends OptionMonad with App { + Console.println((Some("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") >>= (x => Some(x.length))).get) +} diff --git a/tests/pending/run/tcpoly_overriding.check b/tests/pending/run/tcpoly_overriding.check new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/tests/pending/run/tcpoly_overriding.check @@ -0,0 +1 @@ +1 diff --git a/tests/pending/run/tcpoly_overriding.scala b/tests/pending/run/tcpoly_overriding.scala new file mode 100644 index 000000000000..01b9c29ac80f --- /dev/null +++ b/tests/pending/run/tcpoly_overriding.scala @@ -0,0 +1,19 @@ + +import scala.language.{ higherKinds } + +abstract class A[t[x]] { + def b: t[Int] +} + +class B extends A[List] { + // underlying functionality being tested is overriding, but bugs manifest itself during erasure + // erasure should generate two methods: one that returns an Object (to implement the method in A) + // one that is as close as possible to the original method and thus returns a List + // the problem only manifests itself here -- but it's really a problem with overriding + // the link between this method and the method in A isn't seen + def b: List[Int] = List(1) +} + +object Test extends dotty.runtime.LegacyApp { + Console.println((new B).b(0)) +} diff --git a/tests/pending/run/tcpoly_parseridioms.check b/tests/pending/run/tcpoly_parseridioms.check new file mode 100644 index 000000000000..8bd0a086d616 --- /dev/null +++ b/tests/pending/run/tcpoly_parseridioms.check @@ -0,0 +1,21 @@ +tcpoly_parseridioms.scala:18: warning: match may not be exhaustive. +It would fail on the following input: ParseResult() + case Success(next, x) => b(next) match { + ^ +tcpoly_parseridioms.scala:17: warning: match may not be exhaustive. +It would fail on the following input: ParseResult() + def apply(in: Input): ParseResult[Tuple2[T, U]] = a(in) match { + ^ +tcpoly_parseridioms.scala:30: warning: match may not be exhaustive. +It would fail on the following input: ParseResult() + case Failure(_, _) => b(in) match { + ^ +tcpoly_parseridioms.scala:28: warning: match may not be exhaustive. +It would fail on the following input: ParseResult() + def apply(in: Input): ParseResult[T] = a(in) match { + ^ +tcpoly_parseridioms.scala:39: warning: match may not be exhaustive. +It would fail on the following input: ParseResult() + def apply(in: Input): ParseResult[U] = a(in) match { + ^ +Success(List(),Plus(1,2)) diff --git a/tests/pending/run/tcpoly_parseridioms.scala b/tests/pending/run/tcpoly_parseridioms.scala new file mode 100644 index 000000000000..6d541996c743 --- /dev/null +++ b/tests/pending/run/tcpoly_parseridioms.scala @@ -0,0 +1,112 @@ + +import scala.language.{ higherKinds, implicitConversions, postfixOps } + +trait Parsers { + type Input = List[Char] + + sealed class ParseResult[+t](val next: Input) + case class Success[+t](override val next: Input, result: t) extends ParseResult[t](next) + case class Failure(override val next: Input, msg: String) extends ParseResult[Nothing](next) + + abstract class Parser[+t] { + def apply(in: Input): ParseResult[t] + } + + // sequence + def sq[T, U](a: => Parser[T], b: => Parser[U]): Parser[Tuple2[T, U]] = new Parser[Tuple2[T, U]] { + def apply(in: Input): ParseResult[Tuple2[T, U]] = a(in) match { + case Success(next, x) => b(next) match { + case Success(next2, y) => Success(next2, (x,y)) + case Failure(_, msg) => Failure(in, msg) + } + case Failure(_, msg) => Failure(in, msg) + } + } + + // ordered choice + def or[T, U <: T](a: => Parser[T], b: => Parser[U]): Parser[T] = new Parser[T] { + def apply(in: Input): ParseResult[T] = a(in) match { + case Success(next, x) => Success(next, x) + case Failure(_, _) => b(in) match { + case Success(next, y) => Success(next, y) + case Failure(_, msg) => Failure(in, msg) + } + } + } + + // lifting + def lift[T, U](f: T => U)(a: => Parser[T]): Parser[U] = new Parser[U] { + def apply(in: Input): ParseResult[U] = a(in) match { + case Success(n, x) => Success(n, f(x)) + case Failure(n, msg) => Failure(n, msg) + } + } + + def accept[T](c: Char, r: T): Parser[T] = new Parser[T] { + def apply(in: Input) = in match { + case c2 :: n if c2 == c => Success(n, r) + case n => Failure(n, "expected "+c+" at the head of "+n) + } + } + + def apply_++[s, tt](fun: Parser[s => tt], arg: Parser[s]): Parser[tt] = lift[Tuple2[s=>tt, s], tt]({case (f, a) => f(a)})(sq(fun, arg)) + + def success[u](v: u): Parser[u] = new Parser[u] { + def apply(in: Input) = Success(in, v) + } + +} + +trait Idioms { + trait Idiom[idi[x]] { + def liftedApply[s, t](fun: idi[s => t])(arg: idi[s]): idi[t] + def pure[a](x: a): idi[a] + def pureMethod[a](name: String, x: a): idi[a] = pure(x) // hack for Mirrors: allow passing of method names + } + + class IdiomaticTarget[idi[x], idiom <: Idiom[idi], s](i: idiom, tgt: s) { + def dot [t](fun: s => t, name: String) = new IdiomaticApp2[idi, idiom, t](i, i.liftedApply(i.pureMethod(name, fun))(i.pure(tgt))) + } // TODO: `.` --> java.lang.ClassFormatError: Illegal method name "." in class Idioms$Id$ + + class IdiomaticFunction[idi[x], idiom <: Idiom[idi], s, t](i: idiom, fun: s => t) { + def <| (a: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(i.pure(fun))(a)) + } + + class IdiomaticApp[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) { + // where x <: s=>t -- TODO can this be expressed without generalised constraints? + def <> [s, t](b: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(a.asInstanceOf[idi[s=>t]])(b)) + + def |> : idi[x] = a + } + + class IdiomaticApp2[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) extends IdiomaticApp[idi, idiom, x](i, a) { + def <| [s, t](b: idi[s]) = <>[s,t](b) + } +} + +trait ParserIdioms extends Parsers with Idioms { + object ParserIdiom extends Idiom[Parser] { + def liftedApply[s, t](fun: Parser[s => t])(arg: Parser[s]): Parser[t] = apply_++(fun, arg) + def pure[a](x: a): Parser[a] = success(x) + } + + implicit def parserIdiomFun[s, t](fun: s=>t): IdiomaticFunction[Parser, ParserIdiom.type, s, t] = + new IdiomaticFunction[Parser, ParserIdiom.type, s, t](ParserIdiom, fun) + implicit def parserIdiomTgt[s](tgt: s): IdiomaticTarget[Parser, ParserIdiom.type, s] = + new IdiomaticTarget[Parser, ParserIdiom.type, s](ParserIdiom, tgt) + + trait Expr + case class Plus(a: Int, b: Int) extends Expr + + def num = or(accept('0', 0), or(accept('1', 1),accept('2', 2))) + + // TODO: how can parserIdiom(curry2(_)) be omitted? + def expr: Parser[Expr] = parserIdiomFun(curry2(Plus)) <| num <> num |> + + implicit def curry2[s,t,u](fun: (s, t)=>u)(a: s)(b: t): u = fun(a, b) + implicit def curry3[r,s,t,u](fun: (r,s, t)=>u)(a: r)(b: s)(c: t): u = fun(a, b, c) +} + +object Test extends ParserIdioms with App { + println(expr("12".toList)) +} diff --git a/tests/pending/run/test-cpp.check b/tests/pending/run/test-cpp.check new file mode 100644 index 000000000000..13f4c64be376 --- /dev/null +++ b/tests/pending/run/test-cpp.check @@ -0,0 +1,81 @@ +--- a ++++ b +@@ -36,3 +36,3 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, value x, value y ++ locals: value args + startBlock: 1 +@@ -41,10 +41,6 @@ + 1: +- 52 CONSTANT(2) +- 52 STORE_LOCAL(value x) + 52 SCOPE_ENTER value x +- 53 LOAD_LOCAL(value x) +- 53 STORE_LOCAL(value y) + 53 SCOPE_ENTER value y + 54 LOAD_MODULE object Predef +- 54 LOAD_LOCAL(value y) ++ 54 CONSTANT(2) + 54 BOX INT +@@ -91,3 +87,3 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, value x, value y ++ locals: value args, value x + startBlock: 1 +@@ -100,7 +96,5 @@ + 81 SCOPE_ENTER value x +- 82 LOAD_LOCAL(value x) +- 82 STORE_LOCAL(value y) + 82 SCOPE_ENTER value y + 83 LOAD_MODULE object Predef +- 83 LOAD_LOCAL(value y) ++ 83 LOAD_LOCAL(value x) + 83 BOX INT +@@ -134,3 +128,3 @@ + def main(args: Array[String] (ARRAY[REF(class String)])): Unit { +- locals: value args, value x, value y ++ locals: value args + startBlock: 1 +@@ -139,10 +133,6 @@ + 1: +- 66 THIS(TestAliasChainDerefThis) +- 66 STORE_LOCAL(value x) + 66 SCOPE_ENTER value x +- 67 LOAD_LOCAL(value x) +- 67 STORE_LOCAL(value y) + 67 SCOPE_ENTER value y + 68 LOAD_MODULE object Predef +- 68 LOAD_LOCAL(value y) ++ 68 THIS(Object) + 68 CALL_METHOD scala.Predef.println (dynamic) +@@ -175,3 +165,3 @@ + def test(x: Int (INT)): Unit { +- locals: value x, value y ++ locals: value x + startBlock: 1 +@@ -180,7 +170,5 @@ + 1: +- 29 LOAD_LOCAL(value x) +- 29 STORE_LOCAL(value y) + 29 SCOPE_ENTER value y + 30 LOAD_MODULE object Predef +- 30 LOAD_LOCAL(value y) ++ 30 LOAD_LOCAL(value x) + 30 BOX INT +@@ -222,7 +210,5 @@ + 96 SCOPE_ENTER variable x +- 97 LOAD_LOCAL(variable x) +- 97 STORE_LOCAL(variable y) + 97 SCOPE_ENTER variable y + 98 LOAD_MODULE object Predef +- 98 LOAD_LOCAL(variable y) ++ 98 LOAD_LOCAL(variable x) + 98 BOX INT +@@ -232,6 +218,4 @@ + 100 STORE_LOCAL(variable y) +- 101 LOAD_LOCAL(variable y) +- 101 STORE_LOCAL(variable x) + 102 LOAD_MODULE object Predef +- 102 LOAD_LOCAL(variable x) ++ 102 LOAD_LOCAL(variable y) + 102 BOX INT diff --git a/tests/pending/run/test-cpp.scala b/tests/pending/run/test-cpp.scala new file mode 100644 index 000000000000..4e00e7265844 --- /dev/null +++ b/tests/pending/run/test-cpp.scala @@ -0,0 +1,104 @@ +/** + * The only change is in the decision to replace a LOAD_LOCAL(l) + * in the copy-propagation performed before ClosureElimination. + * + * In the general case, the local variable 'l' is connected through + * an alias chain with other local variables and at the end of the + * alias chain there may be a Value, call it 'v'. + * + * If 'v' is cheaper to access (it is a Deref(This) or Const(_)), then + * replace the instruction to load it from the cheaper place. + * Otherwise, we use the local variable at the end of the alias chain + * instead of 'l'. + */ + +import scala.tools.partest.IcodeComparison + +object Test extends IcodeComparison { + override def printIcodeAfterPhase = "dce" +} + +import scala.util.Random._ + +/** + * The example in the bug report (Issue-5321): an alias chain which store + * an Unknown. Should remove local variable 'y'. + */ +object TestBugReport { + def test(x: Int) = { + val y = x + println(y) + } +} + +/** + * The code taken from scala.tools.nsc.settings.Settings: + * After inlining of the setter is performed, there is an opportunity for + * copy-propagation to eliminate some local variables. + */ +object TestSetterInline { + private var _postSetHook: this.type => Unit = (x: this.type) => () + def withPostSetHook(f: this.type => Unit): this.type = { _postSetHook = f ; this } +} + + +/** + * The access of the local variable 'y' should be replaced by the + * constant. + */ +object TestAliasChainConstat { + + def main(args: Array[String]): Unit = { + val x = 2 + val y = x + println(y) + } +} + +/** + * At the end of the alias chain we have a reference to 'this'. + * The local variables should be all discarded and replace by a + * direct reference to this + */ +class TestAliasChainDerefThis { + + def main(args: Array[String]): Unit = { + val x = this + val y = x + println(y) + } +} + +/** + * At the end of the alias chain, there is the value of a field. + * The use of variable 'y' should be replaced by 'x', not by an access + * to the field 'f' since it is more costly. + */ +object TestAliasChainDerefField { + def f = nextInt + + def main(args: Array[String]): Unit = { + val x = f + val y = x + println(y) + } +} + + +/** + * The first time 'println' is called, 'x' is replaced by 'y' + * and the second time, 'y' is replaced by 'x'. But none of them + * can be removed. + */ +object TestDifferentBindings { + + def main(args: Array[String]): Unit = { + var x = nextInt + var y = x + println(y) + + y = nextInt + x = y + println(x) + } +} diff --git a/tests/pending/run/toolbox_console_reporter.check b/tests/pending/run/toolbox_console_reporter.check new file mode 100644 index 000000000000..1395c6874072 --- /dev/null +++ b/tests/pending/run/toolbox_console_reporter.check @@ -0,0 +1,8 @@ +hello +============compiler console============= +warning: method foo in object Utils is deprecated: test + +========================================= +============compiler messages============ +Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) +========================================= diff --git a/tests/pending/run/toolbox_console_reporter.scala b/tests/pending/run/toolbox_console_reporter.scala new file mode 100644 index 000000000000..53cbcb0fbcc1 --- /dev/null +++ b/tests/pending/run/toolbox_console_reporter.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd} + +object Test extends dotty.runtime.LegacyApp { + //val oldErr = Console.err; + val baos = new java.io.ByteArrayOutputStream() + val errs = new java.io.PrintStream(baos) + (Console withErr errs) { + val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation") + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) + println("============compiler console=============") + errs.flush() + println(baos.toString); + println("=========================================") + println("============compiler messages============") + toolbox.frontEnd.infos.foreach(println(_)) + println("=========================================") + } +} diff --git a/tests/pending/run/toolbox_current_run_compiles.check b/tests/pending/run/toolbox_current_run_compiles.check new file mode 100644 index 000000000000..da29283aaa47 --- /dev/null +++ b/tests/pending/run/toolbox_current_run_compiles.check @@ -0,0 +1,2 @@ +true +false diff --git a/tests/pending/run/toolbox_current_run_compiles.scala b/tests/pending/run/toolbox_current_run_compiles.scala new file mode 100644 index 000000000000..702741c2e668 --- /dev/null +++ b/tests/pending/run/toolbox_current_run_compiles.scala @@ -0,0 +1,28 @@ +package pkg { + import scala.reflect.macros.blackbox.Context + import scala.language.experimental.macros + + object Macros { + def impl[T: c.WeakTypeTag](c: Context) = { + import c.universe._ + val sym = c.weakTypeOf[T].typeSymbol + val g = c.universe.asInstanceOf[scala.tools.nsc.Global] + c.Expr[Boolean](Literal(Constant(g.currentRun.compiles(sym.asInstanceOf[g.Symbol])))) + } + def compiles[T]: Boolean = macro impl[T] + } +} + +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val cm = ru.runtimeMirror(getClass.getClassLoader) + val toolbox = cm.mkToolBox() + toolbox.eval(toolbox.parse("""{ + class C + println(pkg.Macros.compiles[C]) + println(pkg.Macros.compiles[Object]) + }""")) +} diff --git a/tests/pending/run/toolbox_default_reporter_is_silent.check b/tests/pending/run/toolbox_default_reporter_is_silent.check new file mode 100644 index 000000000000..ce013625030b --- /dev/null +++ b/tests/pending/run/toolbox_default_reporter_is_silent.check @@ -0,0 +1 @@ +hello diff --git a/tests/pending/run/toolbox_default_reporter_is_silent.scala b/tests/pending/run/toolbox_default_reporter_is_silent.scala new file mode 100644 index 000000000000..694720721037 --- /dev/null +++ b/tests/pending/run/toolbox_default_reporter_is_silent.scala @@ -0,0 +1,16 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) +} diff --git a/tests/pending/run/toolbox_parse_package.check b/tests/pending/run/toolbox_parse_package.check new file mode 100644 index 000000000000..46465980a0e8 --- /dev/null +++ b/tests/pending/run/toolbox_parse_package.check @@ -0,0 +1,8 @@ +package foo { + object bar extends scala.AnyRef { + def () = { + super.(); + () + } + } +} diff --git a/tests/pending/run/toolbox_parse_package.scala b/tests/pending/run/toolbox_parse_package.scala new file mode 100644 index 000000000000..a4ba71aaa0da --- /dev/null +++ b/tests/pending/run/toolbox_parse_package.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + println(toolbox.parse("package foo { object bar }")) +} diff --git a/tests/pending/run/toolbox_silent_reporter.check b/tests/pending/run/toolbox_silent_reporter.check new file mode 100644 index 000000000000..2d05b1e3f864 --- /dev/null +++ b/tests/pending/run/toolbox_silent_reporter.check @@ -0,0 +1,4 @@ +hello +============compiler messages============ +Info(NoPosition,method foo in object Utils is deprecated: test,WARNING) +========================================= diff --git a/tests/pending/run/toolbox_silent_reporter.scala b/tests/pending/run/toolbox_silent_reporter.scala new file mode 100644 index 000000000000..72109b822447 --- /dev/null +++ b/tests/pending/run/toolbox_silent_reporter.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, mkSilentFrontEnd} + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox(options = "-deprecation", frontEnd = mkSilentFrontEnd()) + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) + println("============compiler messages============") + toolbox.frontEnd.infos.foreach(println(_)) + println("=========================================") +} diff --git a/tests/pending/run/toolbox_typecheck_implicitsdisabled.check b/tests/pending/run/toolbox_typecheck_implicitsdisabled.check new file mode 100644 index 000000000000..009ba651fe74 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_implicitsdisabled.check @@ -0,0 +1,5 @@ +{ + import scala.Predef._; + scala.Predef.ArrowAssoc[Int](1).->[Int](2) +} +scala.tools.reflect.ToolBoxError: reflective typecheck has failed: value -> is not a member of Int diff --git a/tests/pending/run/toolbox_typecheck_implicitsdisabled.scala b/tests/pending/run/toolbox_typecheck_implicitsdisabled.scala new file mode 100644 index 000000000000..542a44b7ad77 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_implicitsdisabled.scala @@ -0,0 +1,27 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + + val tree1 = Block(List( + Import(Select(Ident(TermName("scala")), TermName("Predef")), List(ImportSelector(termNames.WILDCARD, -1, null, -1)))), + Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + ) + val ttree1 = toolbox.typecheck(tree1, withImplicitViewsDisabled = false) + println(ttree1) + + try { + val tree2 = Block(List( + Import(Select(Ident(TermName("scala")), TermName("Predef")), List(ImportSelector(termNames.WILDCARD, -1, null, -1)))), + Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) + ) + val ttree2 = toolbox.typecheck(tree2, withImplicitViewsDisabled = true) + println(ttree2) + } catch { + case ex: Throwable => + println(ex) + } +} diff --git a/tests/pending/run/toolbox_typecheck_inferimplicitvalue.check b/tests/pending/run/toolbox_typecheck_inferimplicitvalue.check new file mode 100644 index 000000000000..ec17b4203b18 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_inferimplicitvalue.check @@ -0,0 +1 @@ +C.MC diff --git a/tests/pending/run/toolbox_typecheck_inferimplicitvalue.scala b/tests/pending/run/toolbox_typecheck_inferimplicitvalue.scala new file mode 100644 index 000000000000..73c47e01fba0 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_inferimplicitvalue.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class C +object C { + implicit object MC extends C +} + +object Test extends dotty.runtime.LegacyApp { + val tb = cm.mkToolBox() + println(tb.inferImplicitValue(typeOf[C])) +} diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled.check b/tests/pending/run/toolbox_typecheck_macrosdisabled.check new file mode 100644 index 000000000000..62de3758264a --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_macrosdisabled.check @@ -0,0 +1,41 @@ +({ + val $u: ru.type = ru; + val $m: $u.Mirror = ru.runtimeMirror({ + final class $anon extends scala.AnyRef { + def (): <$anon: AnyRef> = { + $anon.super.(); + () + }; + () + }; + new $anon() +}.getClass().getClassLoader()); + $u.Expr.apply[Int(2)]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Literal.apply($u.Constant.apply(2)) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Int(2)]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.ConstantType($u.Constant.apply(2)) + } + }; + new $typecreator2() + })) +}: ru.Expr[Int]) +ru.reify[Int](2) diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled.scala b/tests/pending/run/toolbox_typecheck_macrosdisabled.scala new file mode 100644 index 000000000000..2aa0202e7ad4 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_macrosdisabled.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +// Note: If you're looking at this test and you don't know why, you may +// have accidentally changed the way type tags reify. If so, validate +// that your changes are accurate and update the check file. + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + val rupkg = cm.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) + println(ttree1) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) + val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) + println(ttree2) +} diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled2.check b/tests/pending/run/toolbox_typecheck_macrosdisabled2.check new file mode 100644 index 000000000000..86f89504d190 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_macrosdisabled2.check @@ -0,0 +1,41 @@ +({ + val $u: ru.type = ru; + val $m: $u.Mirror = ru.runtimeMirror({ + final class $anon extends scala.AnyRef { + def (): <$anon: AnyRef> = { + $anon.super.(); + () + }; + () + }; + new $anon() +}.getClass().getClassLoader()); + $u.Expr.apply[Array[Int]]($m, { + final class $treecreator1 extends TreeCreator { + def (): $treecreator1 = { + $treecreator1.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.Apply.apply($u.Select.apply($u.internal.reificationSupport.mkIdent($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + } + }; + new $treecreator1() + })($u.TypeTag.apply[Array[Int]]($m, { + final class $typecreator2 extends TypeCreator { + def (): $typecreator2 = { + $typecreator2.super.(); + () + }; + def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = { + val $u: U = $m$untyped.universe; + val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; + $u.internal.reificationSupport.TypeRef($u.internal.reificationSupport.ThisType($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor)) + } + }; + new $typecreator2() + })) +}: ru.Expr[Array[Int]]) +ru.reify[Array[Int]](scala.Array.apply(2)) diff --git a/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala b/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala new file mode 100644 index 000000000000..c554110edb15 --- /dev/null +++ b/tests/pending/run/toolbox_typecheck_macrosdisabled2.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox +import internal._ + +// Note: If you're looking at this test and you don't know why, you may +// have accidentally changed the way type tags reify. If so, validate +// that your changes are accurate and update the check file. + +object Test extends dotty.runtime.LegacyApp { + val toolbox = cm.mkToolBox() + val rupkg = cm.staticModule("scala.reflect.runtime.package") + val rusym = reificationSupport.selectTerm(rupkg, "universe") + val NullaryMethodType(rutpe) = rusym.info + val ru = reificationSupport.newFreeTerm("ru", scala.reflect.runtime.universe) + reificationSupport.setInfo(ru, rutpe) + + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree1 = toolbox.typecheck(tree1, withMacrosDisabled = false) + println(ttree1) + + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) + val ttree2 = toolbox.typecheck(tree2, withMacrosDisabled = true) + println(ttree2) +} diff --git a/tests/pending/run/tpeCache-tyconCache.check b/tests/pending/run/tpeCache-tyconCache.check new file mode 100644 index 000000000000..ff604819e0c3 --- /dev/null +++ b/tests/pending/run/tpeCache-tyconCache.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> + +scala> AnyRefClass.tpe eq AnyRefClass.typeConstructor +res0: Boolean = true + +scala> AnyRefClass.tpe eq AnyRefClass.typeConstructor +res1: Boolean = true + +scala> :quit diff --git a/tests/pending/run/tpeCache-tyconCache.scala b/tests/pending/run/tpeCache-tyconCache.scala new file mode 100644 index 000000000000..f907167a3377 --- /dev/null +++ b/tests/pending/run/tpeCache-tyconCache.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + override def code = """ +:power + +AnyRefClass.tpe eq AnyRefClass.typeConstructor +AnyRefClass.tpe eq AnyRefClass.typeConstructor + """.trim +} diff --git a/tests/pending/run/trait-renaming.check b/tests/pending/run/trait-renaming.check new file mode 100644 index 000000000000..b2e5affde58a --- /dev/null +++ b/tests/pending/run/trait-renaming.check @@ -0,0 +1,2 @@ +public static int bippy.A$B$1$class.f(bippy.A$B$1) +public static void bippy.A$B$1$class.$init$(bippy.A$B$1) diff --git a/tests/pending/run/trait-renaming/A_1.scala b/tests/pending/run/trait-renaming/A_1.scala new file mode 100644 index 000000000000..d0fab7bfc344 --- /dev/null +++ b/tests/pending/run/trait-renaming/A_1.scala @@ -0,0 +1,15 @@ +package bippy { + class A { + def f = { + trait B { + def f = 5 + } + trait C { + def g = 10 + } + new B with C { } + } + + def g = Class.forName("bippy.A$B$1$class") + } +} diff --git a/tests/pending/run/trait-renaming/B_2.scala b/tests/pending/run/trait-renaming/B_2.scala new file mode 100644 index 000000000000..174e929fe21c --- /dev/null +++ b/tests/pending/run/trait-renaming/B_2.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + (new bippy.A).g.getDeclaredMethods.map(_.toString).sorted foreach println + } +} diff --git a/tests/pending/run/transform.scala b/tests/pending/run/transform.scala new file mode 100644 index 000000000000..d73155ceec2a --- /dev/null +++ b/tests/pending/run/transform.scala @@ -0,0 +1,8 @@ +object Test { + val x = (1 to 10).toBuffer + + def main(args: Array[String]): Unit = { + x transform (_ * 2) + assert(x.sum == (1 to 10).sum * 2) + } +} diff --git a/tests/pending/run/transpose.scala b/tests/pending/run/transpose.scala new file mode 100644 index 000000000000..2761a24ff5bf --- /dev/null +++ b/tests/pending/run/transpose.scala @@ -0,0 +1,12 @@ +object Test { + def wrap[T >: Null](body: => T) = + try body + catch { case _: IllegalArgumentException => null } + + def main(args: Array[String]): Unit = { + assert(wrap(Nil.transpose) == Nil) + assert(wrap(List(List(1, 2), List(1)).transpose) == null) + assert(wrap(List(List(1), List(1, 2)).transpose) == null) + assert(wrap(List(List(1, 2), List(1, 2)).transpose) == List(List(1, 1), List(2, 2))) + } +} diff --git a/tests/pending/run/treePrint.check b/tests/pending/run/treePrint.check new file mode 100644 index 000000000000..3360815ac193 --- /dev/null +++ b/tests/pending/run/treePrint.check @@ -0,0 +1,5 @@ +def foo = { + var q: Boolean = false; + val x = 5; + ((x == 5) || (!q)) || (true) +} diff --git a/tests/pending/run/treePrint.scala b/tests/pending/run/treePrint.scala new file mode 100644 index 000000000000..8bbf645faebb --- /dev/null +++ b/tests/pending/run/treePrint.scala @@ -0,0 +1,43 @@ +/** Testing compact tree printers. + */ +object Test { + import scala.tools.nsc._ + import interpreter._ + import java.io.{ OutputStream, BufferedReader, StringReader, PrintWriter, Writer, OutputStreamWriter} + + val code = """ + def foo = { + var q: Boolean = false + val x = if (true) { + if (true) { + if (true) { + 5 + } + else if (true) { + 5 + } else { + 10 + } + } + else 20 + } + else 30 + + (x == 5) || !q || true + } + """ + + class NullOutputStream extends OutputStream { def write(b: Int): Unit = { } } + + def main(args: Array[String]): Unit = { + val settings = new Settings + settings.classpath.value = System.getProperty("java.class.path") + settings.Ycompacttrees.value = true + + val intp = new IMain(settings, new PrintWriter(new NullOutputStream)) + val vals = new ReplVals { } + val power = new Power(intp, vals) + intp.interpret("""def initialize = "Have to interpret something or we get errors." """) + power trees code foreach println + } +} diff --git a/tests/pending/run/triemap-hash.scala b/tests/pending/run/triemap-hash.scala new file mode 100644 index 000000000000..902b80a014d1 --- /dev/null +++ b/tests/pending/run/triemap-hash.scala @@ -0,0 +1,46 @@ + + + +import util.hashing.Hashing + + + +object Test { + + def main(args: Array[String]): Unit = { + hashing() + equality() + } + + def hashing(): Unit = { + import collection._ + + val tm = new concurrent.TrieMap[String, String](Hashing.fromFunction(x => x.length + x(0).toInt), Equiv.universal) + tm.put("a", "b") + tm.put("c", "d") + + assert(tm("a") == "b") + assert(tm("c") == "d") + + for (i <- 0 until 1000) tm(i.toString) = i.toString + for (i <- 0 until 1000) assert(tm(i.toString) == i.toString) + } + + def equality(): Unit = { + import collection._ + + val tm = new concurrent.TrieMap[String, String](Hashing.fromFunction(x => x(0).toInt), Equiv.fromFunction(_(0) == _(0))) + tm.put("a", "b") + tm.put("a1", "d") + tm.put("b", "c") + + assert(tm("a") == "d", tm) + assert(tm("b") == "c", tm) + + for (i <- 0 until 1000) tm(i.toString) = i.toString + assert(tm.size == 12, tm) + assert(tm("0") == "0", tm) + for (i <- 1 to 9) assert(tm(i.toString) == i.toString + "99", tm) + } + +} diff --git a/tests/pending/run/triple-quoted-expr.check b/tests/pending/run/triple-quoted-expr.check new file mode 100644 index 000000000000..4e59695f36ad --- /dev/null +++ b/tests/pending/run/triple-quoted-expr.check @@ -0,0 +1,5 @@ + +hi +hi + +hi diff --git a/tests/pending/run/triple-quoted-expr.scala b/tests/pending/run/triple-quoted-expr.scala new file mode 100644 index 000000000000..6d91ac5888f0 --- /dev/null +++ b/tests/pending/run/triple-quoted-expr.scala @@ -0,0 +1,26 @@ +class A { + def f1 = { + val x = 5 + +""" +hi""" + } + def f2 = { + val x = 5 + + """hi""" + } + def f3 = { + val x = 5 + + "\nhi" + } +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new A + import x._ + List(f1, f2, f3) foreach println + } +} diff --git a/tests/pending/run/try-2.check b/tests/pending/run/try-2.check new file mode 100644 index 000000000000..987d3462df79 --- /dev/null +++ b/tests/pending/run/try-2.check @@ -0,0 +1,7 @@ +try-2.scala:41: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 10; + ^ +exception happened + +Nothin +Nothin diff --git a/tests/pending/run/try-2.scala b/tests/pending/run/try-2.scala new file mode 100644 index 000000000000..b55977ba8bab --- /dev/null +++ b/tests/pending/run/try-2.scala @@ -0,0 +1,61 @@ +/* + * Test different variants of the try-catch block. + * + */ + + +object Test { + + + def tryAllUnit: Unit = + try { + throw new Error(); + } + catch { + case _: Throwable => Console.println("exception happened\n"); + } + + def tryUnitAll: Unit = + try { + Console.println("Nothin"); + } catch { + case _: Throwable => sys.error("Bad, bad, lama!"); + } + + def tryAllAll: Unit = + try { + throw new Error(); + } catch { + case _: Throwable => sys.error("Bad, bad, lama!"); + } + + def tryUnitUnit: Unit = + try { + Console.println("Nothin"); + } catch { + case _: Throwable => Console.println("Nothin"); + } + + def tryIntUnit: Unit = + try { + 10; + } catch { + case _: Throwable => Console.println("Huh?"); + } + + + def execute(f: => Unit) = try { + f; + } catch { + case _: Throwable => (); + } + + + def main(args:Array[String]): Unit = { + execute(tryAllUnit); + execute(tryUnitAll); + execute(tryAllAll); + execute(tryUnitUnit); + execute(tryIntUnit); + } +} diff --git a/tests/pending/run/try-catch-unify.check b/tests/pending/run/try-catch-unify.check new file mode 100644 index 000000000000..67a8c64a33c7 --- /dev/null +++ b/tests/pending/run/try-catch-unify.check @@ -0,0 +1,4 @@ +Failure(java.lang.NumberFormatException: For input string: "Hi") +Success(5.0) +O NOES +Failure(java.lang.NumberFormatException: For input string: "Hi") diff --git a/tests/pending/run/try-catch-unify.scala b/tests/pending/run/try-catch-unify.scala new file mode 100644 index 000000000000..151e549e5fdf --- /dev/null +++ b/tests/pending/run/try-catch-unify.scala @@ -0,0 +1,16 @@ +import util._ + +import control.Exception._ + +object Test { + def main(args: Array[String]): Unit = { + println(catching(classOf[NumberFormatException]) withTry ("Hi".toDouble)) + println(catching(classOf[NumberFormatException]) withTry ("5".toDouble)) + try { + catching(classOf[NumberFormatException]) withTry (sys.error("O NOES")) + } catch { + case t: Throwable => println(t.getMessage) + } + println(nonFatalCatch withTry ("Hi".toDouble)) + } +} diff --git a/tests/pending/run/try.check b/tests/pending/run/try.check new file mode 100644 index 000000000000..f742ccb0dfab --- /dev/null +++ b/tests/pending/run/try.check @@ -0,0 +1,9 @@ +try.scala:65: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 1+1; + ^ +1 + 1 = 2 +1 + 1 = 2 +1 + 1 = 2 +1 + 1 = 2 + +1 + 1 = 2 diff --git a/tests/pending/run/try.scala b/tests/pending/run/try.scala new file mode 100644 index 000000000000..785f0153a7a5 --- /dev/null +++ b/tests/pending/run/try.scala @@ -0,0 +1,129 @@ +object Test extends AnyRef with App { + val x = 1; + + def try1 = { + Console.print("1 + 1 = "); + Console.println(1 + ( + try { + x; + } catch { + case _: Error => 1; + } + )); + } + + def try2 = { + Console.print("1 + 1 = "); + Console.println( + (try { x } catch { + case _: Error => 1; + }) + + + (try { x } catch { + case _: Error => 1; + }) + ); + } + + var n = 0; + + def try3 = { + Console.print("1 + 1 = "); + val x = try { 1 } catch { + case e: Error => 1; + } + this.n = try { 1 } catch { + case e: Error => 1; + } + Console.println(x + n); + } + + var instance: AnyRef = null; + + def try4 = { + if (instance == null) { + instance = try { + "" //new String(); + } catch { + case _: Throwable => + val cs = "aaa"; + if (cs.length() > 0) { + "" //new String(); + } else { + throw new Error("fatal error"); + null + } + } + } + } + + def try5 = try { + Console.print("1 + 1 = "); + try { + if (true) + sys.error("exit"); + 1+1; + () + } catch { + case _: Throwable => + Console.println("2"); + sys.error("for good"); + } + Console.println("a"); + } catch { + case _: Throwable => (); + } + + class A { + private val result = { + val y = try { x } catch { + case _: Error => 1; + }; + x + y + } + Console.print("1 + 1 = "); + Console.println(result); + } + + // ticket #981 + def try6: Unit = { + class SekwencjaArray { + def get = null + } + + var sekw : SekwencjaArray = + try { + null + } catch { + case _: Throwable => null + } + + new AnyRef { + def getValueAt(row:Int, col:Int) = sekw.get + } + } + +/* + def finally1 = { + Console.print("1 + 1 = "); + Console.println(1 + ( + try { + x + } finally { + () + } + )); + } + +*/ + + try1; + try2; + try3; + try4; + try5; + try6; + Console.println; + new A(); + () +} diff --git a/tests/pending/run/tuple-match.check b/tests/pending/run/tuple-match.check new file mode 100644 index 000000000000..0c1ea0005b14 --- /dev/null +++ b/tests/pending/run/tuple-match.check @@ -0,0 +1,8 @@ +4, #3 +4, #2 +4, #4 +3, #2 +2, #2 +1, #1 +FOUR +THREE diff --git a/tests/pending/run/tuple-match.scala b/tests/pending/run/tuple-match.scala new file mode 100644 index 000000000000..fcaefbff5bd6 --- /dev/null +++ b/tests/pending/run/tuple-match.scala @@ -0,0 +1,27 @@ +object Test { + val FOUR = (-1, -2, -3, "bingo donkey vegas") + val THREE = (-1, -2, -3) + + def f(x: Any) = x match { + case FOUR => "FOUR" + case (_, _, 3, _) => "4, #3" + case (_, 2, _, _) => "4, #2" + case (_, 2, _) => "3, #2" + case Tuple1(1) => "1, #1" + case (_, _, _, 4) => "4, #4" + case THREE => "THREE" + case (_, 2) => "2, #2" + case _ => "default" + } + + def main(args: Array[String]): Unit = { + println(f((1, 2, 3, 4))) + println(f((1, 2, 30, 4))) + println(f((1, 20, 30, 4))) + println(f((1, 2, 3))) + println(f((1, 2))) + println(f(Tuple1(1))) + println(f((-1, -2, -3, "bingo donkey vegas"))) + println(f((-1, -2, -3))) + } +} diff --git a/tests/pending/run/tuple-zipped.scala b/tests/pending/run/tuple-zipped.scala new file mode 100644 index 000000000000..37ac52977f35 --- /dev/null +++ b/tests/pending/run/tuple-zipped.scala @@ -0,0 +1,41 @@ + +import scala.language.postfixOps + +object Test { + val xs1 = List.range(1, 100) + val xs2 = xs1.view + val xs3 = xs1 take 10 + val ss1 = Stream from 1 + val ss2 = ss1.view + val ss3 = ss1 take 10 + val as1 = 1 to 100 toArray + val as2 = as1.view + val as3 = as1 take 10 + + def xss1 = List[Seq[Int]](xs1, xs2, xs3, ss1, ss2, ss3, as1, as2, as3) + def xss2 = List[Seq[Int]](xs1, xs2, xs3, ss3, as1, as2, as3) // no infinities + def xss3 = List[Seq[Int]](xs2, xs3, ss3, as1) // representative sampling + + def main(args: Array[String]): Unit = { + for (cc1 <- xss1 ; cc2 <- xss2) { + val sum1 = (cc1, cc2).zipped map { case (x, y) => x + y } sum + val sum2 = (cc1, cc2).zipped map (_ + _) sum + + assert(sum1 == sum2) + } + + for (cc1 <- xss1 ; cc2 <- xss2 ; cc3 <- xss3) { + val sum1 = (cc1, cc2, cc3).zipped map { case (x, y, z) => x + y + z } sum + val sum2 = (cc1, cc2, cc3).zipped map (_ + _ + _) sum + + assert(sum1 == sum2) + } + + assert((ss1, ss1).zipped exists ((x, y) => true)) + assert((ss1, ss1, ss1).zipped exists ((x, y, z) => true)) + + assert(!(ss1, ss2, 1 to 3).zipped.exists(_ + _ + _ > 100000)) + assert((1 to 3, ss1, ss2).zipped.forall(_ + _ + _ > 0)) + assert((ss1, 1 to 3, ss2).zipped.map(_ + _ + _).size == 3) + } +} diff --git a/tests/pending/run/tuples.check b/tests/pending/run/tuples.check new file mode 100644 index 000000000000..3fc4878158db --- /dev/null +++ b/tests/pending/run/tuples.check @@ -0,0 +1,5 @@ +(1,abc,true) +OK +x = 2; y = xxx; z = 3.14159 +x = 2; y = xxx; z = 3.14159 +x = 2; y = xxx; z = 3.14159 diff --git a/tests/pending/run/tuples.scala b/tests/pending/run/tuples.scala new file mode 100644 index 000000000000..e3fd85dc651c --- /dev/null +++ b/tests/pending/run/tuples.scala @@ -0,0 +1,31 @@ +import Function._ + +object Test extends dotty.runtime.LegacyApp { + var xyz: (Int, String, Boolean) = _ + xyz = (1, "abc", true) + Console.println(xyz) + xyz match { + case (1, "abc", true) => Console.println("OK") + case _ => ??? + } + def func(x: Int, y: String, z: Double): Unit = { + Console.println("x = " + x + "; y = " + y + "; z = " + z); + } + + def params = (2, "xxx", 3.14159) // (*****) + + tupled(func _)(params) // call the function with all the params at once + func(2, "xxx", 3.14159) // the same call + (func _).apply(2, "xxx", 3.14159) // the same call + + // Composing a tuple + def t = (1, "Hello", false) + + // Decomposing a tuple + val (i, s, b) = t + + // all the assertions are passed + assert(i == 1) + assert(s == "Hello") + assert(b == false) +} diff --git a/tests/pending/run/type-currying.check b/tests/pending/run/type-currying.check new file mode 100644 index 000000000000..e5db238ca518 --- /dev/null +++ b/tests/pending/run/type-currying.check @@ -0,0 +1,27 @@ +Map(abc -> 55) +(a,0) +(b,1) +(c,2) +(d,3) +(e,4) +(f,5) +(g,6) +(h,7) +(i,8) +(j,9) +(k,10) +(l,11) +(m,12) +(n,13) +(o,14) +(p,15) +(q,16) +(r,17) +(s,18) +(t,19) +(u,20) +(v,21) +(w,22) +(x,23) +(y,24) +(z,25) diff --git a/tests/pending/run/type-currying.scala b/tests/pending/run/type-currying.scala new file mode 100644 index 000000000000..e10f8fc9f18c --- /dev/null +++ b/tests/pending/run/type-currying.scala @@ -0,0 +1,61 @@ + + +import scala.language.{ higherKinds, reflectiveCalls } +import scala.collection.{ mutable, immutable, generic } +import generic.CanBuildFrom + +object Partial { + type KnownContainer[CC[K, V] <: collection.Map[K, V]] = { + def values[V] : KnownValues[CC, V] + def apply[K] : KnownKeys[CC, K] + } + type KnownKeys[CC[K, V] <: collection.Map[K, V], K] = { + def apply[V](implicit cbf: CanBuildFrom[_, (K, V), CC[K, V]]): CC[K, V] + } + type KnownValues[CC[K, V] <: collection.Map[K, V], V] = { + def apply[K](implicit cbf: CanBuildFrom[_, (K, V), CC[K, V]]): CC[K, V] + } + + def apply[CC[K, V] <: collection.Map[K, V]] : KnownContainer[CC] = new { + def values[V] : KnownValues[CC, V] = new { + def apply[K](implicit cbf: CanBuildFrom[_, (K, V), CC[K, V]]) = cbf().result + } + def apply[K] = new { + def apply[V](implicit cbf: CanBuildFrom[_, (K, V), CC[K, V]]) = cbf().result + } + } +} + +object Test { + val m = Partial[immutable.TreeMap] + val m1 = m[String] + val m2 = m[Int][Int] + + val mutableBippy = Partial[mutable.HashMap][String][Int] + mutableBippy("abc") = 55 + + val immutableBippy = Partial[immutable.HashMap].values[Int] + def make[T](xs: T*) = immutableBippy[T] ++ xs.zipWithIndex + + val n0 = Partial[immutable.HashMap][String][Int] ++ Seq(("a", 1)) + val n1 = Partial.apply[immutable.HashMap].apply[String].apply[Int] ++ Seq(("a", 1)) + + def main(args: Array[String]): Unit = { + println(mutableBippy) + make('a' to 'z': _*).toList.sorted foreach println + assert(n0 == n1) + } +} + +class A { + object Foo { + def apply[T] = Bar + } + object Bar { + def apply() = Foo + } + + def f() = Foo + def g = f()[Int]()[String]() + def h = Foo[Foo.type]()[Foo.type]() +} diff --git a/tests/pending/run/typealias_overriding.check b/tests/pending/run/typealias_overriding.check new file mode 100644 index 000000000000..2dc752a8c8b4 --- /dev/null +++ b/tests/pending/run/typealias_overriding.check @@ -0,0 +1 @@ +LinkedNode diff --git a/tests/pending/run/typealias_overriding.scala b/tests/pending/run/typealias_overriding.scala new file mode 100644 index 000000000000..e19ae0bed55f --- /dev/null +++ b/tests/pending/run/typealias_overriding.scala @@ -0,0 +1,23 @@ +// this bug (http://scala-webapps.epfl.ch/bugtracking/bugs/displayItem.do?id=1065) +// was caused by Uncurry not normalizing all the types +// (more specifically the argument/return types of an anonymous Function) +object Test extends dotty.runtime.LegacyApp { + trait AddRemove { + type TNode <: NodeImpl; + trait NodeImpl; + + object removing { + type TNode = AddRemove.this.TNode; + def printNode(node: TNode, f: TNode => String) = Console.println(f(node)) + } + } + + class Linked extends AddRemove { + type TNode = Node // can also directly write `class Node extends super.NodeImpl' -- doesn't change the bug + class Node extends super.NodeImpl { override def toString = "LinkedNode" } + + removing.printNode(new Node, (x: removing.TNode) => x.toString) // make inference explicit, doesn't affect the bug + } + + new Linked +} diff --git a/tests/pending/run/typecheck.check b/tests/pending/run/typecheck.check new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/pending/run/typecheck/Macros_1.scala b/tests/pending/run/typecheck/Macros_1.scala new file mode 100644 index 000000000000..ee1c8da76381 --- /dev/null +++ b/tests/pending/run/typecheck/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.whitebox._ +import scala.language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + c.typecheck(q"class C") + q"()" + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/typecheck/Test_2.scala b/tests/pending/run/typecheck/Test_2.scala new file mode 100644 index 000000000000..b79cc3b315da --- /dev/null +++ b/tests/pending/run/typecheck/Test_2.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends dotty.runtime.LegacyApp { + Macros.foo + + val tb = cm.mkToolBox() + tb.typecheck(q"class C") +} \ No newline at end of file diff --git a/tests/pending/run/typed-annotated.check b/tests/pending/run/typed-annotated.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/pending/run/typed-annotated.check @@ -0,0 +1 @@ +42 diff --git a/tests/pending/run/typed-annotated/Macros_1.scala b/tests/pending/run/typed-annotated/Macros_1.scala new file mode 100644 index 000000000000..4f0660dc456a --- /dev/null +++ b/tests/pending/run/typed-annotated/Macros_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.blackbox.Context +import language.experimental.macros + +class ann extends scala.annotation.StaticAnnotation + +object Macros { + def impl(c: Context) = { + import c.universe._ + // val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), Ident(newTypeName("Int"))) + val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), termNames.CONSTRUCTOR), List()), TypeTree(weakTypeOf[Int])) + c.Expr[Unit](Block( + List(ValDef(Modifiers(), newTermName("x"), tpt, Literal(Constant(42)))), + Apply(Ident(newTermName("println")), List(Ident(newTermName("x")))))) + } + + def foo = macro impl +} \ No newline at end of file diff --git a/tests/pending/run/typed-annotated/Test_2.scala b/tests/pending/run/typed-annotated/Test_2.scala new file mode 100644 index 000000000000..0fc472aa62e0 --- /dev/null +++ b/tests/pending/run/typed-annotated/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends dotty.runtime.LegacyApp { + Macros.foo +} \ No newline at end of file diff --git a/tests/pending/run/typetags_core.check b/tests/pending/run/typetags_core.check new file mode 100644 index 000000000000..980b4719bf07 --- /dev/null +++ b/tests/pending/run/typetags_core.check @@ -0,0 +1,30 @@ +true +TypeTag[Byte] +true +TypeTag[Short] +true +TypeTag[Char] +true +TypeTag[Int] +true +TypeTag[Long] +true +TypeTag[Float] +true +TypeTag[Double] +true +TypeTag[Boolean] +true +TypeTag[Unit] +true +TypeTag[Any] +true +TypeTag[AnyVal] +true +TypeTag[AnyRef] +true +TypeTag[java.lang.Object] +true +TypeTag[Null] +true +TypeTag[Nothing] diff --git a/tests/pending/run/typetags_core.scala b/tests/pending/run/typetags_core.scala new file mode 100644 index 000000000000..9250b4f32492 --- /dev/null +++ b/tests/pending/run/typetags_core.scala @@ -0,0 +1,34 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[TypeTag[Byte]] eq TypeTag.Byte) + println(implicitly[TypeTag[Byte]]) + println(implicitly[TypeTag[Short]] eq TypeTag.Short) + println(implicitly[TypeTag[Short]]) + println(implicitly[TypeTag[Char]] eq TypeTag.Char) + println(implicitly[TypeTag[Char]]) + println(implicitly[TypeTag[Int]] eq TypeTag.Int) + println(implicitly[TypeTag[Int]]) + println(implicitly[TypeTag[Long]] eq TypeTag.Long) + println(implicitly[TypeTag[Long]]) + println(implicitly[TypeTag[Float]] eq TypeTag.Float) + println(implicitly[TypeTag[Float]]) + println(implicitly[TypeTag[Double]] eq TypeTag.Double) + println(implicitly[TypeTag[Double]]) + println(implicitly[TypeTag[Boolean]] eq TypeTag.Boolean) + println(implicitly[TypeTag[Boolean]]) + println(implicitly[TypeTag[Unit]] eq TypeTag.Unit) + println(implicitly[TypeTag[Unit]]) + println(implicitly[TypeTag[Any]] eq TypeTag.Any) + println(implicitly[TypeTag[Any]]) + println(implicitly[TypeTag[AnyVal]] eq TypeTag.AnyVal) + println(implicitly[TypeTag[AnyVal]]) + println(implicitly[TypeTag[AnyRef]] eq TypeTag.AnyRef) + println(implicitly[TypeTag[AnyRef]]) + println(implicitly[TypeTag[Object]] eq TypeTag.Object) + println(implicitly[TypeTag[Object]]) + println(implicitly[TypeTag[Null]] eq TypeTag.Null) + println(implicitly[TypeTag[Null]]) + println(implicitly[TypeTag[Nothing]] eq TypeTag.Nothing) + println(implicitly[TypeTag[Nothing]]) +} diff --git a/tests/pending/run/typetags_multi.check b/tests/pending/run/typetags_multi.check new file mode 100644 index 000000000000..6110252c3691 --- /dev/null +++ b/tests/pending/run/typetags_multi.check @@ -0,0 +1,5 @@ +TypeTag[Int] +TypeTag[Array[Int]] +TypeTag[Array[Array[Int]]] +TypeTag[Array[Array[Array[Int]]]] +TypeTag[Array[Array[Array[Array[Int]]]]] diff --git a/tests/pending/run/typetags_multi.scala b/tests/pending/run/typetags_multi.scala new file mode 100644 index 000000000000..046de29ab590 --- /dev/null +++ b/tests/pending/run/typetags_multi.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ + +object Test extends dotty.runtime.LegacyApp { + println(implicitly[TypeTag[Int]]) + println(implicitly[TypeTag[Array[Int]]]) + println(implicitly[TypeTag[Array[Array[Int]]]]) + println(implicitly[TypeTag[Array[Array[Array[Int]]]]]) + println(implicitly[TypeTag[Array[Array[Array[Array[Int]]]]]]) +} diff --git a/tests/pending/run/typetags_serialize.check b/tests/pending/run/typetags_serialize.check new file mode 100644 index 000000000000..22928a2e94d8 --- /dev/null +++ b/tests/pending/run/typetags_serialize.check @@ -0,0 +1,3 @@ +TypeTag[Int] +TypeTag[String] +TypeTag[Test.C[Double]] diff --git a/tests/pending/run/typetags_serialize.scala b/tests/pending/run/typetags_serialize.scala new file mode 100644 index 000000000000..aa0414096b4d --- /dev/null +++ b/tests/pending/run/typetags_serialize.scala @@ -0,0 +1,34 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends dotty.runtime.LegacyApp { + class C[A] { + def m(a: A): Int = 5 + } + + def test(tag: TypeTag[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(tag) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val retag = in.readObject().asInstanceOf[ru.TypeTag[_]].in(cm) + in.close() + fin.close() + + println(retag) + } catch { + case ex: Exception => + println(ex) + } + + test(implicitly[TypeTag[Int]]) + test(implicitly[TypeTag[String]]) + test(implicitly[TypeTag[C[Double]]]) +} diff --git a/tests/pending/run/typetags_symbolof_x.check b/tests/pending/run/typetags_symbolof_x.check new file mode 100644 index 000000000000..fd0e069bcae2 --- /dev/null +++ b/tests/pending/run/typetags_symbolof_x.check @@ -0,0 +1,6 @@ +class Int +object C +type T +type Id +class Nothing +class Null diff --git a/tests/pending/run/typetags_symbolof_x.scala b/tests/pending/run/typetags_symbolof_x.scala new file mode 100644 index 000000000000..9f740cd026b5 --- /dev/null +++ b/tests/pending/run/typetags_symbolof_x.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ + +class C +object C + +object Test extends dotty.runtime.LegacyApp { + type T = Int + type Id[X] = X + println(symbolOf[Int]) + println(symbolOf[C.type]) + println(symbolOf[T]) + println(symbolOf[Id[_]]) + println(symbolOf[Nothing]) + println(symbolOf[Null]) +} diff --git a/tests/pending/run/typetags_without_scala_reflect_manifest_lookup.scala b/tests/pending/run/typetags_without_scala_reflect_manifest_lookup.scala new file mode 100644 index 000000000000..2b1af02f2565 --- /dev/null +++ b/tests/pending/run/typetags_without_scala_reflect_manifest_lookup.scala @@ -0,0 +1,29 @@ +import scala.tools.partest._ +import scala.tools.nsc.Settings + +object Test extends DirectTest { + override def extraSettings = "-cp " + sys.props("partest.lib") + " -d \"" + testOutput.path + "\"" + + def code = """ + object Test extends dotty.runtime.LegacyApp { + // manifest lookup also involves type tag lookup + // because we support manifest <-> typetag convertability + // + // however when scala-reflect.jar (the home of type tags) is not on the classpath + // we need to omit the type tag lookup, because we lack the necessary symbols + // to do implicit search and tag materialization + // (such missing symbols are e.g. ApiUniverseClass and TypeTagsClass) + // + // the test case you're looking at checks exactly this + // we establish a classpath that only includes scala-library.jar + // and then force scalac to perform implicit search for a manifest + // if type tag lookup is not disabled, the compiler will crash + // if it is disabled, then the compilation will succeed + // http://groups.google.com/group/scala-internals/browse_thread/thread/166ce4b71b7c46bb + def foo[T: Manifest] = () + foo[List[Int]] + } + """ + + def show = compile() +} \ No newline at end of file diff --git a/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.check b/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.check new file mode 100644 index 000000000000..84e5435afe12 --- /dev/null +++ b/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.check @@ -0,0 +1,2 @@ + +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/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.scala b/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.scala new file mode 100644 index 000000000000..819efc92f7f0 --- /dev/null +++ b/tests/pending/run/typetags_without_scala_reflect_typetag_lookup.scala @@ -0,0 +1,43 @@ +import scala.tools.partest._ + +object Test extends StoreReporterDirectTest { + def code = ??? + + def library = """ + import scala.reflect.runtime.universe._ + + object Library { + def foo[T: TypeTag] = () + } + """ + def compileLibrary() = { + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(library) + } + + def app = """ + object Test extends dotty.runtime.LegacyApp { + // tries to materialize a type tag not having scala-reflect.jar on the classpath + // even though it's easy to materialize a type tag of Int, this line will fail + // because materialization involves classes from scala-reflect.jar + // + // in this test we make sure that the compiler doesn't crash + // but just displays several missing class file errors and an unavailable implicit message + Library.foo[Int] + } + """ + def compileApp() = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(app) + } + + def show(): Unit = { + compileLibrary(); + println(filteredInfos.mkString("\n")) + storeReporter.infos.clear() + compileApp(); + // we should get "missing or invalid dependency detected" errors, because we're trying to use an implicit that can't be unpickled + // but we don't know the number of these errors and their order, so I just ignore them all + println(filteredInfos.filterNot(_.msg.contains("missing or invalid dependency detected")).mkString("\n")) + } +} diff --git a/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.check b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.check new file mode 100644 index 000000000000..8c9d07d8361c --- /dev/null +++ b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.check @@ -0,0 +1,2 @@ + +pos: source-newSource1.scala,line-9,offset=479 No Manifest available for App.this.T. ERROR diff --git a/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala new file mode 100644 index 000000000000..a865f4d137dd --- /dev/null +++ b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala @@ -0,0 +1,47 @@ +import scala.tools.partest._ +import scala.tools.nsc.Settings + +object Test extends StoreReporterDirectTest { + def code = ??? + + def library = """ + import scala.reflect.runtime.universe._ + + trait Library { + type T + implicit val tt: TypeTag[T] + } + """ + def compileLibrary() = { + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(library) + } + + def app = """ + trait App extends Library { + // tries to create a manifest from a type tag without having scala-reflect.jar on the classpath + // even though it's possible to convert a type tag into a manifest, this will fail + // because conversion requires classes from scala-reflect.jar + // + // in this test we make sure that the compiler doesn't crash + // but just displays several missing class file errors and an unavailable implicit message + manifest[T] + } + """ + def compileApp() = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + val global = newCompiler("-cp", classpath, "-d", testOutput.path) + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(app) + //global.reporter.ERROR.foreach(println) + } + + def show(): Unit = { + compileLibrary(); + println(filteredInfos.mkString("\n")) + storeReporter.infos.clear() + compileApp(); + // we should get "missing or invalid dependency detected" errors, because we're trying to use an implicit that can't be unpickled + // but we don't know the number of these errors and their order, so I just ignore them all + println(filteredInfos.filterNot (_.msg.contains("missing or invalid dependency detected")).mkString("\n")) + } +} diff --git a/tests/pending/run/unapply.check b/tests/pending/run/unapply.check new file mode 100644 index 000000000000..847e3b381e00 --- /dev/null +++ b/tests/pending/run/unapply.check @@ -0,0 +1,3 @@ +unapply.scala:57: warning: comparing values of types Null and Null using `==' will always yield true + assert(doMatch2(b) == null) + ^ diff --git a/tests/pending/run/unapply.scala b/tests/pending/run/unapply.scala new file mode 100644 index 000000000000..43f02b9f3985 --- /dev/null +++ b/tests/pending/run/unapply.scala @@ -0,0 +1,122 @@ +object Test { + def main(args: Array[String]): Unit = { + Foo.run() + Mas.run() + LisSeqArr.run() + StreamFoo.run() + Test1256.run() + } +} + +// this class is used for representation +class Bar { + var size: Int = 50 + var name: String = "medium" +} + +// test basic unapply for 0, 1 and 2 args and with precise type test +object Fii { + def unapply(x: Any): Boolean = x.isInstanceOf[Bar] +} +object Faa { + def unapply(x: Any): Option[String] = if(x.isInstanceOf[Bar]) Some(x.asInstanceOf[Bar].name) else None +} +object FaaPrecise { + def unapply(x: Bar): Option[String] = Some(x.name) +} +object FaaPreciseSome { + def unapply(x: Bar) = Some(x.name) // return type Some[String] +} +object VarFoo { + def unapply(a : Int)(implicit b : Int) : Option[Int] = Some(a + b) +} + +object Foo { + def unapply(x: Any): Option[Product2[Int, String]] = x match { + case y: Bar => Some(y.size, y.name) + case _ => None + } + def doMatch1(b:Bar) = b match { + case Foo(s:Int, n:String) => (s,n) + } + def doMatch2(b:Bar) = b match { + case Fii() => null + } + def doMatch3(b:Bar) = b match { + case Faa(n:String) => n + } + def doMatch4(b:Bar) = (b:Any) match { + case FaaPrecise(n:String) => n + } + def doMatch5(b:Bar) = (b:Any) match { + case FaaPreciseSome(n:String) => n + } + def run(): Unit = { + val b = new Bar + assert(doMatch1(b) == (50,"medium")) + assert(doMatch2(b) == null) + assert(doMatch3(b) == "medium") + assert(doMatch4(b) == "medium") + assert(doMatch5(b) == "medium") + implicit val bc: Int = 3 + assert(7 == (4 match { + case VarFoo(x) => x + })) + } +} + +// same, but now object is not top-level +object Mas { + object Gaz { + def unapply(x: Any): Option[Product2[Int, String]] = x match { + case y: Baz => Some(y.size, y.name) + case _ => None + } + } + class Baz { + var size: Int = 60 + var name: String = "too large" + } + def run(): Unit = { + val b = new Baz + assert((60,"too large") == (b match { + case Gaz(s:Int, n:String) => (s,n) + })) + } +} + +object LisSeqArr { + def run(): Unit = { + assert((1,2) == ((List(1,2,3): Any) match { case List(x,y,_*) => (x,y)})) + assert((1,2) == ((List(1,2,3): Any) match { case Seq(x,y,_*) => (x,y)})) + } +} + +object StreamFoo { + def sum(stream: Stream[Int]): Int = + stream match { + case Stream.Empty => 0 + case Stream.cons(hd, tl) => hd + sum(tl) + } + def run(): Unit = { + val str: Stream[Int] = List(1,2,3).toStream + assert(6 == sum(str)) + } +} + +object Test1256 { + class Sync { + def unapply(scrut: Any): Boolean = false + } + + class Buffer { + val Get = new Sync + val jp: PartialFunction[Any, Any] = { + case Get() => + } + } + + def run(): Unit = { + assert(!(new Buffer).jp.isDefinedAt(42)) + } +} diff --git a/tests/pending/run/unapplyArray.scala b/tests/pending/run/unapplyArray.scala new file mode 100644 index 000000000000..a29ef124b882 --- /dev/null +++ b/tests/pending/run/unapplyArray.scala @@ -0,0 +1,31 @@ +object Test { + def main(args:Array[String]): Unit = { + val z = Array(1,2,3,4) + val zs: Seq[Int] = z + val za: Any = z + +/* + Console.println("z is arr[int]"+z.isInstanceOf[Array[int]]) + Console.println("zs is arr[int]"+zs.isInstanceOf[Array[int]]) + Console.println("za is arr[int]"+ za.isInstanceOf[Array[int]]) + + Console.println("z is seq[int]"+z.isInstanceOf[Seq[int]]) + Console.println("zs is seq[int]"+zs.isInstanceOf[Seq[int]]) + Console.println("za is seq[int]"+ za.isInstanceOf[Seq[int]]) + + Console.println("z is anyref"+z.isInstanceOf[AnyRef]) + + Console.println("z useq "+ Seq.unapplySeq(z)) + Console.println("zs useq "+ Seq.unapplySeq(zs)) + Console.println("za useq "+ Seq.unapplySeq(za)) + + Console.println("z aseq "+ Seq.unapplySeq(z)) + Console.println("zs aseq "+ Seq.unapplySeq(zs)) + Console.println("za aseq "+ Seq.unapplySeq(za)) +*/ + val zl = zs match { + case Seq(xs:_*) => xs.length + } + assert(zl == 4) + } +} diff --git a/tests/pending/run/unboxingBug.check b/tests/pending/run/unboxingBug.check new file mode 100644 index 000000000000..d6aa7b90f6a5 --- /dev/null +++ b/tests/pending/run/unboxingBug.check @@ -0,0 +1,6 @@ +97 +97 +97 +97 +1 +1 diff --git a/tests/pending/run/unboxingBug.scala b/tests/pending/run/unboxingBug.scala new file mode 100644 index 000000000000..e3cef18b3326 --- /dev/null +++ b/tests/pending/run/unboxingBug.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(identity('a').toInt) + println('a'.toInt) + println(identity('a').asInstanceOf[Int]) + println('a'.asInstanceOf[Int]) + println(identity(1).asInstanceOf[Int]) + println(1.asInstanceOf[Int]) +} diff --git a/tests/pending/run/unittest_collection.check b/tests/pending/run/unittest_collection.check new file mode 100644 index 000000000000..df1629dd7eb1 --- /dev/null +++ b/tests/pending/run/unittest_collection.check @@ -0,0 +1 @@ +warning: there was one deprecation warning; re-run with -deprecation for details diff --git a/tests/pending/run/unittest_collection.scala b/tests/pending/run/unittest_collection.scala new file mode 100644 index 000000000000..d10845475b74 --- /dev/null +++ b/tests/pending/run/unittest_collection.scala @@ -0,0 +1,58 @@ +object Test { + + import scala.collection.mutable.{ArrayBuffer, Buffer, BufferProxy, ListBuffer} + + def main(args: Array[String]): Unit = { + test(collection.mutable.ArrayBuffer[String]()) + test(collection.mutable.ListBuffer[String]()) + class BBuf(z:ListBuffer[String]) extends BufferProxy[String] { + def self = z + } + test(new BBuf(collection.mutable.ListBuffer[String]())) + } + + def test(x: Buffer[String]): Unit = { + // testing method += + x += "one" + assert(x(0) == "one", "retrieving 'one'") + assert(x.length == 1, "length A") + x += "two" + assert(x(1) == "two", "retrieving 'two'") + assert(x.length == 2, "length B") + + // testing method -= (removing last element) + x -= "two" + + assert(x.length == 1, "length C") + + try { x(1); sys.error("no exception for removed element") } + catch { case i:IndexOutOfBoundsException => } + + try { x.remove(1); sys.error("no exception for removed element") } + catch { case i:IndexOutOfBoundsException => } + + x += "two2" + assert(x.length == 2, "length D") + + // removing first element + x.remove(0) + assert(x.length == 1, "length E") + + // toList + assert(x.toList == List("two2"), "toList") + + // clear + x.clear() + assert(x.length == 0, "length 0") + assert(x.isEmpty, "isEmpty") + + // copyToBuffer + x += "a" + x += "b" + val dest = new ArrayBuffer[String] + x.copyToBuffer(dest) + assert(List("a", "b") == dest.toList, "dest") + assert(List("a", "b") == x.toList, "source") + } + +} diff --git a/tests/pending/run/unittest_iterator.scala b/tests/pending/run/unittest_iterator.scala new file mode 100644 index 000000000000..7c47e27e3dd9 --- /dev/null +++ b/tests/pending/run/unittest_iterator.scala @@ -0,0 +1,53 @@ +// Some iterator grouped/sliding unit tests +object Test { + def it = (1 to 10).iterator + def assertThat[T](expectedLength: Int, expectedLast: Seq[T])(it: Iterator[Seq[T]]): Unit = { + val xs = it.toList + def fail(msg: String) = "assertion failed on %s: %s".format(xs, msg) + assert(xs.size == expectedLength, fail("expected length " + expectedLength)) + assert(xs.last == expectedLast, fail("expected last " + expectedLast)) + } + + def main(args: Array[String]): Unit = { + val itSum = it.toStream.sum + for (i <- it) { + // sum of the groups == sum of the original + val thisSum = ((it grouped i) map (_.sum)).toStream.sum + assert(thisSum == itSum, thisSum + " != " + itSum) + } + + // grouped + assertThat(4, List(10)) { it grouped 3 } + assertThat(3, List(7, 8, 9)) { it grouped 3 withPartial false } + assertThat(4, List(10, -1, -1)) { it grouped 3 withPadding -1 } + + // testing by-name padding + val padIt = it + assertThat(4, List(10, 1, 2)) { it grouped 3 withPadding padIt.next } + + // sliding + assertThat(8, List(8, 9, 10)) { it sliding 3 } + assertThat(3, (3 to 10).toList) { it sliding 8 } + assertThat(2, List(9, 10)) { it.sliding(8, 8) } + assertThat(1, (1 to 8).toList) { it.sliding(8, 8) withPartial false } + assertThat(2, List(9, 10, -1, -1, -1)) { it.sliding(5, 8) withPadding -1 } + assertThat(1, (1 to 5).toList) { it.sliding(5, 8) withPartial false } + + // larger step than window + assertThat(5, List(9)) { it.sliding(1, 2) } + assertThat(3, List(9, 10)) { it.sliding(2, 4) } + + // make sure it throws past the end + val thrown = try { + val it = List(1,2,3).sliding(2) + it.next + it.next + it.next + false + } + catch { + case _: NoSuchElementException => true + } + assert(thrown) + } +} diff --git a/tests/pending/run/unreachable.scala b/tests/pending/run/unreachable.scala new file mode 100644 index 000000000000..6a428c6ef02c --- /dev/null +++ b/tests/pending/run/unreachable.scala @@ -0,0 +1,128 @@ +import scala.util.Random.nextInt +import scala.sys.error + +object Test extends dotty.runtime.LegacyApp { + def unreachableNormalExit: Int = { + return 42 + 0 + } + + def unreachableIf: Int = { + return 42 + if (nextInt % 2 == 0) + 0 + else + 1 + } + + def unreachableIfBranches: Int = { + if (nextInt % 2 == 0) + return 42 + else + return 42 + + return 0 + } + + def unreachableOneLegIf: Int = { + if (nextInt % 2 == 0) + return 42 + + return 42 + } + + def unreachableLeftBranch: Int = { + val result = if (nextInt % 2 == 0) + return 42 + else + 42 + + return result + } + + def unreachableRightBranch: Int = { + val result = if (nextInt % 2 == 0) + 42 + else + return 42 + + return result + } + + def unreachableTryCatchFinally: Int = { + return 42 + try { + return 0 + } catch { + case x: Throwable => return 1 + } finally { + return 2 + } + return 3 + } + + def unreachableAfterTry: Int = { + try { + return 42 + } catch { + case x: Throwable => return 2 + } + return 3 + } + + def unreachableAfterCatch: Int = { + try { + error("haha") + } catch { + case x: Throwable => return 42 + } + return 3 + } + + def unreachableAfterFinally: Int = { + try { + return 1 + } catch { + case x: Throwable => return 2 + } finally { + return 42 + } + return 3 + } + + def unreachableSwitch: Int = { + return 42 + val x = nextInt % 2 + x match { + case 0 => return 0 + case 1 => return 1 + case -1 => return 2 + } + 3 + } + + def unreachableAfterSwitch: Int = { + val x = nextInt % 2 + x match { + case 0 => return 42 + case 1 => return 41 + x + case -1 => return 43 + x + } + 2 + } + + def check(f: Int) = assert(f == 42, s"Expected 42 but got $f") + + check(unreachableNormalExit) + check(unreachableIf) + check(unreachableIfBranches) + check(unreachableOneLegIf) + check(unreachableLeftBranch) + check(unreachableRightBranch) + check(unreachableTryCatchFinally) + check(unreachableAfterTry) + check(unreachableAfterCatch) + check(unreachableAfterFinally) + check(unreachableSwitch) + check(unreachableAfterSwitch) +} diff --git a/tests/pending/run/value-class-extractor-2.check b/tests/pending/run/value-class-extractor-2.check new file mode 100644 index 000000000000..5903b996b6f9 --- /dev/null +++ b/tests/pending/run/value-class-extractor-2.check @@ -0,0 +1,8 @@ +String +List +Int +Something else +String +List +Int +Something else diff --git a/tests/pending/run/value-class-extractor-2.scala b/tests/pending/run/value-class-extractor-2.scala new file mode 100644 index 000000000000..d776c35edacc --- /dev/null +++ b/tests/pending/run/value-class-extractor-2.scala @@ -0,0 +1,108 @@ +final class Opt[+A >: Null](val value: A) extends AnyVal { + def get: A = value + def isEmpty = value == null +} +object Opt { + final val None = new Opt[Null](null) + def apply[A >: Null](value: A): Opt[A] = if (value == null) None else new Opt[A](value) +} + +object ValueOpt { + // public java.lang.String unapply(java.lang.Object); + // 0: aload_1 + // 1: instanceof #16 // class java/lang/String + // 4: ifeq 21 + // 7: getstatic #21 // Field Opt$.MODULE$:LOpt$; + // 10: astore_2 + // 11: ldc #23 // String String + // 13: checkcast #16 // class java/lang/String + // 16: astore 5 + // 18: goto 71 + // 21: aload_1 + // 22: instanceof #25 // class scala/collection/immutable/List + // 25: ifeq 42 + // 28: getstatic #21 // Field Opt$.MODULE$:LOpt$; + // 31: astore_3 + // 32: ldc #27 // String List + // 34: checkcast #16 // class java/lang/String + // 37: astore 5 + // 39: goto 71 + // 42: aload_1 + // 43: instanceof #29 // class java/lang/Integer + // 46: ifeq 64 + // 49: getstatic #21 // Field Opt$.MODULE$:LOpt$; + // 52: astore 4 + // 54: ldc #31 // String Int + // 56: checkcast #16 // class java/lang/String + // 59: astore 5 + // 61: goto 71 + // 64: getstatic #21 // Field Opt$.MODULE$:LOpt$; + // 67: pop + // 68: aconst_null + // 69: astore 5 + // 71: aload 5 + // 73: areturn + def unapply(x: Any): Opt[String] = x match { + case _: String => Opt("String") + case _: List[_] => Opt("List") + case _: Int => Opt("Int") + case _ => Opt.None + } +} +object RegularOpt { + // public scala.Option unapply(java.lang.Object); + // 0: aload_1 + // 1: instanceof #16 // class java/lang/String + // 4: ifeq 20 + // 7: new #18 // class scala/Some + // 10: dup + // 11: ldc #20 // String String + // 13: invokespecial #23 // Method scala/Some."":(Ljava/lang/Object;)V + // 16: astore_2 + // 17: goto 64 + // 20: aload_1 + // 21: instanceof #25 // class scala/collection/immutable/List + // 24: ifeq 40 + // 27: new #18 // class scala/Some + // 30: dup + // 31: ldc #27 // String List + // 33: invokespecial #23 // Method scala/Some."":(Ljava/lang/Object;)V + // 36: astore_2 + // 37: goto 64 + // 40: aload_1 + // 41: instanceof #29 // class java/lang/Integer + // 44: ifeq 60 + // 47: new #18 // class scala/Some + // 50: dup + // 51: ldc #31 // String Int + // 53: invokespecial #23 // Method scala/Some."":(Ljava/lang/Object;)V + // 56: astore_2 + // 57: goto 64 + // 60: getstatic #36 // Field scala/None$.MODULE$:Lscala/None$; + // 63: astore_2 + // 64: aload_2 + // 65: areturn + def unapply(x: Any): Option[String] = x match { + case _: String => Some("String") + case _: List[_] => Some("List") + case _: Int => Some("Int") + case _ => None + } +} + +object Test { + def f(x: Any) = x match { + case ValueOpt(s) => s + case _ => "Something else" + } + def g(x: Any) = x match { + case RegularOpt(s) => s + case _ => "Something else" + } + val xs = List("abc", Nil, 5, Test) + + def main(args: Array[String]): Unit = { + xs map f foreach println + xs map g foreach println + } +} diff --git a/tests/pending/run/value-class-extractor-seq.check b/tests/pending/run/value-class-extractor-seq.check new file mode 100644 index 000000000000..84552a7aa5b2 --- /dev/null +++ b/tests/pending/run/value-class-extractor-seq.check @@ -0,0 +1,3 @@ +Bip(1, 2, 3) +Bip(1, 2, c @ Array(3, 4, 5): _*) +class [I diff --git a/tests/pending/run/value-class-extractor-seq.scala b/tests/pending/run/value-class-extractor-seq.scala new file mode 100644 index 000000000000..9264e70387d0 --- /dev/null +++ b/tests/pending/run/value-class-extractor-seq.scala @@ -0,0 +1,59 @@ +import scala.runtime.ScalaRunTime.stringOf + +final class ArrayOpt[T](val xs: Array[T]) extends AnyVal { + def isEmpty = xs == null + def get = xs +} + +object Bip { + def mkInts(xs: Array[Short]) = xs map (_.toInt) + def unapplySeq(x: Any): ArrayOpt[Int] = x match { + case xs: Array[Int] => new ArrayOpt(xs) + case xs: Array[Short] => new ArrayOpt(mkInts(xs)) + case _ => new ArrayOpt(null) + } + // public int[] unapplySeq(java.lang.Object); + // 0: aload_1 + // 1: astore_2 + // 2: aload_2 + // 3: instanceof #52 // class "[I" + // 6: ifeq 20 + // 9: aload_2 + // 10: checkcast #52 // class "[I" + // 13: astore_3 + // 14: aload_3 + // 15: astore 4 + // 17: goto 47 + // 20: aload_2 + // 21: instanceof #58 // class "[S" + // 24: ifeq 44 + // 27: aload_2 + // 28: checkcast #58 // class "[S" + // 31: astore 5 + // 33: aload_0 + // 34: aload 5 + // 36: invokevirtual #60 // Method mkInts:([S)[I + // 39: astore 4 + // 41: goto 47 + // 44: aconst_null + // 45: astore 4 + // 47: aload 4 + // 49: areturn +} + +object Test { + def f(x: Any) = x match { + case Bip(a, b, c) => s"Bip($a, $b, $c)" + case Bip(a, b, c : _*) => s"Bip($a, $b, c @ ${stringOf(c)}: _*)" + case _ => "" + x.getClass + } + + def main(args: Array[String]): Unit = { + println(f(Array[Int](1,2,3))) + println(f(Array[Int](1,2,3,4,5))) + println(f(Array[Int](1))) + } + // Bip(1, 2, 3) + // Bip(1, 2, c @ [I@782be20e: _*) + // class [I +} diff --git a/tests/pending/run/value-class-extractor.check b/tests/pending/run/value-class-extractor.check new file mode 100644 index 000000000000..e16447118c19 --- /dev/null +++ b/tests/pending/run/value-class-extractor.check @@ -0,0 +1,9 @@ +'a' +'b' +'c' +NoChar +Some(a) +Some(b) +Some(c) +None +9 diff --git a/tests/pending/run/value-class-extractor.scala b/tests/pending/run/value-class-extractor.scala new file mode 100644 index 000000000000..3eaffa0c2397 --- /dev/null +++ b/tests/pending/run/value-class-extractor.scala @@ -0,0 +1,91 @@ +final class NonNullChar(val get: Char) extends AnyVal { + def isEmpty = get == 0.toChar + override def toString = if (isEmpty) "NoChar" else s"'$get'" +} +object NonNullChar { + @inline final val None = new NonNullChar(0.toChar) +} + +final class SomeProduct extends Product3[String, Int, List[String]] { + def canEqual(x: Any) = x.isInstanceOf[SomeProduct] + def _1 = "abc" + def _2 = 5 + def _3 = List("bippy") + def isEmpty = false + def get = this +} +object SomeProduct { + def unapply(x: SomeProduct) = x +} + +object Test { + def prod(x: SomeProduct): Int = x match { + case SomeProduct(x, y, z) => x.length + y + z.length + case _ => -1 + } + + def f(x: Char): NonNullChar = x match { + case 'a' => new NonNullChar('a') + case 'b' => new NonNullChar('b') + case 'c' => new NonNullChar('c') + case _ => NonNullChar.None + } + // public char f(char); + // 0: iload_1 + // 1: tableswitch { // 97 to 99 + // 97: 47 + // 98: 42 + // 99: 37 + // default: 28 + // } + // 28: getstatic #19 // Field NonNullChar$.MODULE$:LNonNullChar$; + // 31: invokevirtual #23 // Method NonNullChar$.None:()C + // 34: goto 49 + // 37: bipush 99 + // 39: goto 49 + // 42: bipush 98 + // 44: goto 49 + // 47: bipush 97 + // 49: ireturn + def g(x: Char): Option[Char] = x match { + case 'a' => Some('a') + case 'b' => Some('b') + case 'c' => Some('c') + case _ => None + } + // public scala.Option g(char); + // 0: iload_1 + // 1: tableswitch { // 97 to 99 + // 97: 64 + // 98: 49 + // 99: 34 + // default: 28 + // } + // 28: getstatic #33 // Field scala/None$.MODULE$:Lscala/None$; + // 31: goto 76 + // 34: new #35 // class scala/Some + // 37: dup + // 38: bipush 99 + // 40: invokestatic #41 // Method scala/runtime/BoxesRunTime.boxToCharacter:(C)Ljava/lang/Character; + // 43: invokespecial #44 // Method scala/Some."":(Ljava/lang/Object;)V + // 46: goto 76 + // 49: new #35 // class scala/Some + // 52: dup + // 53: bipush 98 + // 55: invokestatic #41 // Method scala/runtime/BoxesRunTime.boxToCharacter:(C)Ljava/lang/Character; + // 58: invokespecial #44 // Method scala/Some."":(Ljava/lang/Object;)V + // 61: goto 76 + // 64: new #35 // class scala/Some + // 67: dup + // 68: bipush 97 + // 70: invokestatic #41 // Method scala/runtime/BoxesRunTime.boxToCharacter:(C)Ljava/lang/Character; + // 73: invokespecial #44 // Method scala/Some."":(Ljava/lang/Object;)V + // 76: areturn + def main(args: Array[String]): Unit = { + "abcd" foreach (ch => println(f(ch))) + "abcd" foreach (ch => println(g(ch))) + println(prod(new SomeProduct)) + } +} + + diff --git a/tests/pending/run/value-class-partial-func-depmet.scala b/tests/pending/run/value-class-partial-func-depmet.scala new file mode 100644 index 000000000000..f8d2a16e73c5 --- /dev/null +++ b/tests/pending/run/value-class-partial-func-depmet.scala @@ -0,0 +1,24 @@ +class C +class A { class C } + +object Test { + def main(args: Array[String]): Unit = { + val a = new A + + new VC("").foo(a) + } +} + +class VC(val a: Any) extends AnyVal { + def foo(a: A) = { + val pf: PartialFunction[a.C, Any] = { case x => x } + (pf: PartialFunction[Null, Any]).isDefinedAt(null) + } +} + +// 2.11.0-M6 +// test/files/run/value-class-partial-func-depmet.scala:14: error: overriding method applyOrElse in trait PartialFunction of type [A1 <: a.C, B1 >: Any](x: A1, default: A1 => B1)B1; +// method applyOrElse has incompatible type +// val pf: PartialFunction[a.C, Any] = { case x => x } +// ^ +// one error found diff --git a/tests/pending/run/valueclasses-classmanifest-basic.check b/tests/pending/run/valueclasses-classmanifest-basic.check new file mode 100644 index 000000000000..bc56c4d89448 --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-basic.check @@ -0,0 +1 @@ +Foo diff --git a/tests/pending/run/valueclasses-classmanifest-basic.scala b/tests/pending/run/valueclasses-classmanifest-basic.scala new file mode 100644 index 000000000000..8eab07c30873 --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-basic.scala @@ -0,0 +1,6 @@ +class Foo(val x: Int) extends AnyVal + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + println(classManifest[Foo]) +} diff --git a/tests/pending/run/valueclasses-classmanifest-existential.check b/tests/pending/run/valueclasses-classmanifest-existential.check new file mode 100644 index 000000000000..4577aacc0e67 --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-existential.check @@ -0,0 +1 @@ +Foo[] diff --git a/tests/pending/run/valueclasses-classmanifest-existential.scala b/tests/pending/run/valueclasses-classmanifest-existential.scala new file mode 100644 index 000000000000..e8351557e98a --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-existential.scala @@ -0,0 +1,6 @@ +class Foo[T](val x: T) extends AnyVal + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + println(classManifest[Foo[_]]) +} diff --git a/tests/pending/run/valueclasses-classmanifest-generic.check b/tests/pending/run/valueclasses-classmanifest-generic.check new file mode 100644 index 000000000000..c6be42d550d2 --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-generic.check @@ -0,0 +1 @@ +Foo[java.lang.String] diff --git a/tests/pending/run/valueclasses-classmanifest-generic.scala b/tests/pending/run/valueclasses-classmanifest-generic.scala new file mode 100644 index 000000000000..d37155d3cdb0 --- /dev/null +++ b/tests/pending/run/valueclasses-classmanifest-generic.scala @@ -0,0 +1,6 @@ +class Foo[T](val x: T) extends AnyVal + +@deprecated("Suppress warnings", since="2.11") +object Test extends dotty.runtime.LegacyApp { + println(classManifest[Foo[String]]) +} diff --git a/tests/pending/run/valueclasses-classtag-basic.check b/tests/pending/run/valueclasses-classtag-basic.check new file mode 100644 index 000000000000..bc56c4d89448 --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-basic.check @@ -0,0 +1 @@ +Foo diff --git a/tests/pending/run/valueclasses-classtag-basic.scala b/tests/pending/run/valueclasses-classtag-basic.scala new file mode 100644 index 000000000000..ab86f58a67aa --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-basic.scala @@ -0,0 +1,5 @@ +class Foo(val x: Int) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.classTag[Foo]) +} diff --git a/tests/pending/run/valueclasses-classtag-existential.check b/tests/pending/run/valueclasses-classtag-existential.check new file mode 100644 index 000000000000..9e2b9e1da7a4 --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-existential.check @@ -0,0 +1 @@ +Object diff --git a/tests/pending/run/valueclasses-classtag-existential.scala b/tests/pending/run/valueclasses-classtag-existential.scala new file mode 100644 index 000000000000..1e5cfe7a1d16 --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-existential.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.classTag[Foo[_]]) +} diff --git a/tests/pending/run/valueclasses-classtag-generic.check b/tests/pending/run/valueclasses-classtag-generic.check new file mode 100644 index 000000000000..bc56c4d89448 --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-generic.check @@ -0,0 +1 @@ +Foo diff --git a/tests/pending/run/valueclasses-classtag-generic.scala b/tests/pending/run/valueclasses-classtag-generic.scala new file mode 100644 index 000000000000..d93ca5f0a8c8 --- /dev/null +++ b/tests/pending/run/valueclasses-classtag-generic.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.classTag[Foo[String]]) +} diff --git a/tests/pending/run/valueclasses-constr.check b/tests/pending/run/valueclasses-constr.check new file mode 100644 index 000000000000..785e6fa25bf4 --- /dev/null +++ b/tests/pending/run/valueclasses-constr.check @@ -0,0 +1,10 @@ +16 +00:16:40 +16 +00:16:40 +16 +00:16:40 +16 +00:16:40 +16 +00:16:40 diff --git a/tests/pending/run/valueclasses-constr.scala b/tests/pending/run/valueclasses-constr.scala new file mode 100644 index 000000000000..73ac29435b09 --- /dev/null +++ b/tests/pending/run/valueclasses-constr.scala @@ -0,0 +1,79 @@ +package test1 { + object TOD { + final val SecondsPerDay = 86400 + + def apply(seconds: Int) = { + val n = seconds % SecondsPerDay + new TOD(if (n >= 0) n else n + SecondsPerDay) + } + } + + final class TOD (val secondsOfDay: Int) extends AnyVal { + def hours = secondsOfDay / 3600 + def minutes = (secondsOfDay / 60) % 60 + def seconds = secondsOfDay % 60 + + override def toString = "%02d:%02d:%02d".format(hours, minutes, seconds) + } +} +package test2 { + object TOD { + final val SecondsPerDay = 86400 + + def apply(seconds: Int) = { + val n = seconds % SecondsPerDay + new TOD(if (n >= 0) n else n + SecondsPerDay) + } + } + + final class TOD private[test2] (val secondsOfDay: Int) extends AnyVal { + def hours = secondsOfDay / 3600 + def minutes = (secondsOfDay / 60) % 60 + def seconds = secondsOfDay % 60 + + override def toString = "%02d:%02d:%02d".format(hours, minutes, seconds) + } + + object Client { + def newTOD(x: Int) = new TOD(x) + } +} + +package test3 { + object TOD { + final val SecondsPerDay = 86400 + + def apply(seconds: Int) = { + val n = seconds % SecondsPerDay + new TOD(if (n >= 0) n else n + SecondsPerDay) + } + } + + final class TOD private (val secondsOfDay: Int) extends AnyVal { + def hours = secondsOfDay / 3600 + def minutes = (secondsOfDay / 60) % 60 + def seconds = secondsOfDay % 60 + + override def toString = "%02d:%02d:%02d".format(hours, minutes, seconds) + } +} + +object Test extends dotty.runtime.LegacyApp { + + val y1: test1.TOD = new test1.TOD(1000) + val y2: test2.TOD = test2.Client.newTOD(1000) + val x1: test1.TOD = test1.TOD(1000) + val x2: test2.TOD = test2.TOD(1000) + val x3: test3.TOD = test3.TOD(1000) + println(y1.minutes) + println(y1) + println(y2.minutes) + println(y2) + println(x1.minutes) + println(x1) + println(x2.minutes) + println(x2) + println(x3.minutes) + println(x3) +} + diff --git a/tests/pending/run/valueclasses-manifest-basic.check b/tests/pending/run/valueclasses-manifest-basic.check new file mode 100644 index 000000000000..bc56c4d89448 --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-basic.check @@ -0,0 +1 @@ +Foo diff --git a/tests/pending/run/valueclasses-manifest-basic.scala b/tests/pending/run/valueclasses-manifest-basic.scala new file mode 100644 index 000000000000..3ea2bffe36e4 --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-basic.scala @@ -0,0 +1,5 @@ +class Foo(val x: Int) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(manifest[Foo]) +} diff --git a/tests/pending/run/valueclasses-manifest-existential.check b/tests/pending/run/valueclasses-manifest-existential.check new file mode 100644 index 000000000000..f91a575ea744 --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-existential.check @@ -0,0 +1 @@ +Foo[_ <: Any] diff --git a/tests/pending/run/valueclasses-manifest-existential.scala b/tests/pending/run/valueclasses-manifest-existential.scala new file mode 100644 index 000000000000..c3fb044e1f3f --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-existential.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(manifest[Foo[_]]) +} diff --git a/tests/pending/run/valueclasses-manifest-generic.check b/tests/pending/run/valueclasses-manifest-generic.check new file mode 100644 index 000000000000..c6be42d550d2 --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-generic.check @@ -0,0 +1 @@ +Foo[java.lang.String] diff --git a/tests/pending/run/valueclasses-manifest-generic.scala b/tests/pending/run/valueclasses-manifest-generic.scala new file mode 100644 index 000000000000..349487870413 --- /dev/null +++ b/tests/pending/run/valueclasses-manifest-generic.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(manifest[Foo[String]]) +} diff --git a/tests/pending/run/valueclasses-pavlov.check b/tests/pending/run/valueclasses-pavlov.check new file mode 100644 index 000000000000..b112e5507ec9 --- /dev/null +++ b/tests/pending/run/valueclasses-pavlov.check @@ -0,0 +1,2 @@ +box1: ok +box2: ok diff --git a/tests/pending/run/valueclasses-pavlov.scala b/tests/pending/run/valueclasses-pavlov.scala new file mode 100644 index 000000000000..6ab5ff3e6beb --- /dev/null +++ b/tests/pending/run/valueclasses-pavlov.scala @@ -0,0 +1,26 @@ +trait Foo extends Any { + def box1(x: Box1): String + def box2(x: Box2): String +} + +class Box1(val value: String) extends AnyVal + +class Box2(val value: String) extends AnyVal with Foo { + def box1(x: Box1) = "box1: ok" + def box2(x: Box2) = "box2: ok" +} + +class C(x: String) { + def this() = this("") +} + +object Test { + + def main(args: Array[String]): Unit = { + val b1 = new Box1("") + val b2 = new Box2("") + val f: Foo = b2 + println(f.box1(b1)) + println(f.box2(b2)) + } +} diff --git a/tests/pending/run/valueclasses-typetag-basic.check b/tests/pending/run/valueclasses-typetag-basic.check new file mode 100644 index 000000000000..bc56c4d89448 --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-basic.check @@ -0,0 +1 @@ +Foo diff --git a/tests/pending/run/valueclasses-typetag-basic.scala b/tests/pending/run/valueclasses-typetag-basic.scala new file mode 100644 index 000000000000..9273ad638701 --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-basic.scala @@ -0,0 +1,5 @@ +class Foo(val x: Int) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.runtime.universe.typeOf[Foo]) +} diff --git a/tests/pending/run/valueclasses-typetag-existential.check b/tests/pending/run/valueclasses-typetag-existential.check new file mode 100644 index 000000000000..d166a13fdcbf --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-existential.check @@ -0,0 +1 @@ +Foo[_] diff --git a/tests/pending/run/valueclasses-typetag-existential.scala b/tests/pending/run/valueclasses-typetag-existential.scala new file mode 100644 index 000000000000..8c1dd2a1a4b2 --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-existential.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.runtime.universe.typeOf[Foo[_]]) +} diff --git a/tests/pending/run/valueclasses-typetag-generic.check b/tests/pending/run/valueclasses-typetag-generic.check new file mode 100644 index 000000000000..534d1b37c46d --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-generic.check @@ -0,0 +1 @@ +Foo[String] diff --git a/tests/pending/run/valueclasses-typetag-generic.scala b/tests/pending/run/valueclasses-typetag-generic.scala new file mode 100644 index 000000000000..9253e52e9b8d --- /dev/null +++ b/tests/pending/run/valueclasses-typetag-generic.scala @@ -0,0 +1,5 @@ +class Foo[T](val x: T) extends AnyVal + +object Test extends dotty.runtime.LegacyApp { + println(scala.reflect.runtime.universe.typeOf[Foo[String]]) +} diff --git a/tests/pending/run/var-arity-class-symbol.scala b/tests/pending/run/var-arity-class-symbol.scala new file mode 100644 index 000000000000..2a7d329877d5 --- /dev/null +++ b/tests/pending/run/var-arity-class-symbol.scala @@ -0,0 +1,19 @@ +import scala.reflect.runtime.universe._, definitions._ +object Test extends dotty.runtime.LegacyApp { + // Tuples + assert(TupleClass.seq.size == 22) + assert(TupleClass(0) == NoSymbol) + assert(TupleClass(23) == NoSymbol) + assert((1 to 22).forall { i => TupleClass(i).name.toString == s"Tuple$i" }) + // Functions + assert(FunctionClass.seq.size == 23) + assert(FunctionClass(-1) == NoSymbol) + assert(FunctionClass(23) == NoSymbol) + assert((0 to 22).forall { i => FunctionClass(i).name.toString == s"Function$i" }) + // Products + assert(ProductClass.seq.size == 23) + assert(ProductClass(-1) == NoSymbol) + assert(ProductClass(0) == UnitClass) + assert(ProductClass(23) == NoSymbol) + assert((1 to 22).forall { i => ProductClass(i).name.toString == s"Product$i" }) +} diff --git a/tests/pending/run/vector1.check b/tests/pending/run/vector1.check new file mode 100644 index 000000000000..10447a0964b4 --- /dev/null +++ b/tests/pending/run/vector1.check @@ -0,0 +1,6 @@ +===== test1 ===== +===== test2 ===== +===== test3 ===== +===== test4 ===== +===== test5 ===== +done diff --git a/tests/pending/run/vector1.scala b/tests/pending/run/vector1.scala new file mode 100644 index 000000000000..d536183961aa --- /dev/null +++ b/tests/pending/run/vector1.scala @@ -0,0 +1,199 @@ +// testing the impl from the scala library +//package test5 + +import scala.collection._ +import scala.collection.immutable._ + +import scala.collection.generic._ +import scala.collection.mutable.Builder + + +object Test { + + def vector(label: String, n: Int): Vector[String] = { + val a = new VectorBuilder[String] + for (i <- 0 until n) + a += (label + i) + + val res = a.result + assertVector(res, label, 0, n) + } + + def vectorForward(label: String, n: Int): Vector[String] = { + var a: Vector[String] = Vector.empty + for (i <- 0 until n) + a = a :+ (label + i) + + assertVector(a, label, 0, n) + } + + def vectorBackward(label: String, n: Int): Vector[String] = { + var a: Vector[String] = Vector.empty + for (i <- 0 until n) + a = (label + (n-1-i)) +: a + + assertVector(a, label, 0, n) + } + + def assertVector[V](a: Vector[V], label: String, start: Int, end: Int) = { + assertVectorIndexed(a, label, start, end) + assertVectorIterated(a, label, start, end) + } + + def assertVectorIndexed[V](a: Vector[V], label: String, start: Int, end: Int) = { + val res = a + assert(res.length == (end-start), res.length+"!="+(end-start)+" ("+res+")") + for (i <- start until end) { + assert(res(i) == (label + i), ""+res(i)+"!="+(label + i)) + } + res + } + + def assertVectorIterated[V](a: Vector[V], label: String, start: Int, end: Int) = { + val res = a + assert(res.length == (end-start), res.length+"!="+(end-start)+" ("+res+")") + var i = start + var it = res.iterator + while(it.hasNext) { + val x = it.next() + assert(x == (label + i), x.toString+"!="+(label + i)) + i += 1 + } + assert(i == end) + res + } + + + + def test1() = { + println("===== test1 =====") + + val N = 150000 + val a = vector("a", N) + val b = vectorForward("b", N) + val c = vectorBackward("b", N) + + () +// //println(a) + } + + def test2() = { + println("===== test2 =====") + + var a: Vector[String] = Vector.empty + + val rand = new java.util.Random + + val N = 150000 + var min = N/2//rand.nextInt(N) + var max = min + + val chunkLimit = 11 + + def nextChunkSize = 3 //rand.nextInt(chunkLimit) + + def seqBack() = for (i <- 0 until Math.min(nextChunkSize, N-max)) { a = a :+ ("a"+max); max += 1 } + def seqFront() = for (i <- 0 until Math.min(nextChunkSize, min)) { min -= 1; a = ("a"+min) +: a } + + try { + + while (min > 0 || max < N) { + seqFront() + seqBack() + } + } catch { + case ex: Throwable => + //println("----------------") + //a.debug + throw ex + } + + assertVector(a, "a", 0, N) + } + + + + def test3() = { + println("===== test3 =====") + + val N = 150000 + val a = vector("a", N) + + val pos = scala.util.Random.shuffle(scala.collection.mutable.WrappedArray.make[Int](Array.tabulate[Int](N)(i => i))) + + var b = a + + { + var i = 0 + while (i < N) { + b = b.updated(pos(i), "b"+(pos(i))) + i += 1 + } + + assertVector(b, "b", 0, N) + } + +// //println(a) + } + + def test4() = { + println("===== test4 =====") + + val N = 150000 + val a = vectorForward("a", N) + + { + var i = 0 + var it = a + while (i < N) { + assert(it.length == (N-i), it.length+" items at iteration "+i) + val x = it(0) + val y = it(N-i-1) + assert(x == "a"+i, x+"!=a"+i) + assert(y == "a"+(N-1), y+"!=a"+(N-1)) + it = it.drop(1) + i += 1 + } + assert(it.length == 0) + } + +// //println(a) + } + + def test5() = { + println("===== test5 =====") + + val N = 150000 + val a = vectorBackward("a", N) + + { + var i = 0 + var it = a + while (i < N) { + assert(it.length == (N-i), it.length+" items at iteration "+i) + val x = it(0) + val y = it(N-i-1) +// println("x " + x + "/" + i) +// println("y " + y) + assert(x == "a0", x+"!=a0") + assert(y == "a"+(N-i-1), y+"!=a"+(N-i-1)) + it = it.dropRight(1) + i += 1 + } + assert(it.length == 0) + } + } + + def main(args: Array[String]) = { + + test1() + test2() + test3() + test4() + test5() + + println("done") + } + +} + diff --git a/tests/pending/run/verify-ctor.check b/tests/pending/run/verify-ctor.check new file mode 100644 index 000000000000..8baef1b4abc4 --- /dev/null +++ b/tests/pending/run/verify-ctor.check @@ -0,0 +1 @@ +abc diff --git a/tests/pending/run/verify-ctor.scala b/tests/pending/run/verify-ctor.scala new file mode 100644 index 000000000000..528d038a8edc --- /dev/null +++ b/tests/pending/run/verify-ctor.scala @@ -0,0 +1,13 @@ +class Foo(val str: String) { + def this(arr: Array[Char]) = this({ + if (arr.length == 0) sys.exit(1) + new String(arr) + }) +} + +object Test { + def main(args: Array[String]) = { + val t = new Foo(Array('a', 'b', 'c')) + println(t.str) + } +} diff --git a/tests/pending/run/view-headoption.check b/tests/pending/run/view-headoption.check new file mode 100644 index 000000000000..5c98b54b46cb --- /dev/null +++ b/tests/pending/run/view-headoption.check @@ -0,0 +1,28 @@ +fail +success +f1: Some(5) +fail +success +f2: 5 +fail +success +fail +fail +success +fail +fail +fail +success +f3: Some(5) +fail +success +fail +success +fail +fail +success +fail +fail +fail +success +f4: 5 diff --git a/tests/pending/run/view-headoption.scala b/tests/pending/run/view-headoption.scala new file mode 100644 index 000000000000..659c7e6b8201 --- /dev/null +++ b/tests/pending/run/view-headoption.scala @@ -0,0 +1,18 @@ +object Test { + val failer = () => { println("fail") ; None } + val succeeder = () => { println("success") ; Some(5) } + val fs = List(failer, succeeder, failer, failer, succeeder, failer, failer, failer, succeeder) + + def f0 = fs.view flatMap (f => f()) + def f1 = f0.headOption + def f2 = f0.head + def f3 = f0.lastOption + def f4 = f0.last + + def main(args: Array[String]): Unit = { + println("f1: " + f1) + println("f2: " + f2) + println("f3: " + f3) + println("f4: " + f4) + } +} diff --git a/tests/pending/run/view-iterator-stream.check b/tests/pending/run/view-iterator-stream.check new file mode 100644 index 000000000000..2da02c865c89 --- /dev/null +++ b/tests/pending/run/view-iterator-stream.check @@ -0,0 +1,112 @@ + +** drop 20 -> take 10 -> slice(1, 5) ** + +------------------- +toIndexedSeq -> toIterator -> toStream Stream(22, ?) 22 23 24 25 +toIndexedSeq -> toIterator -> view StreamView(...) 22 23 24 25 +toIndexedSeq -> toStream -> toIterator non-empty iterator 22 23 24 25 +toIndexedSeq -> toStream -> view StreamView(...) 22 23 24 25 +toIndexedSeq -> view -> toIterator non-empty iterator 22 23 24 25 +toIndexedSeq -> view -> toStream Stream(22, ?) 22 23 24 25 +toIterator -> toIndexedSeq -> toStream Stream(22, ?) 22 23 24 25 +toIterator -> toIndexedSeq -> view SeqView(...) 22 23 24 25 +toIterator -> toStream -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +toIterator -> toStream -> view StreamView(...) 22 23 24 25 +toIterator -> view -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +toIterator -> view -> toStream Stream(22, ?) 22 23 24 25 +toStream -> toIndexedSeq -> toIterator non-empty iterator 22 23 24 25 +toStream -> toIndexedSeq -> view SeqView(...) 22 23 24 25 +toStream -> toIterator -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +toStream -> toIterator -> view StreamView(...) 22 23 24 25 +toStream -> view -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +toStream -> view -> toIterator non-empty iterator 22 23 24 25 +view -> toIndexedSeq -> toIterator non-empty iterator 22 23 24 25 +view -> toIndexedSeq -> toStream Stream(22, ?) 22 23 24 25 +view -> toIterator -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +view -> toIterator -> toStream Stream(22, ?) 22 23 24 25 +view -> toStream -> toIndexedSeq Vector(22, 23, 24, 25) 22 23 24 25 +view -> toStream -> toIterator non-empty iterator 22 23 24 25 + +** take 20 -> drop 10 -> slice(1, 5) ** + +------------------- +toIndexedSeq -> toIterator -> toStream Stream(12, ?) 12 13 14 15 +toIndexedSeq -> toIterator -> view StreamView(...) 12 13 14 15 +toIndexedSeq -> toStream -> toIterator non-empty iterator 12 13 14 15 +toIndexedSeq -> toStream -> view StreamView(...) 12 13 14 15 +toIndexedSeq -> view -> toIterator non-empty iterator 12 13 14 15 +toIndexedSeq -> view -> toStream Stream(12, ?) 12 13 14 15 +toIterator -> toIndexedSeq -> toStream Stream(12, ?) 12 13 14 15 +toIterator -> toIndexedSeq -> view SeqView(...) 12 13 14 15 +toIterator -> toStream -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +toIterator -> toStream -> view StreamView(...) 12 13 14 15 +toIterator -> view -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +toIterator -> view -> toStream Stream(12, ?) 12 13 14 15 +toStream -> toIndexedSeq -> toIterator non-empty iterator 12 13 14 15 +toStream -> toIndexedSeq -> view SeqView(...) 12 13 14 15 +toStream -> toIterator -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +toStream -> toIterator -> view StreamView(...) 12 13 14 15 +toStream -> view -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +toStream -> view -> toIterator non-empty iterator 12 13 14 15 +view -> toIndexedSeq -> toIterator non-empty iterator 12 13 14 15 +view -> toIndexedSeq -> toStream Stream(12, ?) 12 13 14 15 +view -> toIterator -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +view -> toIterator -> toStream Stream(12, ?) 12 13 14 15 +view -> toStream -> toIndexedSeq Vector(12, 13, 14, 15) 12 13 14 15 +view -> toStream -> toIterator non-empty iterator 12 13 14 15 + +** slice(20, 40) -> drop 10 -> take 5 ** + +------------------- +toIndexedSeq -> toIterator -> toStream Stream(31, ?) 31 32 33 34 35 +toIndexedSeq -> toIterator -> view StreamView(...) 31 32 33 34 35 +toIndexedSeq -> toStream -> toIterator non-empty iterator 31 32 33 34 35 +toIndexedSeq -> toStream -> view StreamView(...) 31 32 33 34 35 +toIndexedSeq -> view -> toIterator non-empty iterator 31 32 33 34 35 +toIndexedSeq -> view -> toStream Stream(31, ?) 31 32 33 34 35 +toIterator -> toIndexedSeq -> toStream Stream(31, ?) 31 32 33 34 35 +toIterator -> toIndexedSeq -> view SeqView(...) 31 32 33 34 35 +toIterator -> toStream -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +toIterator -> toStream -> view StreamView(...) 31 32 33 34 35 +toIterator -> view -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +toIterator -> view -> toStream Stream(31, ?) 31 32 33 34 35 +toStream -> toIndexedSeq -> toIterator non-empty iterator 31 32 33 34 35 +toStream -> toIndexedSeq -> view SeqView(...) 31 32 33 34 35 +toStream -> toIterator -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +toStream -> toIterator -> view StreamView(...) 31 32 33 34 35 +toStream -> view -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +toStream -> view -> toIterator non-empty iterator 31 32 33 34 35 +view -> toIndexedSeq -> toIterator non-empty iterator 31 32 33 34 35 +view -> toIndexedSeq -> toStream Stream(31, ?) 31 32 33 34 35 +view -> toIterator -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +view -> toIterator -> toStream Stream(31, ?) 31 32 33 34 35 +view -> toStream -> toIndexedSeq Vector(31, 32, 33, 34, 35) 31 32 33 34 35 +view -> toStream -> toIterator non-empty iterator 31 32 33 34 35 + +** slice(20, 40) -> take 10 -> drop 5 ** + +------------------- +toIndexedSeq -> toIterator -> toStream Stream(26, ?) 26 27 28 29 30 +toIndexedSeq -> toIterator -> view StreamView(...) 26 27 28 29 30 +toIndexedSeq -> toStream -> toIterator non-empty iterator 26 27 28 29 30 +toIndexedSeq -> toStream -> view StreamView(...) 26 27 28 29 30 +toIndexedSeq -> view -> toIterator non-empty iterator 26 27 28 29 30 +toIndexedSeq -> view -> toStream Stream(26, ?) 26 27 28 29 30 +toIterator -> toIndexedSeq -> toStream Stream(26, ?) 26 27 28 29 30 +toIterator -> toIndexedSeq -> view SeqView(...) 26 27 28 29 30 +toIterator -> toStream -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +toIterator -> toStream -> view StreamView(...) 26 27 28 29 30 +toIterator -> view -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +toIterator -> view -> toStream Stream(26, ?) 26 27 28 29 30 +toStream -> toIndexedSeq -> toIterator non-empty iterator 26 27 28 29 30 +toStream -> toIndexedSeq -> view SeqView(...) 26 27 28 29 30 +toStream -> toIterator -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +toStream -> toIterator -> view StreamView(...) 26 27 28 29 30 +toStream -> view -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +toStream -> view -> toIterator non-empty iterator 26 27 28 29 30 +view -> toIndexedSeq -> toIterator non-empty iterator 26 27 28 29 30 +view -> toIndexedSeq -> toStream Stream(26, ?) 26 27 28 29 30 +view -> toIterator -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +view -> toIterator -> toStream Stream(26, ?) 26 27 28 29 30 +view -> toStream -> toIndexedSeq Vector(26, 27, 28, 29, 30) 26 27 28 29 30 +view -> toStream -> toIterator non-empty iterator 26 27 28 29 30 diff --git a/tests/pending/run/view-iterator-stream.scala b/tests/pending/run/view-iterator-stream.scala new file mode 100644 index 000000000000..0e0c42d7d396 --- /dev/null +++ b/tests/pending/run/view-iterator-stream.scala @@ -0,0 +1,70 @@ + +import scala.language.postfixOps + +import scala.collection.{ mutable, immutable, generic } +import collection.TraversableView + +object Test { + type PerturberFn[T] = TraversableOnce[T] => TraversableOnce[T] + lazy val Id = new Perturber(Nil, identity[TraversableOnce[Int]] _) { } + class Perturber(val labels: List[String], val f: PerturberFn[Int]) extends PerturberFn[Int] { + def apply(xs: TraversableOnce[Int]): TraversableOnce[Int] = f(xs) + def show(xs: TraversableOnce[Int]): String = { + val res = f(xs) + val resString = "" + res + val rest = res.toTraversable + val failed = (rest take 100).size == 100 + + "%-45s %-30s %s".format(toString, resString, + if (failed) "" else rest.mkString(" ") + ) + } + def and(g: Perturber): Perturber = + new Perturber(this.labels ++ g.labels, f andThen g.f) + + override def toString = labels mkString " -> " + } + object Perturber { + def apply(label: String, f: PerturberFn[Int]) = new Perturber(List(label), f) + } + + def naturals = Stream from 1 + val toV : Perturber = Perturber("view", _.toTraversable.view) + val toI : Perturber = Perturber("toIterator", _.toIterator) + val toS : Perturber = Perturber("toStream", _.toStream) + val toIS : Perturber = Perturber("toIndexedSeq", _.toIndexedSeq) + + def p(ps: Perturber*): Perturber = if (ps.isEmpty) Id else ps.reduceLeft(_ and _) + def drop(n: Int): Perturber = Perturber("drop " + n, _.toIterator drop n) + def take(n: Int): Perturber = Perturber("take " + n, _.toIterator take n) + def slice(from: Int, until: Int): Perturber = + Perturber( + "slice(%d, %d)".format(from, until), + _.toTraversable.slice(from, until) + ) + + val fns = List[Perturber](toV, toI, toS, toIS) + + def tds(n: Int): Perturber = p(drop(n), take(n / 2), slice(1, n / 4)) + def dts(n: Int): Perturber = p(take(n), drop(n / 2), slice(1, n / 4)) + def sdt(n: Int): Perturber = p(slice(n, n * 2), drop(n / 2), take(n / 4)) + def std(n: Int): Perturber = p(slice(n, n * 2), take(n / 2), drop(n / 4)) + + val transforms = (fns.permutations map (xs => p(xs take 3: _*))).toList.distinct + def mkOps(n: Int) = List[Perturber](tds(n), dts(n), sdt(n), std(n)) + def runOps(n: Int) = { + val xs: List[(String, List[String])] = mkOps(n) map { op => + ("" + op, transforms map (_ show op(naturals)) sorted) + } + for ((k, v) <- xs) { + println("\n** " + k + " **\n") + println("-------------------") + v foreach println + } + () + } + + def main(args: Array[String]): Unit = { + runOps(20) + } +} diff --git a/tests/pending/run/virtpatmat_alts.check b/tests/pending/run/virtpatmat_alts.check new file mode 100644 index 000000000000..f39e292fef10 --- /dev/null +++ b/tests/pending/run/virtpatmat_alts.check @@ -0,0 +1,7 @@ +virtpatmat_alts.scala:5: warning: match may not be exhaustive. + (true, true) match { + ^ +virtpatmat_alts.scala:9: warning: match may not be exhaustive. + List(5) match { + ^ +OK 5 diff --git a/tests/pending/run/virtpatmat_alts.scala b/tests/pending/run/virtpatmat_alts.scala new file mode 100644 index 000000000000..d76b29307d5b --- /dev/null +++ b/tests/pending/run/virtpatmat_alts.scala @@ -0,0 +1,15 @@ +/* + * filter: It would fail on the following input + */ +object Test extends dotty.runtime.LegacyApp { + (true, true) match { + case (true, true) | (false, false) => 1 + } + + List(5) match { + case 1 :: Nil | 2 :: Nil => println("FAILED") + case (x@(4 | 5 | 6)) :: Nil => println("OK "+ x) + case 7 :: Nil => println("FAILED") + case Nil => println("FAILED") + } +} diff --git a/tests/pending/run/virtpatmat_apply.check b/tests/pending/run/virtpatmat_apply.check new file mode 100644 index 000000000000..e8e3b295e660 --- /dev/null +++ b/tests/pending/run/virtpatmat_apply.check @@ -0,0 +1 @@ +OK 2 diff --git a/tests/pending/run/virtpatmat_apply.flags b/tests/pending/run/virtpatmat_apply.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_apply.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_apply.scala b/tests/pending/run/virtpatmat_apply.scala new file mode 100644 index 000000000000..838d456cb8d5 --- /dev/null +++ b/tests/pending/run/virtpatmat_apply.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + List(1, 2, 3) match { + case Nil => println("FAIL") + case x :: y :: xs if xs.length == 2 => println("FAIL") + case x :: y :: xs if xs.length == 1 => println("OK "+ y) + } +} diff --git a/tests/pending/run/virtpatmat_casting.check b/tests/pending/run/virtpatmat_casting.check new file mode 100644 index 000000000000..b11425edc80f --- /dev/null +++ b/tests/pending/run/virtpatmat_casting.check @@ -0,0 +1 @@ +List(1) diff --git a/tests/pending/run/virtpatmat_casting.flags b/tests/pending/run/virtpatmat_casting.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_casting.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_casting.scala b/tests/pending/run/virtpatmat_casting.scala new file mode 100644 index 000000000000..81b52ee1b7d4 --- /dev/null +++ b/tests/pending/run/virtpatmat_casting.scala @@ -0,0 +1,9 @@ +object Test extends dotty.runtime.LegacyApp { + println(List(1,2,3) match { + case Nil => List(0) +// since the :: extractor's argument must be a ::, there has to be a cast before its unapply is invoked + case x :: y :: z :: a :: xs => xs ++ List(x) + case x :: y :: z :: xs => xs ++ List(x) + case _ => List(0) + }) +} diff --git a/tests/pending/run/virtpatmat_extends_product.check b/tests/pending/run/virtpatmat_extends_product.check new file mode 100644 index 000000000000..c07e8385a736 --- /dev/null +++ b/tests/pending/run/virtpatmat_extends_product.check @@ -0,0 +1 @@ +AnnotationInfo(a,1) diff --git a/tests/pending/run/virtpatmat_extends_product.flags b/tests/pending/run/virtpatmat_extends_product.flags new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/tests/pending/run/virtpatmat_extends_product.flags @@ -0,0 +1 @@ + diff --git a/tests/pending/run/virtpatmat_extends_product.scala b/tests/pending/run/virtpatmat_extends_product.scala new file mode 100644 index 000000000000..7d290083e4b0 --- /dev/null +++ b/tests/pending/run/virtpatmat_extends_product.scala @@ -0,0 +1,14 @@ +object Test extends dotty.runtime.LegacyApp { + case class AnnotationInfo(a: String, b: Int) extends Product2[String, Int] { + def _1 = a + def _2 = b + } + + // if we're not careful in unapplyTypeListFromReturnType, the generated unapply is + // thought to return two components instead of one, since AnnotationInfo (the result of the unapply) is a Product2 + case class NestedAnnotArg(ai: AnnotationInfo) + + NestedAnnotArg(AnnotationInfo("a", 1)) match { + case NestedAnnotArg(x) => println(x) + } +} diff --git a/tests/pending/run/virtpatmat_literal.check b/tests/pending/run/virtpatmat_literal.check new file mode 100644 index 000000000000..0eabe3671300 --- /dev/null +++ b/tests/pending/run/virtpatmat_literal.check @@ -0,0 +1,3 @@ +OK +OK +OK diff --git a/tests/pending/run/virtpatmat_literal.flags b/tests/pending/run/virtpatmat_literal.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_literal.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_literal.scala b/tests/pending/run/virtpatmat_literal.scala new file mode 100644 index 000000000000..682e6b76599e --- /dev/null +++ b/tests/pending/run/virtpatmat_literal.scala @@ -0,0 +1,22 @@ +object Test extends dotty.runtime.LegacyApp { + val a = 1 + 1 match { + case 2 => println("FAILED") + case 1 => println("OK") + case `a` => println("FAILED") + } + + val one = 1 + 1 match { + case 2 => println("FAILED") + case `one` => println("OK") + case 1 => println("FAILED") + } + + 1 match { + case 2 => println("FAILED") + case Test.one => println("OK") + case 1 => println("FAILED") + } + +} diff --git a/tests/pending/run/virtpatmat_nested_lists.check b/tests/pending/run/virtpatmat_nested_lists.check new file mode 100644 index 000000000000..ddf68eeedd4d --- /dev/null +++ b/tests/pending/run/virtpatmat_nested_lists.check @@ -0,0 +1,4 @@ +virtpatmat_nested_lists.scala:5: warning: match may not be exhaustive. + List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) } + ^ +2 diff --git a/tests/pending/run/virtpatmat_nested_lists.flags b/tests/pending/run/virtpatmat_nested_lists.flags new file mode 100644 index 000000000000..ca9a4c06970b --- /dev/null +++ b/tests/pending/run/virtpatmat_nested_lists.flags @@ -0,0 +1 @@ +-Ypatmat-exhaust-depth off \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_nested_lists.scala b/tests/pending/run/virtpatmat_nested_lists.scala new file mode 100644 index 000000000000..17199ea86645 --- /dev/null +++ b/tests/pending/run/virtpatmat_nested_lists.scala @@ -0,0 +1,6 @@ +/* + * filter: It would fail on the following input + */ +object Test extends dotty.runtime.LegacyApp { + List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) } +} diff --git a/tests/pending/run/virtpatmat_npe.check b/tests/pending/run/virtpatmat_npe.check new file mode 100644 index 000000000000..a0aba9318add --- /dev/null +++ b/tests/pending/run/virtpatmat_npe.check @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_npe.flags b/tests/pending/run/virtpatmat_npe.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_npe.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_npe.scala b/tests/pending/run/virtpatmat_npe.scala new file mode 100644 index 000000000000..efa66f3286c4 --- /dev/null +++ b/tests/pending/run/virtpatmat_npe.scala @@ -0,0 +1,10 @@ +class C { + class D + val values = new Array[AnyRef](10) + values(0) match { + case name: D => println("NOK: "+ name) // the outer check on D's outer should not cause a NPE + case null => println("OK") + } +} + +object Test extends C with App diff --git a/tests/pending/run/virtpatmat_opt_sharing.check b/tests/pending/run/virtpatmat_opt_sharing.check new file mode 100644 index 000000000000..78ec61f19da3 --- /dev/null +++ b/tests/pending/run/virtpatmat_opt_sharing.check @@ -0,0 +1,4 @@ +virtpatmat_opt_sharing.scala:7: warning: match may not be exhaustive. + List(1, 3, 4, 7) match { + ^ +1 diff --git a/tests/pending/run/virtpatmat_opt_sharing.flags b/tests/pending/run/virtpatmat_opt_sharing.flags new file mode 100644 index 000000000000..ca9a4c06970b --- /dev/null +++ b/tests/pending/run/virtpatmat_opt_sharing.flags @@ -0,0 +1 @@ +-Ypatmat-exhaust-depth off \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_opt_sharing.scala b/tests/pending/run/virtpatmat_opt_sharing.scala new file mode 100644 index 000000000000..0a66a753b6f0 --- /dev/null +++ b/tests/pending/run/virtpatmat_opt_sharing.scala @@ -0,0 +1,13 @@ +/* + * filter: It would fail on the following input + */ +object Test extends dotty.runtime.LegacyApp { + virtMatch() + def virtMatch() = { + List(1, 3, 4, 7) match { + case 1 :: 3 :: 4 :: 5 :: x => println("nope") + case 1 :: 3 :: 4 :: 6 :: x => println("nope") + case 1 :: 3 :: 4 :: 7 :: x => println(1) + } + } +} diff --git a/tests/pending/run/virtpatmat_partial.check b/tests/pending/run/virtpatmat_partial.check new file mode 100644 index 000000000000..137d16da7929 --- /dev/null +++ b/tests/pending/run/virtpatmat_partial.check @@ -0,0 +1,17 @@ +Map(a -> Some(1), b -> None) +Map(a -> 1) +a +undefined +a +undefined +a +undefined +a +undefined +hai! +hai! +2 +hai! +undefined +1 +undefined diff --git a/tests/pending/run/virtpatmat_partial.flags b/tests/pending/run/virtpatmat_partial.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_partial.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_partial.scala b/tests/pending/run/virtpatmat_partial.scala new file mode 100644 index 000000000000..b93a54cbc911 --- /dev/null +++ b/tests/pending/run/virtpatmat_partial.scala @@ -0,0 +1,181 @@ +object Test extends dotty.runtime.LegacyApp { + val a = Map("a" -> Some(1), "b" -> None) + println(a) + +// inferred type should be Map[String, Int] + val res = a collect {case (p, Some(a)) => (p, a)} + +// variations: const target -> switch, non-const -> normal match, char target --> scrut needs toInt, +// eta-expanded --> work is done by typedFunction, non-eta-expanded --> typedMatch + + object nonConstCharEta { + final val GT : Char = 'a' + final val GTGT : Char = 'b' + final val GTGTGT : Char = 'c' + final val GTEQ : Char = 'd' + final val GTGTEQ : Char = 'e' + final val GTGTGTEQ: Char = 'f' + final val ASSIGN : Char = 'g' + + def acceptClosingAngle(in: Char): Unit = { + val closers: PartialFunction[Char, Char] = { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + object nonConstChar { + final val GT : Char = 'a' + final val GTGT : Char = 'b' + final val GTGTGT : Char = 'c' + final val GTEQ : Char = 'd' + final val GTGTEQ : Char = 'e' + final val GTGTGTEQ: Char = 'f' + final val ASSIGN : Char = 'g' + + def acceptClosingAngle(in: Char): Unit = { + val closers: PartialFunction[Char, Char] = x => x match { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + object constCharEta { + final val GT = 'a' + final val GTGT = 'b' + final val GTGTGT = 'c' + final val GTEQ = 'd' + final val GTGTEQ = 'e' + final val GTGTGTEQ= 'f' + final val ASSIGN = 'g' + + def acceptClosingAngle(in: Char): Unit = { + val closers: PartialFunction[Char, Char] = x => x match { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + object constChar { + final val GT = 'a' + final val GTGT = 'b' + final val GTGTGT = 'c' + final val GTEQ = 'd' + final val GTGTEQ = 'e' + final val GTGTGTEQ= 'f' + final val ASSIGN = 'g' + + def acceptClosingAngle(in: Char): Unit = { + val closers: PartialFunction[Char, Char] = { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + object constIntEta { + final val GT = 1 + final val GTGT = 2 + final val GTGTGT = 3 + final val GTEQ = 4 + final val GTGTEQ = 5 + final val GTGTGTEQ = 6 + final val ASSIGN = 7 + + def acceptClosingAngle(in: Int): Unit = { + val closers: PartialFunction[Int, Int] = x => {println("hai!"); (x + 1)} match { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + object constInt { + final val GT = 1 + final val GTGT = 2 + final val GTGTGT = 3 + final val GTEQ = 4 + final val GTGTEQ = 5 + final val GTGTGTEQ = 6 + final val ASSIGN = 7 + + def acceptClosingAngle(in: Int): Unit = { + val closers: PartialFunction[Int, Int] = { + case GTGTGTEQ => GTGTEQ + case GTGTGT => GTGT + case GTGTEQ => GTEQ + case GTGT => GT + case GTEQ => ASSIGN + } + if (closers isDefinedAt in) println(closers(in)) + else println("undefined") + } + + def test() = { + acceptClosingAngle(GTGT) + acceptClosingAngle(ASSIGN) + } + } + + println(res) // prints "Map(a -> 1)" + + nonConstCharEta.test() + nonConstChar.test() + constCharEta.test() + constChar.test() + constIntEta.test() + constInt.test() +} diff --git a/tests/pending/run/virtpatmat_partial_backquoted.check b/tests/pending/run/virtpatmat_partial_backquoted.check new file mode 100644 index 000000000000..8ab8f2967766 --- /dev/null +++ b/tests/pending/run/virtpatmat_partial_backquoted.check @@ -0,0 +1 @@ +Set(You got me!) diff --git a/tests/pending/run/virtpatmat_partial_backquoted.scala b/tests/pending/run/virtpatmat_partial_backquoted.scala new file mode 100644 index 000000000000..21f686dcf831 --- /dev/null +++ b/tests/pending/run/virtpatmat_partial_backquoted.scala @@ -0,0 +1,12 @@ +object Test extends dotty.runtime.LegacyApp { + class Region { override def toString = "You got me!" } + class SymbolType + case class SymbolInfo(tp: SymbolType, regions: List[Region], x: Any) + + def findRegionsWithSymbolType(rawSymbolInfos: Seq[SymbolInfo], symbolType: SymbolType): Set[Region] = + rawSymbolInfos.collect { case SymbolInfo(`symbolType`, regions, _) => regions }.flatten.toSet + + val stp = new SymbolType + val stp2 = new SymbolType + println(findRegionsWithSymbolType(List(SymbolInfo(stp2, List(), null), SymbolInfo(stp, List(new Region), null)), stp)) +} diff --git a/tests/pending/run/virtpatmat_staging.check b/tests/pending/run/virtpatmat_staging.check new file mode 100644 index 000000000000..106ae40b99a9 --- /dev/null +++ b/tests/pending/run/virtpatmat_staging.check @@ -0,0 +1 @@ +runOrElse(7, ?guard(false,?).flatMap(? =>one(foo)).orElse(one(bar))) diff --git a/tests/pending/run/virtpatmat_staging.flags b/tests/pending/run/virtpatmat_staging.flags new file mode 100644 index 000000000000..0a22f7c729cc --- /dev/null +++ b/tests/pending/run/virtpatmat_staging.flags @@ -0,0 +1,2 @@ +-Yrangepos:false +-Xexperimental diff --git a/tests/pending/run/virtpatmat_staging.scala b/tests/pending/run/virtpatmat_staging.scala new file mode 100644 index 000000000000..d444829b02a9 --- /dev/null +++ b/tests/pending/run/virtpatmat_staging.scala @@ -0,0 +1,55 @@ + +import scala.language.{ higherKinds, implicitConversions } + +trait Intf { + type Rep[+T] + type M[+T] = Rep[Maybe[T]] + + val __match: Matcher + abstract class Matcher { + // runs the matcher on the given input + def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U] + + def zero: M[Nothing] + def one[T](x: Rep[T]): M[T] + def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T] + def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] // used for isDefinedAt + } + + abstract class Maybe[+A] { + def flatMap[B](f: Rep[A] => M[B]): M[B] + def orElse[B >: A](alternative: => M[B]): M[B] + } + + implicit def proxyMaybe[A](m: M[A]): Maybe[A] + implicit def repInt(x: Int): Rep[Int] + implicit def repBoolean(x: Boolean): Rep[Boolean] + implicit def repString(x: String): Rep[String] + + def test = 7 match { case 5 => "foo" case _ => "bar" } +} + +trait Impl extends Intf { + type Rep[+T] = String + + object __match extends Matcher { + def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U] = ("runOrElse("+ in +", ?" + matcher("?") + ")") + def zero: M[Nothing] = "zero" + def one[T](x: Rep[T]): M[T] = "one("+x.toString+")" + def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T] = s"guard($cond,$dann)" + def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] = ("isSuccess("+x+", ?" + f("?") + ")") + } + + implicit def proxyMaybe[A](m: M[A]): Maybe[A] = new Maybe[A] { + def flatMap[B](f: Rep[A] => M[B]): M[B] = m + ".flatMap(? =>"+ f("?") +")" + def orElse[B >: A](alternative: => M[B]): M[B] = m + ".orElse("+ alternative +")" + } + + def repInt(x: Int): Rep[Int] = x.toString + def repBoolean(x: Boolean): Rep[Boolean] = x.toString + def repString(x: String): Rep[String] = x +} + +object Test extends Impl with Intf with App { + println(test) +} diff --git a/tests/pending/run/virtpatmat_stringinterp.check b/tests/pending/run/virtpatmat_stringinterp.check new file mode 100644 index 000000000000..7927f4f2d95a --- /dev/null +++ b/tests/pending/run/virtpatmat_stringinterp.check @@ -0,0 +1 @@ +Node(1) diff --git a/tests/pending/run/virtpatmat_stringinterp.flags b/tests/pending/run/virtpatmat_stringinterp.flags new file mode 100644 index 000000000000..e1b37447c953 --- /dev/null +++ b/tests/pending/run/virtpatmat_stringinterp.flags @@ -0,0 +1 @@ +-Xexperimental \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_stringinterp.scala b/tests/pending/run/virtpatmat_stringinterp.scala new file mode 100644 index 000000000000..6ce1bf9c5093 --- /dev/null +++ b/tests/pending/run/virtpatmat_stringinterp.scala @@ -0,0 +1,16 @@ + +import scala.language.{ implicitConversions } + +object Test extends dotty.runtime.LegacyApp { + case class Node(x: Int) + + implicit def sc2xml(sc: StringContext): XMLContext = new XMLContext(sc) + class XMLContext(sc: StringContext) { + object xml { + def unapplySeq(xml: Node): Option[Seq[Node]] = Some(List(Node(1))) + } + } + + val x: Node = Node(0) + x match { case xml"""""" => println(a) } +} diff --git a/tests/pending/run/virtpatmat_switch.check b/tests/pending/run/virtpatmat_switch.check new file mode 100644 index 000000000000..6ded95c01018 --- /dev/null +++ b/tests/pending/run/virtpatmat_switch.check @@ -0,0 +1,7 @@ +zero +one +many +got a +got b +got some letter +scala.MatchError: 5 (of class java.lang.Integer) \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_switch.flags b/tests/pending/run/virtpatmat_switch.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_switch.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_switch.scala b/tests/pending/run/virtpatmat_switch.scala new file mode 100644 index 000000000000..5cdf271d5665 --- /dev/null +++ b/tests/pending/run/virtpatmat_switch.scala @@ -0,0 +1,38 @@ +object Test extends dotty.runtime.LegacyApp { + def intSwitch(x: Int) = x match { + case 0 => "zero" + case 1 => "one" + case _ => "many" + } + + println(intSwitch(0)) + println(intSwitch(1)) + println(intSwitch(10)) + + def charSwitch(x: Char) = x match { + case 'a' => "got a" + case 'b' => "got b" + case _ => "got some letter" + } + + def byteSwitch(x: Byte) = x match { + case 'a' => "got a" + case 'b' => "got b" + case _ => "got some letter" + } + + println(charSwitch('a')) + println(byteSwitch('b')) + println(charSwitch('z')) + + def implicitDefault(x: Int) = x match { + case 0 => 0 + } + + try { + implicitDefault(5) + } catch { + case e: MatchError => println(e) + } + +} diff --git a/tests/pending/run/virtpatmat_tailcalls_verifyerror.check b/tests/pending/run/virtpatmat_tailcalls_verifyerror.check new file mode 100644 index 000000000000..c508d5366f70 --- /dev/null +++ b/tests/pending/run/virtpatmat_tailcalls_verifyerror.check @@ -0,0 +1 @@ +false diff --git a/tests/pending/run/virtpatmat_tailcalls_verifyerror.flags b/tests/pending/run/virtpatmat_tailcalls_verifyerror.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_tailcalls_verifyerror.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_tailcalls_verifyerror.scala b/tests/pending/run/virtpatmat_tailcalls_verifyerror.scala new file mode 100644 index 000000000000..46c75cf9c860 --- /dev/null +++ b/tests/pending/run/virtpatmat_tailcalls_verifyerror.scala @@ -0,0 +1,14 @@ +// shouldn't result in a verify error when run... +object Test extends dotty.runtime.LegacyApp { + @annotation.tailrec + final def test(meh: Boolean): Boolean = { + Some("a") match { + case x => + x match { + case Some(_) => if(meh) test(false) else false + case _ => test(false) + } + } + } + println(test(true)) +} diff --git a/tests/pending/run/virtpatmat_try.check b/tests/pending/run/virtpatmat_try.check new file mode 100644 index 000000000000..80ebbf494a07 --- /dev/null +++ b/tests/pending/run/virtpatmat_try.check @@ -0,0 +1,2 @@ +meh +B diff --git a/tests/pending/run/virtpatmat_try.flags b/tests/pending/run/virtpatmat_try.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_try.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_try.scala b/tests/pending/run/virtpatmat_try.scala new file mode 100644 index 000000000000..2cd05b79966b --- /dev/null +++ b/tests/pending/run/virtpatmat_try.scala @@ -0,0 +1,47 @@ +object Test extends dotty.runtime.LegacyApp { + case class A(val x: String) extends Throwable + class B extends Exception { override def toString = "B" } + def bla = 0 + + try { + throw new A("meh") + } catch { // this should emit a "catch-switch" + case y: A => println(y.x) + case (_ : A | _ : B) => println("B") + case _: Throwable => println("other") + } + + try { + throw new B() + } catch { // case classes and alternative flattening aren't supported yet, but could be in principle + // case A(x) => println(x) + case y: A => println(y.x) + case x@((_ : A) | (_ : B)) => println(x) + case _: Throwable => println("other") + } + + def simpleTry: Unit = { + try { + bla + } catch { + case x: Exception if x.getMessage == "test" => println("first case " + x) + case x: Exception => println("second case " + x) + } + } + + def typedWildcardTry: Unit = { + try { bla } catch { case _: ClassCastException => bla } + } + + def wildcardTry: Unit = { + try { bla } catch { case _: Throwable => bla } + } + + def tryPlusFinally: Unit = { + try { bla } finally { println("finally") } + } + + def catchAndPassToLambda: Unit = { + try { bla } catch { case ex: Exception => val f = () => ex } + } +} diff --git a/tests/pending/run/virtpatmat_typed.check b/tests/pending/run/virtpatmat_typed.check new file mode 100644 index 000000000000..b304fa5ffc93 --- /dev/null +++ b/tests/pending/run/virtpatmat_typed.check @@ -0,0 +1,4 @@ +virtpatmat_typed.scala:5: warning: unreachable code + case x: String => println("FAILED") + ^ +OK foo diff --git a/tests/pending/run/virtpatmat_typed.flags b/tests/pending/run/virtpatmat_typed.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_typed.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_typed.scala b/tests/pending/run/virtpatmat_typed.scala new file mode 100644 index 000000000000..bf12fd7a5cc5 --- /dev/null +++ b/tests/pending/run/virtpatmat_typed.scala @@ -0,0 +1,7 @@ +object Test extends dotty.runtime.LegacyApp { + ("foo": Any) match { + case x: Int => println("FAILED") + case x: String => println("OK "+ x) + case x: String => println("FAILED") + } +} diff --git a/tests/pending/run/virtpatmat_typetag.check b/tests/pending/run/virtpatmat_typetag.check new file mode 100644 index 000000000000..00df8b5e81b4 --- /dev/null +++ b/tests/pending/run/virtpatmat_typetag.check @@ -0,0 +1,10 @@ +1 is a Int +1 is a java.lang.Integer +1 is not a java.lang.String; it's a class java.lang.Integer +true is a Any +woele is a java.lang.String +1 is a Int +1 is a java.lang.Integer +1 is not a java.lang.String; it's a class java.lang.Integer +true is a Any +woele is a java.lang.String diff --git a/tests/pending/run/virtpatmat_typetag.flags b/tests/pending/run/virtpatmat_typetag.flags new file mode 100644 index 000000000000..e8fb65d50c20 --- /dev/null +++ b/tests/pending/run/virtpatmat_typetag.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_typetag.scala b/tests/pending/run/virtpatmat_typetag.scala new file mode 100644 index 000000000000..3654decda0f4 --- /dev/null +++ b/tests/pending/run/virtpatmat_typetag.scala @@ -0,0 +1,36 @@ +import reflect.{ClassTag, classTag} + +trait Extractors { + type T + implicit val tTag: ClassTag[T] + object ExtractT { + def unapply(x: T) = Some(x) + } + def apply(a: Any) = a match { + case ExtractT(x) => println(x +" is a "+ implicitly[ClassTag[T]]) + case _ => println(a+ " is not a "+ implicitly[ClassTag[T]] +"; it's a "+ a.getClass) + } +} + +object Test extends dotty.runtime.LegacyApp { + def typeMatch[T: ClassTag](a: Any) = a match { + case x : T => println(x +" is a "+ implicitly[ClassTag[T]]) + case _ => println(a+ " is not a "+ implicitly[ClassTag[T]] +"; it's a "+ a.getClass) + } + + // the same match as typeMatch, but using an extractor + def extractorMatch[S: ClassTag](a: Any) = + (new Extractors { type T = S; val tTag = classTag[T] })(a) + + typeMatch[Int](1) + typeMatch[Integer](1) + typeMatch[String](1) + typeMatch[Any](true) + typeMatch[String]("woele") + + extractorMatch[Int](1) + extractorMatch[Integer](1) + extractorMatch[String](1) + extractorMatch[Any](true) + extractorMatch[String]("woele") +} diff --git a/tests/pending/run/virtpatmat_unapply.check b/tests/pending/run/virtpatmat_unapply.check new file mode 100644 index 000000000000..2b89b77d1e92 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapply.check @@ -0,0 +1,2 @@ +1 +6 diff --git a/tests/pending/run/virtpatmat_unapply.flags b/tests/pending/run/virtpatmat_unapply.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapply.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_unapply.scala b/tests/pending/run/virtpatmat_unapply.scala new file mode 100644 index 000000000000..9915b8d924e5 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapply.scala @@ -0,0 +1,32 @@ +class IntList(val hd: Int, val tl: IntList) +object NilIL extends IntList(0, null) +object IntList { + def unapply(il: IntList): Option[(Int, IntList)] = if(il eq NilIL) None else Some(il.hd, il.tl) + def apply(x: Int, xs: IntList) = new IntList(x, xs) +} + +object Test extends dotty.runtime.LegacyApp { + IntList(1, IntList(2, NilIL)) match { + case IntList(a1, IntList(a2, IntList(a3, y))) => println(a1 + a2 + a3) + case IntList(x, y) => println(x) + } + + IntList(1, IntList(2, IntList(3, NilIL))) match { + case IntList(a1, IntList(a2, IntList(a3, y))) => println(a1 + a2 + a3) + case IntList(x, y) => println(x) + } +} + +// ((x1: IntList) => IntList.unapply(x1).flatMap(((x4: (Int, IntList)) => IntList.unapply(x4._2).flatMap(((x5: (Int, IntList)) => IntList.unapply(x5._2).flatMap(((x6: (Int, IntList)) => implicitly[Predef.MatchingStrategy[Option]].success(Predef.println(x4._1.+(x5._1).+(x6._1))))))))).orElse(IntList.unapply(x1).flatMap(((x7: (Int, IntList)) => implicitly[scala.Predef.MatchingStrategy[Option]].success(Predef.println(x7._1))))).orElse(implicitly[scala.Predef.MatchingStrategy[Option]].fail))(IntList.apply(1, IntList.apply(2, IntList.apply(3, null)))) + +/* + ((x1: IntList) => + IntList.this.unapply(x1).flatMap[Int](((x4: (Int, IntList)) => + IntList.this.unapply(x4._2).flatMap[Int](((x5: (Int, IntList)) => + IntList.this.unapply(x5._2).flatMap[Int](((x6: (Int, IntList)) => + Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).success[Int](x6._1))))))).orElse[Int]( + IntList.this.unapply(x1).flatMap[Int](((x7: (Int, IntList)) => + Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).success[Int](x7._1)))).orElse[Int]( + Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).fail) + ).apply(IntList.apply(1, null)) +*/ diff --git a/tests/pending/run/virtpatmat_unapplyprod.check b/tests/pending/run/virtpatmat_unapplyprod.check new file mode 100644 index 000000000000..2660ff8f96a2 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyprod.check @@ -0,0 +1,4 @@ +(2,3) +(2,3) +(2,3) +List(true, false, true) diff --git a/tests/pending/run/virtpatmat_unapplyprod.flags b/tests/pending/run/virtpatmat_unapplyprod.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyprod.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_unapplyprod.scala b/tests/pending/run/virtpatmat_unapplyprod.scala new file mode 100644 index 000000000000..773c6230d61a --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyprod.scala @@ -0,0 +1,23 @@ +object Test extends dotty.runtime.LegacyApp { + case class Foo(x: Int, y: String) + + Foo(2, "3") match { + case Foo(x, y) => println((x, y)) + } + + case class FooSeq(x: Int, y: String, z: Boolean*) + + FooSeq(2, "3") match { + case FooSeq(x, y) => println((x, y)) + } + + FooSeq(2, "3", true, false, true) match { + case FooSeq(x, y) => println("nope") + case FooSeq(x, y, true, false, true) => println((x, y)) + } + + FooSeq(1, "a", true, false, true) match { + case FooSeq(1, "a") => println("nope") + case FooSeq(1, "a", x:_* ) => println(x.toList) + } +} diff --git a/tests/pending/run/virtpatmat_unapplyseq.check b/tests/pending/run/virtpatmat_unapplyseq.check new file mode 100644 index 000000000000..62f9457511f8 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyseq.check @@ -0,0 +1 @@ +6 \ No newline at end of file diff --git a/tests/pending/run/virtpatmat_unapplyseq.flags b/tests/pending/run/virtpatmat_unapplyseq.flags new file mode 100644 index 000000000000..3f5a3100e469 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyseq.flags @@ -0,0 +1 @@ + -Xexperimental diff --git a/tests/pending/run/virtpatmat_unapplyseq.scala b/tests/pending/run/virtpatmat_unapplyseq.scala new file mode 100644 index 000000000000..e202c8d27205 --- /dev/null +++ b/tests/pending/run/virtpatmat_unapplyseq.scala @@ -0,0 +1,5 @@ +object Test extends dotty.runtime.LegacyApp { + List(1,2,3) match { + case Seq(x, y, z) => println(x * y * z) + } +} diff --git a/tests/pending/run/virtpatmat_valdef.check b/tests/pending/run/virtpatmat_valdef.check new file mode 100644 index 000000000000..1a45335bd288 --- /dev/null +++ b/tests/pending/run/virtpatmat_valdef.check @@ -0,0 +1 @@ +meh(true,null) diff --git a/tests/pending/run/virtpatmat_valdef.scala b/tests/pending/run/virtpatmat_valdef.scala new file mode 100644 index 000000000000..b3a89afc1971 --- /dev/null +++ b/tests/pending/run/virtpatmat_valdef.scala @@ -0,0 +1,6 @@ +object Test extends dotty.runtime.LegacyApp { + // patterns in valdefs... + // TODO: irrefutability should indicate we don't actually need to test, just deconstruct + val (modified, result) : (Boolean, String) = (true, null) + println("meh"+ (modified, result)) +} diff --git a/tests/pending/run/weakconform.scala b/tests/pending/run/weakconform.scala new file mode 100755 index 000000000000..e13390730d40 --- /dev/null +++ b/tests/pending/run/weakconform.scala @@ -0,0 +1,4 @@ +object Test extends dotty.runtime.LegacyApp { + val x: Float = 10/3 + assert(x == 3.0) +} diff --git a/tests/pending/run/withIndex.check b/tests/pending/run/withIndex.check new file mode 100644 index 000000000000..6a9c7aaadb7d --- /dev/null +++ b/tests/pending/run/withIndex.check @@ -0,0 +1,8 @@ +List((a,0), (b,1), (c,2)) +List((a,0), (b,1), (c,2)) +List((a,0), (b,1), (c,2)) +List((a,0), (b,1), (c,2)) +List() +List() +List() +List() diff --git a/tests/pending/run/withIndex.scala b/tests/pending/run/withIndex.scala new file mode 100644 index 000000000000..ebf1941c9595 --- /dev/null +++ b/tests/pending/run/withIndex.scala @@ -0,0 +1,29 @@ +object Test { + def main(args: Array[String]) = { + val ary: Array[String] = Array("a", "b", "c") + val lst: List[String] = List("a", "b", "c") + val itr: Iterator[String] = lst.iterator + val str: Stream[String] = lst.iterator.toStream + + Console.println(ary.zipWithIndex.toList) + Console.println(lst.zipWithIndex.toList) + Console.println(itr.zipWithIndex.toList) + Console.println(str.zipWithIndex.toList) + assert { + ary.zipWithIndex match { + case _: Array[Tuple2[_,_]] => true + case _ => false + } + } + + val emptyArray = new Array[String](0) + val emptyList: List[String] = Nil + val emptyIterator = emptyList.iterator + val emptyStream: Stream[String] = Stream.empty + + Console.println(emptyArray.zipWithIndex.toList) + Console.println(emptyList.zipWithIndex.toList) + Console.println(emptyIterator.zipWithIndex.toList) + Console.println(emptyStream.zipWithIndex.toList) + } +} diff --git a/tests/pending/run/xMigration.check b/tests/pending/run/xMigration.check new file mode 100644 index 000000000000..378f7bb6c3f1 --- /dev/null +++ b/tests/pending/run/xMigration.check @@ -0,0 +1,49 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> Map(1 -> "eis").values // no warn +res0: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration:none + +scala> Map(1 -> "eis").values // no warn +res1: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration:any + +scala> Map(1 -> "eis").values // warn +:8: warning: method values in trait MapLike has changed semantics in version 2.8.0: +`values` returns `Iterable[B]` rather than `Iterator[B]`. + Map(1 -> "eis").values // warn + ^ +res2: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration:2.8 + +scala> Map(1 -> "eis").values // no warn +res3: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration:2.7 + +scala> Map(1 -> "eis").values // warn +:8: warning: method values in trait MapLike has changed semantics in version 2.8.0: +`values` returns `Iterable[B]` rather than `Iterator[B]`. + Map(1 -> "eis").values // warn + ^ +res4: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration:2.11 + +scala> Map(1 -> "eis").values // no warn +res5: Iterable[String] = MapLike(eis) + +scala> :setting -Xmigration // same as :any + +scala> Map(1 -> "eis").values // warn +:8: warning: method values in trait MapLike has changed semantics in version 2.8.0: +`values` returns `Iterable[B]` rather than `Iterator[B]`. + Map(1 -> "eis").values // warn + ^ +res6: Iterable[String] = MapLike(eis) + +scala> :quit diff --git a/tests/pending/run/xMigration.scala b/tests/pending/run/xMigration.scala new file mode 100644 index 000000000000..688e8783972c --- /dev/null +++ b/tests/pending/run/xMigration.scala @@ -0,0 +1,19 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +Map(1 -> "eis").values // no warn +:setting -Xmigration:none +Map(1 -> "eis").values // no warn +:setting -Xmigration:any +Map(1 -> "eis").values // warn +:setting -Xmigration:2.8 +Map(1 -> "eis").values // no warn +:setting -Xmigration:2.7 +Map(1 -> "eis").values // warn +:setting -Xmigration:2.11 +Map(1 -> "eis").values // no warn +:setting -Xmigration // same as :any +Map(1 -> "eis").values // warn + """ +} diff --git a/tests/run/byNameVarargs/i499.scala b/tests/run/byNameVarargs/i499.scala index be40ead50952..e1550b6ec659 100644 --- a/tests/run/byNameVarargs/i499.scala +++ b/tests/run/byNameVarargs/i499.scala @@ -1,16 +1,15 @@ -object Test { +object Test extends dotty.runtime.LegacyApp{ def foo(a: => Any*) = () def bar(a: => Any*) = foo(a : _*) def baz(a: => Seq[Any]) = foo(a : _*) bar(???, ???) baz(Seq(???, ???)) - baz(Array(???, ???)) - def foo1(a => Any, b: => Any*) = () + def foo1(a: => Any, b: => Any*) = () foo1(???) foo1(???, ???, ???) - def assertFails(a => Any) = { + def assertFails(a: => Any) = { var failed = false try { a