tests: simple<string> generics test
parent
ce1a181699
commit
45c9ccfc03
|
@ -443,7 +443,7 @@ fn (mut g Gen) fn_call(node ast.CallExpr) {
|
|||
// `json__encode` => `json__encode_User`
|
||||
name += '_' + json_type_str.replace('.', '__')
|
||||
}
|
||||
if node.generic_type != table.void_type {
|
||||
if node.generic_type != table.void_type && node.generic_type != 0 {
|
||||
// `foo<int>()` => `foo_int()`
|
||||
name += '_' + g.typ(node.generic_type)
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ fn simple<T>(p T) T {
|
|||
|
||||
fn test_generic_fn() {
|
||||
assert simple<int>(1) == 1
|
||||
assert simple<string>('g') == 'g'
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue