Skip to content

Commit 2e409e1

Browse files
committed
Fix the description
1 parent 958371c commit 2e409e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -3706,15 +3706,15 @@ object Parsers {
37063706
in.languageImportContext = in.languageImportContext.importContext(imp, NoSymbol)
37073707
for case ImportSelector(id @ Ident(imported), EmptyTree, _) <- selectors do
37083708
if Feature.handleGlobalLanguageImport(prefix, imported) && !outermost then
3709-
val location =
3709+
val desc =
37103710
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"
37133713
val hint =
37143714
if ctx.mode.is(Mode.Interactive) then
37153715
f"\nTo use this language feature, include the flag `-language:$prefix.$imported` when starting the REPL"
37163716
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)
37183718
if allSourceVersionNames.contains(imported) && prefix.isEmpty then
37193719
if !outermost then
37203720
syntaxError(em"source version import is only allowed at the toplevel", id.span)

0 commit comments

Comments
 (0)