Skip to content

Commit 1cd209d

Browse files
committed
cgen: fix runtime sumtype type names on musl
1 parent 24c3d25 commit 1cd209d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎vlib/v/gen/c/cgen.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4403,7 +4403,7 @@ fn (mut g Gen) typeof_expr(node ast.TypeOf) {
44034403
if sym.kind == .sum_type {
44044404
// When encountering a .sum_type, typeof() should be done at runtime,
44054405
// because the subtype of the expression may change:
4406-
g.write('builtin__tos3(v_typeof_sumtype_${sym.cname}( (')
4406+
g.write('builtin__charptr_vstring_literal(v_typeof_sumtype_${sym.cname}( (')
44074407
if typ.nr_muls() > 0 {
44084408
g.write('*'.repeat(typ.nr_muls()))
44094409
}

‎vlib/v/gen/c/fn.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
16921692
match node.kind {
16931693
.type_name {
16941694
if left_sym.kind in [.sum_type, .interface] {
1695-
g.conversion_function_call('builtin__tos3(v_typeof_${prefix_name}_${typ_sym.cname}',
1695+
g.conversion_function_call('builtin__charptr_vstring_literal(v_typeof_${prefix_name}_${typ_sym.cname}',
16961696
')', node)
16971697
return
16981698
}

0 commit comments

Comments
 (0)