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

language_2/extension_methods/static_extension_syntax_test.dart #37765

Closed
bwilkerson opened this issue Aug 6, 2019 · 8 comments
Closed

language_2/extension_methods/static_extension_syntax_test.dart #37765

bwilkerson opened this issue Aug 6, 2019 · 8 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).

Comments

@bwilkerson
Copy link
Member

The test language_2/extension_methods/static_extension_syntax_test.dart defines a class (line 163):

class Rec<T extends Rec<T>> {}

and declares a local variable:

Rec<Object> superRec = RecSolution();

I believe that the type argument Object is not valid here because Object is not a Rec<T>.

@lrhn @leafpetersen

@leafpetersen
Copy link
Member

I think this is an analyzer bug: #34777 .

@bwilkerson
Copy link
Member Author

Then I'll close this issue. Thanks!

@leafpetersen
Copy link
Member

Actually, I think that test is bogus. That should be a static error.

@leafpetersen
Copy link
Member

Rec<Object> is a valid super bounded type, but superRec.e19 can't possibly infer a valid non-super bounded type. Same for superRec.e20.

@leafpetersen
Copy link
Member

@leafpetersen leafpetersen self-assigned this Aug 6, 2019
@mit-mit mit-mit added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Aug 7, 2019
@bwilkerson
Copy link
Member Author

@leafpetersen

Analyzer is now reporting two errors that I believe to be errors in the test:

error: The argument type 'List<RecSolution>' can't be assigned to the parameter type 'RecSolution'. (argument_type_not_assignable at [test_package] lib/shared_tests/static_extension_syntax_test.dart:75)
error: The argument type 'List<RecSolution>' can't be assigned to the parameter type 'RecSolution'. (argument_type_not_assignable at [test_package] lib/shared_tests/static_extension_syntax_test.dart:80)

There is also one error being reported that might be an error in analyzer:

error: The argument type 'T' can't be assigned to the parameter type 'Object'. (argument_type_not_assignable at [test_package] lib/shared_tests/static_extension_syntax_test.dart:12)

It looks like analyzer might be resolving to bounds too soon, but I'd appreciate it if you could look at it and confirm that there should not be an error there.

@bwilkerson bwilkerson reopened this Aug 12, 2019
@leafpetersen
Copy link
Member

It looks like analyzer might be resolving to bounds too soon, but I'd appreciate it if you could look at it and confirm that there should not be an error there.

Definitely not a correct error, and I don't see this with a bleeding edge build so maybe a local regression?

@leafpetersen
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

3 participants