mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:58:13 +00:00
Check that the declaration with unimplemented members is ClassDeclaration (not ClassTypeAlias).
Another exception from logs. R=brianwilkerson@google.com Change-Id: I87ee5a7ad9c7171b23714a23f8ee861688bbf331 Reviewed-on: https://dart-review.googlesource.com/40467 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
94d8d6bf3b
commit
befb4f943a
|
@ -1466,7 +1466,9 @@ class FixProcessor {
|
|||
}
|
||||
|
||||
Future<Null> _addFix_createMissingOverrides() async {
|
||||
// prepare target
|
||||
if (node.parent is! ClassDeclaration) {
|
||||
return;
|
||||
}
|
||||
ClassDeclaration targetClass = node.parent as ClassDeclaration;
|
||||
ClassElement targetClassElement = targetClass.element;
|
||||
utils.targetClassElement = targetClassElement;
|
||||
|
@ -1613,6 +1615,9 @@ class FixProcessor {
|
|||
}
|
||||
|
||||
Future<Null> _addFix_createNoSuchMethod() async {
|
||||
if (node.parent is! ClassDeclaration) {
|
||||
return;
|
||||
}
|
||||
ClassDeclaration targetClass = node.parent as ClassDeclaration;
|
||||
// prepare environment
|
||||
String prefix = utils.getIndent(1);
|
||||
|
|
|
@ -3113,7 +3113,20 @@ class B extends A {
|
|||
''');
|
||||
}
|
||||
|
||||
test_createNoSuchMethod() async {
|
||||
test_createNoSuchMethod_BAD_classTypeAlias() async {
|
||||
await resolveTestUnit('''
|
||||
abstract class A {
|
||||
m();
|
||||
}
|
||||
|
||||
class B = Object with A;
|
||||
''');
|
||||
await assertNoFix(
|
||||
DartFixKind.CREATE_NO_SUCH_METHOD,
|
||||
);
|
||||
}
|
||||
|
||||
test_createNoSuchMethod_OK() async {
|
||||
await resolveTestUnit('''
|
||||
abstract class A {
|
||||
m1();
|
||||
|
|
Loading…
Reference in a new issue