-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Named tuples second implementation #19174
Commits on May 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9d1f20d - Browse repository at this point
Copy the full SHA 9d1f20dView commit details -
Improvements to Tuples: New methods
New methods: filter, indicesWhere, reverseOnto
Configuration menu - View commit details
-
Copy full SHA for 2395ece - Browse repository at this point
Copy the full SHA 2395eceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64a79c9 - Browse repository at this point
Copy the full SHA 64a79c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb95265 - Browse repository at this point
Copy the full SHA cb95265View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ae8252 - Browse repository at this point
Copy the full SHA 6ae8252View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f79b87 - Browse repository at this point
Copy the full SHA 1f79b87View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9899b7 - Browse repository at this point
Copy the full SHA b9899b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27d6288 - Browse repository at this point
Copy the full SHA 27d6288View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dd48f9 - Browse repository at this point
Copy the full SHA 5dd48f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd9bb8a - Browse repository at this point
Copy the full SHA bd9bb8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0a11cd - Browse repository at this point
Copy the full SHA e0a11cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9d86fe - Browse repository at this point
Copy the full SHA b9d86feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0fbdb49 - Browse repository at this point
Copy the full SHA 0fbdb49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f53dcd - Browse repository at this point
Copy the full SHA 6f53dcdView commit details -
Configuration menu - View commit details
-
Copy full SHA for b44f15d - Browse repository at this point
Copy the full SHA b44f15dView commit details -
Avoid widening into unreducible types when inferring types
This is a general improvement, independent of named tuples.
Configuration menu - View commit details
-
Copy full SHA for 02aa578 - Browse repository at this point
Copy the full SHA 02aa578View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7115e7 - Browse repository at this point
Copy the full SHA b7115e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c9bb5f - Browse repository at this point
Copy the full SHA 5c9bb5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4758830 - Browse repository at this point
Copy the full SHA 4758830View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18f600d - Browse repository at this point
Copy the full SHA 18f600dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5513ed6 - Browse repository at this point
Copy the full SHA 5513ed6View commit details -
Better printing of NamedTuple type trees
Use the sugared representation, not the raw NamedTuple type tree.
Configuration menu - View commit details
-
Copy full SHA for fb1541a - Browse repository at this point
Copy the full SHA fb1541aView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf09b19 - Browse repository at this point
Copy the full SHA cf09b19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4baa509 - Browse repository at this point
Copy the full SHA 4baa509View commit details -
Configuration menu - View commit details
-
Copy full SHA for 702dcd5 - Browse repository at this point
Copy the full SHA 702dcd5View commit details -
Implement Fields as a Selectable type member
Subclasses of Selectable can instantiate Fields to a named tuple type that provides possible selection names and their types on instances of the type. See: https://contributors.scala-lang.org/t/expanding-changing-selectable-based-on-upcoming-named-tuples-feature/6395/5
Configuration menu - View commit details
-
Copy full SHA for 1e31d16 - Browse repository at this point
Copy the full SHA 1e31d16View commit details -
I usually try to avoid explicit returns, but here they do make the code easier to read.
Configuration menu - View commit details
-
Copy full SHA for 22e6c89 - Browse repository at this point
Copy the full SHA 22e6c89View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0888f6 - Browse repository at this point
Copy the full SHA d0888f6View commit details -
Fix fields as a selectable type member
The selectDynamic call could already have influenced type variables in the expected type before we wrap it in a cast. Need to pass in the right expected type to the typedDynamicSelect.
Configuration menu - View commit details
-
Copy full SHA for 69964b0 - Browse repository at this point
Copy the full SHA 69964b0View commit details -
Make NamedTuple.From work for named tuple arguments
NamedTyple.From should be the identity for named tuple arguments
Configuration menu - View commit details
-
Copy full SHA for a3409e0 - Browse repository at this point
Copy the full SHA a3409e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 111674c - Browse repository at this point
Copy the full SHA 111674cView commit details -
inMode is useful, but its name is can easily be misinterpreted. Hopefully, withModeBits is better. Fixes rebase breakage where inMode was made private, but needs to be public since it is now used in Desugar.
Configuration menu - View commit details
-
Copy full SHA for 1fd5962 - Browse repository at this point
Copy the full SHA 1fd5962View commit details -
Revert NamedArg term/type classification
Strip NamedArgs instead when making a term/type classification of tuples. The previous classification of NamedArgs as terms or types broke the completion test suite. It seems that completion relies on NamedArgs being neither types nor terms. And in a sense, that's correct. They are not.
Configuration menu - View commit details
-
Copy full SHA for c0b792f - Browse repository at this point
Copy the full SHA c0b792fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 611861b - Browse repository at this point
Copy the full SHA 611861bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 640da16 - Browse repository at this point
Copy the full SHA 640da16View commit details -
It now work with just named tuples, no other extensions are needed.
Configuration menu - View commit details
-
Copy full SHA for 67c0af2 - Browse repository at this point
Copy the full SHA 67c0af2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cd5d7e - Browse repository at this point
Copy the full SHA 2cd5d7eView commit details -
Update documentation following review suggestions
Co-authored-by: Dale Wijnand <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d8b7595 - Browse repository at this point
Copy the full SHA d8b7595View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0eb247 - Browse repository at this point
Copy the full SHA e0eb247View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4279a58 - Browse repository at this point
Copy the full SHA 4279a58View commit details -
Don't abbreviate tuple bindings if right-hand-side is named
We need to go through an explicit pattern match to drop the names.
Configuration menu - View commit details
-
Copy full SHA for c0bd1e4 - Browse repository at this point
Copy the full SHA c0bd1e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b997f3d - Browse repository at this point
Copy the full SHA b997f3dView commit details -
Fix tuple selection in pattern matcher
The pattern matcher selects tuples up to 22 using _1, _2, ... But if the scrutinee is a named tuple this only works if it is cast to a regular tuple first.
Configuration menu - View commit details
-
Copy full SHA for 2206d88 - Browse repository at this point
Copy the full SHA 2206d88View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca19f1a - Browse repository at this point
Copy the full SHA ca19f1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 984fe62 - Browse repository at this point
Copy the full SHA 984fe62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21bcfef - Browse repository at this point
Copy the full SHA 21bcfefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92d22c9 - Browse repository at this point
Copy the full SHA 92d22c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1613ee1 - Browse repository at this point
Copy the full SHA 1613ee1View commit details -
Configuration menu - View commit details
-
Copy full SHA for a04d3a7 - Browse repository at this point
Copy the full SHA a04d3a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37b1bd2 - Browse repository at this point
Copy the full SHA 37b1bd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f8f6c6 - Browse repository at this point
Copy the full SHA 3f8f6c6View commit details -
Add an infix shorthand for
Append[X, Y]
as is the case for `Concat`
Configuration menu - View commit details
-
Copy full SHA for 9627c08 - Browse repository at this point
Copy the full SHA 9627c08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a4162f - Browse repository at this point
Copy the full SHA 8a4162fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ab9e7b - Browse repository at this point
Copy the full SHA 0ab9e7bView commit details -
Refine bounds of
type Filter
predicateto only require being defined on the element types. Similar to what we have for `type FlatMap`
Configuration menu - View commit details
-
Copy full SHA for 075b7d1 - Browse repository at this point
Copy the full SHA 075b7d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c58c8c2 - Browse repository at this point
Copy the full SHA c58c8c2View commit details -
Do
indexOf
runtime operation based on term equalityand refine `type IndexOf` doc
Configuration menu - View commit details
-
Copy full SHA for 57b17ac - Browse repository at this point
Copy the full SHA 57b17acView commit details -
Configuration menu - View commit details
-
Copy full SHA for f427ec9 - Browse repository at this point
Copy the full SHA f427ec9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94b7c1f - Browse repository at this point
Copy the full SHA 94b7c1fView commit details -
Move
NonEmptyTuple
methods intoTuple
This is for the same reason as we changed `type Head[X <: NonEmptyTuple] = ...` to `type Head[X <: Tuple] = ...` Also, this is no more unsafe than the other operations already defined for all tuples. `drop(1)` for example was always defined, even though `tail` wasn't.
Configuration menu - View commit details
-
Copy full SHA for 5df2120 - Browse repository at this point
Copy the full SHA 5df2120View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40c6138 - Browse repository at this point
Copy the full SHA 40c6138View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03509b8 - Browse repository at this point
Copy the full SHA 03509b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9047ac3 - Browse repository at this point
Copy the full SHA 9047ac3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 579e14a - Browse repository at this point
Copy the full SHA 579e14aView commit details -
Make named-tuples-strawman-2.scala a run test
The tuple term level definitions were not being tested before
Configuration menu - View commit details
-
Copy full SHA for 8d6fa37 - Browse repository at this point
Copy the full SHA 8d6fa37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e29c4f - Browse repository at this point
Copy the full SHA 1e29c4fView commit details
Commits on May 7, 2024
-
Undo all unnecessary changes to Tuples.
Keep only the changes we need for making NamedTuple work properly. We still keep operations Contains and Disjoint in Tuple and make Reverse standard. We remove or amend tests that relied on the changes to Tuple. No tests about NamedTuple's are affected.
Configuration menu - View commit details
-
Copy full SHA for 0c89c92 - Browse repository at this point
Copy the full SHA 0c89c92View commit details -
Revert the addition of
type Fields
inSelectable
.If we add it as is now, we will *not* be able to add the bound in a future release. It is best to leave it completely undefined. The typer is happy to ignore the case where it does not exist at all.
Configuration menu - View commit details
-
Copy full SHA for f80a8dd - Browse repository at this point
Copy the full SHA f80a8ddView commit details