Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root of Java select must be class or rooted package #21800

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Fixes #21333

Edge case in Java interop.

@som-snytt
Copy link
Contributor Author

The edge case is imports. scala/bug#7675

@som-snytt som-snytt force-pushed the issue/21333-java-package-names branch from f76979b to e3f0b1f Compare October 17, 2024 22:16
@som-snytt
Copy link
Contributor Author

-Ycheck apparently complains that Java class java in the empty package duplicates root package java.

I'm unable to reproduce the C.I. failure, which is only on Windows. Is that because the option is only specified for Windows? It reports -Ycheck:all, instead of specifying phase names.

java.lang.AssertionError: assertion failed: class defined twice module class java 6 2887
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
Error while emitting tests\pos\t11788b\Bar.scala
	at dotty.tools.dotc.transform.TreeChecker.testDuplicate(TreeChecker.scala:55)
assertion failed: class defined twice module class java 6 2887
	at dotty.tools.dotc.transform.TreeChecker.transformSym(TreeChecker.scala:78)
	at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform(DenotTransformers.scala:72)

Hopefully just putting the test code into named packages will solve the problem (which I can't reproduce).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First ident in Java type name must be type or package
1 participant