1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/generic_functions_with_normal_function_test.v

13 lines
199 B
V

fn get[T](typ T) T {
return typ
}
fn get_string(typ string) string {
return 'boom'
}
fn test_generic_with_same_type() {
assert get_string('') == 'boom'
assert get[string]('hello') == 'hello'
}