Skip to content

Commit c7bb518

Browse files
pqCommit Queue
authored and
Commit Queue
committed
[element model] migrate always_put_required_named_parameters_first
Bug: https://github.com/dart-lang/linter/issues/5099 Change-Id: I21e9a684b803704b315d3fd1671c919c6cddc138 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387359 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent 9b6c7e6 commit c7bb518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/linter/lib/src/rules/always_put_required_named_parameters_first.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _Visitor extends SimpleAstVisitor<void> {
3838
void visitFormalParameterList(FormalParameterList node) {
3939
var nonRequiredSeen = false;
4040
for (var param in node.parameters.where((p) => p.isNamed)) {
41-
var element = param.declaredElement;
41+
var element = param.declaredFragment?.element;
4242
if (element != null && (element.hasRequired || element.isRequiredNamed)) {
4343
if (nonRequiredSeen) {
4444
var name = param.name;

0 commit comments

Comments
 (0)