Skip to content
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

Dart does not throw error if class argument parameter extends Null #33703

Open
iarkh opened this issue Jun 29, 2018 · 1 comment
Open

Dart does not throw error if class argument parameter extends Null #33703

iarkh opened this issue Jun 29, 2018 · 1 comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. status-blocked Blocked from making progress by another (referenced) issue

Comments

@iarkh
Copy link
Contributor

iarkh commented Jun 29, 2018

Dart SDK Version: 2.0.0-dev.55.0
OS: Windows 10

Sample code below declares a class with parameter which extends [Null]. It causes compiler error with dartanalyzer and passes without errors with dart.

class A<X extends Null> {}
main() {}

This is similar to the issues #33699, #33701.
I believe both tools should behave in the same way.
Dartanalyzer sample output is:

Analyzing test.dart...
  error - 'X' can't be a supertype of its upper bound at test.dart:1:9 - type_parameter_supertype_of_its_bound
1 error found.

Dart stdout and stderr are empty, no exceptions or warnings there.

@eernstg
Copy link
Member

eernstg commented Jun 29, 2018

The discussion on #33701 revealed that the analyzer behaves as specified, and we need to decide (1) change the specification and the analyzer, or (2) just note that this is already working as intended in the analyzer.

Created issue #33709 in order to clarify the language question.

Marking this as blocked on #33709, and setting the label to area-front-end, which is the correct choice for the specification of today.

@eernstg eernstg added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). status-blocked Blocked from making progress by another (referenced) issue area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. status-blocked Blocked from making progress by another (referenced) issue
Projects
None yet
Development

No branches or pull requests

2 participants