Skip to content

Commit 6e28679

Browse files
committed
Don't explicitly check for error trees in export selectors
1 parent 74920d3 commit 6e28679

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ class Namer { typer: Typer =>
11311131
private def exportForwarders(exp: Export, pathMethod: Symbol)(using Context): List[tpd.MemberDef] =
11321132
val buf = new mutable.ListBuffer[tpd.MemberDef]
11331133
val Export(expr, selectors) = exp
1134-
if expr.isEmpty || selectors.exists(_.imported.name == nme.ERROR) then
1134+
if expr.isEmpty then
11351135
report.error(em"Export selector must have prefix and `.`", exp.srcPos)
11361136
return Nil
11371137

tests/neg/i20511.check

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
8 |val i = 1 // error
77
|^^^
88
|'.' expected, but 'end of statement' found
9-
-- Error: tests/neg/i20511.scala:7:21 ----------------------------------------------------------------------------------
9+
-- [E083] Type Error: tests/neg/i20511.scala:7:21 ----------------------------------------------------------------------
1010
7 |export toppingPrice, crustPrice // error // error
1111
| ^^^^^^^^^^
12-
| Export selector must have prefix and `.`
12+
| Any is not a valid export prefix, since it is not an immutable path
13+
|
14+
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)