yuyi
8225622da5
checker: check smartcasting requires either an immutable value, or an explicit mut keyword before the value ( #16654 )
2022-12-12 09:22:56 +02:00
yuyi
d87e400e77
transformer: clean up expr_stmt_match_expr() ( #16655 )
2022-12-12 08:41:02 +02:00
Felipe Pena
1e7208d28b
parser: fix initialization for array of Option type - []?Cell{}
( #16652 )
2022-12-12 08:40:05 +02:00
yuyi
73e886eafe
checker: fix generic fn returning result ( #16646 )
2022-12-11 12:34:58 +02:00
Delyan Angelov
4b2699fddd
cgen: fix copying of a fixed array parameter to a function ( fix #16640 )
2022-12-10 20:10:01 +02:00
lemon
799af2adad
native: support simple multi return ( #16628 )
2022-12-10 16:26:43 +02:00
Delyan Angelov
7c02274754
v.pkgconfig: support PKG_CONFIG_PATH_DEFAULTS for overriding the default search path list too (enable easier -m32 with a custom tcc cross compiler)
2022-12-10 00:50:24 +02:00
Felipe Pena
1ba1f99b9c
orm: declare missing functions to handle literal types ( #16627 )
2022-12-09 20:34:34 +02:00
Felipe Pena
ba8e61ebf3
cgen: fix return typeof[T]()
in generic functions ( #16626 )
2022-12-09 17:24:47 +02:00
yuyi
6c0f22416f
cgen: fix if cond with result or optional in infix expr ( #16625 )
2022-12-09 12:01:14 +02:00
yuyi
68fb4e9fe5
cgen: fixevaluation order for match expressions inside boolean ones ( fix #16554 ) ( #16616 )
2022-12-09 11:56:38 +02:00
Felipe Pena
f365771499
cgen: fix nested struct generation for globals for gcc ( #16614 )
2022-12-08 21:38:01 +02:00
谢克
32c80c53b3
cgen: fix generic functions returning none or error values with generic result types ( #16613 )
2022-12-08 11:08:39 +02:00
Felipe Pena
2261606b56
checker: disallow Bar{...foo}
when Bar needs more fields, than what foo
has ( #16609 )
2022-12-07 16:56:07 +02:00
yuyi
4eb81d2f05
checker: improve error messages of missing generic type names ( #16610 )
2022-12-07 11:29:18 +02:00
Delyan Angelov
48a7de643e
all: support typeof[ T ]().idx and typeof[ T ]().name, where T can be any type, including ![]&string
( #16513 )
2022-12-07 11:26:27 +02:00
Swastik Baranwal
bb705c01d2
parser: add proper error msg for :=
used in const decl ( #16607 )
2022-12-06 22:44:33 +03:00
yuyi
921416d821
parser: fix parsing generic types using '[]' in anon fn decl ( #16605 )
2022-12-06 18:15:59 +02:00
Felipe Pena
cf015e5073
checker: add clearer errors for break
/continue
used within a $for
loop ( #16600 )
2022-12-06 17:27:59 +02:00
Swastik Baranwal
ada8643ac5
checker: disallow using builtin type names for const names ( #16599 )
2022-12-06 15:44:25 +02:00
yuyi
e35f5f290e
cgen: fix string of map with generic struct value ( #16595 )
2022-12-06 12:38:05 +02:00
yuyi
a96e2e7093
parser: fix parsing embedded generic interface using '[]' ( #16603 )
2022-12-06 12:37:36 +02:00
yuyi
46bb62955b
cgen: fix generic array init with fields ( #16601 )
2022-12-06 09:33:26 +02:00
Felipe Pena
edfaa76b3e
checker: fix panic caused by compile-time code within or block ( #16602 )
2022-12-06 09:26:04 +02:00
yuyi
50110d4c19
all: replace generic '<>' with '[]' in .vv files ( #16593 )
2022-12-05 16:32:15 +02:00
yuyi
7e9e2ff459
cgen: fix if expr with multiple array call ( fix #16583 ) ( #16589 )
2022-12-05 12:07:39 +02:00
yuyi
59c979c8d2
checker: check generic interface type specifing type names ( fix #16576 ) ( #16591 )
2022-12-05 10:05:32 +02:00
Swastik Baranwal
ce06c2818d
checker: add disallow none
operations and range ( #16584 )
2022-12-05 08:50:36 +02:00
yuyi
ffc73bf643
builder: fix v builder error ( #16590 )
2022-12-05 08:48:45 +02:00
Delyan Angelov
d8d75ee67e
v.builder: fix v -os wasm32_emscripten examples/2048
on windows
2022-12-04 17:49:33 +02:00
Delyan Angelov
d09c8c914b
testing: refactor the v test
implementation to make supporting different output modes easier
2022-12-02 18:12:42 +02:00
Delyan Angelov
e419faf746
all: fix dependant
->dependent
typos, cleanup comments
2022-12-02 12:51:10 +02:00
Delyan Angelov
675c362f57
v.util: cleanup util.path_styled_for_error_messages/1
2022-12-02 11:48:01 +02:00
Delyan Angelov
c77344e0a2
checker: add a return *x
suggestion, to the error fn ... expects you to return a non reference type ..., but you are returning ... instead
2022-12-02 10:40:36 +02:00
yuyi
f16722596c
all: replace generic '<>' with '[]' in error messages and comments ( #16571 )
2022-12-02 09:22:48 +02:00
Tim Marston
cbe64cb543
checker: allow struct updates from struct aliases ( #16567 )
2022-12-02 00:28:10 +02:00
Delyan Angelov
161847ed1a
v.pref: make -b unknown_backend
an error, with a more informative diagnostic message
2022-12-01 15:28:51 +02:00
yuyi
c06696bc9a
cgen: fix printing multi-reference struct ( #16560 )
2022-11-30 21:30:15 +02:00
yuyi
fd04c1a03a
cgen: fix error of match expr ( fix #16554 ) ( #16555 )
2022-11-30 12:04:20 +02:00
yuyi
dff61300fb
table: optimize fn_type_signature() ( #16552 )
2022-11-29 13:13:58 +02:00
Swastik Baranwal
58e150df12
parser: add a better error msg for using ...
, instead of ..
in for a in 1...10 {
( #16547 )
2022-11-28 10:37:12 +02:00
yuyi
d257e43932
checker: fix 'return none' in void optional function ( #16545 )
2022-11-28 10:29:02 +02:00
Delyan Angelov
fdbd40d806
scanner: make Scanner.peek_token more robust (p.peek_token(-999999) will return an EOF token, instead of garbage data)
2022-11-27 12:09:43 +02:00
Delyan Angelov
50b73abc62
parser: add p.show()
to ease debugging parser problems, that need more context
...
Using it, produces output like this on stdout:
```
>> vlib/v/tests/typeof_type_test.v:4: keyword `typeof` token `(` token `[` keyword `fn` token `(` name `s` name `string`
>> vlib/v/tests/typeof_type_test.v:8: keyword `typeof` token `(` token `[` name `int` token `]` token `)` token `.`
>> vlib/v/tests/typeof_type_test.v:9: keyword `typeof` token `(` token `[` name `int` token `]` token `)` token `.`
>> vlib/v/tests/typeof_type_test.v:13: keyword `typeof` token `(` token `[` name `u32` token `]` token `)` token `.`
>> vlib/v/tests/typeof_type_test.v:14: keyword `typeof` token `(` token `[` name `u32` token `]` token `)` token `.`
>> vlib/v/tests/typeof_type_test.v:18: keyword `typeof` token `(` token `[` name `string` token `]` token `)` token `.`
```
Note: this tracing output is *deliberately on `stdout`*, instead of `stderr`,
so that you can filter it more easily, without saving it to a file first, i.e.
you can use it while developing/debugging parser issues like this:
`./v -o vnew cmd/v && ./vnew some_file.v | grep some_file.v`
-> this will show only the parsing context for the constructs you are debugging,
for that specific file *only*, instead of for all of `builtin` and the imported files etc.
2022-11-27 11:13:42 +02:00
Vincenzo Palazzo
8543d5e055
checker: improve mut arg error msg ( #16540 )
2022-11-27 07:07:35 +03:00
yuyi
ef5be22f81
all: replace generic <>
with []
- part 2 ( #16536 )
2022-11-26 18:23:26 +02:00
yuyi
b19b97e7b1
generic: replace generic <>
with []
part 1 - allow for both ( #16532 )
2022-11-26 08:59:42 +02:00
Swastik Baranwal
a9b41d2980
all: add support for const
ident in match
range ( #16526 )
2022-11-26 08:56:00 +02:00
yuyi
dee75fe970
checker: perfect infer_struct_generic_types() ( #16524 )
2022-11-24 19:30:02 +02:00
yuyi
f6cc88fa69
tests: add new test for #16519 ( #16520 )
2022-11-24 15:56:07 +02:00