Skip to content

Conversation

@smarter
Copy link
Member

@smarter smarter commented Jun 5, 2019

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.

@smarter smarter added this to the 0.16 Tech Preview milestone Jun 5, 2019
@smarter smarter requested a review from odersky June 5, 2019 13:56
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.
@smarter smarter force-pushed the fix-ide-toplevel branch from 153b2f2 to 91950d1 Compare June 5, 2019 15:18
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I noted that behavior and was puzzled by it.

@odersky odersky merged commit 9465001 into scala:master Jun 5, 2019
@allanrenucci allanrenucci deleted the fix-ide-toplevel branch June 5, 2019 16:37
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.

2 participants