Skip to content

Commit 17ca7fc

Browse files
Add scala.language.experimental.matchWithSubCases
1 parent 0a391cd commit 17ca7fc

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ object Feature:
3737
val modularity = experimental("modularity")
3838
val quotedPatternsWithPolymorphicFunctions = experimental("quotedPatternsWithPolymorphicFunctions")
3939
val packageObjectValues = experimental("packageObjectValues")
40+
val matchWithSubCases = experimental("matchWithSubCases")
4041

4142
def experimentalAutoEnableFeatures(using Context): List[TermName] =
4243
defn.languageExperimentalFeatures

library/src/scala/language.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,19 @@ object language {
342342
* @see [[https://github.com/scala/improvement-proposals/pull/79]]
343343
*/
344344
@compileTimeOnly("`betterFors` can only be used at compile time in import statements")
345-
@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")
345+
@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")
346346
object betterFors
347347

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

353+
/** Experimental support for match expressions with sub-cases.
354+
*/
355+
@compileTimeOnly("`matchWithSubCases` can only be used at compile time in import statements")
356+
object matchWithSubCases
357+
353358
}
354359

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

library/src/scala/runtime/stdLibPatches/language.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,18 @@ object language:
147147
* @see [[https://github.com/scala/improvement-proposals/pull/79]]
148148
*/
149149
@compileTimeOnly("`betterFors` can only be used at compile time in import statements")
150-
@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")
150+
@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")
151151
object betterFors
152152

153153
/** Experimental support for package object values
154154
*/
155155
@compileTimeOnly("`packageObjectValues` can only be used at compile time in import statements")
156156
object packageObjectValues
157+
158+
/** Experimental support for match expressions with sub-cases.
159+
*/
160+
@compileTimeOnly("`matchWithSubCases` can only be used at compile time in import statements")
161+
object matchWithSubCases
157162
end experimental
158163

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

0 commit comments

Comments
 (0)