mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-01 15:41:53 +00:00
Emit a better error when expecting a compile-time constant, fixes #222
This commit is contained in:
@ -3444,7 +3444,7 @@ function evaluateConstantOffset(compiler: Compiler, expression: Expression): i32
|
||||
(value = getConstValueI64Low(expr)) < 0
|
||||
) {
|
||||
compiler.error(
|
||||
DiagnosticCode.Operation_not_supported,
|
||||
DiagnosticCode.Expression_must_be_a_compile_time_constant,
|
||||
expression.range
|
||||
);
|
||||
value = -1;
|
||||
@ -3457,7 +3457,7 @@ function evaluateConstantOffset(compiler: Compiler, expression: Expression): i32
|
||||
(value = getConstValueI32(expr)) < 0
|
||||
) {
|
||||
compiler.error(
|
||||
DiagnosticCode.Operation_not_supported,
|
||||
DiagnosticCode.Expression_must_be_a_compile_time_constant,
|
||||
expression.range
|
||||
);
|
||||
value = -1;
|
||||
|
Reference in New Issue
Block a user