Skip to content

Make 3.3 the default source version #16329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/SourceVersion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum SourceVersion:
def isAtLeast(v: SourceVersion) = stable.ordinal >= v.ordinal

object SourceVersion extends Property.Key[SourceVersion]:
def defaultSourceVersion = `3.2`
def defaultSourceVersion = `3.3`

/** language versions that may appear in a language import, are deprecated, but not removed from the standard library. */
val illegalSourceVersionNames = List("3.1-migration").map(_.toTermName)
Expand Down
21 changes: 0 additions & 21 deletions compiler/test/dotty/tools/repl/ReplCompilerTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -347,27 +347,6 @@ class ReplCompilerTests extends ReplTest:
assertEquals("java.lang.AssertionError: assertion failed", all.head)
}

@Test def i14491 =
initially {
run("import language.experimental.fewerBraces")
} andThen {
run("""|val x = Seq(7,8,9).apply:
| 1
|""".stripMargin)
assertEquals("val x: Int = 8", storedOutput().trim)
}
initially {
run("""|import language.experimental.fewerBraces
|import language.experimental.fewerBraces as _
|""".stripMargin)
} andThen {
run("""|val x = Seq(7,8,9).apply:
| 1
|""".stripMargin)
assert("expected error if fewerBraces is unimported",
lines().exists(_.contains("missing arguments for method apply")))
}

object ReplCompilerTests:

private val pattern = Pattern.compile("\\r[\\n]?|\\n");
Expand Down
6 changes: 3 additions & 3 deletions tests/neg/i4373b.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ==> 05bef7805687ba94da37177f7568e3ba7da1f91c.scala <==
class x0 {
x1:
x0 | _ // error
// error
x1: // error
x0 | _
// error
44 changes: 22 additions & 22 deletions tests/neg/indent-colons.check
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
-- Error: tests/neg/indent-colons.scala:6:4 ----------------------------------------------------------------------------
6 | : // error
-- Error: tests/neg/indent-colons.scala:7:4 ----------------------------------------------------------------------------
7 | : // error
| ^
| end of statement expected but ':' found
-- Error: tests/neg/indent-colons.scala:12:2 ---------------------------------------------------------------------------
12 | : // error
-- Error: tests/neg/indent-colons.scala:13:2 ---------------------------------------------------------------------------
13 | : // error
| ^
| end of statement expected but ':' found
-- Error: tests/neg/indent-colons.scala:19:2 ---------------------------------------------------------------------------
19 | : // error
-- Error: tests/neg/indent-colons.scala:20:2 ---------------------------------------------------------------------------
20 | : // error
| ^
| end of statement expected but ':' found
-- [E018] Syntax Error: tests/neg/indent-colons.scala:26:14 ------------------------------------------------------------
26 | val y = 1 + : // error
-- [E018] Syntax Error: tests/neg/indent-colons.scala:27:14 ------------------------------------------------------------
27 | val y = 1 + : // error
| ^
| expression expected but : found
|
| longer explanation available when compiling with `-explain`
-- [E018] Syntax Error: tests/neg/indent-colons.scala:30:27 ------------------------------------------------------------
30 | val all = credentials ++ : // error
-- [E018] Syntax Error: tests/neg/indent-colons.scala:31:27 ------------------------------------------------------------
31 | val all = credentials ++ : // error
| ^
| expression expected but : found
|
| longer explanation available when compiling with `-explain`
-- [E134] Type Error: tests/neg/indent-colons.scala:23:12 --------------------------------------------------------------
23 | val x = 1.+ : // error
-- [E134] Type Error: tests/neg/indent-colons.scala:24:12 --------------------------------------------------------------
24 | val x = 1.+ : // error
| ^^^
| None of the overloaded alternatives of method + in class Int with types
| (x: Double): Double
Expand All @@ -35,27 +35,27 @@
| (x: Byte): Int
| (x: String): String
| match expected type (2 : Int)
-- [E006] Not Found Error: tests/neg/indent-colons.scala:32:7 ----------------------------------------------------------
32 | if file.isEmpty // error
-- [E006] Not Found Error: tests/neg/indent-colons.scala:33:7 ----------------------------------------------------------
33 | if file.isEmpty // error
| ^^^^
| Not found: file
|
| longer explanation available when compiling with `-explain`
-- [E006] Not Found Error: tests/neg/indent-colons.scala:34:13 ---------------------------------------------------------
34 | else Seq(file) // error
-- [E006] Not Found Error: tests/neg/indent-colons.scala:35:13 ---------------------------------------------------------
35 | else Seq(file) // error
| ^^^^
| Not found: file
|
| longer explanation available when compiling with `-explain`
-- Error: tests/neg/indent-colons.scala:4:2 ----------------------------------------------------------------------------
4 | tryEither: // error
-- Error: tests/neg/indent-colons.scala:5:2 ----------------------------------------------------------------------------
5 | tryEither: // error
| ^^^^^^^^^
| missing arguments for method tryEither
-- Error: tests/neg/indent-colons.scala:10:2 ---------------------------------------------------------------------------
10 | tryEither: // error
-- Error: tests/neg/indent-colons.scala:11:2 ---------------------------------------------------------------------------
11 | tryEither: // error
| ^^^^^^^^^
| missing arguments for method tryEither
-- Error: tests/neg/indent-colons.scala:17:2 ---------------------------------------------------------------------------
17 | Some(3).fold: // error
-- Error: tests/neg/indent-colons.scala:18:2 ---------------------------------------------------------------------------
18 | Some(3).fold: // error
| ^^^^^^^^^^^^
| missing arguments for method fold in class Option
1 change: 1 addition & 0 deletions tests/neg/indent-colons.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import language.`3.2`
def tryEither[T](x: T)(y: Int => T): T = ???

def test1 =
Expand Down