-
Notifications
You must be signed in to change notification settings - Fork 224
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
Support for selectively overriding individual fields in Dialect #2751
Comments
Thanks for reporting! The issue only happens with quasiquotes? As a workaround, you could create the tree manually, does it work in that case? I am not sure currently how to properly fix it, we could have and additional dialect Scala212Pre16 maybe? |
scala> import scala.meta._
import scala.meta._
scala> t"Foo[_]"
res0: meta.Type.Apply = Foo[_] // Represented ideally in this case by toString
scala> t"Foo[_]".syntax
res1: String = Foo[?] // Since it resolves the `Dialect` on `.syntax`, this now does not do what I'm after
scala> res0.structure // Pull the structure out from the one that appeared to be represented ideally
res2: String = Type.Apply(Type.Name("Foo"), List(Type.Placeholder(Type.Bounds(None, None))))
scala> Type.Apply(Type.Name("Foo"), List(Type.Placeholder(Type.Bounds(None, None)))).syntax
res3: String = Foo[?] // Still resolves the source encoding for _ => ? from the default Dialect
I think in the long run, the restriction that You've got all these beautiful I guess that gets us back to your suggestion of just exposing yet another dialect, your |
Alright. I've created three PRs, all of which I intend to be merged (the two that mention this ticket are intended to be merged and released ASAP to resolve the breakage, the third should be released once 2.12.16 and 2.13.9 are available for consumption). |
Thank you again and perpetually for scalameta, it is an absolute joy to use. I would not have half as much fun metaprogramming without such an excellent library 🙂 |
The failure is not in for instance,
|
Also, maybe |
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Previously, we would always print `?` for the placeholder even if the Scala version wouldn't allow it. Now, we only print `?` if it was explicitely used in the code. Fixes scalameta#2751 The other solution would be introducing another dialect, but that would require a lot of people having to also change that, so it would require a lot more effort in the long run.
Seems possibly related to #2750
Definitely related to #2734
Now that
Foo[?]
syntax is default, I expected to be able to... in order to restore the previous functionality, but I'm greeted with
Digging into the code, I found this message:
which doesn't inspire much hope. How can this be resolved?
I guess this is only a transitional issue, while everybody upgrades to the latest versions of Scala212 and 213, and I can stay on the old version of scalameta, but I've not seen any discussion around this so I thought I'd ask.
Thank you for your excellent library!
A full reproduction case:
The text was updated successfully, but these errors were encountered: