-
Notifications
You must be signed in to change notification settings - Fork 1.1k
String identifiers yield compilation errors when converted withDottyCompat #3100
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
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 21, 2019
There were several issues with the scheme we used so far: - It's different from Scala 2, meaning that some Scala 2 methods could not be called from Dotty and vice-versa (see the added sbt-dotty/sbt-test/scala2-compat/akka/i3100.scala test for an example) - It can lead to invalid filenames on Windows (scala#7492) - The handling of backticks is broken: adding or removing backticks around a name changes how it's encoded. To maintain Scala 2 compat we don't have a lot of choices here, we must use the same scheme, so this commit aligns NameTransformer.scala with https://github.com/scala/scala/blob/2.13.x/src/library/scala/reflect/NameTransformer.scala Fixes scala#3100. Fixes scala#5936. Fixes scala#7492.
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 21, 2019
There were several issues with the scheme we used so far: - It's different from Scala 2, meaning that some Scala 2 methods could not be called from Dotty and vice-versa (see the added sbt-dotty/sbt-test/scala2-compat/akka/i3100.scala test for an example) - It can lead to invalid filenames on Windows (scala#7492) - The handling of backticks is broken: adding or removing backticks around a name changes how it's encoded. To maintain Scala 2 compat we don't have a lot of choices here, we must use the same scheme, so this commit aligns NameTransformer.scala with https://github.com/scala/scala/blob/2.13.x/src/library/scala/reflect/NameTransformer.scala Fixes scala#3100. Fixes scala#5936. Fixes scala#7492.
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 21, 2019
There were several issues with the scheme we used so far: - It's different from Scala 2, meaning that some Scala 2 methods could not be called from Dotty and vice-versa (see the added sbt-dotty/sbt-test/scala2-compat/akka/i3100.scala test for an example) - It can lead to invalid filenames on Windows (scala#7492) - The handling of backticks is broken: adding or removing backticks around a name changes how it's encoded. To maintain Scala 2 compat we don't have a lot of choices here, we must use the same scheme, so this commit aligns NameTransformer.scala with https://github.com/scala/scala/blob/2.13.x/src/library/scala/reflect/NameTransformer.scala Fixes scala#3100. Fixes scala#5936. Fixes scala#7492.
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 25, 2019
There were several issues with the scheme we used so far: - It's different from Scala 2, meaning that some Scala 2 methods could not be called from Dotty and vice-versa (see the added sbt-dotty/sbt-test/scala2-compat/akka/i3100.scala test for an example) - It can lead to invalid filenames on Windows (scala#7492) - The handling of backticks is broken: adding or removing backticks around a name changes how it's encoded. To maintain Scala 2 compat we don't have a lot of choices here, we must use the same scheme, so this commit aligns NameTransformer.scala with https://github.com/scala/scala/blob/2.13.x/src/library/scala/reflect/NameTransformer.scala Some examples: Method name | Old encoding | New encoding ----------------------------------------- a_+ | a_$plus | a_$plus `a_+` | a_+ | a_$plus `+_a` | +_a | $plus_a a_/ | a_$div | a_$div `a_/` | a_$u002F | a_$div If a Dotty method is called `def a_$plus` we won't misinterpret it as `a_+` because the method name comes from the tasty tree which stores unencoded names. On the other hand, names coming from Java / Scala 2 as well as top-level classnames might be misinterpreted as encoded names if they contain a user-written $, this is left unspecified. Fixes scala#3100. Fixes scala#5936. Fixes scala#7492.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have gotten an unexpected compilation error when setting up a template project to try out dotty and following the Akka documentation at http://doc.akka.io/docs/akka-http/current/scala/http/introduction.html#using-akka-http
I set up the dependencies described and added
withDottyCompat
to my library dependencies in mybuild.sbt
and also made sure to definecrossScalaVersions
as per the Dotty example project.I then get an compilation error for the following line of code:
The error I get is
If I change the signature (via content assist) to
Dotty can now compile the project just fine.
The text was updated successfully, but these errors were encountered: