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 "6.8.7. Correspondence, subrange, and stream operators", the lookup operator is defined as yielding the result of lhs.get(index) with type Y? for lhsCorrespondence<X,Y>. But the actual return type of lhs.get(index) may be a subtype of Y?.
It would be nice if the lookup operator honored the actual return type of get rather than assuming an optional type.
Usage example:
objectmultimapsatisfiesCorrespondence<String, [Integer*]> {
sharedactualBooleandefines(Stringkey) => nothing;
sharedactual [Integer*] get(Stringkey) => [];
}
[Integer*] result1 = multimap[""]; // error Integer[]? is not assignable to Integer[]
[Integer*] result2 = multimap.get(""); // ok
The text was updated successfully, but these errors were encountered:
In "6.8.7. Correspondence, subrange, and stream operators", the lookup operator is defined as yielding the result of
lhs.get(index)
with typeY?
forlhs
Correspondence<X,Y>
. But the actual return type oflhs.get(index)
may be a subtype ofY?
.It would be nice if the lookup operator honored the actual return type of
get
rather than assuming an optional type.Usage example:
The text was updated successfully, but these errors were encountered: