You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In BindLengthAndIndexerForListPattern we do: _ = GetWellKnownTypeMember(WellKnownMember.System_Index__op_Implicit_FromInt32, diagnostics, syntax: node);
From Aleksey: Just to clarify. What bothers me here is the fact that lowering never uses this member explicitly, it relies on conversion classification instead, etc. So, we are making an assumption that all that complicated machinery ends up using the method. However, there is no actual guarantee that that would be the case. For example, if method is not marked with special name flag, it won't be considered as a valid conversion operator.
As part of this, we should confirm whether we want list-pattern to lower as expr[0] (using conversion from int to Index) or expr[new Index(0)] (using constructor).
The text was updated successfully, but these errors were encountered:
From discussion with Aleksey, we're leaning towards aligning on constructor. This involves less machinery (no conversion classification) and aligns with what we do for from-end Index values. We'll update the spec to clarify accordingly. @333fred Sounds okay?
From discussion with Aleksey, we're leaning towards aligning on constructor. This involves less machinery (no conversion classification) and aligns with what we do for from-end Index values. We'll update the spec to clarify accordingly. @333fred Sounds okay?
In
BindLengthAndIndexerForListPattern
we do:_ = GetWellKnownTypeMember(WellKnownMember.System_Index__op_Implicit_FromInt32, diagnostics, syntax: node);
From Aleksey: Just to clarify. What bothers me here is the fact that lowering never uses this member explicitly, it relies on conversion classification instead, etc. So, we are making an assumption that all that complicated machinery ends up using the method. However, there is no actual guarantee that that would be the case. For example, if method is not marked with special name flag, it won't be considered as a valid conversion operator.
As part of this, we should confirm whether we want list-pattern to lower as
expr[0]
(using conversion from int to Index) orexpr[new Index(0)]
(using constructor).The text was updated successfully, but these errors were encountered: