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

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

Issue 2188403002: Revert "fix #26141, add support for type arguments to constants" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
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 5e5a20e1b7316d368125b79543f10a750d6b9f17..0a54caa945d7caa6d04eff3b93240b1e30095c02 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -868,9 +868,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
_checkForConstWithNonConst(node);
_checkForConstWithUndefinedConstructor(
node, constructorName, typeName);
- if (!_options.strongMode) {
- _checkForConstWithTypeParameters(typeName);
- }
+ _checkForConstWithTypeParameters(typeName);
_checkForConstDeferredClass(node, constructorName, typeName);
} else {
_checkForNewWithUndefinedConstructor(node, constructorName, typeName);
@@ -893,9 +891,9 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
Object visitListLiteral(ListLiteral node) {
TypeArgumentList typeArguments = node.typeArguments;
if (typeArguments != null) {
- if (!_options.strongMode && node.constKeyword != null) {
+ if (node.constKeyword != null) {
NodeList<TypeName> arguments = typeArguments.arguments;
- if (arguments.isNotEmpty) {
+ if (arguments.length != 0) {
_checkForInvalidTypeArgumentInConstTypedLiteral(arguments,
CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST);
}
@@ -912,7 +910,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
TypeArgumentList typeArguments = node.typeArguments;
if (typeArguments != null) {
NodeList<TypeName> arguments = typeArguments.arguments;
- if (!_options.strongMode && arguments.isNotEmpty) {
+ if (arguments.length != 0) {
if (node.constKeyword != null) {
_checkForInvalidTypeArgumentInConstTypedLiteral(arguments,
CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/value.dart ('k') | pkg/analyzer/test/src/dart/constant/evaluation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698