Skip to content

Commit 052c985

Browse files
FMorschelCommit Queue
authored andcommitted
[DAS] Fixes hover for mixin on abstract implemented type
[email protected] Bug: #57097 Change-Id: Ia67ebb1dbca9e8b3a63e2a26dbb7234385b4bdf4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395562 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Auto-Submit: Felipe Morschel <[email protected]>
1 parent 016310d commit 052c985

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

pkg/analysis_server/lib/src/computer/computer_overrides.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ class _OverriddenElementsFinder {
178178
}
179179
// super
180180
_addInterfaceOverrides(class_.supertype?.element3, checkType);
181+
if (class_ is MixinElement2) {
182+
for (var constraint in class_.superclassConstraints) {
183+
_addInterfaceOverrides(constraint.element3, true);
184+
}
185+
}
181186
}
182187

183188
void _addSuperOverrides(

pkg/analysis_server/test/lsp/hover_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,23 @@ print();
416416
String [!a^bc!] = '';
417417
''', contains('This is a string.'));
418418

419+
Future<void> test_method_mixin_onImplementation() async {
420+
var content = '''
421+
abstract class A {
422+
/// Documentation for [f].
423+
void f();
424+
}
425+
426+
abstract class B implements A {}
427+
428+
mixin M on B {
429+
@override
430+
void [!f^!]() {}
431+
}
432+
''';
433+
await assertStringContents(content, contains('Documentation for [f].'));
434+
}
435+
419436
Future<void> test_method_startOfParameterList() => assertStringContents('''
420437
class A {
421438
/// This is a method.

0 commit comments

Comments
 (0)