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

Analyzer 'create missing overrides' doesn't work right with type arguments #34729

Closed
jensjoha opened this Issue Oct 9, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@jensjoha
Contributor

jensjoha commented Oct 9, 2018

Example:

file import.dart:

class A<R> extends B<R> {
  R a() {}
}

class B<R> {
  R b() {}
}

file main.dart:

import 'import.dart';

class Foo implements A<bool> {
  
}

I'm being told Missing concrete implementations of A.a and B.b.. A quick fix is available. So far so good.
Applying 'Create 2 missing override(s)' and now my file looks like this:

import 'import.dart';
import 'import.dart';

class Foo implements A<bool> {
  @override
  bool a() {
    // TODO: implement a
  }

  @override
  R b() {
    // TODO: implement b
  }
  
}

not only did it forget to apply the type argument for b - it also added an import I already had.

@scheglov

This comment has been minimized.

Show comment
Hide comment
Contributor

scheglov commented Oct 12, 2018

@scheglov scheglov closed this Oct 12, 2018

dart-bot pushed a commit that referenced this issue Oct 12, 2018

Switch CREATE_MISSING_OVERRIDES to writeOverrideOfInheritedMember() a…
…nd using FunctionType signatures.

This fixes the issue, and simplifies code generation.

R=brianwilkerson@google.com

Bug: #34729
Change-Id: I65928b5e68e44e4db77eb9c371aa1e6d27d66635
Reviewed-on: https://dart-review.googlesource.com/c/79468
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