mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 13:47:50 +00:00
Migration: properly handle accesses to getters in mixins.
Bug: https://b.corp.google.com/issues/246998513 Change-Id: I8ca1fe87f256dbf4f31fca9bd3f555d1def4bb3c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260446 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
parent
78dd98a8f4
commit
872e4c5696
|
@ -286,7 +286,7 @@ class EdgeBuilder extends GeneralizingAstVisitor<DecoratedType>
|
|||
Element? baseElement = element.declaration;
|
||||
if (targetType != null) {
|
||||
var enclosingElement = baseElement!.enclosingElement3;
|
||||
if (enclosingElement is ClassElement) {
|
||||
if (enclosingElement is InterfaceElement) {
|
||||
if (targetType.type.explicitBound is InterfaceType &&
|
||||
enclosingElement.typeParameters.isNotEmpty) {
|
||||
substitution = _decoratedClassHierarchy!
|
||||
|
|
|
@ -8777,6 +8777,24 @@ main() {
|
|||
await _checkSingleFileChanges(content, expected);
|
||||
}
|
||||
|
||||
Future<void> test_reference_to_mixin_getter() async {
|
||||
var content = '''
|
||||
mixin M {
|
||||
Object f() => this.x;
|
||||
|
||||
Object get x => null;
|
||||
}
|
||||
''';
|
||||
var expected = '''
|
||||
mixin M {
|
||||
Object? f() => this.x;
|
||||
|
||||
Object? get x => null;
|
||||
}
|
||||
''';
|
||||
await _checkSingleFileChanges(content, expected);
|
||||
}
|
||||
|
||||
Future<void> test_regression_40551() async {
|
||||
var content = '''
|
||||
class B<T extends Object> { // bound should not be made nullable
|
||||
|
|
Loading…
Reference in a new issue