-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Top-level defs cause "cannot merge" errors in ide #6605
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
Comments
Do you have a github repo where the problem is reproducible? |
Trying to build one that's minimal which shows the fault reliably ... it seems to be a bit of a heizenbug |
Here's a self-contained project. It fairly reliably does this for me in the file cannotMergeg.
Navigate in vs code to |
Toplevel defs are enclosed in an object named `<source>$package` by `Desugar#packageDef`, this didn't work correctly in the IDE because the name of the VirtualFile was the whole URI of the file. In particular this lead to double-vision problems ("cannot merge ...") when the toplevel definition was also present on the classpath.
Toplevel defs are enclosed in an object named `<source>$package` by `Desugar#packageDef`, this didn't work correctly in the IDE because the name of the VirtualFile was the whole URI of the file. In particular this lead to double-vision problems ("cannot merge ...") when the toplevel definition was also present on the classpath. Also one of the overload of Driver#compile to Driver#compileFromString for clarity and give better names to VirtualFile it creates since they could also leak into the names of generated objects.
Fixed by #6611, thanks for the minimization! |
I get a lot of these "cannot merge" errors when editing dotty code in visual studio code, run with
sbt launchIDE
. I can't nail down exactly what triggers it, other than it is a lot worse when the package contains the new allowed top-level declarations. Top-level defs and implied instances. In this case,helloWorld
is a top-level def.The text was updated successfully, but these errors were encountered: