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 |
Delyan Angelov
|
80697ec7f3
|
table: .is_used => .usages (a counter, instead of a boolean flag)
|
2021-02-05 10:03:17 +02:00 |
Delyan Angelov
|
e5c9fcb7e9
|
ci: fix building vdoc, vls, etc
|
2021-02-05 09:27:14 +02:00 |
Alexander Medvednikov
|
1084b43ffb
|
all: ast walker for marking unused fns
|
2021-02-05 08:05:35 +01:00 |
Louis Schmieder
|
97c0ef3505
|
orm: struct field support (#8517)
|
2021-02-04 20:28:33 +01:00 |
Uwe Krüger
|
f013e65670
|
checker/cgen: support lock expressions `x := rlock s { s.get() }` (#8540)
|
2021-02-03 23:56:58 +01:00 |
Nick Treleaven
|
de37b52d4b
|
checker: check goto label exists (#8523)
|
2021-02-03 15:20:10 +01:00 |
Swastik Baranwal
|
7ec116d588
|
all: only allow defining `==` and `<` and auto generate `!=`, `>`, `>=` and `<=` (#8520)
|
2021-02-03 15:18:38 +01:00 |
Uwe Krüger
|
9dcf673216
|
all: make `lock` and `rlock` dead lock free :-) (#8534)
|
2021-02-03 15:16:52 +01:00 |
zakuro
|
4b99d6af95
|
cgen: fix bug with duplicate defer generation (#8503)
|
2021-02-03 11:40:21 +02:00 |
zakuro
|
e30e794884
|
checker: add check for using a private const in another module (#8501)
|
2021-02-03 10:17:13 +02:00 |
Uwe Krüger
|
df0520b43a
|
checker,cgen: make `shared` behave like `mut` inside `lock` - and like non-mut inside `rlock` (#8526)
|
2021-02-03 01:20:19 +02:00 |
Daniel Däschle
|
d477e525bb
|
checker/gen: fix generic struct init (#8322)
|
2021-02-03 00:42:00 +11:00 |
Ruofan XU
|
a0a33f7ff1
|
checker: fix map of function as argument and direct call of function in map (#8494)
|
2021-02-02 03:58:32 +01:00 |
Nick Treleaven
|
79e9084f7b
|
checker: allow `Struct{...expr}` where `expr` is another struct type (#8495)
|
2021-02-01 20:08:25 +01:00 |
Uwe Krüger
|
17746561f2
|
cgen: put `shared` arrays and maps always on heap (#8496)
|
2021-02-01 20:07:01 +01:00 |
Delyan Angelov
|
fab7b9d9d9
|
checker: fix `x := match enumexpr { .case2 { fn1 } .case2 { fn2} }`, where fn1 and fn2 have compatible signature
|
2021-02-01 21:01:58 +02:00 |
Nick Treleaven
|
c537578481
|
checker: ensure `expr` is an lvalue with `Struct{...expr` (#8489)
|
2021-02-01 15:18:03 +01:00 |
yuyi
|
53a5aad855
|
cgen: fix fixed array of function (#8490)
|
2021-02-01 14:50:10 +01:00 |
Uwe Krüger
|
44ec9e3ebc
|
checker/cgen: put `shared` struct always on heap (#8492)
|
2021-02-01 14:39:36 +01:00 |
spaceface
|
effa3188dd
|
cgen: fix type casts to interfaces (#8476)
|
2021-01-31 19:24:33 +02:00 |
Larpon
|
d25825df57
|
all: support compile time `$env('ENV_VAR')` (#8456)
|
2021-01-31 19:22:42 +02:00 |
Nick Treleaven
|
f992099726
|
checker: check s.$method(arg) argument is []string (#8455)
|
2021-01-31 15:28:23 +01:00 |
yuyi
|
2963425995
|
cgen: fix fn_with_mut_args (fix #7139) (#8446)
|
2021-01-31 02:45:45 +01:00 |
BigBlack
|
c5e7956eb5
|
checker: fix generic_mutable_arrays in functions (#8445)
|
2021-01-30 18:35:03 +01:00 |
Nick Treleaven
|
64d12cdc8d
|
checker: check number of C function arguments for some cases (#8444)
|
2021-01-30 18:33:36 +01:00 |
Nick Treleaven
|
849bc6c3d8
|
tests: fix weird CI failure with error details (#8449)
|
2021-01-30 18:53:39 +02:00 |
Uwe Krüger
|
9c82eec529
|
checker: support nested propagation cases `f(g() ?)` (#8447)
|
2021-01-30 16:53:31 +01:00 |
Nick Treleaven
|
43c3a3b080
|
checker: fix compile-time call with string identifier expression (#8415)
|
2021-01-30 15:24:16 +01:00 |
div72
|
8c70920695
|
all: add offsetof (#8380)
|
2021-01-30 12:57:09 +01:00 |
Lukas Neubert
|
2774db077d
|
fmt: keep user choice for newlines in match branches (#8418)
|
2021-01-30 11:57:57 +01:00 |
yuyi
|
77b3d40f46
|
checker: fix `map = {}` (#8435)
|
2021-01-30 11:55:10 +01:00 |
Uwe Krüger
|
5e9b528a9d
|
checker/cgen: support `return` from nested `or` (#8430)
|
2021-01-30 12:46:36 +02:00 |
Delyan Angelov
|
760b4c37b9
|
all: support _test.vv files (to test _test.v errors/checks too)
|
2021-01-30 10:42:18 +02:00 |
Delyan Angelov
|
30e0c478d7
|
checker: add error for _test.v file without test_ functions
|
2021-01-30 10:19:29 +02:00 |
Swastik Baranwal
|
e03ece2a4b
|
checker: check the fn decl for anon fns too (#7529)
|
2021-01-29 23:11:05 +02:00 |
yuyi
|
26c06a56b7
|
checker: fix array_insert_or_prepend_short_struct_init (#8397)
|
2021-01-29 14:53:14 +01:00 |
Nick Treleaven
|
d012f2713b
|
checker: improve errors with compile-time field access (#8373)
|
2021-01-29 00:45:00 +01:00 |
spaceface
|
4aee997689
|
checker: make implementing an interface with another interface an error (#8398)
|
2021-01-29 00:41:59 +01:00 |
yuyi
|
1be7cc14d3
|
checker: check duplicate of a const name (#8396)
|
2021-01-28 18:34:55 +01:00 |
Uwe Krüger
|
0afe36e153
|
checker: fix receiver pos for single letter type error message (#8393)
|
2021-01-28 15:20:07 +02:00 |
Lukas Neubert
|
75d85403a6
|
fmt: better ternary concat wrapping (#8379)
|
2021-01-28 11:23:48 +01:00 |
Alexander Medvednikov
|
68dab101d9
|
checker: fix one letter receiver panic
|
2021-01-28 11:05:37 +01:00 |
Alexander Medvednikov
|
36e75e5208
|
Revert "parser: fix panic when single letter receiver parsed (#8381)"
This reverts commit 93b0d8ca64 .
|
2021-01-28 10:59:04 +01:00 |
Daniel Däschle
|
93b0d8ca64
|
parser: fix panic when single letter receiver parsed (#8381)
|
2021-01-28 10:56:43 +01:00 |
Tim Basel
|
5fc7eadd8b
|
cgen: fix short struct init with `mut` (#8384)
|
2021-01-28 10:05:09 +02:00 |
zakuro
|
8162396783
|
checker: deny multi-value in a singe-value context (#8328)
|
2021-01-27 23:10:51 +02:00 |
yuyi
|
d1ab22d45f
|
checker: fix array append short struct init (#8362)
|
2021-01-27 13:55:53 +01:00 |
Enzo
|
2b30c48770
|
checker: fix ctdefine check in non-main modules (#8332)
|
2021-01-27 13:54:33 +01:00 |
Swastik Baranwal
|
17921f4171
|
checker: add checks for optional selector_expr (#8330)
|
2021-01-27 13:53:20 +01:00 |
Nick Treleaven
|
58a76344cb
|
checker: avoid SelectorExpr filter on Ident unless it's a generic type name (#8357)
|
2021-01-27 13:52:52 +01:00 |
Delyan Angelov
|
e5a84719ca
|
all: require calling `optfn() ?` / `optfn() or {...}` for `fn optfn() ? {}`
|
2021-01-26 16:43:17 +02:00 |
spaceface
|
5f2b2df546
|
checker: don't disallow defining methods on interfaces (#8335)
|
2021-01-26 11:56:17 +01:00 |
zakuro
|
3959ba5751
|
checker: make a calling no-body function a checker error (#8265)
|
2021-01-26 11:19:48 +01:00 |
Lukas Neubert
|
2007dbc7b5
|
fmt: put the opening brace on a new line again for infix (#8336)
|
2021-01-26 11:19:32 +01:00 |
spaceface
|
daff085033
|
checker: fix treating C structs with capitalized fields as embeds (#8343)
|
2021-01-25 18:47:14 +02:00 |
Daniel Däschle
|
006a11454f
|
cgen: fix generic type $else $if (#8339)
|
2021-01-25 17:08:02 +01:00 |
Delyan Angelov
|
728344ff65
|
ci: fix `v test-cleancode`
|
2021-01-25 12:55:01 +02:00 |
Delyan Angelov
|
94fd3ff431
|
checker: remove the 'in module main cannot be declared public' error/warning
|
2021-01-25 12:55:00 +02:00 |
spaceface
|
4be45e8d02
|
checker: add mutability checks for interface fields; add tests (#8312)
|
2021-01-24 22:11:17 +01:00 |
Uwe Krüger
|
815104e5d0
|
parser: parse `-1` and `-13.3` as number literals (#8321)
|
2021-01-24 22:09:51 +01:00 |
Alexander Medvednikov
|
8bcb6c10cc
|
checker: remove duplicate const error; fmt: force full path to consts
|
2021-01-24 10:01:13 +01:00 |
Daniel Däschle
|
35432c5e92
|
gen: fix generic multi return (#8303)
|
2021-01-23 23:41:32 +02:00 |
Uwe Krüger
|
38880b23eb
|
checker: allow `a[i]` for `shared` arrays outside `unsafe` (#8292)
|
2021-01-23 13:33:32 +01:00 |
yuyi
|
5ee3fecf60
|
checker: check for mut val in immutable obj (#8285)
|
2021-01-23 10:40:17 +01:00 |
Lukas Neubert
|
8b61891348
|
fmt: smarter if condition wrapping (#8201)
|
2021-01-23 10:33:22 +02:00 |
zakuro
|
9812230847
|
checker: make the no-body main function a checker error (#8211)
|
2021-01-23 10:30:26 +02:00 |
Daniel Däschle
|
c5c7addb88
|
checker: improve infer generic (#8281)
|
2021-01-23 10:19:08 +02:00 |
spaceface
|
c2d501e8a9
|
all: implement interface fields (#8259)
|
2021-01-23 08:57:17 +02:00 |
Louis Schmieder
|
e06e8b10cd
|
orm: fix empty struct and simplify (#8246)
|
2021-01-22 23:28:26 +01:00 |
Daniel Däschle
|
dbf84520f1
|
all: update assoc syntax (#8274)
|
2021-01-22 23:24:48 +01:00 |
Daniel Däschle
|
500ebf77e4
|
all: implement multiple generics (#8231)
|
2021-01-22 13:49:56 +01:00 |
Uwe Krüger
|
925ffd76f4
|
sync/channels: expose `ch.closed` as `bool` pseudo attribute (#8244)
|
2021-01-22 09:37:29 +02:00 |
Daniel Däschle
|
3ee7bc960f
|
checker/gen: fix smartcast pointer sumtype (#8260)
|
2021-01-21 22:31:25 +02:00 |
Louis Schmieder
|
6b1956fb60
|
checker: fix warning at comptime call (#8248)
|
2021-01-21 21:36:11 +02:00 |
Daniel Däschle
|
c6d6690064
|
checker: fix if expr infix (#8215)
* checker: fix if expr infix
* remove debugger code
* fmt
* remove debug
* add test cases
|
2021-01-21 12:42:24 +01:00 |
zakuro
|
29b3077ea1
|
checker: make negative literal index a checker error (#8242)
|
2021-01-21 13:27:16 +02:00 |
Louis Schmieder
|
4045ec1ca8
|
checker: remove vweb unused vars (#8180)
|
2021-01-21 11:09:19 +01:00 |
spaceface
|
f059a9e96c
|
builtin: fix sorting arrays of primitives (#8204)
|
2021-01-20 23:19:35 +02:00 |
yuyi
|
190bb38087
|
checker: check fixed array size (#8224)
|
2021-01-20 23:17:49 +02:00 |
Delyan Angelov
|
d9532eda30
|
checker: error on a.slice(x,y) outside `builtin`
|
2021-01-19 15:55:52 +02:00 |
Delyan Angelov
|
85bcfdd636
|
checker: handle `a[i] or { statements expr }` the same as the other or blocks
|
2021-01-19 09:28:34 +02:00 |
Lukas Neubert
|
b44c08aff0
|
fmt: wrap match branch expressions (#8190)
|
2021-01-19 06:16:42 +01:00 |
Uwe Krüger
|
b74690cbec
|
builtin, checker, cgen: implement `x = a[k] or { ... }` for maps and arrays (#8193)
|
2021-01-19 06:06:57 +01:00 |
Uwe Krüger
|
5cc591b2b6
|
all: support generic `chan` (#8188)
|
2021-01-18 18:37:45 +01:00 |
Lukas Neubert
|
ac2c3847af
|
all: update copyright to 2019-2021 (#8029)
|
2021-01-18 13:20:06 +01:00 |
Lukas Neubert
|
16c9cbce7c
|
fmt: correctly increase f.line_len for write_indent (#8174)
|
2021-01-18 06:02:29 +01:00 |
Delyan Angelov
|
75af639721
|
checker: allow ptr++/ptr-- in unsafe{}, for any kind of pointer, except voidptr
|
2021-01-17 18:09:25 +02:00 |
Swastik Baranwal
|
334b66b311
|
checker/cgen: add checks and fix cgen for [typedef] for C structs (#8169)
|
2021-01-17 17:18:07 +02:00 |
Alexander Medvednikov
|
2b058edc98
|
checker: do not require ref field init with update expr
|
2021-01-17 06:24:03 +01:00 |
yuyi
|
9376c57a51
|
cgen: fix for_in_mut_val (fix #8087) (#8129)
|
2021-01-17 05:32:34 +01:00 |
Swastik Baranwal
|
ef627c9d21
|
checker: improve message and positioning for operator overloading (#8133)
|
2021-01-17 03:37:44 +01:00 |
Delyan Angelov
|
5ae55731b9
|
embed: move to `v.embed_file`, fix CI failing test
|
2021-01-16 20:03:07 +02:00 |
Daniel Däschle
|
53941c4a0a
|
fmt: fix if cond break readability (#8132)
|
2021-01-16 02:12:17 +01:00 |
Delyan Angelov
|
c4c4b9c7b1
|
gen,checker: implement g.trace/2 and c.trace/2, similar to p.trace/2
|
2021-01-15 20:28:53 +02:00 |
Delyan Angelov
|
263fb7d7a8
|
checker: fix `instance.cb_field(mut arg)`
|
2021-01-15 20:28:42 +02:00 |
Uwe Krüger
|
8d014d4646
|
sync: allow `go` routine join with return value (#8125)
|
2021-01-15 13:45:26 +01:00 |
Swastik Baranwal
|
0ca36aafe2
|
cgen: allow assignment operators for type aliases (#8086)
|
2021-01-15 02:27:19 +01:00 |
Nick Treleaven
|
c80cc917c7
|
checker: check casting struct -> interface; disallow casting struct -> interface pointer (#8110)
|
2021-01-15 01:20:58 +01:00 |
Nick Treleaven
|
127503c77d
|
checker: disallow indexing a voidptr (#8109)
|
2021-01-14 20:51:43 +02:00 |
Nick Treleaven
|
890fb2d09d
|
checker: show signature for interface method on error (#8111)
|
2021-01-14 20:50:06 +02:00 |
Larpon
|
f73500f2fe
|
all: add support for the `x := $embed_file('v.png')` compile time call (#8048)
|
2021-01-14 16:20:11 +02:00 |
Nick Treleaven
|
0f2a770b9c
|
checker: improve errors for interface method compatibility (#8097)
|
2021-01-13 23:44:29 +01:00 |
zakuro
|
47536df2d0
|
table: remove nr_dims from Array (#8053)
|
2021-01-13 23:43:19 +01:00 |
yuyi
|
1d28c4de2a
|
cgen: fix multi fixed arrays with default init (fix #8038) (#8064)
|
2021-01-13 22:57:33 +02:00 |
Nick Treleaven
|
ac85257ea0
|
parser: fix sizeof(mod.Type), fix checking sizeof expression (#8065)
|
2021-01-13 06:13:39 +01:00 |
Swastik Baranwal
|
1e853b0efc
|
cgen: implement argument operator overloading (#8067)
|
2021-01-13 03:31:14 +01:00 |
Daniel Däschle
|
3289dff7ff
|
checker: require explicit return none (#8060)
|
2021-01-12 11:43:55 +01:00 |
zakuro
|
33694665f0
|
fmt: align each contiguous field of struct. not the whole. (#7981)
|
2021-01-12 04:38:43 +01:00 |
Swastik Baranwal
|
5a1699dec2
|
checker: add more checks for operator overloading (#8030)
|
2021-01-12 04:37:20 +01:00 |
Uwe Krüger
|
5f95dd54bd
|
builtin: rename `any_*` -> `*_literal` - 2. part (#8032)
|
2021-01-11 22:58:15 +01:00 |
yuyi
|
a1c67232d0
|
checker: fix duplicate variable name (fix #265) (#7982)
|
2021-01-10 21:41:29 +01:00 |
yuyi
|
a97ed55a09
|
checker: check for an unknown struct name (fix #8007) (#8010)
|
2021-01-10 21:16:53 +02:00 |
Swastik Baranwal
|
0081e5740d
|
checker: only allow `!=` and `==` for enum (#7985)
|
2021-01-10 12:26:31 +02:00 |
Swastik Baranwal
|
1f5255c2bb
|
cgen: implement `>=` and `<=` (#7991)
|
2021-01-10 12:24:46 +02:00 |
Ned Palacios
|
256ddcee1f
|
v.ast: add walker submodule for ast walking (#7775)
|
2021-01-09 05:36:38 +01:00 |
Daniel Däschle
|
bbac95a438
|
parser: error on recursive struct (#7964)
|
2021-01-09 01:33:36 +01:00 |
Nick Treleaven
|
141b0cb882
|
checker: fix warning & allow assigning to a union field without unsafe (#7970)
|
2021-01-09 01:32:33 +01:00 |
yuyi
|
828120a918
|
checker: check unknown generic type (#7954)
|
2021-01-08 07:04:06 +01:00 |
Alexander Medvednikov
|
e3f8d448c1
|
all: [noinit] struct attribute
|
2021-01-08 04:49:16 +01:00 |
Daniel Däschle
|
88d18f3303
|
checker: smartcast in for loops (#7942)
|
2021-01-07 21:35:32 +01:00 |
Nick Treleaven
|
cbefe6c32f
|
parser: warn about old use of `typeof` (#7923)
|
2021-01-07 20:32:02 +01:00 |
Uwe Krüger
|
ffd753abdc
|
all: implement `ch <- x or {...}` and `ch <- x ?` (#7928)
|
2021-01-06 21:19:40 +01:00 |
Daniel Däschle
|
9025c3528f
|
all: implement comptime if for generic type `$if T is string {` (#7901)
|
2021-01-06 19:58:53 +02:00 |
Alexander Medvednikov
|
3722e16073
|
builtin: fix byte.str() (part 2)
|
2021-01-05 19:26:50 +01:00 |
Nick Treleaven
|
7a6b160d63
|
checker: fix indexing a type alias instance (#7889)
|
2021-01-05 19:17:18 +01:00 |
Alexander Medvednikov
|
5a70eba8e1
|
all: byte.str() => byte.ascii_str()
|
2021-01-05 19:14:37 +01:00 |
Nick Treleaven
|
8fc33bc27d
|
checker: warn when casting number or a voidptr to reference type outside unsafe (#7900)
|
2021-01-05 20:07:45 +02:00 |
Alexander Medvednikov
|
3e04dfc79f
|
builtin: fix byte.str() (part 1)
|
2021-01-05 18:59:51 +01:00 |
Daniel Däschle
|
c137a79666
|
checker: check if $if left is selector expr (#7897)
|
2021-01-05 18:14:55 +02:00 |
Nick Treleaven
|
3203a124b2
|
checker: warn when casting between reference types outside of `unsafe` (#7892)
|
2021-01-05 17:02:04 +02:00 |
Daniel Däschle
|
5841d5d8e1
|
all: implement basic comptime field selector (#7888)
|
2021-01-05 16:11:43 +02:00 |
zakuro
|
3dae44db73
|
checker: do not allow empty enums (#7848)
|
2021-01-05 01:46:32 +01:00 |
spaceface
|
efb80bdffd
|
all: implement iterators in for loops (#7867)
|
2021-01-05 01:06:44 +01:00 |
Nick Treleaven
|
040b923665
|
checker: warn when accessing `union` fields outside `unsafe` (#7869)
|
2021-01-04 21:44:37 +02:00 |
Daniel Däschle
|
164d7bf5fb
|
parser: struct updating syntax with `Abc{...oldabc newfield: val}` (#7865)
|
2021-01-04 20:19:03 +02:00 |
yuyi
|
46d311dcc4
|
generic: fix return multi array generic (fix #7727 #7753) (#7855)
|
2021-01-04 18:40:53 +02:00 |
Uwe Krüger
|
4a25c2bb6f
|
types: rename `any_*`, `untyped *` -> `* literal` (#7845)
|
2021-01-04 00:11:09 +02:00 |
zakuro
|
dd516858d4
|
fmt: align struct field comments (#7632)
|
2021-01-03 21:10:25 +01:00 |
Delyan Angelov
|
745a7f8d8f
|
ci: run vfmt over checker.v and types.v
|
2021-01-03 19:02:33 +02:00 |
Enzo
|
9332f7cac2
|
checker: allow `map` method name (#7834)
|
2021-01-03 16:57:29 +01:00 |