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
The context type for an expression of the form e1[e2]++, e1[e2]--, ++e1[e2], --e1[e2] is apparently not specified.
In the case where the corresponding operator declarations have parameter types T1 and T2 for the index, the most general type that would work is the greatest lower bound of T1 and T2, so we would most likely use the standard lower bound (which is an approximation of the greatest lower bound).
classC {
T0operator[](T1 index) ...
operator[]=(T2 index, T3 value) ...
}
Xwhatever<X>() {
print(X);
throw0;
}
voidmain() {
C()[whatever()]++; // Prints the standard lower bound of `T1` and `T2`.
}
The text was updated successfully, but these errors were encountered:
I'm proposing the phrases 'standard upper bound' and 'standard lower bound' in this PR where a number of new sections from the overall null safety update to the language specification are added. That is again the result of integrating several documents including https://github.com/dart-lang/language/blob/master/resources/type-system/upper-lower-bounds.md into the language specification. Sorry, I forgot for a moment that this phrase is in text that hasn't yet landed.
It is not intended to differ from the functions that we've called "least upper bound" and "greatest lower bound" which are already implemented and used as part of the current language version (I don't remember precisely when those functions were changed most recently, but they have been essentially unchanged during all null safety language versions).
The context type for an expression of the form
e1[e2]++
,e1[e2]--
,++e1[e2]
,--e1[e2]
is apparently not specified.In the case where the corresponding operator declarations have parameter types
T1
andT2
for the index, the most general type that would work is the greatest lower bound ofT1
andT2
, so we would most likely use the standard lower bound (which is an approximation of the greatest lower bound).The text was updated successfully, but these errors were encountered: