Index: runtime/vm/parser.cc |
=================================================================== |
--- runtime/vm/parser.cc (revision 40790) |
+++ runtime/vm/parser.cc (working copy) |
@@ -8877,6 +8877,9 @@ |
const intptr_t expr_pos = TokenPos(); |
if (CurrentToken() == Token::kTHROW) { |
+ if (require_compiletime_const) { |
+ ReportError("'throw expr' is not a valid compile-time constant"); |
+ } |
ConsumeToken(); |
if (CurrentToken() == Token::kSEMICOLON) { |
ReportError("expression expected after throw"); |