File tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/parsing
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3706,15 +3706,15 @@ object Parsers {
3706
3706
in.languageImportContext = in.languageImportContext.importContext(imp, NoSymbol )
3707
3707
for case ImportSelector (id @ Ident (imported), EmptyTree , _) <- selectors do
3708
3708
if Feature .handleGlobalLanguageImport(prefix, imported) && ! outermost then
3709
- val location =
3709
+ val desc =
3710
3710
if ctx.mode.is(Mode .Interactive ) then
3711
- " in the REPL"
3712
- else " at the toplevel"
3711
+ " not allowed in the REPL"
3712
+ else " only allowed at the toplevel"
3713
3713
val hint =
3714
3714
if ctx.mode.is(Mode .Interactive ) then
3715
3715
f " \n To use this language feature, include the flag `-language: $prefix. $imported` when starting the REPL "
3716
3716
else " "
3717
- syntaxError(em " this language import is only allowed $location $hint" , id.span)
3717
+ syntaxError(em " this language import is $desc $hint" , id.span)
3718
3718
if allSourceVersionNames.contains(imported) && prefix.isEmpty then
3719
3719
if ! outermost then
3720
3720
syntaxError(em " source version import is only allowed at the toplevel " , id.span)
You can’t perform that action at this time.
0 commit comments