0 issues 1 contributor 4 branches 0 releases
Additions: 51 Deletions: 5 View patch
1 - DOOM is now translated/compiled and launched on CI servers. A screenshot of the running game
2 is made via `vgret` and is compared to the expected result.
3 - VLS performance improvements, especially on Windows.
4-- Add `v ls` tool for installing, for updating, and for launching VLS (V Language Server)
5+- `v ls` tool for installing, for updating, and for launching VLS (V Language Server).
6 - Support `assert condition, extra_message`, where the `extra_message` will be evaluated and shown if the assertion fails.
7+- Anonymous sumtypes have been removed (deprecated for now) due to complicating the language and the compiler too much.
8
9 ## V 0.3
10 *30 Jun 2022*
11
1
2 type Var = GlobalVar | LocalVar | ast.Ident
3
4-fn (mut g Gen) get_var_from_ident(ident ast.Ident) LocalVar|GlobalVar|Register {
5+type IdentVar = GlobalVar | LocalVar | Register
6+
7+fn (mut g Gen) get_var_from_ident(ident ast.Ident) IdentVar {
8 mut obj := ident.obj
9 if obj !in [ast.Var, ast.ConstField, ast.GlobalField, ast.AsmRegister] {
10 obj = ident.scope.find(ident.name) or { g.n_error('unknown variable $ident.name') }
11
1 // parse_inline_sum_type parses the type and registers it in case the type is an anonymous sum type.
2 // It also takes care of inline sum types where parse_type only parses a standalone type.
3 pub fn (mut p Parser) parse_inline_sum_type() ast.Type {
4+ p.warn('inline sum types have been deprecated and will be removed on January 1, 2023 due ' +
5+ 'to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead')
6 variants := p.parse_sum_type_variants()
7 if variants.len > 1 {
8 if variants.len > parser.maximum_inline_sum_type_variants {
9
1+vlib/v/parser/tests/anon_sum_type_interface.vv:2:6: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
2+ 1 | interface Foo {
3+ 2 | bar string | int
4+ | ~~~~~~
5+ 3 | }
6
1+vlib/v/parser/tests/anon_sum_type_struct.vv:2:6: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
2+ 1 | struct Foo {
3+ 2 | bar string | int
4+ | ~~~~~~
5+ 3 | }
6
1+vlib/v/parser/tests/inline_sum_type_optional_err.vv:1:11: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
2+ 1 | fn foo() ?string | int {
3+ | ~~~~~~
4+ 2 | return 0
5+ 3 | }
6 vlib/v/parser/tests/inline_sum_type_optional_err.vv:1:10: error: an inline sum type cannot be optional
7 1 | fn foo() ?string | int {
8 | ~~~~~~~~~~~~~
9
1+vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:4:6: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
2+ 2 |
3+ 3 | struct Foo {
4+ 4 | bar int | string | token.Pos | bool | u32
5+ | ~~~
6+ 5 | }
7+ 6 |
8 vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:4:6: warning: an inline sum type expects a maximum of 3 types (5 were given)
9- 2 |
10+ 2 |
11 3 | struct Foo {
12 4 | bar int | string | token.Pos | bool | u32
13 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 5 | }
15 6 |
16+vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:7:12: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
17+ 5 | }
18+ 6 |
19+ 7 | fn foo(arg int | string | token.Pos | bool | u32) int | string | token.Pos | bool | u32 {
20+ | ~~~
21+ 8 | return 1
22+ 9 | }
23 vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:7:12: warning: an inline sum type expects a maximum of 3 types (5 were given)
24 5 | }
25- 6 |
26+ 6 |
27 7 | fn foo(arg int | string | token.Pos | bool | u32) int | string | token.Pos | bool | u32 {
28 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 8 | return 1
30 9 | }
31+vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:7:51: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
32+ 5 | }
33+ 6 |
34+ 7 | fn foo(arg int | string | token.Pos | bool | u32) int | string | token.Pos | bool | u32 {
35+ | ~~~
36+ 8 | return 1
37+ 9 | }
38 vlib/v/parser/tests/inline_sum_type_return_type_too_many_variants.vv:7:51: warning: an inline sum type expects a maximum of 3 types (5 were given)
39 5 | }
40- 6 |
41+ 6 |
42 7 | fn foo(arg int | string | token.Pos | bool | u32) int | string | token.Pos | bool | u32 {
43 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 8 | return 1
45
1+vlib/v/parser/tests/option_sum_type_return_err.vv:1:22: warning: inline sum types have been deprecated and will be removed on January 1, 2023 due to complicating the language and the compiler too much; define named sum types with `type Foo = Bar | Baz` instead
2+ 1 | fn option_sumtype() ?string | int {
3+ | ~~~~~~
4+ 2 | return 0
5+ 3 | }
6 vlib/v/parser/tests/option_sum_type_return_err.vv:1:21: error: an inline sum type cannot be optional
7 1 | fn option_sumtype() ?string | int {
8 | ~~~~~~~~~~~~~
9