-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Milestone
Description
Championed issue: dotnet/csharplang#190
Various scenarios:
if (tuple1 == (1, 2)) ...if (nestedTuple == ...) ...if (nullableT1 == t2) ...if (nullableT1 == nullableT2) ...
Open issues and test ideas:
- Issue with
this(issue Tuple equality: consider that struct this has side-effects and should be saved to temp #25488, PR Struct this should be saved to temp in tuple equality #25390) - Add optimization with NullableAlwaysHasValue/NullableNeverHasValue (issue Tuple equality: remember which temps are never null and optimize lowering further #25487)
- Should we pro-actively block tuple operators in VB as well? (no, let overload resolution kick in, confirm with VB LDM) (Kathleen confirmed ok to leave unblocked)
-
merge-fixups(PR Add suggested tuple equality tests #25486) - IOperation and order of children (Implementing basic GetOperations on tuple equality #25374)
- Allow on 1-tuple (
t8.Rest)? (no, remains disallowed) -
block EnC (Block EnC on and around tuple equality #25402) - should we produce any warnings for name mismatch between elements of compared tuples? (Track and check names in tuple equality #25396)
- Should we block other operators (even user-defined), just in case? (no, let overload resolution kick in)
- Fix semantic model (Restore semantic model functionality in tuple comparisons #25297)
- Test with
(default, default) - Test with fix for
defaultin comparison (Give default literals a type in tuple comparisons #25327) - Update spec and implementation so that order is: (1) dynamic case, (2) tuple case, (3) regular overload resolution, (4) fail.
- Verify in IDE
- Open question about customer
==,&andtrueoperators (answer: we'll apply conditional "truthiness/falsiness" on element-wise comparison results) (resolved in LDM on Feb 5th) - Double-check what is the truthiness rule for dynamic (from type, not from expression)
- Test with element of tuple being
bool? - test that only implicit conversion operator will be recognized (explicit conversion operator fails)
- Capture behavior for
d == tuplewheredis dynamic and holding a type that has a user-defined comparison operator to tuple types - Capture behavior for
d1 == d2whered1andd2are dynamic and holding tuple types (that may or may not be comparable statically) - Scenarios with
Restof 1 element orValueTuple'1in general should be disallowed (they are not tuples)
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Projects
Status
Done Umbrellas