v2 / vlib / v / checker / tests / test_functions_wrong_signature_test.vv
20 lines · 17 sloc · 421 bytes · 90941b3b1f5513cef7f913bc54f1b5a2af0c8c7a
Raw
1// ordinary functions can return whatever they like,
2// since they are not called by V's testing system
3// in the generated main():
4fn abc() int {
5 return 1
6}
7
8// should be disallowed:
9fn test_returning_int() int {
10}
11
12// NB: this is allowed explicitly now, to allow for shorter tests
13// of functions returning options.
14fn test_returning_opt() {
15 assert true
16}
17
18// should be disallowed:
19fn test_take_parameters(v int) {
20}
21