Commit Graph

1683 Commits (e6270b05dcf0006867102e7b2a24f0a37a2b27b5)

Author SHA1 Message Date
Leo Developer b3094b0667
checker: abort prematurely on too many errors (#11185) 2021-08-15 13:41:51 +03:00
Leo Developer f6d7170e77
checker: changes related to warn/error limit (#11184) 2021-08-14 22:14:13 +03:00
Leo Developer 8a8a0932f7
all: add limit to accumulated errors / warnings (#11183) 2021-08-14 19:49:21 +03:00
Delyan Angelov deb26b92b9
cgen: support `typeof(x).idx`, as well as `iface.type_idx()` (#11178) 2021-08-14 17:22:25 +03:00
Delyan Angelov 900c37aa65
v.gen.c: support `T.typ` - an int for the type index of the generic type `T` (#11175) 2021-08-14 08:48:25 +03:00
yuyi 579aa7b1b5
v.checker: fix multi insts of generics fn with generic struct (#11161) 2021-08-12 22:58:02 +03:00
yuyi 90adf4d092
v.checker: fix multi insts of generics struct with array (#11142) 2021-08-11 16:59:13 +03:00
Delyan Angelov a64a4d932c
v.checker: turn `interface field ... must be initialized` to a notice temporarily 2021-08-11 16:39:41 +03:00
Enzo da53f818df
all: initial support for closures (x64 / linux-only) (#11114) 2021-08-10 21:27:15 +03:00
Daniel Däschle a64b191ce5
checker: forbid multiple pointer yields (#11105) 2021-08-09 02:11:53 +03:00
Daniel Däschle 9af65d8830
checker: protect against assigning to a typeless variable (#11094) 2021-08-07 18:09:07 +03:00
yuyi 11784279ba
checker: check fn_call().sort() (fix #11040) (#11056) 2021-08-04 21:23:22 +03:00
Delyan Angelov f9c279d11d
v.checker: make calling a deprecated fn an error, 180 days (6 months) after its deprecation date (#10682) 2021-08-04 17:41:00 +03:00
Daniel Däschle 800c0e5092
vlib: remove deprecated map{} usages as well as deprecated functions (#11035) 2021-08-04 12:44:41 +03:00
Daniel Däschle 815c4b7420
all: rename generic_struct_inst to generic_inst (#11044) 2021-08-04 03:37:27 +03:00
Louis Schmieder a55ba08fad
orm: fix time (#11026) 2021-08-03 05:17:00 +03:00
Leo Developer 6dcf72fe9b
cgen: dont generate function if its flag is false (#11021) 2021-08-03 03:17:22 +03:00
Florian Blasius 69f31d8d5c
checker: check int literal to enum cast (fix #10125) (#10348) 2021-08-02 07:12:29 +03:00
Uwe Krüger 6068777e03
parser/checker: deduce type of global from initialization expression (#11005) 2021-07-31 16:35:19 +03:00
Delyan Angelov e374ffb590
checker: add an early checker error for `node.left_types.len != node.left.len` in assignments 2021-07-31 14:57:29 +03:00
Louis Schmieder 0bb587c8c2
checker: fix defer ident handling & fix defer optional error message (#10975) 2021-07-30 20:29:06 +03:00
Alexander Medvednikov ec92964bb0 checker: make interface init check a warning for now 2021-07-30 03:32:02 +03:00
Louis Schmieder 7c504920e1
checker: fix negative values for unsigned integers (#10976) 2021-07-30 03:27:59 +03:00
Daniel Däschle 6fa8e4269e
checker: force interface init (#10910) 2021-07-30 03:18:20 +03:00
yuyi 57f30668e3
v.checker: fix `a.map(voidfn(it))` (#10985) 2021-07-29 11:43:56 +03:00
Uwe Krüger 08aa6c08f6
all: more improvements for global variables (#10986) 2021-07-29 10:57:31 +03:00
yuyi 9f4431544d
checker: fix typo in selector_expr() (#10977) 2021-07-28 08:28:55 +03:00
Uwe Krüger 45ad48d76a
cgen: properly handle initialization expression for globals (#10981) 2021-07-28 08:11:55 +03:00
Delyan Angelov 6134c4870b
v.util: extract v.util.version, use it to speed up building `v repl`, `v up` and `v doctor` 2021-07-27 12:59:56 +03:00
yuyi 4cf91a28f6
checker: fix generics interface with multi generic types (#10964) 2021-07-26 08:54:57 +03:00
Delyan Angelov 0bcb955258
checker: fix regression of anon fns that have loops with break/continue 2021-07-25 10:46:31 +03:00
Uwe Krüger 55c5b9ce7b
cgen: panic with error message when `go` command fails (#10943) 2021-07-25 01:13:34 +03:00
Daniel Däschle 3be8ef3b5a
checker: check duplicated field and method (only for fields that are anon-fns for now) (#10927) 2021-07-24 16:06:09 +03:00
Delyan Angelov b9771ea120
v.checker: small cleanup for incomplete match errors 2021-07-24 13:32:55 +03:00
Uwe Krüger 1e5627e777
parser: don't require unary `>` prefix for `select` timeout (#10928) 2021-07-23 23:24:27 +03:00
Louis Schmieder 1999850f88
checker: disallow labels in defer statements (#10901) 2021-07-23 22:35:05 +03:00
playX 69cbdf9fdc
v.gen.js, os_js: port the OS module to JS (#10872) 2021-07-23 18:04:36 +03:00
Delyan Angelov 6313ed6a79
checker,cgen: fix `-os cross` support for `$if !solaris { #include <sys/ptrace.h> }` 2021-07-23 16:24:42 +03:00
Delyan Angelov c797e1460d
checker: do not skip any of the top level `$if OS {` branches in `-os cross` mode 2021-07-23 15:53:03 +03:00
Louis Schmieder 26db3b0995
orm: redesign orm (re-write it in V) (#10353) 2021-07-23 12:33:55 +03:00
Daniel Däschle a2de3ffcdb
checker: check if condition optional (#10921) 2021-07-23 08:52:51 +03:00
Daniel Däschle 2c0c211c79
all: implement accessing embedded field and method of aggregate (#10907) 2021-07-23 01:14:39 +03:00
Daniel Däschle f40090e8ff
checker: fix break inside anon fn (#10914) 2021-07-23 01:13:36 +03:00
Louis Schmieder 742f6f849c
checker: check using a map as a struct init in parameter (#10904) 2021-07-22 10:42:59 +03:00
Daniel Däschle 12884e9eb7
checker: disallow invalid pointer arithmetic (#10888) 2021-07-21 23:39:49 +03:00
shadow 591af866ba
checker: prohibit returning a fixed array (#10882) 2021-07-21 11:39:22 +03:00
Daniel Däschle f6402eae10
checker: check `match` with type alias (#10863) 2021-07-20 15:06:36 +03:00
Daniel Däschle 60b705b4c4
checker, gen: implement basic struct embed direct field init support (#10871) 2021-07-20 15:06:06 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
playX 425ca5e3c3
v.gen.js: add three backend options for JS, and comptime if support (#10859) 2021-07-19 15:55:03 +03:00
yuyi 8e99a018df
checker, cgen: fix generics interface method (#10858) 2021-07-19 13:29:46 +03:00
yuyi cf82bd3407
checker: fix fixed array with const unint type size (fix #10826) (#10853) 2021-07-19 12:44:03 +03:00
yuyi fdba3607af
checker: fix generics fn selector expr with unexpected symbol (#10851) 2021-07-19 09:16:15 +03:00
Delyan Angelov 241a7b760d
strconv,checker,cgen: fix -cstrict compilation of hello_world.v 2021-07-19 01:08:48 +03:00
Delyan Angelov 48546d0f45
all: do compile time const evaluation for `const x = "abc" + "xyz"` and `const x = 16 * 1024 + 5` (fix const prealloc_block_size) 2021-07-18 22:59:18 +03:00
shadowninja55 eb65ad078d
checker: prohibit passing non-lvalue as `voidptr` (#10838) 2021-07-18 15:04:16 +03:00
yuyi 8b8f496762
checker: fix generics fn return generic interface (fix #10818) (#10831) 2021-07-18 08:55:19 +03:00
Delyan Angelov 568aa742b2
v.parser: improve conditions for debugging ast.CastExpr parsing 2021-07-17 17:49:29 +03:00
spaceface 22fcbe70a2
checker: allow omitting `{}` in trailing struct args (#10832) 2021-07-17 15:44:44 +03:00
shadowninja55 0d587d3580
checker: prohibit using non-lvalue as mut receiver (#10790) 2021-07-16 13:03:40 +03:00
yuyi ddaac5af92
checker: fix generics with multi generic struct types (#10808) 2021-07-15 17:39:55 +03:00
shadowninja55 7c0be629ab
checker: prohibit fixed array to fixed array assignment where elem_typ is a pointer (#10775) 2021-07-15 08:38:03 +03:00
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes (#10795) 2021-07-15 08:29:13 +03:00
crthpl 5089eb4a84
parser: fix pointer cast expressions hack (#10777) 2021-07-13 12:01:24 +03:00
Delyan Angelov 85564b7b83
vinix: support -os vinix (part 1) 2021-07-13 11:24:09 +03:00
shadowninja55 7694afa44c
checker: check that `mut` args are lvalues (#10779) 2021-07-13 08:06:39 +03:00
shadowninja55 02f0a30555
checker: ensure hex character literals don't overflow in strings (#10725) 2021-07-12 22:37:31 +03:00
yuyi 5c7881feb7
checker: fix error of for_in alias (#10770) 2021-07-12 09:17:00 +03:00
zakuro ba9b53cc4d
cgen: fix error when using anon generics fn that have generics struct arg (#10751) 2021-07-11 19:30:41 +03:00
yuyi c65bfc122d
checker: check assigning array_init with no type (#10757) 2021-07-11 18:52:01 +03:00
shadowninja55 b222e4efae
checker: change expr depth limit to 150 (#10745) 2021-07-10 20:24:53 +03:00
Louis Schmieder eb96ad11d9
checker: add pkgconfig to comptime if (#10692) 2021-07-09 18:17:04 +03:00
shadowninja55 aa5b609d95
checker: check integer literals (#10706) 2021-07-09 14:02:10 +03:00
Delyan Angelov 972cbe2e9a
serenity: add more support 2021-07-09 11:33:51 +03:00
yuyi fb9b2e873c
checker: fix generic fn with assign reference generic struct (fix #10681) (#10695) 2021-07-08 16:50:25 +03:00
Alexander Medvednikov 9ba6c23d5c checker: casted => cast 2021-07-08 05:11:12 +03:00
shadowninja55 806d6172cb
checker: prohibit casting `void` (#10690) 2021-07-07 21:59:58 +03:00
shadowninja55 f070222124
checker: prohibit option and `IError` in multi-return (#10689) 2021-07-07 11:57:10 +03:00
yuyi c4b5805890
checker: check generic method call args mismatch (#10669) 2021-07-05 10:14:00 +03:00
Delyan Angelov 972542d6ee
checker: `[noreturn]` part 2 (cleanup) (#10667) 2021-07-05 05:05:37 +03:00
Delyan Angelov 6aecda3be8
all: support `[noreturn] fn abc() { for{} }`, mark panic/1 and exit/1with it too. (#10654) 2021-07-04 20:24:19 +03:00
yuyi b0b4b8e65b
checker: fix missing check generic fn call args (fix #10649) (#10657) 2021-07-04 19:15:15 +03:00
yuyi 665279938e
checker: fix nested generic struct init (fix #10652) (#10659) 2021-07-04 18:37:31 +03:00
shadowninja55 8c43d2450f
vweb: prohibit invalid parameter types in vweb app methods (#10631) 2021-07-04 18:37:09 +03:00
Daniel Däschle 0f9537ece5
all: remove ustring (#10630) 2021-07-03 20:14:09 +03:00
yuyi e4d88a5be5
v.checker: minor cleanup of fn_call() (#10632) 2021-07-02 19:45:12 +03:00
yuyi abbf71c794
ast.table: cleanup type_implements_interface() (#10643) 2021-07-02 10:18:04 +03:00
Delyan Angelov a33a2ba095
checker: check for `x := []Interface{len: 9}` without `init:` 2021-07-02 08:37:49 +03:00
div72 9d02ca51d1
checker: relax naming requirements for translated code (#10619) 2021-06-30 14:47:13 +03:00
yuyi 1e896c7020
checker: check optional interface type mismatch (#10617) 2021-06-30 08:54:28 +03:00
shadowninja55 f029f7e897
checker: prohibit `char.str()`, add tests (#10615) 2021-06-30 08:16:31 +03:00
shadowninja55 f45f30a9c2
checker, cgen: fix aliased array methods (#10603) 2021-06-29 12:14:37 +03:00
shadowninja55 06a6a8e199
checker: check for empty branches in match expressions (#10593) 2021-06-28 19:32:28 +03:00
shadowninja55 ea3983a91b
checker: require .sort() body for some types (#10550) 2021-06-27 17:17:03 +03:00
shadowninja55 eb5afb7403
checker: prohibit selective const imports (#10574) 2021-06-26 18:09:52 +03:00
Delyan Angelov 19dca026a9
checker: bugfix for `__global ( cpu_get_id fn () u64 ) ... cpu_get_id()`
Support new vlib/v/checker/tests/globals_run/ folder, for .vv files
that will be run with `-enable-globals run`, and the results will be
compared with their matching `.run.out` files.

Add regression tests.
2021-06-26 01:23:50 +03:00
Alexander Medvednikov 7458927593 checker: fix global fn calls 2021-06-25 20:26:24 +03:00
yuyi 4bfe76123a
generics: fix generic fn type mismatch of returning a generic struct (#10553) 2021-06-24 12:47:36 +03:00
BigBlack 8324a766e8
checker: allow for `unsafe {*(p+1) = 22}` (#10557) 2021-06-24 12:39:42 +03:00
shadowninja55 83eb9d5d07
checker: disallow accessing fields or methods of `void` (#10552) 2021-06-24 07:33:12 +03:00
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