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

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2045353002: @required support for super and redirecting cons (#26642). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: FunctionExpressionInvocations Created 4 years, 6 months 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/generated/hint_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 4bf1d0e16a737803754f650e243a5c156c07efbb..b7bc5942c0dc7914af1b42f97ae4f05a5359d59d 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -6222,6 +6222,13 @@ class RequiredConstantsComputer extends RecursiveAstVisitor {
RequiredConstantsComputer(this.source);
@override
+ Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+ _checkForMissingRequiredParam(
+ node.staticInvokeType, node.argumentList, node);
+ return super.visitFunctionExpressionInvocation(node);
+ }
+
+ @override
Object visitInstanceCreationExpression(InstanceCreationExpression node) {
DartType type = node.constructorName.type.type;
if (type is InterfaceType) {
@@ -6238,6 +6245,25 @@ class RequiredConstantsComputer extends RecursiveAstVisitor {
return super.visitMethodInvocation(node);
}
+ @override
+ Object visitRedirectingConstructorInvocation(
+ RedirectingConstructorInvocation node) {
+ DartType type = node.staticElement?.type;
+ if (type != null) {
+ _checkForMissingRequiredParam(type, node.argumentList, node);
+ }
+ return super.visitRedirectingConstructorInvocation(node);
+ }
+
+ @override
+ Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+ DartType type = node.staticElement?.type;
+ if (type != null) {
+ _checkForMissingRequiredParam(type, node.argumentList, node);
+ }
+ return super.visitSuperConstructorInvocation(node);
+ }
+
void _checkForMissingRequiredParam(
DartType type, ArgumentList argumentList, AstNode node) {
if (type is FunctionType) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698