diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index d72131161d25..fb990f43fbf2 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -26,7 +26,6 @@ object Feature: val dependent = experimental("dependent") val erasedDefinitions = experimental("erasedDefinitions") val symbolLiterals = deprecated("symbolLiterals") - val fewerBraces = experimental("fewerBraces") val saferExceptions = experimental("saferExceptions") /** Is `feature` enabled by by a command-line setting? The enabling setting is diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index cb8de2a9907f..39e129571f11 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -58,7 +58,7 @@ trait AllScalaSettings extends CommonScalaSettings, PluginSettings, VerboseSetti val oldSyntax: Setting[Boolean] = BooleanSetting("-old-syntax", "Require `(...)` around conditions.") val indent: Setting[Boolean] = BooleanSetting("-indent", "Together with -rewrite, remove {...} syntax when possible due to significant indentation.") val noindent: Setting[Boolean] = BooleanSetting("-no-indent", "Require classical {...} syntax, indentation is not significant.", aliases = List("-noindent")) - val YindentColons: Setting[Boolean] = BooleanSetting("-Yindent-colons", "(disabled: use -language:experimental.fewerBraces instead)") + val YindentColons: Setting[Boolean] = BooleanSetting("-Yindent-colons", "(disabled: colons can always indent from Scala v3.2.x)") /* Decompiler settings */ val printTasty: Setting[Boolean] = BooleanSetting("-print-tasty", "Prints the raw tasty.", aliases = List("--print-tasty")) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 0c3df1b1957a..d56d5fff85c0 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -757,7 +757,7 @@ object Parsers { } }) canRewrite &= (in.isAfterLineEnd || statCtdTokens.contains(in.token)) // test (5) - if (canRewrite && (!underColonSyntax || in.fewerBracesEnabled)) { + if (canRewrite && !underColonSyntax) { val openingPatchStr = if !colonRequired then "" else if testChar(startOpening - 1, Chars.isOperatorPart(_)) then " :" @@ -2252,8 +2252,8 @@ object Parsers { * | SimpleExpr `.` MatchClause * | SimpleExpr (TypeArgs | NamedTypeArgs) * | SimpleExpr1 ArgumentExprs - * | SimpleExpr1 `:` IndentedExpr -- under language.experimental.fewerBraces - * | SimpleExpr1 FunParams (‘=>’ | ‘?=>’) IndentedExpr -- under language.experimental.fewerBraces + * | SimpleExpr1 `:` IndentedExpr + * | SimpleExpr1 FunParams (‘=>’ | ‘?=>’) IndentedExpr * IndentedExpr ::= indent (CaseClauses | Block) outdent * Quoted ::= ‘'’ ‘{’ Block ‘}’ * | ‘'’ ‘[’ Type ‘]’ @@ -2322,7 +2322,7 @@ object Parsers { case LPAREN if canApply => val app = atSpan(startOffset(t), in.offset) { val argExprs @ (args, isUsing) = argumentExprs() - if !isUsing && in.isArrow && location != Location.InGuard && in.fewerBracesEnabled then + if !isUsing && in.isArrow && location != Location.InGuard then val params = convertToParams(Tuple(args)) if params.forall(_.name != nme.ERROR) then applyToClosure(t, in.offset, params) @@ -2336,13 +2336,13 @@ object Parsers { val app = atSpan(startOffset(t), in.offset) { mkApply(t, argumentExprs()) } simpleExprRest(app, location, canApply = true) case USCORE => - if in.lookahead.isArrow && location != Location.InGuard && in.fewerBracesEnabled then + if in.lookahead.isArrow && location != Location.InGuard then val app = applyToClosure(t, in.offset, convertToParams(wildcardIdent())) simpleExprRest(app, location, canApply = true) else atSpan(startOffset(t), in.skipToken()) { PostfixOp(t, Ident(nme.WILDCARD)) } case IDENTIFIER - if !in.isOperator && in.lookahead.isArrow && location != Location.InGuard && in.fewerBracesEnabled => + if !in.isOperator && in.lookahead.isArrow && location != Location.InGuard => val app = applyToClosure(t, in.offset, convertToParams(termIdent())) simpleExprRest(app, location, canApply = true) case _ => diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index fa9aa67e8088..83adfa4ded43 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -202,15 +202,6 @@ object Scanners { def featureEnabled(name: TermName) = Feature.enabled(name)(using languageImportContext) def erasedEnabled = featureEnabled(Feature.erasedDefinitions) - private var fewerBracesEnabledCache = false - private var fewerBracesEnabledCtx: Context = NoContext - - def fewerBracesEnabled = - if fewerBracesEnabledCtx ne myLanguageImportContext then - fewerBracesEnabledCache = featureEnabled(Feature.fewerBraces) - fewerBracesEnabledCtx = myLanguageImportContext - fewerBracesEnabledCache - /** All doc comments kept by their end position in a `Map`. * * Note: the map is necessary since the comments are looked up after an @@ -655,7 +646,7 @@ object Scanners { case END => if !isEndMarker then token = IDENTIFIER case COLON => - if fewerBracesEnabled then observeColonEOL() + observeColonEOL() case RBRACE | RPAREN | RBRACKET => closeIndented() case EOF => diff --git a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala index 69b3df423c5b..2b9c8c2b8e08 100644 --- a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala +++ b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala @@ -243,24 +243,11 @@ class ReplCompilerTests extends ReplTest: @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: diff --git a/docs/_docs/internals/syntax.md b/docs/_docs/internals/syntax.md index c484c42864e5..74c5cafae4f3 100644 --- a/docs/_docs/internals/syntax.md +++ b/docs/_docs/internals/syntax.md @@ -254,8 +254,8 @@ SimpleExpr ::= SimpleRef | SimpleExpr ‘.’ MatchClause | SimpleExpr TypeArgs TypeApply(expr, args) | SimpleExpr ArgumentExprs Apply(expr, args) - | SimpleExpr ‘:’ IndentedExpr -- under language.experimental.fewerBraces - | SimpleExpr FunParams (‘=>’ | ‘?=>’) IndentedExpr -- under language.experimental.fewerBraces + | SimpleExpr ‘:’ IndentedExpr + | SimpleExpr FunParams (‘=>’ | ‘?=>’) IndentedExpr | SimpleExpr ‘_’ PostfixOp(expr, _) (to be dropped) | XmlExpr -- to be dropped IndentedExpr ::= indent CaseClauses | Block outdent diff --git a/docs/_docs/reference/experimental/overview.md b/docs/_docs/reference/experimental/overview.md index 2644de0d864e..2c499598e5f5 100644 --- a/docs/_docs/reference/experimental/overview.md +++ b/docs/_docs/reference/experimental/overview.md @@ -10,7 +10,6 @@ All experimental language features can be found under the `scala.language.experi They are enabled by importing the feature or using the `-language` compiler flag. * [`erasedDefinitions`](./erased-defs.md): Enable support for `erased` modifier. -* `fewerBraces`: Enable support for using indentation for arguments. * [`genericNumberLiterals`](./numeric-literals.md): Enable support for generic number literals. * [`namedTypeArguments`](./named-typeargs.md): Enable support for named type arguments * [`saferExceptions`](./canthrow.md): Enable support for checked exceptions. diff --git a/docs/_docs/reference/other-new-features/indentation-experimental.md b/docs/_docs/reference/other-new-features/indentation-experimental.md deleted file mode 100644 index cbdd41eeaf12..000000000000 --- a/docs/_docs/reference/other-new-features/indentation-experimental.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -layout: doc-page -title: "Fewer Braces" -movedTo: https://docs.scala-lang.org/scala3/reference/other-new-features/indentation-experimental.html ---- - -By and large, the possible indentation regions coincide with those regions where braces `{...}` are also legal, no matter whether the braces enclose an expression or a set of definitions. There is one exception, though: Arguments to function can be enclosed in braces but they cannot be simply indented instead. Making indentation always significant for function arguments would be too restrictive and fragile. - -To allow such arguments to be written without braces, a variant of the indentation scheme is implemented under language import -```scala -import language.experimental.fewerBraces -``` -Alternatively, it can be enabled with command line option `-language:experimental.fewerBraces`. - -This variant is more contentious and less stable than the rest of the significant indentation scheme. It allows to replace a function argument in braces by a `:` at the end of a line and indented code, similar to the convention for class bodies. It also allows to leave out braces around arguments that are multi-line function values. - -## Using `:` At End Of Line - - -Similar to what is done for classes and objects, a `:` that follows a function reference at the end of a line means braces can be omitted for function arguments. Example: -```scala -times(10): - println("ah") - println("ha") -``` - -The colon can also follow an infix operator: - -```scala -credentials ++ : - val file = Path.userHome / ".credentials" - if file.exists - then Seq(Credentials(file)) - else Seq() -``` - -Function calls that take multiple argument lists can also be handled this way: - -```scala -val firstLine = files.get(fileName).fold: - val fileNames = files.values - s"""no file named $fileName found among - |${values.mkString(\n)}""".stripMargin - : - f => - val lines = f.iterator.map(_.readLine) - lines.mkString("\n) -``` - - -## Lambda Arguments Without Braces - -Braces can also be omitted around multiple line function value arguments: -```scala -val xs = elems.map x => - val y = x - 1 - y * y -xs.foldLeft (x, y) => - x + y -``` -Braces can be omitted if the lambda starts with a parameter list and `=>` or `=>?` at the end of one line and it has an indented body on the following lines. - -## Syntax Changes - -``` -SimpleExpr ::= ... - | SimpleExpr `:` IndentedArgument - | SimpleExpr FunParams (‘=>’ | ‘?=>’) IndentedArgument -InfixExpr ::= ... - | InfixExpr id `:` IndentedArgument -IndentedArgument ::= indent (CaseClauses | Block) outdent -``` - -Note that a lambda argument must have the `=>` at the end of a line for braces -to be optional. For instance, the following would also be incorrect: - -```scala - xs.map x => x + 1 // error: braces or parentheses are required -``` -The lambda has to be enclosed in braces or parentheses: -```scala - xs.map(x => x + 1) // ok -``` diff --git a/docs/_docs/reference/other-new-features/indentation.md b/docs/_docs/reference/other-new-features/indentation.md index c7a6fdbb7453..cf422453283b 100644 --- a/docs/_docs/reference/other-new-features/indentation.md +++ b/docs/_docs/reference/other-new-features/indentation.md @@ -416,12 +416,6 @@ The `-indent` option only works on [new-style syntax](./control-syntax.md). So t Generally, the possible indentation regions coincide with those regions where braces `{...}` are also legal, no matter whether the braces enclose an expression or a set of definitions. There is one exception, though: Arguments to function can be enclosed in braces but they cannot be simply indented instead. Making indentation always significant for function arguments would be too restrictive and fragile. -To allow such arguments to be written without braces, a variant of the indentation scheme is implemented under language import -```scala -import language.experimental.fewerBraces -``` -This variant is more contentious and less stable than the rest of the significant indentation scheme. In this variant, a colon `:` at the end of a line is also one of the possible tokens that opens an indentation region. Examples: - ```scala times(10): println("ah") diff --git a/library/src/scala/runtime/stdLibPatches/language.scala b/library/src/scala/runtime/stdLibPatches/language.scala index 7c8c116a106e..43efd3f87236 100644 --- a/library/src/scala/runtime/stdLibPatches/language.scala +++ b/library/src/scala/runtime/stdLibPatches/language.scala @@ -48,11 +48,6 @@ object language: @compileTimeOnly("`erasedDefinitions` can only be used at compile time in import statements") object erasedDefinitions - /** Experimental support for using indentation for arguments - */ - @compileTimeOnly("`fewerBraces` can only be used at compile time in import statements") - object fewerBraces - /** Experimental support for typechecked exception capabilities * * @see [[https://dotty.epfl.ch/docs/reference/experimental/canthrow]] diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 73b7e9ca674e..0be1c21b398a 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -17,6 +17,8 @@ object MiMaFilters { ProblemFilters.exclude[MissingClassProblem]("scala.compiletime.ops.long$"), ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#CompilationInfoModule.XmacroSettings"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#CompilationInfoModule.XmacroSettings"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.fewerBraces"), + ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$fewerBraces$"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.deriving.Mirror.fromProductTyped"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.deriving.Mirror.fromTuple"), diff --git a/tests/neg-custom-args/no-experimental/experimental-imports.scala b/tests/neg-custom-args/no-experimental/experimental-imports.scala index 63a150978b1c..17b8e3181af0 100644 --- a/tests/neg-custom-args/no-experimental/experimental-imports.scala +++ b/tests/neg-custom-args/no-experimental/experimental-imports.scala @@ -2,14 +2,12 @@ import annotation.experimental @experimental object Object1: - import language.experimental.fewerBraces import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals import language.experimental.erasedDefinitions erased def f = 1 object Object2: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions @@ -17,14 +15,12 @@ object Object2: @experimental object Class1: - import language.experimental.fewerBraces import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals import language.experimental.erasedDefinitions erased def f = 1 object Class2: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions @@ -32,14 +28,12 @@ object Class2: @experimental def fun1 = - import language.experimental.fewerBraces import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals import language.experimental.erasedDefinitions erased def f = 1 def fun2 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions diff --git a/tests/neg-custom-args/no-experimental/experimental-nested-imports-2.scala b/tests/neg-custom-args/no-experimental/experimental-nested-imports-2.scala index 85076cca723a..a4962c6153a0 100644 --- a/tests/neg-custom-args/no-experimental/experimental-nested-imports-2.scala +++ b/tests/neg-custom-args/no-experimental/experimental-nested-imports-2.scala @@ -1,7 +1,6 @@ import annotation.experimental class Class1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @@ -9,7 +8,6 @@ class Class1: def g = 1 object Object1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @@ -17,7 +15,6 @@ object Object1: def g = 1 def fun1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @@ -25,7 +22,6 @@ def fun1 = def g = 1 val value1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition diff --git a/tests/neg-custom-args/no-experimental/experimental-nested-imports-3.scala b/tests/neg-custom-args/no-experimental/experimental-nested-imports-3.scala index 1af04918b1d9..77fbe41479d2 100644 --- a/tests/neg-custom-args/no-experimental/experimental-nested-imports-3.scala +++ b/tests/neg-custom-args/no-experimental/experimental-nested-imports-3.scala @@ -1,25 +1,21 @@ import annotation.experimental class Class1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition object Object1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition def fun1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition val value1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition diff --git a/tests/neg-custom-args/no-experimental/experimental-nested-imports.scala b/tests/neg-custom-args/no-experimental/experimental-nested-imports.scala index b9fc38dc4915..180c43b9f671 100644 --- a/tests/neg-custom-args/no-experimental/experimental-nested-imports.scala +++ b/tests/neg-custom-args/no-experimental/experimental-nested-imports.scala @@ -1,28 +1,24 @@ import annotation.experimental class Class1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @experimental def f = 1 object Object1: - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @experimental def f = 1 def fun1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @experimental def f = 1 val value1 = - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition diff --git a/tests/neg-custom-args/no-experimental/experimental-package-imports.scala b/tests/neg-custom-args/no-experimental/experimental-package-imports.scala index 90ec387b1036..047b3eb61e82 100644 --- a/tests/neg-custom-args/no-experimental/experimental-package-imports.scala +++ b/tests/neg-custom-args/no-experimental/experimental-package-imports.scala @@ -1,7 +1,6 @@ import annotation.experimental package foo { - import language.experimental.fewerBraces // error import language.experimental.namedTypeArguments // error import language.experimental.genericNumberLiterals // error import language.experimental.erasedDefinitions // ok: only check at erased definition @@ -13,7 +12,6 @@ package foo { package foo2 { // ok: all definitions are top-level @experimental - import language.experimental.fewerBraces import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals import language.experimental.erasedDefinitions diff --git a/tests/neg-custom-args/nowarn/nowarn.check b/tests/neg-custom-args/nowarn/nowarn.check index d542643dbbbc..45904c9335cb 100644 --- a/tests/neg-custom-args/nowarn/nowarn.check +++ b/tests/neg-custom-args/nowarn/nowarn.check @@ -63,7 +63,7 @@ Matching filters for @nowarn or -Wconf: | ^ | method f is deprecated -- Deprecation Warning: tests/neg-custom-args/nowarn/nowarn.scala:47:10 ------------------------------------------------ -47 |def t7c = f: // warning (deprecation) +47 |def t7c = f // warning (deprecation) | ^ | method f is deprecated -- Unchecked Warning: tests/neg-custom-args/nowarn/nowarn.scala:53:7 --------------------------------------------------- @@ -78,10 +78,10 @@ Matching filters for @nowarn or -Wconf: 40 |@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation) |^^^^^^^^^^^^^^^^^^^ |@nowarn annotation does not suppress any warnings --- Error: tests/neg-custom-args/nowarn/nowarn.scala:48:3 --------------------------------------------------------------- -48 | @nowarn("msg=fish") // error (unused nowarn) - | ^^^^^^^^^^^^^^^^^^^ - | @nowarn annotation does not suppress any warnings +-- Error: tests/neg-custom-args/nowarn/nowarn.scala:48:5 --------------------------------------------------------------- +48 | : @nowarn("msg=fish") // error (unused nowarn) + | ^^^^^^^^^^^^^^^^^^^ + | @nowarn annotation does not suppress any warnings -- Error: tests/neg-custom-args/nowarn/nowarn.scala:60:0 --------------------------------------------------------------- 60 |@nowarn def t9a = { 1: @nowarn; 2 } // error (outer @nowarn is unused) |^^^^^^^ diff --git a/tests/neg-custom-args/nowarn/nowarn.scala b/tests/neg-custom-args/nowarn/nowarn.scala index 39ecde91517f..3599f8c3c633 100644 --- a/tests/neg-custom-args/nowarn/nowarn.scala +++ b/tests/neg-custom-args/nowarn/nowarn.scala @@ -42,10 +42,10 @@ def t6a = f // warning (refchecks, deprecation) @nowarn def t6f = f def t7a = f: @nowarn("cat=deprecation") -def t7b = f: - @nowarn("msg=deprecated") -def t7c = f: // warning (deprecation) - @nowarn("msg=fish") // error (unused nowarn) +def t7b = f + : @nowarn("msg=deprecated") +def t7c = f // warning (deprecation) + : @nowarn("msg=fish") // error (unused nowarn) def t7d = f: @nowarn("") def t7e = f: @nowarn diff --git a/tests/neg/closure-args.scala b/tests/neg/closure-args.scala index 9b59de205d86..46106f9eca92 100644 --- a/tests/neg/closure-args.scala +++ b/tests/neg/closure-args.scala @@ -1,5 +1,3 @@ -import language.experimental.fewerBraces - val x = List().map (x: => Int) => // error ??? val y = List() map x => // error diff --git a/tests/neg/i4373b.scala b/tests/neg/i4373b.scala index 297fcd76ff08..a3d8f3850eff 100644 --- a/tests/neg/i4373b.scala +++ b/tests/neg/i4373b.scala @@ -1,5 +1,5 @@ // ==> 05bef7805687ba94da37177f7568e3ba7da1f91c.scala <== class x0 { x1: // error - x0 | _ // error + x0 | _ // error \ No newline at end of file diff --git a/tests/neg/i7751.scala b/tests/neg/i7751.scala index ed33723a152d..f353d7d8d5ec 100644 --- a/tests/neg/i7751.scala +++ b/tests/neg/i7751.scala @@ -1,3 +1,2 @@ -import language.experimental.fewerBraces val a = Some(a=a,)=> // error // error // error val a = Some(x=y,)=> diff --git a/tests/neg/indent-experimental.scala b/tests/neg/indent-experimental.scala index e945e172d1de..4d26ce311870 100644 --- a/tests/neg/indent-experimental.scala +++ b/tests/neg/indent-experimental.scala @@ -1,5 +1,3 @@ -import language.experimental.fewerBraces - val x = if true then: // error 1 diff --git a/tests/pos-custom-args/no-experimental/experimental-imports-empty.scala b/tests/pos-custom-args/no-experimental/experimental-imports-empty.scala index bb27629a6062..998086c5d9a4 100644 --- a/tests/pos-custom-args/no-experimental/experimental-imports-empty.scala +++ b/tests/pos-custom-args/no-experimental/experimental-imports-empty.scala @@ -1,5 +1,4 @@ import annotation.experimental -import language.experimental.fewerBraces import language.experimental.namedTypeArguments import language.experimental.genericNumberLiterals import language.experimental.erasedDefinitions diff --git a/tests/pos/closure-args.scala b/tests/pos/closure-args.scala index dd30baf7d2b0..5b3b267d895a 100644 --- a/tests/pos/closure-args.scala +++ b/tests/pos/closure-args.scala @@ -1,5 +1,3 @@ -import language.experimental.fewerBraces - val xs = List(1, 2, 3) val ys = xs.map x => x + 1 diff --git a/tests/pos/fewer-braces.scala b/tests/pos/fewer-braces.scala index 28fd62def2eb..a414bfb76686 100644 --- a/tests/pos/fewer-braces.scala +++ b/tests/pos/fewer-braces.scala @@ -1,5 +1,3 @@ -import language.experimental.fewerBraces - object Test: assert((new Object: Any).isInstanceOf[Object]) \ No newline at end of file diff --git a/tests/pos/i12218.scala b/tests/pos/i12218.scala index 515e71f83fc8..c710c6ecb5f3 100644 --- a/tests/pos/i12218.scala +++ b/tests/pos/i12218.scala @@ -1,4 +1,3 @@ -import language.experimental.fewerBraces @main def runTest(): Unit = val arr = Array(1,2,3) if diff --git a/tests/pos/indent-colons.scala b/tests/pos/indent-colons.scala index 09abc69a483a..11a3c385bf3b 100644 --- a/tests/pos/indent-colons.scala +++ b/tests/pos/indent-colons.scala @@ -1,4 +1,3 @@ -import language.experimental.fewerBraces object Test: locally: