Skip to content

Commit 60900bb

Browse files
KacperFKorbantgodzik
authored andcommitted
Don't explicitly check for error trees in export selectors
[Cherry-picked 6e28679]
1 parent 03fdc14 commit 60900bb

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
@@ -1111,7 +1111,7 @@ class Namer { typer: Typer =>
11111111
private def exportForwarders(exp: Export, pathMethod: Symbol)(using Context): List[tpd.MemberDef] =
11121112
val buf = new mutable.ListBuffer[tpd.MemberDef]
11131113
val Export(expr, selectors) = exp
1114-
if expr.isEmpty || selectors.exists(_.imported.name == nme.ERROR) then
1114+
if expr.isEmpty then
11151115
report.error(em"Export selector must have prefix and `.`", exp.srcPos)
11161116
return Nil
11171117

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)