Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 1500793002: Checker is defensive against unresolved redirecting constructor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index aadab6c32189de5b4fad1a41cd0aecef68ffd33d..dab56d1138878615b469613aef1e9a380a26a9d4 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -583,8 +583,13 @@ class CodeChecker extends RecursiveAstVisitor {
@override
void visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) {
- var type = node.staticElement.type;
- checkArgumentList(node.argumentList, type);
+ var type = node.staticElement?.type;
+ // TODO(leafp): There's a TODO in visitRedirectingConstructorInvocation
+ // in the element_resolver to handle the case that the element is null
+ // and emit an error. In the meantime, just be defensive here.
+ if (type != null) {
+ checkArgumentList(node.argumentList, type);
+ }
node.visitChildren(this);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698