diff --git a/src/builtins.ts b/src/builtins.ts index d63064c4..d90d70fa 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -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; diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index 831dc9a4..726de9f3 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -30,6 +30,7 @@ export enum DiagnosticCode { Function_0_cannot_be_inlined_into_itself = 217, Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218, Optional_properties_are_not_supported = 219, + Expression_must_be_a_compile_time_constant = 220, Unterminated_string_literal = 1002, Identifier_expected = 1003, _0_expected = 1005, @@ -159,6 +160,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 217: return "Function '{0}' cannot be inlined into itself."; case 218: return "Cannot access method '{0}' without calling it as it requires 'this' to be set."; case 219: return "Optional properties are not supported."; + case 220: return "Expression must be a compile-time constant."; case 1002: return "Unterminated string literal."; case 1003: return "Identifier expected."; case 1005: return "'{0}' expected."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index c1830de6..50d880e6 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -22,6 +22,7 @@ "Function '{0}' cannot be inlined into itself.": 217, "Cannot access method '{0}' without calling it as it requires 'this' to be set.": 218, "Optional properties are not supported.": 219, + "Expression must be a compile-time constant.": 220, "Unterminated string literal.": 1002, "Identifier expected.": 1003,