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

Named tuples 3 #20346

Closed
wants to merge 68 commits into from
Closed

Named tuples 3 #20346

wants to merge 68 commits into from

Commits on May 6, 2024

  1. Configuration menu
    Copy the full SHA
    9d1f20d View commit details
    Browse the repository at this point in the history
  2. Improvements to Tuples: New methods

    New methods: filter, indicesWhere, reverseOnto
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    2395ece View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    64a79c9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb95265 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6ae8252 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1f79b87 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b9899b7 View commit details
    Browse the repository at this point in the history
  8. Add doc page

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    27d6288 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5dd48f9 View commit details
    Browse the repository at this point in the history
  10. Various tweaks

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    bd9bb8a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e0a11cd View commit details
    Browse the repository at this point in the history
  12. Fix test

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    b9d86fe View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0fbdb49 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    6f53dcd View commit details
    Browse the repository at this point in the history
  15. Another fix for named get patterns

    Also, add deep matches to tests
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    b44f15d View commit details
    Browse the repository at this point in the history
  16. Avoid widening into unreducible types when inferring types

    This is a general improvement, independent of named tuples.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    02aa578 View commit details
    Browse the repository at this point in the history
  17. Fix rebase breakage

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    b7115e7 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5c9bb5f View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4758830 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    18f600d View commit details
    Browse the repository at this point in the history
  21. Update check file

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    5513ed6 View commit details
    Browse the repository at this point in the history
  22. Better printing of NamedTuple type trees

    Use the sugared representation, not the raw NamedTuple type tree.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    fb1541a View commit details
    Browse the repository at this point in the history
  23. Add FieldsOf type

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    cf09b19 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    4baa509 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    702dcd5 View commit details
    Browse the repository at this point in the history
  26. 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
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    1e31d16 View commit details
    Browse the repository at this point in the history
  27. Refactor typedSelect

    I usually try to avoid explicit returns, but here they do make the
    code easier to read.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    22e6c89 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    d0888f6 View commit details
    Browse the repository at this point in the history
  29. 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.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    69964b0 View commit details
    Browse the repository at this point in the history
  30. Make NamedTuple.From work for named tuple arguments

    NamedTyple.From should be the identity for named tuple arguments
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    a3409e0 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    111674c View commit details
    Browse the repository at this point in the history
  32. Rename inMode to withModeBits

    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.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    1fd5962 View commit details
    Browse the repository at this point in the history
  33. 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.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    c0b792f View commit details
    Browse the repository at this point in the history
  34. Update MimaFilters

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    611861b View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    640da16 View commit details
    Browse the repository at this point in the history
  36. Add tyql test case

    It now work with just named tuples, no other extensions are needed.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    67c0af2 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    2cd5d7e View commit details
    Browse the repository at this point in the history
  38. Update documentation following review suggestions

    Co-authored-by: Dale Wijnand <[email protected]>
    odersky and dwijnand committed May 6, 2024
    Configuration menu
    Copy the full SHA
    d8b7595 View commit details
    Browse the repository at this point in the history
  39. Drop TreeInfo's dropNamedArg

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    e0eb247 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    4279a58 View commit details
    Browse the repository at this point in the history
  41. Don't abbreviate tuple bindings if right-hand-side is named

    We need to go through an explicit pattern match to drop the names.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    c0bd1e4 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    b997f3d View commit details
    Browse the repository at this point in the history
  43. 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.
    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    2206d88 View commit details
    Browse the repository at this point in the history
  44. Fixes to NamedTuple

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    ca19f1a View commit details
    Browse the repository at this point in the history
  45. More tests

    odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    984fe62 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    21bcfef View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    92d22c9 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    1613ee1 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    a04d3a7 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    37b1bd2 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    3f8f6c6 View commit details
    Browse the repository at this point in the history
  52. Add an infix shorthand for Append[X, Y]

    as is the case for `Concat`
    EugeneFlesselle authored and odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    9627c08 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    8a4162f View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    0ab9e7b View commit details
    Browse the repository at this point in the history
  55. Refine bounds of type Filter predicate

    to only require being defined on the element types.
    Similar to what we have for `type FlatMap`
    EugeneFlesselle authored and odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    075b7d1 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    c58c8c2 View commit details
    Browse the repository at this point in the history
  57. Do indexOf runtime operation based on term equality

    and refine `type IndexOf` doc
    EugeneFlesselle authored and odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    57b17ac View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    f427ec9 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    94b7c1f View commit details
    Browse the repository at this point in the history
  60. Move NonEmptyTuple methods into Tuple

    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.
    EugeneFlesselle authored and odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    5df2120 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    40c6138 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    03509b8 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    9047ac3 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    579e14a View commit details
    Browse the repository at this point in the history
  65. Make named-tuples-strawman-2.scala a run test

    The tuple term level definitions were not being tested before
    EugeneFlesselle authored and odersky committed May 6, 2024
    Configuration menu
    Copy the full SHA
    8d6fa37 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    1e29c4f View commit details
    Browse the repository at this point in the history
  67. Undo all changes to Tuples.

    For the two operations that we really need for NamedTuple, we
    define them as "internal" helpers inside NamedTuple.
    
    We remove or amend tests that relied on the changes to Tuple. No
    tests about NamedTuple's are affected.
    sjrd committed May 6, 2024
    Configuration menu
    Copy the full SHA
    87ba9c3 View commit details
    Browse the repository at this point in the history
  68. Revert the addition of type Fields in Selectable.

    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.
    sjrd committed May 6, 2024
    Configuration menu
    Copy the full SHA
    5406b11 View commit details
    Browse the repository at this point in the history