Skip to content

Commit aa3eb29

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate verifySuperFormalParameters()
Change-Id: I1ce336a406a8bcb1fcc1446b03c0f7c9473cb00a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395045 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
1 parent ce36fba commit aa3eb29

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/analyzer/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ lib/src/error/must_call_super_verifier.dart
117117
lib/src/error/nullable_dereference_verifier.dart
118118
lib/src/error/override_verifier.dart
119119
lib/src/error/required_parameters_verifier.dart
120-
lib/src/error/super_formal_parameters_verifier.dart
121120
lib/src/error/type_arguments_verifier.dart
122121
lib/src/error/unused_local_elements_verifier.dart
123122
lib/src/error/use_result_verifier.dart

pkg/analyzer/lib/src/error/super_formal_parameters_verifier.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:analyzer/dart/ast/ast.dart';
65
import 'package:analyzer/error/listener.dart';
6+
import 'package:analyzer/src/dart/ast/ast.dart';
77
import 'package:analyzer/src/dart/ast/extensions.dart';
8-
import 'package:analyzer/src/dart/element/element.dart';
98
import 'package:analyzer/src/error/codes.dart';
109

1110
VerifySuperFormalParametersResult verifySuperFormalParameters({
@@ -16,11 +15,13 @@ VerifySuperFormalParametersResult verifySuperFormalParameters({
1615
var result = VerifySuperFormalParametersResult();
1716
for (var parameter in constructor.parameters.parameters) {
1817
parameter = parameter.notDefault;
19-
if (parameter is SuperFormalParameter) {
20-
var parameterElement =
21-
parameter.declaredElement as SuperFormalParameterElementImpl;
18+
if (parameter is SuperFormalParameterImpl) {
19+
var declaredFragment = parameter.declaredFragment!;
2220
if (parameter.isNamed) {
23-
result.namedArgumentNames.add(parameterElement.name);
21+
var name = declaredFragment.name2;
22+
if (name != null) {
23+
result.namedArgumentNames.add(name);
24+
}
2425
} else {
2526
result.positionalArgumentCount++;
2627
if (hasExplicitPositionalArguments) {

0 commit comments

Comments
 (0)