@@ -45,6 +45,7 @@ pub enum ErrorCode {
4545 ExpectedExprAfterOp , // E0023
4646 InvalidMatchSyntax , // E0024
4747 InvalidForSyntax , // E0025
48+ InvalidConstExpr , // E0026 — const must be a compile-time literal expression
4849
4950 // === Type Errors (E0100-E0199) ===
5051 TypeMismatch , // E0100
@@ -105,6 +106,7 @@ pub enum ErrorCode {
105106 ContinueOutsideLoop , // E0419
106107 ReturnOutsideFunction , // E0420
107108 DuplicateMethod , // E0421 — duplicate method in interface
109+ DuplicateConst , // E0422 — duplicate const declaration
108110
109111 // === Import Errors (E0500-E0599) ===
110112 ModuleNotFound , // E0500
@@ -177,6 +179,7 @@ impl ErrorCode {
177179 Self :: ExpectedExprAfterOp => "E0023" ,
178180 Self :: InvalidMatchSyntax => "E0024" ,
179181 Self :: InvalidForSyntax => "E0025" ,
182+ Self :: InvalidConstExpr => "E0026" ,
180183
181184 Self :: TypeMismatch => "E0100" ,
182185 Self :: UnknownType => "E0101" ,
@@ -232,6 +235,7 @@ impl ErrorCode {
232235 Self :: ContinueOutsideLoop => "E0419" ,
233236 Self :: ReturnOutsideFunction => "E0420" ,
234237 Self :: DuplicateMethod => "E0421" ,
238+ Self :: DuplicateConst => "E0422" ,
235239
236240 Self :: ModuleNotFound => "E0500" ,
237241 Self :: ImportNotFound => "E0501" ,
@@ -299,6 +303,7 @@ impl ErrorCode {
299303 "E0023" => Some ( Self :: ExpectedExprAfterOp ) ,
300304 "E0024" => Some ( Self :: InvalidMatchSyntax ) ,
301305 "E0025" => Some ( Self :: InvalidForSyntax ) ,
306+ "E0026" => Some ( Self :: InvalidConstExpr ) ,
302307
303308 "E0100" => Some ( Self :: TypeMismatch ) ,
304309 "E0101" => Some ( Self :: UnknownType ) ,
@@ -354,6 +359,7 @@ impl ErrorCode {
354359 "E0419" => Some ( Self :: ContinueOutsideLoop ) ,
355360 "E0420" => Some ( Self :: ReturnOutsideFunction ) ,
356361 "E0421" => Some ( Self :: DuplicateMethod ) ,
362+ "E0422" => Some ( Self :: DuplicateConst ) ,
357363
358364 "E0500" => Some ( Self :: ModuleNotFound ) ,
359365 "E0501" => Some ( Self :: ImportNotFound ) ,
@@ -423,6 +429,7 @@ impl ErrorCode {
423429 Self :: ExpectedExprAfterOp => "EXPECTED EXPRESSION" ,
424430 Self :: InvalidMatchSyntax => "INVALID MATCH" ,
425431 Self :: InvalidForSyntax => "INVALID FOR" ,
432+ Self :: InvalidConstExpr => "INVALID CONST EXPR" ,
426433
427434 Self :: TypeMismatch => "TYPE MISMATCH" ,
428435 Self :: UnknownType => "UNKNOWN TYPE" ,
@@ -460,6 +467,7 @@ impl ErrorCode {
460467 Self :: DuplicateField => "DUPLICATE FIELD" ,
461468 Self :: DuplicateVariant => "DUPLICATE VARIANT" ,
462469 Self :: DuplicateMethod => "DUPLICATE METHOD" ,
470+ Self :: DuplicateConst => "DUPLICATE CONST" ,
463471 Self :: InvalidSignature => "INVALID SIGNATURE" ,
464472 Self :: MissingReturn => "MISSING RETURN" ,
465473 Self :: UnreachableCode => "UNREACHABLE CODE" ,
0 commit comments