Skip to content

Commit

Permalink
Minor update to CLs WG notes (#7872)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson authored Jan 26, 2024
1 parent 072b196 commit fc21965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meetings/working-groups/collection-literals/CL-2024-01-23.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Broken down, we see important design needing to be made in the following areas:

For example, we could consider things in the following ways:

- `k:v` is simply a shorthand for `KeyValuePair<TKey,TValue>`. And as such, the following would be legal: `List<KeyValuePair<string, int>> nameToAgeList = ["mads": 21]`
- `k:v` represents a key-value *association*, and thus should only be usable with dictionary-esque (tbd) types, not sequence-esque types.
- `k:v` is simply a shorthand for `KeyValuePair<TKey,TValue>`. And as such, the following would be legal: `List<KeyValuePair<string, int>> nameToAgeList = ["mads": 21]`. This allows for the possibility that `((Collection)[k:v])[k]` may not yield `v`.
- `k:v` represents a key-value *association*, and thus should only be usable with dictionary-esque (tbd) types, not sequence-esque types. This enforces the intuition that `((Collection)[k:v])[k]` yields `v`.

As part of this, we want to figure out what expressions elements can mix/match with what target types. For example (as shown above) can a `k:v` element be used with a sequence-type? Can a normal expression element be used with a dictionary type (e.g. `Dictionary<string, int> x = [kvp1, kvp2]`)?

Expand Down

0 comments on commit fc21965

Please sign in to comment.