@@ -45,6 +45,7 @@ object Feature:
4545 val magic = experimental(" magic" )
4646 val inlineTraits = experimental(" inlineTraits" )
4747 val specializedTraits = experimental(" specializedTraits" )
48+ val maybe = experimental(" maybe" )
4849
4950 val nonViralExperimentalFeatures : Set [TermName ] =
5051 Set (captureChecking, separationChecking, safe, magic)
@@ -86,6 +87,7 @@ object Feature:
8687 (magic, " Enable extensions for working with coding agents" ),
8788 (inlineTraits, " Allow inline traits" ),
8889 (specializedTraits, " Allow specialized traits" ),
90+ (maybe, " Allow T? and T ? E types" ),
8991 )
9092
9193 /** Features that are now standard; the language import / -language choice is
@@ -193,10 +195,13 @@ object Feature:
193195 || enabledBySetting(specializedTraits)
194196 || ctx.compilationUnit.knowsInlineTraits
195197
198+ def maybeEnabled (using Context ) =
199+ enabled(maybe) || magicEnabled
200+
196201 /** Is pureFunctions enabled for this compilation unit? */
197202 def pureFunsEnabled (using Context ) =
198203 enabledBySetting(pureFunctions)
199- || ctx.compilationUnit .knowsPureFuns
204+ || ctx.originalCompilationUnit .knowsPureFuns
200205 || ccEnabled
201206
202207 /** Is capture checking enabled by a command-line setting? */
0 commit comments