diff --git a/jvm/refspec/src/main/scala/org/scalatest/refspec/RefSpecLike.scala b/jvm/refspec/src/main/scala/org/scalatest/refspec/RefSpecLike.scala index 04460e49a6..27d67601a5 100644 --- a/jvm/refspec/src/main/scala/org/scalatest/refspec/RefSpecLike.scala +++ b/jvm/refspec/src/main/scala/org/scalatest/refspec/RefSpecLike.scala @@ -127,7 +127,7 @@ trait RefSpecLike extends TestSuite with Informing with Notifying with Alerting case other: Throwable if (!Suite.anExceptionThatShouldCauseAnAbort(other)) => if (ScalaTestVersions.BuiltForScalaVersion == "2.12") throw new NotAllowedException(FailureMessages.exceptionWasThrownInObject(Prettifier.default, UnquotedString(other.getClass.getName), UnquotedString(scopeDesc)), Some(other), Right((_: StackDepthException) => 9)) - else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("2.13")) + else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("2.13") || ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) throw new NotAllowedException(FailureMessages.exceptionWasThrownInObject(Prettifier.default, UnquotedString(other.getClass.getName), UnquotedString(scopeDesc)), Some(other), Right((_: StackDepthException) => 7)) else throw new NotAllowedException(FailureMessages.exceptionWasThrownInObject(Prettifier.default, UnquotedString(other.getClass.getName), UnquotedString(scopeDesc)), Some(other), Right((_: StackDepthException) => 8)) diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldCompileSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldCompileSpec.scala index c8109267ac..408c36693b 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldCompileSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/ShouldCompileSpec.scala @@ -129,7 +129,7 @@ class ShouldCompileSpec extends AnyFunSpec { assert(e.message.get.indexOf("println(\"test)") >= 0) assert(e.failedCodeFileName === (Some(fileName))) assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6))) - assert(e.message.get.indexOf(if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) "')' expected, but eof found" else "unclosed string literal") >= 0) + assert(e.message.get.indexOf(if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) "expression expected but erroneous token found" else "unclosed string literal") >= 0) } } } diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/DirectExpectationsSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/DirectExpectationsSpec.scala index 4adb9d0fb8..aa82425b74 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/DirectExpectationsSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/DirectExpectationsSpec.scala @@ -591,7 +591,7 @@ class DirectExpectationsSpec extends AnyFunSpec { assert(fact.factMessage == Resources.expectedNoErrorButGotParseError("reflective compilation has failed: \n\nunclosed string literal\n')' expected but '}' found.", "\nprintln(\"test)\n")) else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) assert(fact.factMessage == Resources.expectedNoErrorButGotParseError( - "')' expected, but eof found", + "expression expected but erroneous token found", """ |println("test) |""".stripMargin @@ -692,7 +692,7 @@ class DirectExpectationsSpec extends AnyFunSpec { assert(fact.factMessage == Resources.expectedTypeErrorButGotParseError("reflective compilation has failed: \n\nunclosed string literal\n')' expected but '}' found.", "\nprintln(\"test)\n")) else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) assert(fact.factMessage == Resources.expectedTypeErrorButGotParseError( - "')' expected, but eof found", + "expression expected but erroneous token found", """ |println("test) |""".stripMargin diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/ExpectationsSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/ExpectationsSpec.scala index a296be43cb..ffad8e1ec0 100644 --- a/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/ExpectationsSpec.scala +++ b/jvm/scalatest-test/src/test/scala/org/scalatest/expectations/ExpectationsSpec.scala @@ -643,7 +643,7 @@ class ExpectationsSpec extends AnyFunSpec with Expectations { assert(fact.factMessage == Resources.expectedNoErrorButGotParseError("reflective compilation has failed: \n\nunclosed string literal\n')' expected but '}' found.", "\nprintln(\"test)\n")) else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) assert(fact.factMessage == Resources.expectedNoErrorButGotParseError( - "')' expected, but eof found", + "expression expected but erroneous token found", """ |println("test) |""".stripMargin @@ -788,7 +788,7 @@ class ExpectationsSpec extends AnyFunSpec with Expectations { assert(fact.factMessage == Resources.expectedTypeErrorButGotParseError("reflective compilation has failed: \n\nunclosed string literal\n')' expected but '}' found.", "\nprintln(\"test)\n")) else if (ScalaTestVersions.BuiltForScalaVersion.startsWith("3.")) assert(fact.factMessage == Resources.expectedTypeErrorButGotParseError( - "')' expected, but eof found", + "expression expected but erroneous token found", """ |println("test) |""".stripMargin diff --git a/project/DottyBuild.scala b/project/DottyBuild.scala index 494399ca98..72c2834047 100644 --- a/project/DottyBuild.scala +++ b/project/DottyBuild.scala @@ -19,7 +19,7 @@ trait DottyBuild { this: BuildCommons => // List of available night build at https://repo1.maven.org/maven2/ch/epfl/lamp/dotty-compiler_0.27/ // lazy val dottyVersion = dottyLatestNightlyBuild.get - lazy val dottyVersion = System.getProperty("scalatest.dottyVersion", "3.1.0") + lazy val dottyVersion = System.getProperty("scalatest.dottyVersion", "3.1.3") lazy val dottySettings = List( scalaVersion := dottyVersion, scalacOptions ++= List("-language:implicitConversions", "-noindent", "-Xprint-suspension")