1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast, checker, cgen: fix generic fn/method with comptime for/if (fix #15905) (#15910)

This commit is contained in:
yuyi
2022-09-30 07:40:30 +08:00
committed by GitHub
parent 63578e63c6
commit 659bd1a428
9 changed files with 173 additions and 7 deletions

View File

@ -654,9 +654,10 @@ pub mut:
// 10 <- original type (orig_type)
// [11, 12, 13] <- cast order (smartcasts)
// 12 <- the current casted type (typ)
pos token.Pos
is_used bool // whether the local variable was used in other expressions
is_changed bool // to detect mutable vars that are never changed
pos token.Pos
is_used bool // whether the local variable was used in other expressions
is_changed bool // to detect mutable vars that are never changed
is_comptime_field bool // comptime field var `a := t.$(field.name)`
//
// (for setting the position after the or block for autofree)
is_or bool // `x := foo() or { ... }`