File tree 3 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ object Feature:
26
26
val dependent = experimental(" dependent" )
27
27
val erasedDefinitions = experimental(" erasedDefinitions" )
28
28
val symbolLiterals : TermName = deprecated(" symbolLiterals" )
29
+ val macros = experimental(" macros" )
29
30
30
31
val experimentalWarningMessage = " Experimental features may only be used with nightly or snapshot version of compiler."
31
32
@@ -35,9 +36,9 @@ object Feature:
35
36
Properties .experimental && ! ctx.settings.YnoExperimental .value
36
37
37
38
def isExperimental (feature : TermName ): Boolean =
38
- feature match
39
+ feature != macros && feature. match
39
40
case QualifiedName (nme.experimental, _) => true
40
- case _ => true
41
+ case _ => false
41
42
42
43
/** Is `feature` enabled by by a command-line setting? The enabling setting is
43
44
*
Original file line number Diff line number Diff line change @@ -520,6 +520,7 @@ object StdNames {
520
520
val longHash : N = " longHash"
521
521
val macroThis : N = " _this"
522
522
val macroContext : N = " c"
523
+ val macros : N = " macros"
523
524
val main : N = " main"
524
525
val manifest : N = " manifest"
525
526
val ManifestFactory : N = " ManifestFactory"
Original file line number Diff line number Diff line change @@ -3036,7 +3036,10 @@ object Parsers {
3036
3036
val imp = Import (tree, selectors)
3037
3037
if isLanguageImport(tree) then
3038
3038
in.languageImportContext = in.languageImportContext.importContext(imp, NoSymbol )
3039
- if isExperimentalImport(tree) && ! Feature .experimentalEnabled then
3039
+ if isExperimentalImport(tree)
3040
+ && ! Feature .experimentalEnabled
3041
+ && selectors.exists(_.name != nme.macros)
3042
+ then
3040
3043
report.error(Feature .experimentalWarningMessage, imp.srcPos)
3041
3044
for
3042
3045
case ImportSelector (id @ Ident (imported), EmptyTree , _) <- selectors
You can’t perform that action at this time.
0 commit comments