Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add scala.language.experimental.matchWithSubCases
  • Loading branch information
EugeneFlesselle committed Aug 15, 2025
commit 17ca7fc170af69649ddfc31c4726ca536ea99cec
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/config/Feature.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ object Feature:
val modularity = experimental("modularity")
val quotedPatternsWithPolymorphicFunctions = experimental("quotedPatternsWithPolymorphicFunctions")
val packageObjectValues = experimental("packageObjectValues")
val matchWithSubCases = experimental("matchWithSubCases")

def experimentalAutoEnableFeatures(using Context): List[TermName] =
defn.languageExperimentalFeatures
Expand Down
7 changes: 6 additions & 1 deletion library/src/scala/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,19 @@ object language {
* @see [[https://github.com/scala/improvement-proposals/pull/79]]
*/
@compileTimeOnly("`betterFors` can only be used at compile time in import statements")
@deprecated("The `experimental.betterFors` language import no longer has any effect, the feature is being stablised and can be enabled using `-preview` flag", since = "3.7")
@deprecated("The `experimental.betterFors` language import no longer has any effect, the feature is being stabilised and can be enabled using `-preview` flag", since = "3.7")
object betterFors

/** Experimental support for package object values
*/
@compileTimeOnly("`packageObjectValues` can only be used at compile time in import statements")
object packageObjectValues

/** Experimental support for match expressions with sub-cases.
*/
@compileTimeOnly("`matchWithSubCases` can only be used at compile time in import statements")
object matchWithSubCases

}

/** The deprecated object contains features that are no longer officially suypported in Scala.
Expand Down
7 changes: 6 additions & 1 deletion library/src/scala/runtime/stdLibPatches/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,18 @@ object language:
* @see [[https://github.com/scala/improvement-proposals/pull/79]]
*/
@compileTimeOnly("`betterFors` can only be used at compile time in import statements")
@deprecated("The `experimental.betterFors` language import no longer has any effect, the feature is being stablised and can be enabled using `-preview` flag", since = "3.7")
@deprecated("The `experimental.betterFors` language import no longer has any effect, the feature is being stabilised and can be enabled using `-preview` flag", since = "3.7")
object betterFors

/** Experimental support for package object values
*/
@compileTimeOnly("`packageObjectValues` can only be used at compile time in import statements")
object packageObjectValues

/** Experimental support for match expressions with sub-cases.
*/
@compileTimeOnly("`matchWithSubCases` can only be used at compile time in import statements")
object matchWithSubCases
end experimental

/** The deprecated object contains features that are no longer officially suypported in Scala.
Expand Down