Skip to content

Commit d26549d

Browse files
Merge pull request #12516 from dotty-staging/fix-12249
Fix #12249: don't export java defined modules
2 parents c1eaf8c + 070b863 commit d26549d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,8 @@ class Namer { typer: Typer =>
10001000
) match
10011001
case Some(other) => No(i"overrides ${other.showLocated}, which is already a member of $cls")
10021002
case None => Yes
1003+
else if sym.isAllOf(JavaModule) then
1004+
Skip
10031005
else Yes
10041006
}
10051007

tests/neg/12249.scala

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
export java.util.UUID
3+
4+
def bar = println(new UUID(1, 2)) // OK
5+
6+
def foo = println(UUID.randomUUID()) // error
7+
// ^^^^
8+
// Not found: UUID
9+

0 commit comments

Comments
 (0)