mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Fix conversion of class with type parameters to mixin (issue 35322)
Change-Id: I771a5573809fa0f03e0901f3e3f30684b6a48ef8 Reviewed-on: https://dart-review.googlesource.com/c/86223 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
831ab3580c
commit
9b5fcc9166
|
@ -447,6 +447,8 @@ class AssistProcessor {
|
|||
classDeclaration.leftBracket), (DartEditBuilder builder) {
|
||||
builder.write('mixin ');
|
||||
builder.write(classDeclaration.name.name);
|
||||
builder.writeTypeParameters(
|
||||
classDeclaration.declaredElement.typeParameters);
|
||||
builder.writeTypes(superclassConstraints, prefix: ' on ');
|
||||
builder.writeTypes(interfaces, prefix: ' implements ');
|
||||
builder.write(' ');
|
||||
|
|
|
@ -373,6 +373,15 @@ mixin A {}
|
|||
''');
|
||||
}
|
||||
|
||||
test_typeParameters() async {
|
||||
await resolveTestUnit('''
|
||||
class A<T> {}
|
||||
''');
|
||||
await assertHasAssistAt('A', '''
|
||||
mixin A<T> {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_with_noSuper() async {
|
||||
await resolveTestUnit('''
|
||||
class A {}
|
||||
|
|
Loading…
Reference in a new issue