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

Initializing a field with a generic static method tearoff causes type error #32396

Closed
leafpetersen opened this issue Mar 2, 2018 · 2 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@leafpetersen
Copy link
Member

This code produces a strange type error in the analysis driver, but not the task model.

  error • A value of type '<T>(T) → T' can't be assigned to a variable of type '<T₀>(T) → T' at /Users/leafp/tmp/ddctest.dart:3:20 • invalid_assignment
class C<E> {
  static T g<T>(T e) => null;
  static final h = g;
}
@leafpetersen leafpetersen added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Mar 2, 2018
@jmesserly
Copy link

jmesserly commented Mar 2, 2018

doh. That's a capture/substitution bug, could be related to #30379. (but it could be something else. FunctionType APIs are pretty error prone, it's easy to drop the type parameters or substitution by accident.)

@scheglov
Copy link
Contributor

@scheglov scheglov self-assigned this Mar 16, 2018
dart-bot pushed a commit that referenced this issue Mar 19, 2018
R=brianwilkerson@google.com

Bug: #32396
Change-Id: I4b6b6804cfced4c6628198a7e99e0123f77c2108
Reviewed-on: https://dart-review.googlesource.com/46940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

3 participants