-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dotty pickles type trees of | and & to applied type tree of fictional symbols #7688
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
These tags were actually removed in #5935 but it might make sense to bring them back, the main benefit of #5935 is that it simplifies dotty internals, but that doesn't mean we can't represent & and | explicitly in Tasty itself. Also I think that this PR removed all the logic in tasty-reflect for constructing & and | types which is something people actually want to do in macros (cf. https://contributors.scala-lang.org/t/union-types-and-generalisations/3820/6?u=smarter) /cc @nicolasstucki |
I took a stab at this, but preserving the positions for the idempotency test seems hard |
do you mean that the positions are lost somewhere ? |
So I pickled just the type arguments of the AppliedTypeTree, with ANDtpt length tag, then when I reconstruct an AppliedTypeTree from the args and a ref(defn.andType), the range was off by one |
so I need to preserve the position of the tycon that is thrown away |
Right, the typetree itself should have a position, but I don't think that's any different from other type trees. |
Or do you mean the position of |
$ diff before-pickling.txt after-pickling.txt
53c53
< ):scala.quoted.Expr[$t0 & T2@tests/pos/i7264c.scala<113..116>]@tests/pos/i7264c.scala<113..116>@
---
> ):scala.quoted.Expr[$t0 & T2@tests/pos/i7264c.scala<114..116>]@tests/pos/i7264c.scala<113..116>@ |
closing because we discussed in a meeting about tasty format that |
minimized code
Because intersection types and union types are pickled in TASTy to applied type trees of imaginary types
scala.&
andscala.|
, all implementations must intercept these names, when they could be reified as the intrinsic types that they are.expectation
maybe new tags
ANDtpt
andORtpt
The text was updated successfully, but these errors were encountered: