Skip to content

Commit 0fa438d

Browse files
scheglovCommit Queue
authored andcommitted
Augment. Fix resolving AugmentedInvocation after AugmentedExpression for fields changes.
Each change separately worked, together - logical merge conflict. Bug: #55650 Change-Id: If839fcc5dca980902f1e69f5a4b5706812163bb7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365482 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 2ac16dc commit 0fa438d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pkg/analyzer/lib/src/generated/resolver.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ import 'package:analyzer/src/generated/utilities_dart.dart';
8484
import 'package:analyzer/src/generated/variable_type_provider.dart';
8585
import 'package:analyzer/src/task/inference_error.dart';
8686
import 'package:analyzer/src/util/ast_data_extractor.dart';
87-
import 'package:analyzer/src/utilities/extensions/object.dart';
8887

8988
typedef SharedMatchContext = shared.MatchContext<AstNode, Expression,
9089
DartPattern, DartType, PromotableElement>;
@@ -2148,7 +2147,7 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
21482147
var outerAugmentation = _enclosingAugmentation;
21492148
try {
21502149
_enclosingFunction = element;
2151-
_enclosingAugmentation = element.ifTypeOrNull();
2150+
_enclosingAugmentation = element;
21522151
assert(_thisType == null);
21532152
_setupThisType();
21542153
checkUnreachableNode(node);
@@ -2596,7 +2595,9 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
25962595
try {
25972596
_enclosingFunction = element;
25982597
if (!isLocal) {
2599-
_enclosingAugmentation = element.ifTypeOrNull();
2598+
if (element case AugmentableElement enclosingAugmentation) {
2599+
_enclosingAugmentation = enclosingAugmentation;
2600+
}
26002601
}
26012602
checkUnreachableNode(node);
26022603
node.documentationComment?.accept(this);
@@ -2938,7 +2939,9 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
29382939
var outerAugmentation = _enclosingAugmentation;
29392940
try {
29402941
_enclosingFunction = element;
2941-
_enclosingAugmentation = element.ifTypeOrNull();
2942+
if (element case AugmentableElement enclosingAugmentation) {
2943+
_enclosingAugmentation = enclosingAugmentation;
2944+
}
29422945
assert(_thisType == null);
29432946
_setupThisType();
29442947
checkUnreachableNode(node);
@@ -3565,7 +3568,9 @@ class ResolverVisitor extends ThrowingAstVisitor<void>
35653568

35663569
var outerAugmentation = _enclosingAugmentation;
35673570
try {
3568-
_enclosingAugmentation = element.ifTypeOrNull();
3571+
if (element case AugmentableElement enclosingAugmentation) {
3572+
_enclosingAugmentation = enclosingAugmentation;
3573+
}
35693574
libraryResolutionContext._variableNodes[element] = node;
35703575
_variableDeclarationResolver.resolve(node);
35713576
} finally {

0 commit comments

Comments
 (0)