mirror of
https://github.com/bearlanguageorg/bear.git
synced 2026-08-26 15:37:18 +00:00
fix: make seen map mutable and use u64 for tagged-value shifts
The struct-literal validator declared `seen` without `mut`, causing a compile error on V. Left-shifting i64 values also produced signed-shift warnings; cast through u64 instead. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+1
-1
@@ -430,7 +430,7 @@ fn (mut g Gen) gen_expr(e Expr) ! {
|
||||
// file, where the same validation applies)
|
||||
if e.name.len > 0 && e.name in g.structs {
|
||||
decl_fields := g.structs[e.name]
|
||||
seen := map[string]bool{}
|
||||
mut seen := map[string]bool{}
|
||||
for f in e.fields {
|
||||
if f.name !in decl_fields {
|
||||
return error('unknown field "${f.name}" for struct ${e.name} (line ${e.line})')
|
||||
|
||||
Reference in New Issue
Block a user