diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala index 5e9d0d8f2a03..f3a3c1fc452f 100644 --- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala +++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala @@ -2,7 +2,7 @@ package dotty.tools package dotc package reporting -import java.io.{ PrintStream, PrintWriter, File => JFile, FileOutputStream } +import java.io.{ PrintStream, PrintWriter, File => JFile, FileOutputStream, StringWriter } import java.text.SimpleDateFormat import java.util.Date import core.Decorators._ @@ -26,6 +26,10 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M protected final val _messageBuf = mutable.ArrayBuffer.empty[String] final def messages: Iterator[String] = _messageBuf.iterator + protected final val _consoleBuf = new StringWriter + protected final val _consoleReporter = new ConsoleReporter(null, new PrintWriter(_consoleBuf)) + final def consoleOutput: String = _consoleBuf.toString + private[this] var _didCrash = false final def compilerCrashed: Boolean = _didCrash @@ -63,6 +67,7 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M } override def doReport(m: MessageContainer)(implicit ctx: Context): Unit = { + // Here we add extra information that we should know about the error message val extra = m.contained() match { case pm: PatternMatchExhaustivity => s": ${pm.uncovered}" @@ -72,6 +77,7 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M m match { case m: Error => { _errorBuf.append(m) + _consoleReporter.doReport(m) printMessageAndPos(m, extra) } case m => diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index d657670c876f..ca5ec01ed261 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -58,7 +58,7 @@ trait ParallelTesting extends RunnerOrchestration { self => def flags: TestFlags def sourceFiles: Array[JFile] - def runClassPath: String = outDir.getAbsolutePath + JFile.pathSeparator + flags.runClassPath + def runClassPath: String = outDir.getPath + JFile.pathSeparator + flags.runClassPath def title: String = self match { case self: JointCompilationSource => @@ -86,16 +86,18 @@ trait ParallelTesting extends RunnerOrchestration { self => val sb = new StringBuilder val maxLen = 80 var lineLen = 0 + val delimiter = " " sb.append( s"""| |Test '$title' compiled with $errors error(s) and $warnings warning(s), - |the test can be reproduced by running:""".stripMargin + |the test can be reproduced by running from SBT (prefix it with ./bin/ if you + |want to run from the command line):""".stripMargin ) - sb.append("\n\n./bin/dotc ") + sb.append("\n\ndotc ") flags.all.foreach { arg => if (lineLen > maxLen) { - sb.append(" \\\n ") + sb.append(delimiter) lineLen = 4 } sb.append(arg) @@ -105,8 +107,8 @@ trait ParallelTesting extends RunnerOrchestration { self => self match { case source: JointCompilationSource => { - source.sourceFiles.map(_.getAbsolutePath).foreach { path => - sb.append("\\\n ") + source.sourceFiles.map(_.getPath).foreach { path => + sb.append(delimiter) sb.append(path) sb += ' ' } @@ -117,7 +119,7 @@ trait ParallelTesting extends RunnerOrchestration { self => val fsb = new StringBuilder(command) self.compilationGroups.foreach { files => files.map(_.getPath).foreach { path => - fsb.append("\\\n ") + fsb.append(delimiter) lineLen = 8 fsb.append(path) fsb += ' ' @@ -215,21 +217,20 @@ trait ParallelTesting extends RunnerOrchestration { self => */ final def checkFile(testSource: TestSource): Option[JFile] = (testSource match { case ts: JointCompilationSource => - ts.files.collectFirst { case f if !f.isDirectory => new JFile(f.getAbsolutePath.replaceFirst("\\.scala$", ".check")) } + ts.files.collectFirst { case f if !f.isDirectory => new JFile(f.getPath.replaceFirst("\\.scala$", ".check")) } case ts: SeparateCompilationSource => - Option(new JFile(ts.dir.getAbsolutePath + ".check")) + Option(new JFile(ts.dir.getPath + ".check")) }).filter(_.exists) /** * Checks if the given actual lines are the same as the ones in the check file. * If not, fails the test. */ - final def diffTest(testSource: TestSource, checkFile: JFile, actual: List[String]) = { + final def diffTest(testSource: TestSource, checkFile: JFile, actual: List[String], reporters: Seq[TestReporter], logger: LoggedRunnable) = { val expected = Source.fromFile(checkFile, "UTF-8").getLines().toList for (msg <- diffMessage(testSource.title, actual, expected)) { - echo(msg) - failTestSource(testSource) + onFailure(testSource, reporters, logger, Some(msg)) dumpOutputToFile(checkFile, actual) } } @@ -318,9 +319,9 @@ trait ParallelTesting extends RunnerOrchestration { self => if (!testFilter.isDefined) testSources else testSources.filter { case JointCompilationSource(_, files, _, _, _, _) => - files.exists(file => file.getAbsolutePath.contains(testFilter.get)) + files.exists(file => file.getPath.contains(testFilter.get)) case SeparateCompilationSource(_, dir, _, _) => - dir.getAbsolutePath.contains(testFilter.get) + dir.getPath.contains(testFilter.get) } /** Total amount of test sources being compiled by this test */ @@ -422,9 +423,8 @@ trait ParallelTesting extends RunnerOrchestration { self => } protected def compile(files0: Array[JFile], flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = { - - val flags = flags0.and("-d", targetDir.getAbsolutePath) - .withClasspath(targetDir.getAbsolutePath) + val flags = flags0.and("-d", targetDir.getPath) + .withClasspath(targetDir.getPath) def flattenFiles(f: JFile): Array[JFile] = if (f.isDirectory) f.listFiles.flatMap(flattenFiles) @@ -468,10 +468,10 @@ trait ParallelTesting extends RunnerOrchestration { self => // If a test contains a Java file that cannot be parsed by Dotty's Java source parser, its // name must contain the string "JAVA_ONLY". - val dottyFiles = files.filterNot(_.getName.contains("JAVA_ONLY")).map(_.getAbsolutePath) + val dottyFiles = files.filterNot(_.getName.contains("JAVA_ONLY")).map(_.getPath) driver.process(allArgs ++ dottyFiles, reporter = reporter) - val javaFiles = files.filter(_.getName.endsWith(".java")).map(_.getAbsolutePath) + val javaFiles = files.filter(_.getName.endsWith(".java")).map(_.getPath) val javaErrors = compileWithJavac(javaFiles) if (javaErrors.isDefined) { @@ -485,7 +485,7 @@ trait ParallelTesting extends RunnerOrchestration { self => protected def compileFromTasty(flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = { val tastyOutput = new JFile(targetDir.getPath + "_from-tasty") tastyOutput.mkdir() - val flags = flags0 and ("-d", tastyOutput.getAbsolutePath) and "-from-tasty" + val flags = flags0 and ("-d", tastyOutput.getPath) and "-from-tasty" def tastyFileToClassName(f: JFile): String = { val pathStr = targetDir.toPath.relativize(f.toPath).toString.replace(JFile.separatorChar, '.') @@ -609,11 +609,11 @@ trait ParallelTesting extends RunnerOrchestration { self => } } - private def verifyOutput(checkFile: Option[JFile], dir: JFile, testSource: TestSource, warnings: Int) = { + private def verifyOutput(checkFile: Option[JFile], dir: JFile, testSource: TestSource, warnings: Int, reporters: Seq[TestReporter], logger: LoggedRunnable) = { if (Properties.testsNoRun) addNoRunWarning() else runMain(testSource.runClassPath) match { case Success(output) => checkFile match { - case Some(file) if file.exists => diffTest(testSource, file, output.linesIterator.toList) + case Some(file) if file.exists => diffTest(testSource, file, output.linesIterator.toList, reporters, logger) case _ => } case Failure(output) => @@ -627,7 +627,7 @@ trait ParallelTesting extends RunnerOrchestration { self => } override def onSuccess(testSource: TestSource, reporters: Seq[TestReporter], logger: LoggedRunnable) = - verifyOutput(checkFile(testSource), testSource.outDir, testSource, countWarnings(reporters)) + verifyOutput(checkFile(testSource), testSource.outDir, testSource, countWarnings(reporters), reporters, logger) } private final class NegTest(testSources: List[TestSource], times: Int, threadLimit: Option[Int], suppressAllOutput: Boolean)(implicit summaryReport: SummaryReporting) @@ -649,11 +649,10 @@ trait ParallelTesting extends RunnerOrchestration { self => } override def onSuccess(testSource: TestSource, reporters: Seq[TestReporter], logger: LoggedRunnable): Unit = - checkFile(testSource).foreach(diffTest(testSource, _, reporterOutputLines(reporters))) + checkFile(testSource).foreach(diffTest(testSource, _, reporterOutputLines(reporters), reporters, logger)) def reporterOutputLines(reporters: Seq[TestReporter]): List[String] = - reporters.flatMap(_.allErrors).sortBy(_.pos.source.toString).flatMap { error => - (error.pos.span.toString + " in " + error.pos.source.file.name) :: error.getMessage().linesIterator.toList }.toList + reporters.flatMap(_.consoleOutput.split("\n")).toList // In neg-tests we allow two types of error annotations, // "nopos-error" which doesn't care about position and "error" which @@ -668,7 +667,7 @@ trait ParallelTesting extends RunnerOrchestration { self => Source.fromFile(file, "UTF-8").getLines().zipWithIndex.foreach { case (line, lineNbr) => val errors = line.sliding("// error".length).count(_.mkString == "// error") if (errors > 0) - errorMap.put(s"${file.getAbsolutePath}:${lineNbr}", errors) + errorMap.put(s"${file.getPath}:${lineNbr}", errors) val noposErrors = line.sliding("// nopos-error".length).count(_.mkString == "// nopos-error") if (noposErrors > 0) { @@ -686,7 +685,9 @@ trait ParallelTesting extends RunnerOrchestration { self => def getMissingExpectedErrors(errorMap: HashMap[String, Integer], reporterErrors: Iterator[MessageContainer]) = !reporterErrors.forall { error => val key = if (error.pos.exists) { - val fileName = error.pos.source.file.toString + def toRelative(path: String): String = // For some reason, absolute paths leak from the compiler itself... + path.split("/").dropWhile(_ != "tests").mkString("/") + val fileName = toRelative(error.pos.source.file.toString) s"$fileName:${error.pos.line}" } else "nopos" @@ -715,16 +716,11 @@ trait ParallelTesting extends RunnerOrchestration { self => def linesMatch = (outputLines, checkLines).zipped.forall(_ == _) - if (outputLines.length != checkLines.length || !linesMatch) { - // Print diff to files and summary: - val diff = DiffUtil.mkColoredLineDiff(checkLines :+ DiffUtil.EOF, outputLines :+ DiffUtil.EOF) - - Some( - s"""|Output from '$sourceTitle' did not match check file. - |Diff (expected on the left, actual right): - |""".stripMargin + diff + "\n") - } else None - + if (outputLines.length != checkLines.length || !linesMatch) Some( + s"""|Output from '$sourceTitle' did not match check file. Actual output: + |${outputLines.mkString(EOL)} + |""".stripMargin + "\n") + else None } /** The `CompilationTest` is the main interface to `ParallelTesting`, it @@ -943,7 +939,7 @@ trait ParallelTesting extends RunnerOrchestration { self => * and if so copying recursively */ private def copyToDir(dir: JFile, file: JFile): JFile = { - val target = Paths.get(dir.getAbsolutePath, file.getName) + val target = Paths.get(dir.getPath, file.getName) Files.copy(file.toPath, target, REPLACE_EXISTING) if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _)) target.toFile @@ -1221,7 +1217,7 @@ trait ParallelTesting extends RunnerOrchestration { self => val (dirs, files) = compilationTargets(sourceDir, fromTastyFilter) val filteredFiles = testFilter match { - case Some(str) => files.filter(_.getAbsolutePath.contains(str)) + case Some(str) => files.filter(_.getPath.contains(str)) case None => files } diff --git a/docs/docs/contributing/testing.md b/docs/docs/contributing/testing.md index c12f3fe0eac3..eaa0fd95ec25 100644 --- a/docs/docs/contributing/testing.md +++ b/docs/docs/contributing/testing.md @@ -54,6 +54,30 @@ You can also run all paths of classes of a certain name: > testOnly *.TreeTransformerTest ``` +### Testing with checkfiles +Some tests support checking the output of the run or the compilation against a checkfile. A checkfile is a file in which the expected output of the compilation or run is defined. A test against a checkfile fails if the actual output mismatches the expected output. + +Currently, the `run` and `neg` (compilation must fail for the test to succeed) tests support the checkfiles. `run`'s checkfiles contain an expected run output of the successfully compiled program. `neg`'s checkfiles contain an expected error output during compilation. + +Absence of a checkfile is **not** a condition for the test failure. E.g. if a `neg` test fails with the expected number of errors and there is no checkfile for it, the test still passes. + +Checkfiles are located in the same directories as the tests they check, have the same name as these tests with the extension `*.check`. E.g. if you have a test named `tests/neg/foo.scala`, you can create a checkfile for it named `tests/neg/foo.check`. And if you have a test composed of several files in a single directory, e.g. `tests/neg/manyScalaFiles`, the checkfile will be `tests/neg/manyScalaFiles.check`. + +If the actual output mismatches the expected output, the test framework will dump the actual output in the file `*.check.out` and fail the test suite. It will also output the instructions to quickly replace the expected output with the actual output, in the following format: + +``` +Test output dumped in: tests/playground/neg/Sample.check.out + See diff of the checkfile + > diff tests/playground/neg/Sample.check tests/playground/neg/Sample.check.out + Replace checkfile with current output output + > mv tests/playground/neg/Sample.check.out tests/playground/neg/Sample.check +``` + +To create a checkfile for a test, you can do one of the following: + +- Create a dummy checkfile with a random content, run the test, and, when it fails, use the `mv` command reported by the test to replace the dummy checkfile with the actual output. +- Manually compile the file you are testing with `dotc` and copy-paste whatever console output the compiler produces to the checkfile. + ## Integration tests These tests are Scala source files expected to compile with Dotty (pos tests), along with their expected output (run tests) or errors (neg tests). diff --git a/tests/neg-macros/i6432.check b/tests/neg-macros/i6432.check index 8a630dcd0084..706bfe7bae52 100644 --- a/tests/neg-macros/i6432.check +++ b/tests/neg-macros/i6432.check @@ -1,6 +1,16 @@ -[61..64] in Test_2.scala -fgh -[50..53] in Test_2.scala -xyz -[39..42] in Test_2.scala -abc + +-- Error: tests/neg-macros/i6432/Test_2.scala:4:6 ---------------------------------------------------------------------- +4 | foo"abc${"123"}xyz${"456"}fgh" // error // error // error + | ^^^ + | abc + | This location is in code that was inlined at Test_2.scala:4 +-- Error: tests/neg-macros/i6432/Test_2.scala:4:17 --------------------------------------------------------------------- +4 | foo"abc${"123"}xyz${"456"}fgh" // error // error // error + | ^^^ + | xyz + | This location is in code that was inlined at Test_2.scala:4 +-- Error: tests/neg-macros/i6432/Test_2.scala:4:28 --------------------------------------------------------------------- +4 | foo"abc${"123"}xyz${"456"}fgh" // error // error // error + | ^^^ + | fgh + | This location is in code that was inlined at Test_2.scala:4 diff --git a/tests/neg-macros/i6432b.check b/tests/neg-macros/i6432b.check index b3be0d77108d..a0f8a64b2dc9 100644 --- a/tests/neg-macros/i6432b.check +++ b/tests/neg-macros/i6432b.check @@ -1,6 +1,16 @@ -[63..66] in Test_2.scala -fgh -[52..55] in Test_2.scala -xyz -[41..44] in Test_2.scala -abc + +-- Error: tests/neg-macros/i6432b/Test_2.scala:4:8 --------------------------------------------------------------------- +4 | foo"""abc${"123"}xyz${"456"}fgh""" // error // error // error + | ^^^ + | abc + | This location is in code that was inlined at Test_2.scala:4 +-- Error: tests/neg-macros/i6432b/Test_2.scala:4:19 -------------------------------------------------------------------- +4 | foo"""abc${"123"}xyz${"456"}fgh""" // error // error // error + | ^^^ + | xyz + | This location is in code that was inlined at Test_2.scala:4 +-- Error: tests/neg-macros/i6432b/Test_2.scala:4:30 -------------------------------------------------------------------- +4 | foo"""abc${"123"}xyz${"456"}fgh""" // error // error // error + | ^^^ + | fgh + | This location is in code that was inlined at Test_2.scala:4 diff --git a/tests/neg/classOf.check b/tests/neg/classOf.check index b8416e4007e3..ef20b642d88c 100644 --- a/tests/neg/classOf.check +++ b/tests/neg/classOf.check @@ -1,8 +1,14 @@ -[181..202] in classOf.scala -Test.C{I = String} is not a class type -[116..117] in classOf.scala -T is not a class type - -where: T is a type in method f2 with bounds <: String -[72..73] in classOf.scala -T is not a class type +-- Error: tests/neg/classOf.scala:6:22 --------------------------------------------------------------------------------- +6 | def f1[T] = classOf[T] // error + | ^ + | T is not a class type +-- Error: tests/neg/classOf.scala:7:32 --------------------------------------------------------------------------------- +7 | def f2[T <: String] = classOf[T] // error + | ^ + | T is not a class type + | + | where: T is a type in method f2 with bounds <: String +-- Error: tests/neg/classOf.scala:9:18 --------------------------------------------------------------------------------- +9 | val y = classOf[C { type I = String }] // error + | ^^^^^^^^^^^^^^^^^^^^^ + | Test.C{I = String} is not a class type diff --git a/tests/neg/doubleDefinition.check b/tests/neg/doubleDefinition.check index 840b4591c6b2..d9688b1370a4 100644 --- a/tests/neg/doubleDefinition.check +++ b/tests/neg/doubleDefinition.check @@ -1,94 +1,138 @@ -<2471..2471> in doubleDefinition.scala -Double definition: -def foo: [T <: Int](x: T): T in class Test20 at line 143 and -def foo: [S <: Int, T <: Int](x: S): T in class Test20 at line 144 -have the same type after erasure. -<2338..2338> in doubleDefinition.scala -Double definition: -def foo: [T <: Int](x: T): T in class Test19 at line 137 and -def foo(x: Int): Int in class Test19 at line 138 -have the same type after erasure. -<2016..2016> in doubleDefinition.scala -Double definition: -var foo: Int in class Test16 at line 115 and -def foo: => Int in class Test16 at line 116 -<1949..1949> in doubleDefinition.scala -Double definition: -var foo: Int in class Test15 at line 111 and -def foo: => String in class Test15 at line 112 -<1885..1885> in doubleDefinition.scala -Double definition: -var foo: Int in class Test14 at line 107 and -def foo: => Int in class Test14 at line 108 -<1827..1827> in doubleDefinition.scala -Double definition: -var foo: Int in class Test13 at line 103 and -def foo: => String in class Test13 at line 104 -<1772..1772> in doubleDefinition.scala -Double definition: -val foo: Int in class Test12 at line 99 and -def foo: => Int in class Test12 at line 100 -<1705..1705> in doubleDefinition.scala -Double definition: -val foo: Int in class Test11 at line 95 and -def foo: => String in class Test11 at line 96 -<1641..1641> in doubleDefinition.scala -Double definition: -val foo: Int in class Test10 at line 91 and -def foo: => Int in class Test10 at line 92 -<1583..1583> in doubleDefinition.scala -Double definition: -val foo: Int in class Test9 at line 87 and -def foo: => String in class Test9 at line 88 -<1481..1481> in doubleDefinition.scala -Double definition: -var foo: Int in class Test8d at line 81 and -def foo: => Int in class Test8d at line 82 -<1428..1428> in doubleDefinition.scala -Double definition: -def foo: => Int in class Test8c at line 76 and -var foo: Int in class Test8c at line 77 -<1375..1375> in doubleDefinition.scala -Double definition: -def foo: => Int in class Test8b at line 71 and -val foo: Int in class Test8b at line 72 -<1322..1322> in doubleDefinition.scala -Double definition: -val foo: Int in class Test8 at line 66 and -def foo: => Int in class Test8 at line 67 -<1236..1236> in doubleDefinition.scala -Double definition: -def foo(x: List[A]): A => A in trait Test7 at line 61 and -def foo(x: List[A]): (B, B) => B in trait Test7 at line 62 -have matching parameter types. -<984..984> in doubleDefinition.scala -Double definition: -def foo(x: List[A]): A => A in trait Test6 at line 54 and -def foo(x: List[B]): B => B in trait Test6 at line 55 -have the same type after erasure. -<739..739> in doubleDefinition.scala -Double definition: -var foo: Int in class Test4d at line 40 and -def foo: => Int in class Test4d at line 41 -<686..686> in doubleDefinition.scala -Double definition: -def foo: => Int in class Test4c at line 35 and -var foo: Int in class Test4c at line 36 -<633..633> in doubleDefinition.scala -Double definition: -def foo: => Int in class Test4b at line 30 and -val foo: Int in class Test4b at line 31 -<580..580> in doubleDefinition.scala -Double definition: -val foo: Int in class Test4 at line 25 and -def foo: => Int in class Test4 at line 26 -<494..494> in doubleDefinition.scala -Double definition: -def foo(x: List[A]): A => A in class Test3 at line 20 and -def foo(x: List[A]): (B, B) => B in class Test3 at line 21 -have matching parameter types. -<242..242> in doubleDefinition.scala -Double definition: -def foo(x: List[A]): A => A in class Test2 at line 13 and -def foo(x: List[B]): B => B in class Test2 at line 14 -have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:14:4 ------------------------------------------------ +14 | def foo(x: List[B]): Function1[B, B] = ??? // error: same jvm signature + | ^ + | Double definition: + | def foo(x: List[A]): A => A in class Test2 at line 13 and + | def foo(x: List[B]): B => B in class Test2 at line 14 + | have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:21:4 ------------------------------------------------ +21 | def foo(x: List[A]): Function2[B, B, B] = ??? // error + | ^ + | Double definition: + | def foo(x: List[A]): A => A in class Test3 at line 20 and + | def foo(x: List[A]): (B, B) => B in class Test3 at line 21 + | have matching parameter types. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:26:4 ------------------------------------------------ +26 | def foo = 2 // error + | ^ + | Double definition: + | val foo: Int in class Test4 at line 25 and + | def foo: => Int in class Test4 at line 26 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:31:4 ------------------------------------------------ +31 | val foo = 1 // error + | ^ + | Double definition: + | def foo: => Int in class Test4b at line 30 and + | val foo: Int in class Test4b at line 31 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:36:4 ------------------------------------------------ +36 | var foo = 1 // error + | ^ + | Double definition: + | def foo: => Int in class Test4c at line 35 and + | var foo: Int in class Test4c at line 36 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:41:4 ------------------------------------------------ +41 | def foo = 2 // error + | ^ + | Double definition: + | var foo: Int in class Test4d at line 40 and + | def foo: => Int in class Test4d at line 41 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:55:4 ------------------------------------------------ +55 | def foo(x: List[B]): Function1[B, B] = ??? // error: same jvm signature + | ^ + | Double definition: + | def foo(x: List[A]): A => A in trait Test6 at line 54 and + | def foo(x: List[B]): B => B in trait Test6 at line 55 + | have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:62:4 ------------------------------------------------ +62 | def foo(x: List[A]): Function2[B, B, B] = ??? // error + | ^ + | Double definition: + | def foo(x: List[A]): A => A in trait Test7 at line 61 and + | def foo(x: List[A]): (B, B) => B in trait Test7 at line 62 + | have matching parameter types. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:67:4 ------------------------------------------------ +67 | def foo = 2 // error + | ^ + | Double definition: + | val foo: Int in class Test8 at line 66 and + | def foo: => Int in class Test8 at line 67 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:72:4 ------------------------------------------------ +72 | val foo = 1 // error + | ^ + | Double definition: + | def foo: => Int in class Test8b at line 71 and + | val foo: Int in class Test8b at line 72 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:77:4 ------------------------------------------------ +77 | var foo = 1 // error + | ^ + | Double definition: + | def foo: => Int in class Test8c at line 76 and + | var foo: Int in class Test8c at line 77 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:82:4 ------------------------------------------------ +82 | def foo = 2 // error + | ^ + | Double definition: + | var foo: Int in class Test8d at line 81 and + | def foo: => Int in class Test8d at line 82 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:88:4 ------------------------------------------------ +88 | def foo: String // error + | ^ + | Double definition: + | val foo: Int in class Test9 at line 87 and + | def foo: => String in class Test9 at line 88 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:92:4 ------------------------------------------------ +92 | def foo: Int // error + | ^ + | Double definition: + | val foo: Int in class Test10 at line 91 and + | def foo: => Int in class Test10 at line 92 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:96:4 ------------------------------------------------ +96 | def foo: String // error + | ^ + | Double definition: + | val foo: Int in class Test11 at line 95 and + | def foo: => String in class Test11 at line 96 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:100:4 ----------------------------------------------- +100 | def foo: Int // error + | ^ + | Double definition: + | val foo: Int in class Test12 at line 99 and + | def foo: => Int in class Test12 at line 100 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:104:4 ----------------------------------------------- +104 | def foo: String // error + | ^ + | Double definition: + | var foo: Int in class Test13 at line 103 and + | def foo: => String in class Test13 at line 104 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:108:4 ----------------------------------------------- +108 | def foo: Int // error + | ^ + | Double definition: + | var foo: Int in class Test14 at line 107 and + | def foo: => Int in class Test14 at line 108 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:112:4 ----------------------------------------------- +112 | def foo: String // error + | ^ + | Double definition: + | var foo: Int in class Test15 at line 111 and + | def foo: => String in class Test15 at line 112 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:116:4 ----------------------------------------------- +116 | def foo: Int // error + | ^ + | Double definition: + | var foo: Int in class Test16 at line 115 and + | def foo: => Int in class Test16 at line 116 +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:138:6 ----------------------------------------------- +138 | def foo(x: Int): Int = x // error + | ^ + | Double definition: + | def foo: [T <: Int](x: T): T in class Test19 at line 137 and + | def foo(x: Int): Int in class Test19 at line 138 + | have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/doubleDefinition.scala:144:6 ----------------------------------------------- +144 | def foo[S <: Int, T <: Int](x: S): T = ??? // error + | ^ + | Double definition: + | def foo: [T <: Int](x: T): T in class Test20 at line 143 and + | def foo: [S <: Int, T <: Int](x: S): T in class Test20 at line 144 + | have the same type after erasure. diff --git a/tests/neg/exports.check b/tests/neg/exports.check index b5fd10abb817..f3dc4fcde8ce 100644 --- a/tests/neg/exports.check +++ b/tests/neg/exports.check @@ -1,29 +1,49 @@ -<1150..1150> in exports.scala -Cyclic reference involving value bar -[1091..1094] in exports.scala -no eligible member foo at this.foo -this.foo.foo cannot be exported because it is already a member of class Foo -[991..997] in exports.scala -no eligible member concat at this -this.concat cannot be exported because it is already a member of trait IterableOps -<647..647> in exports.scala -Double definition: -final def status: => List[String] in class Copier at line 23 and -final def status: => List[String] in class Copier at line 24 -have the same type after erasure. -<596..596> in exports.scala -Double definition: -def status: => List[String] in class Copier at line 28 and -final def status: => List[String] in class Copier at line 23 -have the same type after erasure. -[785..791] in exports.scala -no eligible member status at this.printUnit -this.printUnit.status cannot be exported because it is not implied -[712..718] in exports.scala -no eligible member bitmap at this.printUnit -this.printUnit.bitmap cannot be exported because it is implied -[518..525] in exports.scala -no eligible member scanAll at this.scanUnit -this.scanUnit.scanAll cannot be exported because it is not accessible -[452..458] in exports.scala -no eligible member scanIt at this.scanUnit +-- Error: tests/neg/exports.scala:21:20 -------------------------------------------------------------------------------- +21 | export scanUnit.scanIt // error: no eligible member + | ^^^^^^ + | no eligible member scanIt at this.scanUnit +-- Error: tests/neg/exports.scala:22:21 -------------------------------------------------------------------------------- +22 | export scanUnit.{scanAll => foo} // error: no eligible member + | ^^^^^^^ + | no eligible member scanAll at this.scanUnit + | this.scanUnit.scanAll cannot be exported because it is not accessible +-- Error: tests/neg/exports.scala:25:21 -------------------------------------------------------------------------------- +25 | export printUnit.bitmap // error: no eligible member + | ^^^^^^ + | no eligible member bitmap at this.printUnit + | this.printUnit.bitmap cannot be exported because it is implied +-- Error: tests/neg/exports.scala:26:29 -------------------------------------------------------------------------------- +26 | export implied printUnit.status // error: no eligible member + | ^^^^^^ + | no eligible member status at this.printUnit + | this.printUnit.status cannot be exported because it is not implied +-- [E120] Duplicate Symbol Error: tests/neg/exports.scala:23:33 -------------------------------------------------------- +23 | export printUnit.{stat => _, _} // error: double definition + | ^ + | Double definition: + | def status: => List[String] in class Copier at line 28 and + | final def status: => List[String] in class Copier at line 23 + | have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/exports.scala:24:20 -------------------------------------------------------- +24 | export scanUnit._ // error: double definition + | ^ + | Double definition: + | final def status: => List[String] in class Copier at line 23 and + | final def status: => List[String] in class Copier at line 24 + | have the same type after erasure. +-- Error: tests/neg/exports.scala:35:15 -------------------------------------------------------------------------------- +35 | export this.{concat => ++} // error: no eligible member + | ^^^^^^ + | no eligible member concat at this + | this.concat cannot be exported because it is already a member of trait IterableOps +-- Error: tests/neg/exports.scala:41:13 -------------------------------------------------------------------------------- +41 | export foo.foo // error: no eligible member + | ^^^ + | no eligible member foo at this.foo + | this.foo.foo cannot be exported because it is already a member of class Foo +-- [E046] Cyclic Error: tests/neg/exports.scala:45:11 ------------------------------------------------------------------ +45 | val bar: Bar = new Bar // error: cyclic reference + | ^ + | Cyclic reference involving value bar + +longer explanation available when compiling with `-explain` diff --git a/tests/neg/i4382.check b/tests/neg/i4382.check index a87e463fed5d..24a47d0c6073 100644 --- a/tests/neg/i4382.check +++ b/tests/neg/i4382.check @@ -1,8 +1,16 @@ -[199..207] in i4382.scala -unreducible application of higher-kinded type App.HkAbs to wildcard arguments -[149..155] in i4382.scala -unreducible application of higher-kinded type App.HkU to wildcard arguments -[97..103] in i4382.scala -unreducible application of higher-kinded type App.HkL to wildcard arguments -[46..51] in i4382.scala -unreducible application of higher-kinded type App.Id to wildcard arguments +-- Error: tests/neg/i4382.scala:3:10 ----------------------------------------------------------------------------------- +3 | def v1: Id[_] = ??? // error + | ^^^^^ + | unreducible application of higher-kinded type App.Id to wildcard arguments +-- Error: tests/neg/i4382.scala:6:10 ----------------------------------------------------------------------------------- +6 | def v2: HkL[_] = ??? // error + | ^^^^^^ + | unreducible application of higher-kinded type App.HkL to wildcard arguments +-- Error: tests/neg/i4382.scala:9:10 ----------------------------------------------------------------------------------- +9 | def v3: HkU[_] = ??? // error + | ^^^^^^ + | unreducible application of higher-kinded type App.HkU to wildcard arguments +-- Error: tests/neg/i4382.scala:12:10 ---------------------------------------------------------------------------------- +12 | def v4: HkAbs[_] = ??? // error + | ^^^^^^^^ + | unreducible application of higher-kinded type App.HkAbs to wildcard arguments diff --git a/tests/neg/i5101.check b/tests/neg/i5101.check index dfe51df9182e..32bbfd7d8fd5 100644 --- a/tests/neg/i5101.check +++ b/tests/neg/i5101.check @@ -1,2 +1,6 @@ -[137..139..142] in i5101.scala -Not found: A0 +-- [E006] Unbound Identifier Error: tests/neg/i5101.scala:11:13 -------------------------------------------------------- +11 | case A0(_) => // error + | ^^^^^ + | Not found: A0 + +longer explanation available when compiling with `-explain` diff --git a/tests/neg/i5311.check b/tests/neg/i5311.check index cf64b5e2ab44..b363e5e870e6 100644 --- a/tests/neg/i5311.check +++ b/tests/neg/i5311.check @@ -1,3 +1,5 @@ -<267..267> in i5311.scala -Found: s.T[Int] => s.T[Int] -Required: m.Foo +-- [E007] Type Mismatch Error: tests/neg/i5311.scala:11:27 ------------------------------------------------------------- +11 | baz((x : s.T[Int]) => x) // error + | ^ + | Found: s.T[Int] => s.T[Int] + | Required: m.Foo diff --git a/tests/neg/i5433.check b/tests/neg/i5433.check index 32df8fc58c8b..47fee9734bb6 100644 --- a/tests/neg/i5433.check +++ b/tests/neg/i5433.check @@ -1,26 +1,28 @@ -<298..298> in i5433.scala -class Fail cannot be defined due to a conflict between its parents when -implementing a super-accessor for foo in trait C: - -1. One of its parent (C) contains a call super.foo in its body, - and when a super-call in a trait is written without an explicit parent - listed in brackets, it is implemented by a generated super-accessor in - the class that extends this trait based on the linearization order of - the class. -2. Because B comes before C in the linearization - order of Fail, and because B overrides foo, - the super-accessor in Fail is implemented as a call to - super[B].foo. -3. However, - X (the type of super[B].foo in Fail) - is not a subtype of - Y (the type of foo in trait C). - Hence, the super-accessor that needs to be generated in Fail - is illegal. - -Here are two possible ways to resolve this: - -1. Change the linearization order of Fail such that - C comes before B. -2. Alternatively, replace super.foo in the body of trait C by a - super-call to a specific parent, e.g. super[A].foo +-- [E137] Reference Error: tests/neg/i5433.scala:17:6 ------------------------------------------------------------------ +17 |class Fail extends B with C // error + | ^ + | class Fail cannot be defined due to a conflict between its parents when + | implementing a super-accessor for foo in trait C: + | + | 1. One of its parent (C) contains a call super.foo in its body, + | and when a super-call in a trait is written without an explicit parent + | listed in brackets, it is implemented by a generated super-accessor in + | the class that extends this trait based on the linearization order of + | the class. + | 2. Because B comes before C in the linearization + | order of Fail, and because B overrides foo, + | the super-accessor in Fail is implemented as a call to + | super[B].foo. + | 3. However, + | X (the type of super[B].foo in Fail) + | is not a subtype of + | Y (the type of foo in trait C). + | Hence, the super-accessor that needs to be generated in Fail + | is illegal. + | + | Here are two possible ways to resolve this: + | + | 1. Change the linearization order of Fail such that + | C comes before B. + | 2. Alternatively, replace super.foo in the body of trait C by a + | super-call to a specific parent, e.g. super[A].foo diff --git a/tests/neg/kinds2.check b/tests/neg/kinds2.check index f31eb74f9aa9..7f9f3b20e0bc 100644 --- a/tests/neg/kinds2.check +++ b/tests/neg/kinds2.check @@ -1,2 +1,4 @@ -[123..124] in kinds2.scala -missing type parameter(s) for C +-- Error: tests/neg/kinds2.scala:14:4 ---------------------------------------------------------------------------------- +14 | f[C] // error: missing type parameter(s) + | ^ + | missing type parameter(s) for C diff --git a/tests/neg/mixin-forwarder-clash1.check b/tests/neg/mixin-forwarder-clash1.check index 68eb09ae90e0..7c007dc62788 100644 --- a/tests/neg/mixin-forwarder-clash1.check +++ b/tests/neg/mixin-forwarder-clash1.check @@ -1,5 +1,7 @@ -<284..284> in mixin-forwarder-clash1.scala -Name clash between inherited members: -def concat(suffix: Int): X in trait One at line 4 and -def concat: [Dummy](suffix: Int): Y in trait Two at line 8 -have the same type after erasure. +-- [E120] Duplicate Symbol Error: tests/neg/mixin-forwarder-clash1.scala:15:6 ------------------------------------------ +15 |class Bar2 extends Bar1 with Two[Foo] // error + | ^ + | Name clash between inherited members: + | def concat(suffix: Int): X in trait One at line 4 and + | def concat: [Dummy](suffix: Int): Y in trait Two at line 8 + | have the same type after erasure. diff --git a/tests/neg/mixin-forwarder-clash2.check b/tests/neg/mixin-forwarder-clash2.check index 66a88e46228d..422782833a36 100644 --- a/tests/neg/mixin-forwarder-clash2.check +++ b/tests/neg/mixin-forwarder-clash2.check @@ -1,5 +1,8 @@ -<6..6> in B_2.scala -Name clash between inherited members: -def concat(suffix: Int): X in trait One and -def concat: [Dummy](suffix: Int): Y in trait Two -have the same type after erasure. + +-- [E120] Duplicate Symbol Error: tests/neg/mixin-forwarder-clash2/B_2.scala:1:6 --------------------------------------- +1 |class Bar2 extends Bar1 with Two[Foo] // error + | ^ + | Name clash between inherited members: + | def concat(suffix: Int): X in trait One and + | def concat: [Dummy](suffix: Int): Y in trait Two + | have the same type after erasure. diff --git a/tests/neg/module-class-name.check b/tests/neg/module-class-name.check index a0a8dee0dc68..37c511149638 100644 --- a/tests/neg/module-class-name.check +++ b/tests/neg/module-class-name.check @@ -1,14 +1,24 @@ -[287..289..292] in module-class-name.scala -value foo is not a member of object Test.C -[247..248] in module-class-name.scala -Found: object Test.C -Required: Int -[192..193] in module-class-name.scala -Found: object Test.C -Required: Test.C -[127..128] in module-class-name.scala -Found: Test.C.type -Required: Test.C -[74..75] in module-class-name.scala -Found: Test.C.type -Required: Test.C +-- [E007] Type Mismatch Error: tests/neg/module-class-name.scala:7:13 -------------------------------------------------- +7 | val x: C = C // error: Found: Test.C.type + | ^ + | Found: Test.C.type + | Required: Test.C +-- [E007] Type Mismatch Error: tests/neg/module-class-name.scala:9:15 -------------------------------------------------- +9 | val y: C = f(C) // error: Found: Test.C.type + | ^ + | Found: Test.C.type + | Required: Test.C +-- [E007] Type Mismatch Error: tests/neg/module-class-name.scala:12:14 ------------------------------------------------- +12 | val z1: C = z // error: Found: object Test.C + | ^ + | Found: object Test.C + | Required: Test.C +-- [E007] Type Mismatch Error: tests/neg/module-class-name.scala:13:16 ------------------------------------------------- +13 | val z2: Int = z // error: Found: object Test.C + | ^ + | Found: object Test.C + | Required: Int +-- [E008] Member Not Found Error: tests/neg/module-class-name.scala:15:4 ----------------------------------------------- +15 | C.foo // error: value foo is not a member of object Test.C + | ^^^^^ + | value foo is not a member of object Test.C diff --git a/tests/neg/multi-file-error.check b/tests/neg/multi-file-error.check index 884d386b3b06..ad6a3f3b53be 100644 --- a/tests/neg/multi-file-error.check +++ b/tests/neg/multi-file-error.check @@ -1,4 +1,12 @@ -[12..15] in A.scala -Not found: foo -[12..15] in B.scala -Not found: bar +-- [E006] Unbound Identifier Error: tests/neg/multi-file-error/A.scala:2:2 --------------------------------------------- +2 | foo() // error + | ^^^ + | Not found: foo + +longer explanation available when compiling with `-explain` +-- [E006] Unbound Identifier Error: tests/neg/multi-file-error/B.scala:2:2 --------------------------------------------- +2 | bar() // error + | ^^^ + | Not found: bar + +longer explanation available when compiling with `-explain` diff --git a/tests/neg/override-scala2-macro.check b/tests/neg/override-scala2-macro.check index ff3f0ea88768..fcef6e87677c 100644 --- a/tests/neg/override-scala2-macro.check +++ b/tests/neg/override-scala2-macro.check @@ -1,3 +1,5 @@ -<56..56> in override-scala2-macro.scala -error overriding method f in class StringContext of type [A >: Any](args: Seq[A]): String; - method f of type [A >: Any](args: Seq[A]): String cannot be used here - only Scala-2 macros can override Scala-2 macros +-- Error: tests/neg/override-scala2-macro.scala:2:22 ------------------------------------------------------------------- +2 | override inline def f[A >: Any](args: A*): String = ??? // error + | ^ + |error overriding method f in class StringContext of type [A >: Any](args: Seq[A]): String; + | method f of type [A >: Any](args: Seq[A]): String cannot be used here - only Scala-2 macros can override Scala-2 macros diff --git a/tests/neg/subtyping.check b/tests/neg/subtyping.check index 42f4ddf2374a..a5602fe3ca21 100644 --- a/tests/neg/subtyping.check +++ b/tests/neg/subtyping.check @@ -1,14 +1,18 @@ -<230..230> in subtyping.scala -Cannot prove that a.T <:< a.U.. -I found: - - $conforms[Nothing] - -But method $conforms in object Predef does not match type a.T <:< a.U. -<106..106> in subtyping.scala -Cannot prove that B#X <:< A#X.. -I found: - - $conforms[Nothing] - -But method $conforms in object Predef does not match type B#X <:< A#X. +-- Error: tests/neg/subtyping.scala:8:27 ------------------------------------------------------------------------------- +8 | implicitly[B#X <:< A#X] // error: no implicit argument + | ^ + | Cannot prove that B#X <:< A#X.. + | I found: + | + | $conforms[Nothing] + | + | But method $conforms in object Predef does not match type B#X <:< A#X. +-- Error: tests/neg/subtyping.scala:12:27 ------------------------------------------------------------------------------ +12 | implicitly[a.T <:< a.U] // error: no implicit argument + | ^ + | Cannot prove that a.T <:< a.U.. + | I found: + | + | $conforms[Nothing] + | + | But method $conforms in object Predef does not match type a.T <:< a.U. diff --git a/tests/neg/t6124.check b/tests/neg/t6124.check index bf7a0ba4e68a..a03500d944a8 100644 --- a/tests/neg/t6124.check +++ b/tests/neg/t6124.check @@ -1,34 +1,70 @@ -[490..493] in t6124.scala -Not found: _52 -[404..406..412] in t6124.scala -value _1415F is not a member of Int -<594..594> in t6124.scala -trailing separator is not allowed -<567..567> in t6124.scala -leading separator is not allowed -<540..540> in t6124.scala -trailing separator is not allowed -<516..516> in t6124.scala -trailing separator is not allowed -<467..467> in t6124.scala -trailing separator is not allowed -<375..375> in t6124.scala -trailing separator is not allowed -<228..228> in t6124.scala -double precision floating point number too small -<197..197> in t6124.scala -trailing separator is not allowed -<159..159> in t6124.scala -Invalid literal number -<164..164> in t6124.scala -trailing separator is not allowed -<137..137> in t6124.scala -trailing separator is not allowed -<111..111> in t6124.scala -trailing separator is not allowed -<84..84> in t6124.scala -trailing separator is not allowed -<49..49> in t6124.scala -Invalid literal number -<25..25> in t6124.scala -trailing separator is not allowed +-- Error: tests/neg/t6124.scala:3:14 ----------------------------------------------------------------------------------- +3 | def f = 3_14_E-2 // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:4:10 ----------------------------------------------------------------------------------- +4 | def e = 3_14E-_2 // error + | ^ + | Invalid literal number +-- Error: tests/neg/t6124.scala:5:17 ----------------------------------------------------------------------------------- +5 | def d = 3_14E-2_ // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:7:15 ----------------------------------------------------------------------------------- +7 | def p = 3.1_4_ // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:8:15 ----------------------------------------------------------------------------------- +8 | def q = 3.1_4_d // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:9:15 ----------------------------------------------------------------------------------- +9 | def r = 3.1_4_dd // error // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:9:10 ----------------------------------------------------------------------------------- +9 | def r = 3.1_4_dd // error // error + | ^ + | Invalid literal number +-- Error: tests/neg/t6124.scala:10:11 ---------------------------------------------------------------------------------- +10 | def s = 3_.1 // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:12:17 ---------------------------------------------------------------------------------- +12 | def tooSmall = 1.0E-325 // error + | ^ + | double precision floating point number too small +-- Error: tests/neg/t6124.scala:17:13 ---------------------------------------------------------------------------------- +17 | val pi1 = 3_.1415F // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:20:17 ---------------------------------------------------------------------------------- +20 | = 999_99_9999_L // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:22:13 ---------------------------------------------------------------------------------- +22 | val x3 = 52_ // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:24:12 ---------------------------------------------------------------------------------- +24 | val x5 = 0_x52 // error + | ^ + | trailing separator is not allowed +-- Error: tests/neg/t6124.scala:25:13 ---------------------------------------------------------------------------------- +25 | val x6 = 0x_52 // error + | ^ + | leading separator is not allowed +-- Error: tests/neg/t6124.scala:26:14 ---------------------------------------------------------------------------------- +26 | val x8 = 0x52_ // error + | ^ + | trailing separator is not allowed +-- [E008] Member Not Found Error: tests/neg/t6124.scala:18:14 ---------------------------------------------------------- +18 | val pi2 = 3._1415F // error + | ^^^^^^^^ + | value _1415F is not a member of Int +-- [E006] Unbound Identifier Error: tests/neg/t6124.scala:21:11 -------------------------------------------------------- +21 | val x1 = _52 // error + | ^^^ + | Not found: _52 + +longer explanation available when compiling with `-explain` diff --git a/tests/neg/t6663.check b/tests/neg/t6663.check index bd1facceeb2c..96f8609c2593 100644 --- a/tests/neg/t6663.check +++ b/tests/neg/t6663.check @@ -1,3 +1,5 @@ -[473..495..498] in t6663.scala -Found: String -Required: Int +-- [E007] Type Mismatch Error: tests/neg/t6663.scala:16:32 ------------------------------------------------------------- +16 | var v = new C(42).foo[String].get :Int // error + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | Found: String + | Required: Int