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
Redesign Tuples with HList-like structure #2199
Closed
Closed
Commits on May 1, 2017
-
Configuration menu - View commit details
-
Copy full SHA for e1ef43d - Browse repository at this point
Copy the full SHA e1ef43dView commit details -
Changes are as follows: - New types for tuples in dotty library: Tuple = Unit | TupleCons Head Tail <: Tuple - Desugaring uses this structure instead of the scala.TupleN for types and expressions - New TupleRewrites phase does rewrites the HList structure into scala.TupleN like case classes (for small arities) or a case class wrapping an Array (for large arities)
Configuration menu - View commit details
-
Copy full SHA for 00044b6 - Browse repository at this point
Copy the full SHA 00044b6View commit details -
Erasure/Scala2Unpickler hacks to restore binary compatibility
To stay binary compatibility with scala 2.11 binaries, we hijack the unpickling of types to fake an HList structure. Later on in erasure, HList types are eraised back to scala.TupleN (for N <= 22). In addition because the actual scala.TupleN classes are neither `<: Tuple` now `<: TupleCons`, these types needs to be systematically araised to Object. In addition to all these carefully compensating hacks, this also imposes a new contain: the dotty-library, which defines several `Tuple/TupleCons` methods, can should now *always* be compiled by dotty itself. Indeed, when compiled with scalac, these types will stay as they are instead of being eraised to Object.
Configuration menu - View commit details
-
Copy full SHA for 1c0a088 - Browse repository at this point
Copy the full SHA 1c0a088View commit details -
Update Build.scala to always use dotty-library-bootstraped
I couldn't get rid of the `dotty-library` project completely, it's still used the first time sbt-briged is compiled with dotty. The dependencies are as follows: - (no dep) compile `dotty-compile` with scalac [0] - (no dep) compile `dotty-library` with scalac [1] - ([0], [1]) → compile `dotty-sbt-bridge` with dotty [2] - ([0], [2]) → compile `dotty-library-bootstraped` with dotty + sbt After that, [1] should never be used again.
Configuration menu - View commit details
-
Copy full SHA for adb13ac - Browse repository at this point
Copy the full SHA adb13acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f4fca6 - Browse repository at this point
Copy the full SHA 9f4fca6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69a402a - Browse repository at this point
Copy the full SHA 69a402aView commit details -
Update tests after tuple changes
- dotc/scala-collections.blacklist: Blacklist Unit and TupleN from scala-collections test - tests/neg/i1653.scala: Having an additional superclass on Unit seams to affect the error here (not sure why). - tests/pos/t0301.scala: Since `_2` is now added thought implicit conversion, the pattern used in this case is no longer stable. - tests/pos/tcpoly_bounds1.scala: This test uses the fact that `(A, B) <: Product2[A, B]`, which is no longer the case. - tests/repl/patdef.check: Having the `_i` via implicit conversions remove the @unchecked here - tests/run/tuple-match.scala: Replace Tuple1 in pattern matching with explicit TupleCons pattern. TupleN can still be used in apply position (defined as defs in DottyPredef), but not in unapply position. - tests/run/unapply.scala: Also uses the fact that `(A, B) <: Product2[A, B]`. - tests/run/withIndex.scala: Might be a limitation in typer?: 14 | case _: Array[Tuple2[_, _]] => true | ^^^^^^^^^^^^ |unreducible application of higher-kinded type [A, B] => dotty.TupleCons[A, dotty.TupleCons[B, Unit]] to wildcard arguments
Configuration menu - View commit details
-
Copy full SHA for 4058a9c - Browse repository at this point
Copy the full SHA 4058a9cView commit details -
The LogPendingSubTypesThreshold change is requires for tests on size ~25 tuples that would otherwise trigger -Yno-deep-subtypes
Configuration menu - View commit details
-
Copy full SHA for 22ffef2 - Browse repository at this point
Copy the full SHA 22ffef2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e477a0 - Browse repository at this point
Copy the full SHA 0e477a0View commit details -
Always publishLocal before tests
Because all tests depend on dotty-library-bootstrapped publishLocal is always needed to run tests.
Configuration menu - View commit details
-
Copy full SHA for 491947a - Browse repository at this point
Copy the full SHA 491947aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c92389 - Browse repository at this point
Copy the full SHA 6c92389View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.