Skip to content

Commit

Permalink
Fix exception when a parameter has no name (issue 30226)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwilkerson committed Jul 21, 2017
1 parent 341172a commit ced90f3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/src/rules/non_constant_identifier_names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@ class Visitor extends SimpleAstVisitor {
}
}

@override
visitConstructorDeclaration(ConstructorDeclaration node) {
if (node.name != null) {
checkIdentifier(node.name);
}
}

@override
visitFormalParameterList(FormalParameterList node) {
node.parameters.forEach((FormalParameter p) {
if (p is! FieldFormalParameter) {
if (p is! FieldFormalParameter && p.identifier != null) {
checkIdentifier(p.identifier, underscoresOk: true);
}
});
Expand All @@ -83,11 +90,4 @@ class Visitor extends SimpleAstVisitor {
}
});
}

@override
visitConstructorDeclaration(ConstructorDeclaration node) {
if (node.name != null) {
checkIdentifier(node.name);
}
}
}

0 comments on commit ced90f3

Please sign in to comment.