-
Notifications
You must be signed in to change notification settings - Fork 213
Upper/lower bound computations in Dart give surprising results #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does this issue cover the discussion at dart-lang/sdk#25821 (comment) about removing the LUB computation when there is enough context to type check the two values individually? |
Also, does it cover the discussion at dart-lang/sdk#19425 (comment) ? |
I believe it's fair to say that dart-lang/sdk#19425 is covered: It deals with a case which is now handled by the |
Note also the following issues on very similar topics:
I created label |
Just to keep coming up with issues, and reminding that it's not just about conditional expressons. All LUBs are dangerous. Consider: class Foo {}
class _BarBase extends Foo {}
class Bar extends _BarBase {}
class _BazBase extends Foo {}
class Baz extends _BazBase {}
void main () {
var list = [Bar(), Baz()];
list.add(Foo());
print(list.length);
} All is well, the LUB of Then I recognize that class Foo {}
class _BarBazBase extends Foo {}
class Bar extends _BarBazBase {}
class Baz extends _BarBazBase {}
void main () {
var list = [Bar(), Baz()];
list.add(Foo()); // Error, cant pass `Foo` to argument expecting `_BarBazBase`.
print(list.length);
} (LUB delenda est!) |
Tracking issue for a longstanding problem that didn't get well-resolved in Dart 2. Fixing this will be breaking.
For language team reference, some non-public discussion here.
The text was updated successfully, but these errors were encountered: