mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
15 lines
666 B
Plaintext
15 lines
666 B
Plaintext
vlib/v/parser/tests/or_default_missing.vv:4:3: error: `or` block must provide a default value of type `int`, or return/continue/break or call a [noreturn] function like panic(err) or exit(1)
|
|
2 | m := [3, 4, 5]
|
|
3 | el := m[4] or {
|
|
4 | println('error')
|
|
| ~~~~~~~~~~~~~~~~
|
|
5 | }
|
|
6 | println(el)
|
|
vlib/v/parser/tests/or_default_missing.vv:17:11: error: last statement in the `or {}` block should be an expression of type `int` or exit parent scope
|
|
15 | mut testvar := 0
|
|
16 | el := m['pp'] or {
|
|
17 | testvar = 12
|
|
| ^
|
|
18 | }
|
|
19 | println('$el $testvar')
|