Skip to content

Commit

Permalink
fix compiler panic for `./v -cc gcc vlib/x/json2/tests/decode_map_tes…
Browse files Browse the repository at this point in the history
…t.v`
  • Loading branch information
spytheman committed Jan 5, 2025
1 parent b6a0d93 commit 6f0948e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion vlib/v/markused/walker.v
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,17 @@ pub fn (mut w Walker) or_block(node ast.OrExpr) {
}

pub fn (mut w Walker) as_cast(node ast.AsCast) {
if node.typ.has_flag(.generic) || node.expr_type.has_flag(.generic) {
if node.typ == 0 {
return
}
if node.typ.has_flag(.generic) {
w.as_cast_type_names['some_generic_type'] = 'some_generic_name'
return
}
if node.expr_type == 0 {
return
}
if node.expr_type.has_flag(.generic) {
w.as_cast_type_names['some_generic_type'] = 'some_generic_name'
return
}
Expand Down

0 comments on commit 6f0948e

Please sign in to comment.