Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

fix issue in const error handling #1045

Merged
merged 3 commits into from
Jun 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/src/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class HasConstErrorListener extends AnalysisErrorListener {

@override
void onError(AnalysisError error) {
hasConstError = errorCodes.contains(error.errorCode);
hasConstError = hasConstError || errorCodes.contains(error.errorCode);
}

static const List<CompileTimeErrorCode> errorCodes = const [
Expand All @@ -340,6 +340,7 @@ class HasConstErrorListener extends AnalysisErrorListener {
CompileTimeErrorCode.INVALID_CONSTANT,
CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL,
CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL,
CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION,
CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT,
CompileTimeErrorCode.NON_CONSTANT_MAP_KEY,
CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE,
Expand Down