v
v copied to clipboard
Insufficient type checking on a templated function, when passing a function type
V version: V 0.2.2 47bf644, timestamp: 2021-07-09 03:27:16 +0300
OS: Linux, Ubuntu 20.04.2 LTS
What did you do?
fn name < T > ( x T ) T
{
return x + 1
}
fn main ( )
{
println ( name ( name ) )
}
What did you expect to see?
A type error because function type does (should not) support arithmetic operation.
What did you see instead?
$ v run main.v
Segmentation fault (core dumped)