Delyan Angelov
b6bd6d1d35
tests: add cmd/tools/vdoc/tests/vdoc_file_test.v, extract a `v.util.diff` module, cleanup
2021-06-22 18:52:34 +03:00
Delyan Angelov
79df7f51c3
v: deprecate `[if ident]` in favour of `[if ident ?]`
2021-06-22 10:30:14 +03:00
yuyi
da4b6b934d
checker: fix map assign array of interface values ( #10532 )
2021-06-21 19:24:42 +03:00
Uwe Krüger
8f2f377cb1
v.checker,v.gen.c: extend auto heap mechanism to objects used as interfaces ( #10529 )
2021-06-21 07:10:10 +03:00
Uwe Krüger
f32a76b268
all: promote value type function arguments to heap if necessary ( #10528 )
2021-06-20 18:40:24 +03:00
Enzo
44d0305ca9
checker,gen: remove automatic string to C string conversion ( #10144 )
2021-06-20 09:30:08 +03:00
yuyi
2298063129
checker: fix nested if smartcast selector exprs ( fix #10372 #10379 ) ( #10502 )
2021-06-18 14:49:15 +03:00
Delyan Angelov
a01e8eb0f8
v.checker: implement `-d debug_manualfree`, noticing `[manualfree]fn f(s string){return s}`
2021-06-18 13:06:52 +03:00
zakuro
751f2950ea
checker: skip checking `[required]` fields for struct update syntax ( #10500 )
2021-06-18 02:51:33 +03:00
Delyan Angelov
39e7290416
v: support for `[if expr]`, part 2 (old `[if ident]` is not yet deprecated)
2021-06-17 18:55:20 +03:00
yuyi
c58b04bcbf
checker: implement if smartcast multi conds (part 2) ( #10487 )
2021-06-17 12:27:31 +03:00
Alexander Medvednikov
eacdd0d7e1
comptime: fix $(field.name) in $for; vweb: shared fields
2021-06-16 20:33:39 +03:00
yuyi
e31be9f5c4
checker: fix generic fn assign ( #10479 )
2021-06-16 19:17:07 +03:00
yuyi
1dca06495d
checker: implement if smartcast multi conds (part 1) ( #10477 )
2021-06-16 19:16:15 +03:00
Delyan Angelov
862c4cf371
v.checker,v.gen: allow for `&IAbc(voidptr(0))` where IAbc contains fields
2021-06-16 10:48:50 +03:00
Delyan Angelov
e7cc93a120
v.checker: allow for a `f(unsafe{voidptr(0)})` call of `fn f(x &Interface){}`
2021-06-16 09:20:01 +03:00
yuyi
ffcc6cf6d2
checker: fix `for in mut val` for floats ( #10470 )
2021-06-16 04:04:31 +03:00
yuyi
bdc8586ddd
checker, cgen: fix `for in mut val` ( #10444 )
2021-06-15 04:43:10 +03:00
yuyi
e5debbbe01
checker: implement smartcast if multi conds (part 1/2) ( #10452 )
2021-06-14 18:10:29 +03:00
Emily Hudson
535dcac8fa
net: ipv6 support, merge unix+ip;[pack:x] attribute ( #9904 )
2021-06-13 23:53:38 +03:00
yuyi
cab054c1ba
checker: simplify checking array append type mismatch ( #10422 )
2021-06-13 06:29:40 +03:00
Uwe Krüger
2ac39d9112
all: new function `isreftype(T)` to know if `T` contains pointers ( #10438 )
2021-06-13 06:26:13 +03:00
Delyan Angelov
2ff0f62866
v: fix passing `-arch arm64` to `$if arm64{}`
2021-06-13 01:15:35 +03:00
Alexander Medvednikov
9ac661be5a
checker: use a correct type name in an error
2021-06-12 17:28:30 +03:00
pancake
3b6045865b
checker: improve error message when using fields as methods ( #10367 )
2021-06-12 15:15:25 +03:00
Alexander Medvednikov
635f045b14
ast: make is_int() work with aliases
2021-06-12 14:35:38 +03:00
Alexander Medvednikov
6761697088
checker: do not allow dereferencing function calls on the left side of an =
2021-06-11 16:07:41 +03:00
crthpl
6576d876fc
cgen: support a `[_naked]` fn attribute ( #10418 )
2021-06-11 11:03:39 +03:00
yuyi
7878bad95e
checker: check array type mismatch of array append ( #10405 )
2021-06-10 21:34:36 +03:00
shadowninja55
10b9ea3258
checker: add an error for assigning to array slices `a[..2] = [0, 0]` ( #10412 )
2021-06-10 19:18:14 +03:00
Delyan Angelov
115edff7e9
v.checker: restrict `x T` in `fn test<T>(x T){ unsafe{ println(x[0]) }`, but allow `x &T`
2021-06-09 12:07:08 +03:00
Delyan Angelov
f351ff037e
Revert "checker: check generic type indexing error ( #10345 )"
...
This reverts commit 103c777ad6
.
Passing references to values should be allowed, and is already used in vinix:
`pub fn cas<T>(_here &T, _ifthis T, writethis T) bool {`
2021-06-09 11:46:17 +03:00
yuyi
49de1f8e64
checker: cleanup in infix_expr() ( #10368 )
2021-06-09 00:06:29 +03:00
yuyi
103c777ad6
checker: check generic type indexing error ( #10345 )
2021-06-08 17:23:44 +03:00
yuyi
0615f2e236
checker: check generic method receivers with no type parameter ( #10374 )
2021-06-07 12:11:29 +03:00
crthpl
8a497080b3
cgen: fix assembly in generic fns ( #10370 )
2021-06-07 10:53:33 +03:00
Lukas Neubert
c14b357fec
checker: fix enums in builtin ( #10366 )
2021-06-06 16:27:46 +03:00
Lukas Neubert
3f00ff465b
checker: check or block inside println calls ( #10354 )
2021-06-05 23:01:58 +03:00
yuyi
8af7558e0c
checker: minor cleanup of return_stmt() ( #10315 )
2021-06-05 14:06:48 +03:00
Lukas Neubert
dc431a3c47
checker: prevent enum value duplication check bypass ( #10287 )
2021-06-05 12:28:17 +03:00
crthpl
9553c5a4e6
parser: fix multiple output modifiers in asm ( #10347 )
2021-06-04 23:18:11 +03:00
yuyi
f4486d79c3
checker: minor cleanup of selector_expr() ( #10316 )
2021-06-03 16:49:50 +03:00
yuyi
fedf07ddd8
checker: minor cleanup of assign_stmt() ( #10314 )
2021-06-03 09:49:03 +03:00
yuyi
86d70fade7
checker: minor cleanup of struct_init() ( #10310 )
2021-06-03 09:48:19 +03:00
yuyi
1747e546bf
parser, checker: check assert optional ( #10319 )
2021-06-02 20:38:26 +03:00
yuyi
cb19079d53
all: move cur_concrete_types to Table ( #10269 )
2021-05-31 17:14:45 +03:00
Louis Schmieder
38796521fa
all: allow defer use from other scope ( #10284 )
2021-05-31 14:43:44 +03:00
Delyan Angelov
eac1e25c5d
strings: simplify Builder ( #10263 )
2021-05-31 14:21:06 +03:00
yuyi
5aa4f622b6
checker: fix match expr returning optional ( #10281 )
2021-05-31 12:34:55 +03:00
Lukas Neubert
09e3099580
checker: error on direct map alias init ( #10282 )
2021-05-31 12:14:37 +03:00
yuyi
c67891d69f
checker: minor cleanup in match_expr() ( #10261 )
2021-05-30 13:33:19 +03:00
Delyan Angelov
b29bc9cdce
checker: fix panic on `fn abc()?{ return error() }`
2021-05-29 23:46:56 +03:00
yuyi
e4f6369cd1
checker: fix match error to none ( #10245 )
2021-05-29 19:30:57 +03:00
yuyi
8785599094
checker, cgen: fix optional with if expr ( #10242 )
2021-05-29 10:00:12 +03:00
yuyi
9ea753e853
checker: fix generic with fixed array parameter ( #10233 )
2021-05-28 18:51:55 +03:00
Alexander Medvednikov
ca8158ac41
parser: handle casts in match expressions; c2v: minor fixes
2021-05-28 17:59:43 +03:00
yuyi
6e493ca8ca
checker: check index_expr or_expr types mismatch ( #10224 )
2021-05-28 11:40:59 +03:00
Enzo
df2b688337
checker: cleanup type alias pascal case check ( #10217 )
2021-05-27 22:40:32 +03:00
Delyan Angelov
2b62dca000
v: support for `$if threads {}, depending on whether `go ` was used at all ( #10227 )
2021-05-27 18:36:07 +03:00
yuyi
7c0cd2f41d
checker, cgen: fix match with complex sumtype exprs ( #10215 )
2021-05-27 10:13:50 +03:00
Alexander Medvednikov
2abbbcc02d
checker: allow int <=> enum usage in c2v'ed code
2021-05-26 11:00:57 +03:00
yuyi
cf07375d1b
checker: fix multi types generic struct init ( #10201 )
2021-05-25 19:51:55 +03:00
joe-conigliaro
4217f05146
checker/ci: workaround bug causing errors with -usecache (sumtype field access) & add more -usecache tests ( #10199 )
2021-05-25 12:28:18 +03:00
yuyi
0e6f0c1de0
checker: check generic struct init without type parameter ( #10193 )
2021-05-25 06:15:05 +03:00
Enzo
c0b1f99935
checker: allow operator overloading on strings (p. 1) ( #10182 )
2021-05-24 10:23:57 +03:00
yuyi
eb5ac23988
checker: fix match expr with if expr ( fix #10177 #10178 ) ( #10179 )
2021-05-23 17:59:57 +03:00
Delyan Angelov
a08cbd364a
v.checker: improve C.printf(abc) deprecation precision
2021-05-23 12:18:21 +03:00
yuyi
ae9f8627fc
checker: simplify generic structs ( #10167 )
2021-05-23 05:54:58 +03:00
Delyan Angelov
bc01de2181
ast: mark ast.File{} with `[heap]`, and use []&ast.File consistently
2021-05-22 19:06:55 +03:00
yuyi
9be596ef12
checker: fix generic struct with anon fn type ( #10161 )
2021-05-21 17:21:18 +03:00
yuyi
87ded1784e
checker: a minor optimization in file_has_main_fn() ( #10143 )
2021-05-21 06:14:57 +03:00
Lukas Neubert
f7cd95472a
checker: clarify duplicate import error ( #10150 )
2021-05-21 06:12:38 +03:00
yuyi
bf69d20353
checker: fix generic struct with anon fn parameter ( #10147 )
2021-05-20 16:57:27 +03:00
yuyi
492d264d08
checker: fix generic structs init ( #10134 )
2021-05-20 09:18:51 +03:00
Enzo
906b207e58
checker: deprecate using V strings in C function calls ( #10140 )
2021-05-20 09:17:44 +03:00
Alexander Medvednikov
f09a5135e9
checker: handle builtin enum init correctly
2021-05-20 03:14:32 +03:00
crthpl
0d44c8857e
checker: fix position of unknown type errors ( #10110 )
2021-05-16 04:51:23 +03:00
Alexander Medvednikov
ed6ad728d9
vweb: fix serving static files
2021-05-16 04:28:14 +03:00
Delyan Angelov
9fa805cbbf
v.checker: workaround for `./v wipe-cache && ./v -usecache self && ./v -usecache examples/hello_world.v` errors.
2021-05-15 09:15:20 +03:00
Uwe Krüger
7bfd89567b
shared: support `lock` on SelectorExpression ( #10105 )
2021-05-15 04:34:27 +03:00
yuyi
ebe58dcafa
checker: cleanup generic structs ( #10086 )
2021-05-12 19:57:14 +03:00
Delyan Angelov
cf3dd7a51f
v.checker: fix `unused variable` warning on `*p = val`
2021-05-12 18:03:01 +03:00
crthpl
8361f714dd
cgen: fix deadlock when returning/breaking in `lock` ( #10079 )
2021-05-12 11:44:47 +03:00
Delyan Angelov
9f27cf5b21
checker: cleanup missed eprintln
2021-05-11 14:00:48 +03:00
Delyan Angelov
6450fda938
ci: fix compiling blog/, *and* comptime_if_is_test.v. Add vweb_app_test.v .
2021-05-11 13:59:08 +03:00
Delyan Angelov
63cb04196b
Revert "ci: fix compiling comptime_if_expr_test.v"
...
This reverts commit c5285e7217
.
2021-05-11 13:47:49 +03:00
Delyan Angelov
c5285e7217
ci: fix compiling comptime_if_expr_test.v
2021-05-11 13:15:53 +03:00
Alexander Medvednikov
0bc80951e3
checker: fix `T is int`
2021-05-11 10:28:11 +03:00
Alexander Medvednikov
0b75a21aab
checker: fix a typo
2021-05-11 09:48:39 +03:00
Alexander Medvednikov
0f28ff4c8d
tests: a minor grammar fix
2021-05-11 09:47:09 +03:00
Alexander Medvednikov
dc034d9b16
vweb: make thread safe; checker: `$if T is Interface {`
2021-05-11 09:30:18 +03:00
yuyi
3b062388ba
checker: minor cleanup in check_files() ( #10075 )
2021-05-11 03:43:26 +03:00
yuyi
74defc4b82
checker: minor cleanup of FnDecl ( #10000 )
2021-05-09 15:27:45 +03:00
Delyan Angelov
21f207e781
v.checker: use more concise error messages (remove please)
2021-05-08 22:32:18 +03:00
spaceface
ef7454b5e2
checker: fix calling functions with variadic interface parameters ( #10052 )
2021-05-08 22:26:13 +03:00
Delyan Angelov
c16d4911c2
v.checker: deprecate `$if linux_or_macos {` in favor of `$if linux || macos {`
2021-05-08 21:00:21 +03:00
Delyan Angelov
cbf30bd13a
checker: fix regression for generics_test.v
2021-05-08 18:23:12 +03:00
yuyi
ed7c8d5e19
checker: fix generics return recursive generic struct ( fix #10028 ) ( #10031 )
2021-05-08 14:33:09 +03:00
yuyi
3dfbd2351b
checker,cgen: fix generics with generic_fn type parameter ( #10022 )
2021-05-08 14:06:56 +03:00
El Koulali András
262ef7598d
checker: fix unchecked optional in match condition ( #10041 )
2021-05-08 13:33:13 +03:00
Uwe Krüger
d26ac5692e
all: various fixes for [heap]/auto-heap handling ( #10033 )
2021-05-07 15:58:48 +03:00
yuyi
7c58dfb88b
checker: fix for_in mut var unused warning ( #10008 )
2021-05-05 14:11:32 +03:00
Louis Schmieder
b8e070b2a1
orm: fix multi substructs ( #9941 )
2021-05-04 12:35:18 +03:00
Ned Palacios
177f8f585b
checker: fn_call fixes ( #9994 )
2021-05-04 12:31:32 +03:00
yuyi
1d045e5496
checker: check generics fn called outside of generic fn ( #9984 )
2021-05-03 19:50:08 +03:00
yuyi
ddc003380c
checker: check generics fn that return generic struct ( #9979 )
2021-05-03 19:48:54 +03:00
yuyi
035fd052d1
checker: check generic struct declaration ( fix #9974 ) ( #9978 )
2021-05-03 19:47:02 +03:00
Delyan Angelov
ae898e77c5
v.markused: handle interface implementation methods, and vweb programs
2021-05-03 18:40:39 +03:00
Enzo
fb7ddcd4c9
checker: fix looking for unprefixed `os` functions ( #9968 )
2021-05-02 21:46:12 +03:00
yuyi
581fe375cc
checker: fix generics with cascaded multi nested generic fn ( fix #3815 ) ( #9965 )
2021-05-02 19:30:57 +03:00
yuyi
ae22967d1d
parser: ensure generic function declaration specifies type names ( fix #9959 ) ( #9967 )
2021-05-02 19:30:39 +03:00
Delyan Angelov
4b818fa2be
v: implement interface embedding ( #9935 )
2021-05-02 03:00:47 +03:00
Enzo
000d4d3064
checker: cleanup typeof ( #9954 )
2021-05-01 21:21:44 +03:00
yuyi
fec947c7e1
ast: minor cleanup in ast.FnDecl ( #9950 )
2021-05-01 12:50:49 +03:00
Alexander Medvednikov
e949d4b26c
tools/fast: add "V lines" and "V lines/s"
2021-04-30 15:31:50 +03:00
Louis Schmieder
fb685eee18
orm: support arrays ( #9936 )
2021-04-30 09:13:26 +03:00
yuyi
ea0ac09297
checker: fix generics with nested external generics fn ( #9933 )
2021-04-29 17:37:54 +03:00
yuyi
25d9272c84
all: rename `table.register_fn_generic_types` to `table.register_fn_concrete_types` ( #9914 )
2021-04-29 09:06:50 +03:00
crthpl
6945f987cf
checker: fix sumtype comparison and sumtype in itself ( #9917 )
2021-04-29 09:04:02 +03:00
zakuro
191a167f42
checker: allow omitting the enum name of map key ( #9919 )
2021-04-29 08:33:41 +03:00
Lukas Neubert
a065d014a2
fmt: keep constant sizes in struct field fixed array types ( #9910 )
2021-04-28 22:11:15 +03:00
Uwe Krüger
f4e92997f2
checker: support value array elements of `[heap]` type inside struct ref ( #9899 )
2021-04-28 07:47:00 +03:00
Louis Schmieder
faf2656335
orm: support multiline statements ( #9888 )
2021-04-27 15:28:57 +03:00
yuyi
9f1ac39770
checker: fix generics with anon generics fn argument ( fix #9859 ) ( #9897 )
...
* checker: fix generics with anon generics fn argument
* cgen: fix typedef of generics anon fn
* fix check generics argument types
2021-04-27 15:25:42 +03:00
pancake
d8bb939072
native: fix tests, address comments and a little cleaner macho
2021-04-27 12:24:58 +03:00
pancake
a31a1eb9cb
native: define println and exit builtins or verror()
2021-04-27 12:24:58 +03:00
pancake
9a3869c521
v.ast: rename aarch64 to arm64 and aarch32 to arm32
2021-04-27 12:24:58 +03:00
Don Park
aebb551e93
cgen: do full struct initialisation for V structs, fixes invalid data from `map[string]Struct{}['unknown']` ( #9878 )
2021-04-27 08:18:48 +03:00
yuyi
3877522ee3
table,checker,cgen: fix generics with recursive generics struct ( #9862 )
2021-04-26 20:05:10 +03:00
yuyi
21d1f86ead
checker: fix generics that return reference generics struct ( fix #6218 ) ( #9869 )
2021-04-26 20:01:01 +03:00
Enzo
de8c4866a4
v.checker: fix postfix expr on generic types ( #9887 )
2021-04-26 19:57:05 +03:00
yuyi
2b43d3193b
checker: fix generics with assign generics struct ( fix #7784 ) ( #9889 )
2021-04-26 19:54:22 +03:00
spaceface
7acb48df83
parser: parse `JS.` interfaces properly ( #9876 )
2021-04-26 09:58:05 +03:00
Uwe Krüger
3c0a368af3
all: automatically move (some) referenced objects to heap ( #9873 )
2021-04-25 21:40:38 +03:00
zakuro
a0835ac139
checker/cgen: implement in expression for alias of array/map ( #9871 )
2021-04-25 18:17:54 +03:00
Alexander Medvednikov
7f5c3cc1f8
checker: do not allow modifying consts via mutable refs
2021-04-24 14:08:50 +03:00
yuyi
8ccdae6188
all: cleanup generics call_expr ( #9856 )
2021-04-24 09:44:15 +03:00
Enzo
af8ef12990
ast: use `AttrKind` ( #9845 )
2021-04-23 15:51:52 +03:00
Enzo
b4e4d48bbd
checker: make sure negation is only used with numeric types ( #9854 )
2021-04-23 15:18:56 +03:00
yuyi
dd2002cc57
cgen: fix generics with multi generics struct receiver ( #9853 )
2021-04-23 15:17:57 +03:00
Alexander Medvednikov
c7a6d28e13
all: improve unused variable warning (fix `x = 1`, `x += 1` etc)
2021-04-23 13:33:48 +03:00
Lukas Neubert
aa40dfc1de
checker: check __global type ( #9804 )
2021-04-23 12:28:08 +03:00
yuyi
8e455495b2
checker: fix generics that return multi generics struct ( #9852 )
2021-04-23 11:19:16 +03:00
yuyi
431d806dcf
ast, parser: cleanup of generic structs ( #9839 )
2021-04-22 18:21:01 +03:00
zakuro
7443179cc8
checker: make use of private enum from outside module an error. ( #9821 )
2021-04-22 07:07:56 +03:00
yuyi
d02822f456
ast.table: simplify resolve_generic_by_names/types() ( #9834 )
2021-04-21 12:22:42 +03:00
yuyi
7abf59710b
checker: check generic fn called no arg without generic names ( #9825 )
2021-04-20 21:36:21 +03:00
Ned Palacios
254d247e80
checker: return none if type is 0 in ensure_type_exists ( #9820 )
2021-04-20 12:11:41 +03:00
Delyan Angelov
9d8bda9eaf
v.ast, v.checker: fix absent 'missing return' warning, when a function ended with a t.panic() call
2021-04-20 11:49:06 +03:00
Delyan Angelov
d4f31412b7
v: deprecate `@VROOT` in favour of `@VMODROOT` ( #9795 )
2021-04-19 19:01:47 +03:00
spaceface
73352583e7
ci: fix all `-cstrict` warnings with gcc and clang ( #9792 )
2021-04-19 15:38:48 +03:00
Ned Palacios
dde3189e66
checker: avoid get_type_symbol panic inside array_init ( #9800 )
2021-04-19 14:58:30 +03:00
Uwe Krüger
8ab0d42b5f
checker: check argument for `chan.try_push/pop()` ( #9798 )
2021-04-19 11:41:21 +03:00
Henrixounez
4a1e2f9dcc
checker: working is none type check + no crash when checking with non types ( #9793 )
2021-04-18 16:28:39 +03:00
Henrixounez
ee7bcfd05c
checker: prevent double module name prepending on generics types regi… ( #9791 )
2021-04-18 16:26:40 +03:00
yuyi
731e942055
checker: fix generics with different order of generics fn ( #9765 )
2021-04-17 08:29:06 +03:00
yuyi
8cb44ed9db
checker: fix generics with nested generics fn ( #9757 )
2021-04-16 11:53:20 +03:00
yuyi
466dc4540b
all: minor cleanup of generics ( #9744 )
2021-04-15 11:00:23 +03:00
Jarred Sumner
9d6caa1d5d
checker: fix segfault in vls for struct field declarations, having custom initializers with fn calls ( #9741 )
2021-04-15 08:49:25 +03:00
Alexander Medvednikov
3a134acc5a
checker: orm: verify table type
2021-04-15 03:11:24 +03:00
yuyi
1250ce4353
cgen: fix generics with embed generics ( fix #8694 ) ( #9724 )
2021-04-15 01:44:11 +02:00
crthpl
0099458c0a
all: small asm fixes and number labels ( #9730 )
2021-04-15 01:30:23 +02:00
Delyan Angelov
345868853e
checker: change wording of the error message for complex boolean expressions
2021-04-14 19:55:52 +03:00
crthpl
14434cc86a
all: bare metal support (fix `-freestanding`) ( #9624 )
2021-04-14 07:50:50 +02:00
Enzo
66294e359a
checker: add immutable_builtin_modify.vv test ( #9702 )
2021-04-13 06:55:41 +03:00
yuyi
c3ccb58450
checker: check generics variadic arg mismatch ( #9700 )
2021-04-13 02:06:24 +02:00
yuyi
b0b3c51658
checker: minor cleanup in fn_call ( #9681 )
2021-04-11 23:57:00 +02:00
Enzo
5a1a1b7c12
all: merge GoExpr and GoStmt ( #9685 )
2021-04-11 23:56:25 +02:00
Enzo
a851901620
checker: allow casting bool to byte ( #9676 )
2021-04-11 13:24:24 +03:00
Uwe Krüger
954c436d28
checker/cgen: auto initialize `shared` elements of structs ( #9669 )
2021-04-11 10:30:23 +03:00
yuyi
a2a18ef92c
v: simplify handling of function generic parameters ( #9673 )
2021-04-11 09:02:57 +03:00
Uwe Krüger
78c6e35bde
checker/cgen: fix `v := rlock m { m[key] or { default_val } }` ( #9666 )
2021-04-10 16:57:18 +02:00
yuyi
cf64001474
checker: fix generics return generic struct ( #9663 )
2021-04-10 14:00:01 +03:00
yuyi
bf6a2f80ef
checker: fix generics with generic struct receiver ( #9658 )
2021-04-10 04:00:53 +02:00
crthpl
903dd49212
v: add support for `$if freestanding {`, without using it (part 1) ( #9656 )
2021-04-09 23:24:25 +03:00
Ned Palacios
50f59674ce
ast, checker: make SelectorExpr.root_ident return ?Ident ( #9647 )
2021-04-09 18:06:40 +02:00
Caian R. Ertl
ddb2e72301
checker: do not allow module aliases started with '_' (underscore) ( #9588 )
2021-04-09 13:14:27 +03:00
Uwe Krüger
84fa1ae444
boehm-gc: support a `[keep_args_alive]` tag for C functions ( #9641 )
2021-04-09 13:13:49 +03:00
spaceface
4feb09fa5b
checker, cgen: add sumtype-like smartcasting capabilites to interfaces ( #9256 )
2021-04-09 11:00:05 +03:00
yuyi
e654d61541
checker: minor cleanup in check_or_expr() ( #9635 )
2021-04-08 08:21:42 +03:00
Enzo
9541eb816b
checker: remove unecessary assert ( #9617 )
2021-04-07 19:18:18 +02:00
yuyi
66fafe7b7b
checker: remove redundant code for generic structs ( #9628 )
2021-04-07 17:26:22 +02:00
yuyi
fef4e1e700
checker: fix generics method return generics struct ( #9614 )
2021-04-07 15:27:58 +02:00
Lukas Neubert
3a07fbc653
fmt: improve match branch wrapping ( #9619 )
2021-04-07 15:26:10 +02:00
ka-weihe
bca9409192
map: wrap up delete fix ( #9626 )
2021-04-07 14:12:12 +02:00
Alexander Medvednikov
ff9837386a
Revert "map: wrap up delete fix ( #9601 )"
...
This reverts commit cbcc0d34b5
.
2021-04-07 03:40:43 +03:00
ka-weihe
cbcc0d34b5
map: wrap up delete fix ( #9601 )
2021-04-06 15:57:08 +02:00
Delyan Angelov
0e94612535
checker: only allow `ptr += int` in unsafe blocks
2021-04-05 22:01:18 +03:00
Delyan Angelov
d11fb8497a
ci: fix some of `v test-cleancode` 3
2021-04-05 21:21:46 +03:00
Ned Palacios
98e1dd4b22
checker: wrap print_backtraces with if is_verbose ( #9595 )
2021-04-05 18:19:20 +03:00
Ned Palacios
07b1dc66dd
ast, parser: add additional pos info for FnDecl and InterfaceDecl nodes ( #9603 )
2021-04-05 18:14:21 +03:00
Delyan Angelov
4cde74f120
checker: make the compiler stricter when checking pointers
2021-04-05 10:02:47 +03:00
Alexander Medvednikov
7b7602a2f9
checker: bring back automatic c'foo' in c calls
2021-04-05 06:36:06 +03:00
Alexander Medvednikov
f3484345c7
checker: remove debugging info
2021-04-04 18:40:10 +03:00
Alexander Medvednikov
57e6138a61
all: remove byteptr and charptr; replace them with &byte and &char
2021-04-04 17:43:32 +03:00
yuyi
8dd4a63913
checker: minor cleanup of checker.v ( #9585 )
2021-04-04 16:05:29 +02:00
ka-weihe
337e447cfb
map: fix delete (part 1) ( #9579 )
2021-04-04 01:11:47 +02:00
Daniel Däschle
6a5f49afb1
all: support `?Type(none)` ( #9567 )
2021-04-02 16:34:48 +02:00
Conner
9ba8d02a5a
generics: add more checks ( #9539 )
2021-04-02 16:27:54 +02:00
Alexander Medvednikov
fb302c6253
checker: fix compilation
2021-04-02 03:29:24 +03:00
Daniel Däschle
d8efe249ce
checker: add check for call expr in map/filter ( #9559 )
2021-04-02 01:56:51 +02:00
Alexander Medvednikov
7385f8e56b
all: a massive merge of ast and table modules
2021-04-02 01:57:09 +03:00
zakuro
0d1714cb0d
checker: check opt call in more places ( #9538 )
2021-04-01 11:49:13 +02:00
crthpl
8d5e310189
asm: make fixed labels possible as displacement ( #9549 )
2021-04-01 09:58:33 +03:00
Delyan Angelov
6daefde5cb
checker,ci: use c.note for "direct sum type init..."; fixes `/v -prod cmd/vls`
2021-03-31 12:38:54 +03:00
Alexander Medvednikov
e2e7e5fd65
walker: skip EmptyExpr for now
2021-03-31 12:15:11 +03:00
Alexander Medvednikov
6f318be96c
checker: do not allow nil sum types init
2021-03-31 11:13:52 +03:00
yuyi
5c21c748c9
builder,checker,table: simpify generics unwrap and struct processing ( #9531 )
2021-03-30 15:23:17 +03:00
Swastik Baranwal
b40d06ec1e
cgen: fix operator overloading for array/map aliases ( #9529 )
2021-03-30 11:39:54 +02:00
yuyi
6143bd6232
generics: check generic_fn called arg mismatch ( #9510 )
2021-03-30 09:36:45 +02:00
Ned Palacios
b319068151
ast, parser: implement simple AST poisoning ( #9525 )
2021-03-30 09:33:29 +02:00
Ned Palacios
999c385b7f
checker: add type check in interface fields ( #9527 )
2021-03-30 09:32:37 +02:00
yuyi
736df955ff
checker: cleanup of generic's unwrap_generic ( #9495 )
2021-03-29 11:15:45 +02:00
yuyi
92f19f5767
generics: fix generics_struct with generic array string ( #9494 )
2021-03-28 10:46:13 +02:00
Alexander Medvednikov
1e9d527d3c
checker: fix the deref mut check
2021-03-26 12:21:22 +03:00
Alexander Medvednikov
bb5958991c
checker: warn about automatic (de)referencing; freetype: compilation flag fixes
2021-03-26 11:42:51 +03:00
yuyi
478bb9ce8e
parser, checker: fix generic fn that returns a generic struct ( #9469 )
2021-03-26 08:32:11 +02:00
Alexander Medvednikov
0c055a1ce9
all: s.contains(s2) instead of `in`
2021-03-23 11:38:56 +03:00
Ned Palacios
aa4e22c287
scanner, token: add column information to tokens ( #9407 )
2021-03-23 06:23:46 +01:00
Lukas Neubert
1b572f75e8
fmt: minor array wrap improvement ( #9420 )
2021-03-22 23:06:12 +01:00
Delyan Angelov
a00c80b98f
v: support compiler notices. Use them for `[deprecated_after: '2021-05-01']` tags
...
Compiler notices are like warnings, with these differences:
a) notices use a different color.
b) notices use a different label.
c) notices do not prevent compilation with -prod.
(warnings are converted to errors with -prod)
2021-03-22 19:59:00 +02:00
zakuro
0258482caf
cgen: auto eq method for sumtype ( #9408 )
2021-03-22 06:39:07 +01:00
zakuro
f9bbc119aa
checker: make optional arguments in func call an error ( #9362 )
2021-03-20 17:27:16 +01:00
Delyan Angelov
a386be6505
v.table: correct `table.types` to `table.type_symbols`
2021-03-19 22:51:52 +02:00
zakuro
95a748e8b0
checker: cleanup call_method ( #9365 )
2021-03-19 14:19:38 +02:00
Miccah
7222ee476b
all: implement array .any and .all ( #9347 )
2021-03-18 15:24:16 +01:00
zakuro
4ae2c22c18
checker: make optional array element an error ( #9343 )
2021-03-18 15:11:51 +02:00
Alexander Medvednikov
88097125f7
checker: remove "use `++` instead of `+= 1`"
2021-03-18 01:37:36 +03:00
zakuro
6cfc2c217b
checker: fix #9330 ( #9342 )
2021-03-17 20:57:14 +02:00
crthpl
fafb035fb5
all: reimplement inline assembly ( #8645 )
2021-03-17 01:43:17 +01:00
yuyi
dd9f9c2718
checker: check array.sort(a < b) ( #9321 )
2021-03-17 01:42:51 +01:00
Enzo
4b6244c9c1
gen: fix generic variadic ( #9333 )
2021-03-17 00:18:43 +02:00
Uwe Krüger
9d168895ed
checker: check write access to shared elements of `struct` and `array` ( #9314 )
2021-03-15 15:54:06 +02:00
Anton Zavodchikov
1ad4623fb8
tmpl: move to v/parser ( #9052 )
2021-03-15 13:35:55 +02:00
Delyan Angelov
25c07c2f43
v.ast: handle more expressions in Expr.str()
2021-03-15 06:27:56 +02:00
yuyi
945769a4f6
all: implement reference receiver optimization for big structs ( #9268 )
2021-03-14 18:11:21 +01:00
StunxFS
92e95f127a
checker: correct type check for generic function with ternary if return ( #9296 )
2021-03-14 19:01:32 +02:00
spaceface
9ed9e7aff0
builtin: cleanup option names (part 1) ( #9293 )
2021-03-14 01:54:46 +01:00
spaceface
e9797c618a
all: implement error interfaces ( #9291 )
2021-03-13 18:13:50 +01:00
Alexander Medvednikov
2f1810634e
checker: do not allow direct initialization of builtin types (s := string{})
2021-03-13 18:20:46 +03:00
spaceface
be409b52e9
builtin: prepare for error interfaces ( #9043 )
2021-03-12 20:05:05 +02:00
StunxFS
3cb1bb7c36
checker: check the amount of parameters passed to `json.decode()` ( #9267 )
2021-03-12 19:02:09 +02:00
Nick Treleaven
9db8a61b92
checker: disallow array append in an expression ( #9265 )
2021-03-12 16:09:01 +01:00
Uwe Krüger
dbbf96702b
checker: require `shared a` to be `rlocked` to read `a[i]` or `a.e` ( #9266 )
2021-03-12 16:08:39 +01:00
Nick Treleaven
e229d0c1c3
checker: improve error message for invalid property ( #9263 )
2021-03-12 14:18:52 +02:00
yuyi
504b87bcfd
checker: minor cleanup in if_expr() ( #9258 )
2021-03-12 13:40:05 +02:00
StunxFS
04c4f16f75
checker: minor changes to `Checker.hash_stmt()` ( #9249 )
2021-03-11 21:43:42 +01:00
StunxFS
8f08795689
checker: warn/error about empty const blocks ( #9252 )
2021-03-11 21:43:04 +01:00
yuyi
9fbb139e29
checker: check map copy error in fn_mut_arg ( #9242 )
2021-03-11 15:19:36 +01:00
Miccah
f26d2f02b7
ast, cgen, checker, parser: support method arguments in comptime $for ( #9208 )
2021-03-11 15:04:34 +02:00
yuyi
a547e889af
checker: check array literal modify error ( #9243 )
2021-03-11 14:57:04 +02:00
spaceface
7d0cba5e96
v.ast: remove the `stmt.position()` method ( #9233 )
2021-03-11 14:50:02 +02:00
zakuro
f280a5c230
checker: extract into call_array_builtin_method to cleanup ( #9225 )
2021-03-10 20:19:39 +02:00
zakuro
ef73e07e62
checker: split fn_decl into functions to cleanup ( #9226 )
2021-03-10 20:18:48 +02:00
zakuro
791dec7b01
v: support `$if prod` ( #9228 )
2021-03-10 19:26:34 +02:00
yuyi
a187a4abb3
checker: check non-optional fn return or_block ( #9227 )
2021-03-10 12:53:23 +01:00
Delyan Angelov
0d2bb714bc
checker: disallow `x := [13]SumType{}` too
2021-03-10 11:07:36 +02:00
Delyan Angelov
96a9e16e64
checker: allow `a := [5*kb]byte{}` where `kb` is a compile time known const too
2021-03-09 20:21:36 +02:00
Delyan Angelov
26cfd0eda9
checker: eval `const a = 1024 * 1024` and other simple integer expressions at compile time
2021-03-09 20:07:08 +02:00
spaceface
f1469a8761
checker: allow accessing fields common to all sumtype members ( #9201 )
2021-03-09 19:16:18 +02:00
yuyi
10c9f61d61
checker: check empty map invalid syntax ( fix #9162 ) ( #9186 )
2021-03-08 19:48:17 +02:00
yuyi
1b47e2953d
checker: check undefined ident of struct ( #9164 )
2021-03-07 14:09:38 +01:00
Lukas Neubert
fdcfe397d4
fmt: write empty or blocks the same as empty fn bodies, empty structs, etc ( #9136 )
2021-03-06 21:04:51 +02:00
zakuro
7333b1706c
checker: minor cleanup: clear_flag(.optional) in check_expr_opt_call ( #9139 )
2021-03-06 20:42:34 +02:00
Delyan Angelov
849cde245c
v: support dump(expr) ( #9160 )
2021-03-06 18:09:28 +01:00
joe-conigliaro
2d73411396
checker: define missing C fn args & check C & JS args ( #8770 )
2021-03-05 17:41:11 +03:00
Delyan Angelov
0f042124cb
tests: support `fn test_fn() ? { opt()? }`
2021-03-05 14:18:21 +02:00
Gal Pasternak
208cabc994
checker: fix generic type ignores implemented interface ( #9124 )
2021-03-05 06:59:18 +02:00
zakuro
4f02da00ba
checker: check arguments count of sort ( #9105 )
2021-03-04 15:22:47 +02:00
zakuro
9bb073580e
checker: replace checking type exists with c.ensure_type_exists ( #9100 )
2021-03-04 12:28:48 +02:00
Nick Treleaven
412c17ccda
checker: check private built-in methods are not accessible ( #9062 )
2021-03-03 11:12:50 +02:00
Uwe Krüger
dd475f4e37
checker/cgen: enable `IfGuardExpr` for `a[k]` and `<-ch` ( #9065 )
2021-03-03 10:10:38 +02:00
StunxFS
dad7c40306
checker: minor cleanup in `call_method` ( #9066 )
2021-03-03 10:07:16 +02:00
zakuro
c74fa9e471
checker: correct pos for type error of `if v is interface` ( #9080 )
2021-03-03 09:23:39 +02:00
Lukas Neubert
8a0b5bad94
fmt: keep empty lines in const blocks ( #9071 )
2021-03-03 09:23:11 +02:00
Joe Conigliaro
a50f2ca5e8
interfaces: error on implemention of own interface method & on duplicate normal methods
2021-03-03 15:02:10 +11:00
Delyan Angelov
d0e8e8f178
checker: add error for `print( voidfn() )`
2021-03-02 17:54:38 +02:00
spaceface
2b53992c01
checker, cgen: allow implementing an interface with an embedded struct ( #9042 )
2021-03-01 21:47:00 +01:00
yuyi
f9c8d3d25c
cgen: fix return if true { 0 } else { none } ( fix #9005 ) ( #9030 )
2021-03-01 13:56:07 +01:00
spaceface
b712af56fd
all: bring back `panic(err.msg)` -> `panic(err)` ( #9022 )
2021-03-01 00:18:14 +01:00
zakuro
ce115dcbe0
builtin: correct error underline for unicode wide chars ( #9010 )
2021-03-01 00:18:02 +01:00
Uwe Krüger
e937d6249c
cgen: fix various issues concerning optionals ( #9021 )
2021-02-28 23:21:03 +01:00
spaceface
d7252f4474
builtin: allow passing any argument type to `panic` ( #9020 )
2021-02-28 22:57:18 +01:00
spaceface
d63b7bc35a
all: update repo to use the new error handling syntax ( #8950 )
2021-02-28 23:20:21 +03:00
spaceface
b9a381f101
all: migrate to the new Option (p. 1) ( #8924 )
2021-02-28 22:24:29 +03:00
Nick Treleaven
a1244a9f5f
checker: check that the module `init` fn, should have no params, and no return type ( #8988 )
2021-02-27 11:11:20 +02:00
Uwe Krüger
f67bff1696
all: support `thread` handles and `wait()` for functions returning optionals ( #8990 )
2021-02-27 10:16:55 +02:00
Nick Treleaven
8874379c48
checker: check left selector expression in `$if left is right` ( #8987 )
2021-02-26 21:51:35 +01:00
Nick Treleaven
4ad95cfeaf
checker: check types with $for/$if introspection ( #8984 )
2021-02-26 15:26:50 +01:00
Nick Treleaven
59d4d0ef1d
checker: detect unknown type to iterate with $for ( #8971 )
2021-02-26 08:28:19 +02:00
Nick Treleaven
3a082621c9
checker: add a check for casting to an unknown type ( #8968 )
2021-02-26 08:26:36 +02:00
Nick Treleaven
57d1b5b74d
checker: show position for variadic/shared/method argument errors ( #8939 )
2021-02-24 19:35:32 +01:00
spaceface
8033203ef6
builtin: add an Option2 struct ( #8890 )
2021-02-22 18:44:15 +02:00
yuyi
7a6fd359d0
checker: check fn_variadic with array_decompose ( #8894 )
2021-02-22 14:26:54 +01:00
Uwe Krüger
5306b2788c
all: extend `wait()` method to array of `thread` handles ( #8840 )
2021-02-22 15:08:52 +02:00
zakuro
f54c1a5cc2
all: add strings.Builder.write_string and use write_string instead of write ( #8892 )
2021-02-22 13:18:11 +02:00
yuyi
1a838b1f43
checker: fix error of match in map_init ( fix #8579 ) ( #8879 )
2021-02-21 17:09:42 +02:00
yuyi
6e46f3850c
ast: change `expr.is_mut_ident()` to `expr.is_auto_deref_var()` ( #8869 )
2021-02-21 12:15:36 +02:00
yuyi
9a744b6750
cgen: fix in map_literal ( fix #8868 ) ( #8871 )
2021-02-21 11:54:30 +02:00
Nicolas Sauzede
f67a4c3ee0
checker, cgen: allow | between bitfield enum values, autogenerate a more specific .str method for them too ( #8856 )
2021-02-20 21:51:54 +02:00
Nick Treleaven
28088cc494
checker: check fixed array index when it's a literal ( #8831 )
2021-02-20 20:18:47 +02:00
Nick Treleaven
1e71c0eaca
checker: warn for deprecated methods too ( #8861 )
2021-02-20 19:25:54 +02:00
Delyan Angelov
8327c9afc1
checker: support a custom `[deprecated: 'message']`
2021-02-20 17:35:44 +02:00
yuyi
5e1159e4c3
checker: change non-const size of fixed array error message ( #8850 )
2021-02-20 12:14:44 +01:00
Nick Treleaven
bcb35e15f9
checker: only allow passing integer *literal* to non-integer pointer method parameter ( #8825 )
2021-02-19 14:14:40 +02:00
zakuro
6e262b5d84
checker: improve error position of infix expr ( #8828 )
2021-02-19 12:38:41 +02:00
Swastik Baranwal
ad162cd6fc
checker: stricter `unknown type` checks, show better suggestions ( #8816 )
2021-02-19 11:23:13 +02:00
zakuro
a34a1ab864
checker/table: minor cleanup by removing unnecessary `_` variable ( #8801 )
2021-02-18 11:30:43 +02:00
Nick Treleaven
4ccf991f61
checker: warn when casting a fixed array (use `&arr[0]` instead) ( #8787 )
2021-02-17 20:45:11 +01:00
yuyi
4fa315edc2
checker: fix for _, mut j in array ( #8785 )
2021-02-17 20:44:28 +01:00
Nick Treleaven
0f8edd918a
checker: disallow `unsafe` map copy ( #8720 )
2021-02-17 05:19:25 +01:00
Delyan Angelov
843de10442
parser,gen: fix `arr << map[key] using map_get_and_set_1, leading to double free
2021-02-16 16:39:31 +02:00
yuyi
982e35909d
cgen: fix `mut` var in `for` loop reads as address ( fix #8548 ) ( #8745 )
2021-02-16 13:24:19 +01:00
Nick Treleaven
01aa09d515
checker: do not allow copying any map lvalue ( #8662 )
2021-02-16 12:46:12 +01:00
Uwe Krüger
0520b755f4
checker/cgen: support `print*()`, `.str()` and '$x' for `shared` ( #8771 )
2021-02-16 12:40:13 +01:00
Nick Treleaven
c057b45bb1
checker: check argument count for C fn with attribute ( #8728 )
2021-02-15 18:56:26 +02:00
zakuro
2911f03627
checker: reject method that have multi-value type receiver ( #8696 )
2021-02-15 17:55:54 +02:00
yuyi
a9c2045dbd
cgen: fix var name clash of array/map ( fix #1994 ) ( #8765 )
2021-02-15 15:51:57 +02:00
Nick Treleaven
629d43caf5
checker: warn when using `goto` outside of `unsafe` ( #8741 )
2021-02-15 15:48:24 +02:00
spaceface
e3649ec4d3
all: implement `type_name()` for interfaces too ( #8767 )
2021-02-15 15:29:44 +02:00
Nick Treleaven
ea803113c3
checker: check `unsafe` V function calls ( #8752 )
2021-02-14 19:31:42 +01:00
zakuro
e534b4397d
checker: report correct position for non-bool cond error ( #8735 )
2021-02-14 19:19:41 +01:00
zakuro
e4f15605c0
checker: reject void type condition ( #8737 )
2021-02-14 07:33:24 +01:00
Delyan Angelov
e809264f12
builder,checker: split the unused marking into a new `v.markused` module
2021-02-13 18:02:31 +02:00
Uwe Krüger
374739b804
all: rename `[ref_only]` -> `[heap]` ( #8718 )
2021-02-13 16:52:01 +02:00
Ned Palacios
db609a0784
checker: skip checking for invalid fn return type ( #8703 )
2021-02-13 01:21:05 +01:00
Uwe Krüger
40066a5daa
checker: obey [ref_only] tag, allow embedding in other ref struct ( #8707 )
2021-02-13 00:47:37 +01:00
Joe Conigliaro
c904c9178d
checker: support ParExpr for trying to take address errors & simplify messages
2021-02-13 02:49:22 +11:00
Joe Conigliaro
5d36a59dd8
checker: fix returning [] from fn which retuns optional array
2021-02-12 22:30:30 +11:00
Alexander Medvednikov
0a03856c83
parser: small c2v fixes
2021-02-12 09:12:26 +01:00
yuyi
3164e29651
all: fix fn_or_for_in mut value (part 1) ( #8671 )
2021-02-12 02:03:11 +02:00
Nick Treleaven
84a16d8684
map: add `move` method ( #8660 )
2021-02-12 02:02:33 +02:00
Nick Treleaven
375efb0953
checker: improve errors for `return` count mismatch ( #8686 )
2021-02-12 01:47:11 +02:00
Joe Conigliaro
317d450723
checker: add error when trying to take address of call expr
2021-02-12 10:39:02 +11:00
zakuro
4305ce1493
checker: extract long match branches in c.stmt(), into separate checker functions ( #8666 )
2021-02-10 18:51:41 +02:00
yuyi
f2e74bce7a
checker: fix sumtype assign error ( fix #7988 ) ( #8655 )
2021-02-10 10:59:56 +01:00
Uwe Krüger
f3c5f24c17
allow `lock` expression to return multiple objects ( #8657 )
2021-02-09 17:09:10 +02:00
Lukas Neubert
5abd49d9bc
cgen: cast default struct field value to correct SumType/interface ( #8619 )
2021-02-08 17:33:05 +02:00
Nick Treleaven
9e751f72c4
doc, fmt: use `map{key: value}` syntax for map literals ( #8623 )
2021-02-08 16:57:42 +02:00
zakuro
e5839effbc
checker/cgen: allow `<<` operator for aliases ( #8561 )
2021-02-08 01:41:47 +01:00
Lukas Neubert
473cd1d416
fmt: single line ternary return ( #8605 )
2021-02-08 00:28:46 +01:00
Uwe Krüger
118ca1240e
all: allow `shared` element types for `struct` and arrays ( #8631 )
2021-02-08 00:28:29 +01:00
Lukas Neubert
7f4c582f1a
fmt: unwrap long infix exprs inside parenthesis if necessary ( #8609 )
2021-02-07 23:10:39 +01:00
Nick Treleaven
f5f65f929f
parser: parse `map{key_expr: val_expr}` ( #8608 )
2021-02-06 22:13:24 +01:00
zakuro
fe9d062b41
gen: fix bug where unreached defer is executed ( #8594 )
2021-02-06 18:40:39 +02:00
yuyi
1b6efebac7
all: fix map = map2 assignment ( #8581 )
2021-02-06 03:06:34 +01:00
zakuro
a94228bb16
checker: make `[] == ArrayAlias([])` an error ( #8562 )
2021-02-05 16:49:40 +01:00
Delyan Angelov
25a3873019
parser,checker: support @METHOD, replaced by 'ReceiverType.MethodName'
2021-02-05 16:32:43 +02:00
Delyan Angelov
d30f94507c
checker: enable -skip-unused for more examples
2021-02-05 11:55:40 +02:00
Delyan Angelov
40fff7b56a
v.pref: support `v -skip-unused run examples/hello_world.v`
2021-02-05 11:12:28 +02:00