Skip to content
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

Add support for generic tuples #4938

Merged
merged 17 commits into from
Sep 6, 2018
Merged

Commits on Sep 6, 2018

  1. Add Tuple and *: types

    These types are injected as parents of Tuple1,...,Tuple22, but are
    eliminated again at erasure.
    
    To support them properly before full dotty bootstrap we needed
    a @`rewrite` annotation that erases the annotated method (unlike
    `@forceInline`, which generates code).
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    f080a39 View commit details
    Browse the repository at this point in the history
  2. Add version-specific source directories in the library

    And replace Tuple.scala with a Scala 2 implementation and a Scala 3
    implementation. The Scala 2 implementaion of Tuple.scala is not strictly
    necessary but could be useful if non-version-specific library sources
    end up referencing scala.Tuple.
    smarter authored and odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    84baabb View commit details
    Browse the repository at this point in the history
  3. Fix Inlined abbreviation in erased code

    Erased code does not keep full Inlined trees. The previous version converted
    the Inlined tree back to the call, but this can expose leaks (since calls are
    not traversed for references). We now keep the Inlined node, so that its call part
    can be subsequently simplified.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    4e550ab View commit details
    Browse the repository at this point in the history
  4. Remove rewrite annotation again

    With the Scala 2/3 split, we don't need it anymore.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    6dde9ea View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    75729c8 View commit details
    Browse the repository at this point in the history
  6. Fix TupleXXL equals

    Does not rely anymore on `deep`, which is dropped in Scala 2.14.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    0a24170 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b9f3ab7 View commit details
    Browse the repository at this point in the history
  8. Erase *: to tuple classes

    Was erased to Object before, but this loses precision and breaks
    binary compatibility with Scala 2.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    26f0d75 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2d1427d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bc08290 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0378bb4 View commit details
    Browse the repository at this point in the history
  12. Whitelist some Scala-2 classes as pure

    Currently, this is not exploited but some rewrites might become more effective that way in the future.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    79ca51c View commit details
    Browse the repository at this point in the history
  13. Fix side-effect handling in reduceProjection

    There's a difference to be made between projections of instance creations in a preceding val
    on the one hand and instance creations in a def or directly written creations on the other hand.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    0285243 View commit details
    Browse the repository at this point in the history
  14. Support a limited form of rewrite unapplys

    Currently only unapplys that return a tuple are supported.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    0996a4a View commit details
    Browse the repository at this point in the history
  15. Enforce implementation restrictions

     - no nested rewrites
     - calls to rewrite unapplys only in rewrite code
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    3d48ff3 View commit details
    Browse the repository at this point in the history
  16. Address review comments

    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    a160063 View commit details
    Browse the repository at this point in the history
  17. Add failing pickling test to blacklist

    tuples1.scala is explainable and harmless. The other two (i4758 and t7426) give a stale
    symbol but in my setup they do that already on master. I wonder how they slipped through the CI.
    odersky committed Sep 6, 2018
    Configuration menu
    Copy the full SHA
    42a5a9d View commit details
    Browse the repository at this point in the history