mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: remove unused generated func (#17258)
This commit is contained in:
parent
404a9aa442
commit
fbfdab9e2d
@ -6466,15 +6466,18 @@ static inline __shared__${interface_name} ${shared_fn_name}(__shared__${cctype}*
|
|||||||
}
|
}
|
||||||
for vtyp, variants in inter_info.conversions {
|
for vtyp, variants in inter_info.conversions {
|
||||||
vsym := g.table.sym(vtyp)
|
vsym := g.table.sym(vtyp)
|
||||||
conversion_functions.write_string('static inline bool I_${interface_name}_is_I_${vsym.cname}(${interface_name} x) {\n\treturn ')
|
|
||||||
for i, variant in variants {
|
if variants.len > 0 {
|
||||||
variant_sym := g.table.sym(variant)
|
conversion_functions.write_string('static inline bool I_${interface_name}_is_I_${vsym.cname}(${interface_name} x) {\n\treturn ')
|
||||||
if i > 0 {
|
for i, variant in variants {
|
||||||
conversion_functions.write_string(' || ')
|
variant_sym := g.table.sym(variant)
|
||||||
|
if i > 0 {
|
||||||
|
conversion_functions.write_string(' || ')
|
||||||
|
}
|
||||||
|
conversion_functions.write_string('(x._typ == _${interface_name}_${variant_sym.cname}_index)')
|
||||||
}
|
}
|
||||||
conversion_functions.write_string('(x._typ == _${interface_name}_${variant_sym.cname}_index)')
|
conversion_functions.writeln(';\n}')
|
||||||
}
|
}
|
||||||
conversion_functions.writeln(';\n}')
|
|
||||||
|
|
||||||
conversion_functions.writeln('static inline ${vsym.cname} I_${interface_name}_as_I_${vsym.cname}(${interface_name} x) {')
|
conversion_functions.writeln('static inline ${vsym.cname} I_${interface_name}_as_I_${vsym.cname}(${interface_name} x) {')
|
||||||
for variant in variants {
|
for variant in variants {
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
interface Foo {}
|
||||||
|
|
||||||
|
interface Bar {}
|
||||||
|
|
||||||
|
pub fn set_foo(mut foo Foo) {
|
||||||
|
if foo is Bar {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_main() {}
|
Loading…
Reference in New Issue
Block a user