Skip to content

Commit

Permalink
[linter] Add more const errors to hasConstError in the linter.
Browse files Browse the repository at this point in the history
More errors surfaced from the changes in https://dart-review.googlesource.com/c/sdk/+/319911.

This CL allows them to be marked as const errors when we check that a constructor can be const-ified.

Bug: flutter/flutter#133152
Change-Id: Ic514fba9d544d5019ca76567be04738a5d5db768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
  • Loading branch information
kallentu authored and Commit Queue committed Aug 23, 2023
1 parent ac901b5 commit b3c433c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/analyzer/lib/src/lint/linter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,13 @@ class _ConstantAnalysisErrorListener extends AnalysisErrorListener {
.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST:
case CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD:
case CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION:
case CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS:
case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL:
case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT:
case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING:
case CompileTimeErrorCode.CONST_EVAL_TYPE_INT:
case CompileTimeErrorCode.CONST_EVAL_TYPE_NUM:
case CompileTimeErrorCode.CONST_EVAL_TYPE_STRING:
case CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION:
case CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE:
case CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT:
Expand Down

0 comments on commit b3c433c

Please sign in to comment.