Open bishabosha opened 4 years ago
This one seems more tricky, if we move the phase CompleteJavaEnums
before pickling, then the check fails for the @static
annotated forwarders to enum values after moving them to the enum class, we can either keep the forwarder moving in a later phase, or special case the error for @static
, or special case pickling for this signature, or do nothing.
@smarter @sjrd
if we move the phase CompleteJavaEnums before pickling
We can't have a phase that changes signature before pickling anyway: https://github.com/lampepfl/dotty/commit/1818b99f7cec44e70ea75eb41e63e4fd0b7d7647
we could chalk it up to another special case primitive of scala implementations? ala Nothing
, &
, |
, AnyKind
etc,
~I imagine this leaks into tasty reflect also so that could be a lot of special casing~ Edit: seems reflection doesn't reify apply nodes for parents
I am going to special case signatures in pickling and then benchmark it
On second thought, it just makes no sense to patch extends java.lang.Enum[MyEnum]
with the correct signature without also expanding the tree to extends java.lang.Enum[MyEnum]($name, $ordinal)
, where $name
and $ordinal
do not exist yet. So again making this change seems pretty dubious without the complete desugaring of constructors appearing before tasty, which is more tricky because there is no precedent for patching a specific parent in desugaring
minimized code
Compile with
0.27.0-RC1
In TASTy, the first parent of
A
iswith no value arguments passed.
expectation
The parent in TASTy should be
with any other relevant desugarings applied, such as adding
$name
and_$ordinal
to the constructor ofA
Alternative
special-casing the synthetic no-arg
java.lang.Enum
constructor becomes part of the specification for TASTy