Skip to content

Commit

Permalink
Elements. Migrate JoinVariableDeclaration.
Browse files Browse the repository at this point in the history
Change-Id: If3290aaeecc8b698dc655755e3da5fe7dc3b26e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387356
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and Commit Queue committed Sep 30, 2024
1 parent a67e33e commit 0065726
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/analysis_server/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ lib/src/services/correction/dart/insert_semicolon.dart
lib/src/services/correction/dart/invert_if_statement.dart
lib/src/services/correction/dart/join_if_with_inner.dart
lib/src/services/correction/dart/join_if_with_outer.dart
lib/src/services/correction/dart/join_variable_declaration.dart
lib/src/services/correction/dart/make_class_abstract.dart
lib/src/services/correction/dart/make_conditional_on_debug_mode.dart
lib/src/services/correction/dart/make_field_public.dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class JoinVariableDeclaration extends ResolvedCorrectionProducer {
// The declared variable must be the one that is assigned.
// There must be no initializer.
var declaredVariable = declaredVariables.single;
if (declaredVariable.declaredElement != left.staticElement ||
if (declaredVariable.declaredElement2 != left.element ||
declaredVariable.initializer != null) {
return;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ class JoinVariableDeclaration extends ResolvedCorrectionProducer {
}

// The assignment should write into the declared variable.
if (assignment.writeElement != declaredVariable.declaredElement) {
if (assignment.writeElement2 != declaredVariable.declaredElement2) {
return;
}

Expand Down

0 comments on commit 0065726

Please sign in to comment.