tests: enable test_generic_fn_with_variadics() test (#9944)
parent
605019ec27
commit
f82f1977d1
|
@ -345,12 +345,15 @@ fn test_generic_struct_print_array_as_field() {
|
|||
assert foo.str() == 'Foo<[]string>{\n data: []\n}'
|
||||
}
|
||||
|
||||
/*
|
||||
struct Abc{ x int y int z int }
|
||||
struct Abc {
|
||||
x int
|
||||
y int
|
||||
z int
|
||||
}
|
||||
|
||||
fn p<T>(args ...T) {
|
||||
size := sizeof(T)
|
||||
print('p called with size: ${size:3d} | ')
|
||||
print('p called with size: ${size:3} | ')
|
||||
for _, x in args {
|
||||
print(x)
|
||||
print(' ')
|
||||
|
@ -370,7 +373,6 @@ fn test_generic_fn_with_variadics(){
|
|||
p(abc)
|
||||
p('Good', 'morning', 'world')
|
||||
}
|
||||
*/
|
||||
|
||||
struct Context {}
|
||||
|
||||
|
@ -392,24 +394,6 @@ fn test_pass_generic_to_nested_function() {
|
|||
test(mut app)
|
||||
}
|
||||
|
||||
/*
|
||||
struct NestedGeneric {}
|
||||
|
||||
fn (ng NestedGeneric) nested_test<T>(mut app T) {
|
||||
app.context = Context {}
|
||||
}
|
||||
|
||||
fn method_test<T>(mut app T) {
|
||||
ng := NestedGeneric{}
|
||||
ng.nested_test<T>(app)
|
||||
}
|
||||
|
||||
fn test_pass_generic_to_nested_method() {
|
||||
mut app := App{}
|
||||
method_test(mut app)
|
||||
}
|
||||
*/
|
||||
|
||||
fn generic_return_map<M>() map[string]M {
|
||||
return map{
|
||||
'': M{}
|
||||
|
|
Loading…
Reference in New Issue