Commit Graph

141 Commits (36ec47cd203a1f119da74b868ceb92f6da7ea930)

Author SHA1 Message Date
yuyi f62b2dcfa7
table: fix generic method with multi generic types (#12297) 2021-10-26 11:00:27 +03:00
yuyi ac99007cab
table: fix generic sumtype instantiations (#12288) 2021-10-25 15:22:41 +03:00
yuyi ff02c19827
table, builder, checker: cleanup unwrap_generic (#12241) 2021-10-21 05:48:02 +03:00
yuyi a006090b08
ast: minor cleanup of register_type_symbol (#12213) 2021-10-17 15:50:42 +03:00
Alexander Ivanov 0386f2bbea
checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963) 2021-10-11 15:41:31 +03:00
yuyi 83bc9b35b1
ast: fix checking generic fn call with fntype arg mismatch (#12132) 2021-10-10 11:14:19 +03:00
crthpl 85b58b03a3
cgen: parallelize (#10844) 2021-09-28 10:28:04 +03:00
Ekopalypse 400ab7876b
ast: fix fixed array typedef generation issue (#11962) 2021-09-24 17:01:42 +03:00
Daniel Däschle b63ec8fbcf
checker: require `params` attribute to use struct as keyword arguments in function (#11135) 2021-09-14 00:05:30 +03:00
Enzo 012da10517
ast, fmt: cleanup (#11477) 2021-09-13 04:08:58 +03:00
Alexander Medvednikov ab3adf3346 checker: no longer allow automatic dereferncing in `a = b` 2021-09-09 20:21:01 +03:00
yuyi b80777df4b
table: fix alias of sumtype method_call (#11268) 2021-08-22 17:20:10 +03:00
Delyan Angelov ec196cfcd1
all: support overriding individual function from .v files in .c.v or .js.v files. 2021-08-22 15:51:26 +03:00
yuyi 0d81d0c0c6
table, checker: fix sumtype array appending aggregate type values (fix #11197) (#11258) 2021-08-21 17:18:01 +03:00
yuyi 3d22dc1608
all: fix formating Foo<A,B> to Foo<A, B> (#11225) 2021-08-18 17:17:21 +03:00
spaceface d2ce1f74d6
ast.table: fix aggregate field type equality check (#11210) 2021-08-18 14:09:54 +03:00
Alexander Medvednikov 03ed32f805 ast: bring back Table.free() for now 2021-08-08 07:07:06 +03:00
Alexander Medvednikov eaf8b63dd2 cgen: fix a c2v bug with variadics 2021-08-08 06:23:22 +03:00
Daniel Däschle 3b116d2455
cgen: support embedded struct fields on sumtype common fields (#11084) 2021-08-06 21:26:19 +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 45ad48d76a
cgen: properly handle initialization expression for globals (#10981) 2021-07-28 08:11:55 +03:00
Delyan Angelov ef0161c233
v.markused: handle compiling vweb, `-live` and orm example programs 2021-07-27 15:50:42 +03:00
Daniel Däschle 2c0c211c79
all: implement accessing embedded field and method of aggregate (#10907) 2021-07-23 01:14:39 +03:00
yuyi ec87f4ee99
table: fix error of generics interface declaration (#10883) 2021-07-21 15:24:52 +03:00
yuyi 850a715c79
table: minor cleanup in does_type_implement_interface() (#10870) 2021-07-20 15:19:02 +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
yuyi a5c784830b
all: simplify global_scope processing (#10848) 2021-07-18 15:29:34 +03:00
Delyan Angelov 568aa742b2
v.parser: improve conditions for debugging ast.CastExpr parsing 2021-07-17 17:49:29 +03:00
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes (#10795) 2021-07-15 08:29:13 +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
crthpl d14de5fdaf
all: fix generic functions with pointer args (#10686) 2021-07-07 11:51:05 +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 665279938e
checker: fix nested generic struct init (fix #10652) (#10659) 2021-07-04 18:37:31 +03:00
yuyi c0f855ace7
cgen: fix anon optional fn (fix #10640) (#10644) 2021-07-02 17:07:05 +03:00
yuyi 8628b19a3a
ast.table: optimize get_final_type_symbol() (#10646) 2021-07-02 16:59:41 +03:00
yuyi abbf71c794
ast.table: cleanup type_implements_interface() (#10643) 2021-07-02 10:18:04 +03:00
yuyi 8b901df366
table: optimize generated code for an empty interface (#10624) 2021-07-01 12:25:40 +03:00
shadowninja55 be8be3d319
v.parser: prohibit redeclaration of builtin types (#10563) 2021-06-25 13:08:56 +03:00
yuyi e9de30373f
table: fix interface embedding with interface parameter (#10567) 2021-06-25 12:52:25 +03:00
yuyi e3ea5c1e17
v.ast: cleanup Table.resolve_generic_to_concrete/3 (#10559) 2021-06-24 18:21:18 +03:00
yuyi 4bfe76123a
generics: fix generic fn type mismatch of returning a generic struct (#10553) 2021-06-24 12:47:36 +03:00
crthpl 71b41d1042
ast.table: fix anonymous function declaration uniqueness for non-tcc c compilers (#10509) 2021-06-19 19:02:26 +03:00
Enzo 05f0f3e180
v.gen.c: refactor infix expression (#10485) 2021-06-18 14:27:52 +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
Delyan Angelov 69ce8baefd
v.ast: allow for `fn f()&IAbc{return voidptr(0)}` with no additional voidptr implicit conversions to compile 2021-06-16 11:07:04 +03:00
Emily Hudson 535dcac8fa
net: ipv6 support, merge unix+ip;[pack:x] attribute (#9904) 2021-06-13 23:53:38 +03:00
Delyan Angelov e70bde54dc
ast: improve Expr.str() for `sizeof(Type)` and `__offsetof(StructName, fieldname)`, for more informative asserts/dumps 2021-06-12 16:49:14 +03:00
yuyi 329a6c974e
table, checker, cgen: implement generic fn infering fixed array (#10352) 2021-06-06 01:11:08 +03:00
Delyan Angelov 55ef849cd2
v.markused: trim unused map fns for programs that do not use them 2021-06-05 17:30:25 +03:00
yuyi cb19079d53
all: move cur_concrete_types to Table (#10269) 2021-05-31 17:14:45 +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
Lukas Neubert 79b97fa361
fmt: keep names of parameters in anonymus function (#10173) 2021-05-23 05:54:39 +03:00
zakuro be92f81b2e
checker: fix type error in `f<T>(fn (v T))` with multiple different Ts (#10154) 2021-05-21 06:13:04 +03:00
Delyan Angelov da090f91d8
cgen: fix using and auto printing `x := [16]&Type{}` 2021-05-20 15:59:02 +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
yuyi ebe58dcafa
checker: cleanup generic structs (#10086) 2021-05-12 19:57:14 +03:00
Delyan Angelov 6f2c18f1c7
ci: fix `v build-tools` 2021-05-11 11:08:46 +03:00
Delyan Angelov 263e1ee4a4
ci: fix compilation of cmd/tools/vtest-cleancode.v 2021-05-11 11:02:28 +03:00
Alexander Medvednikov dc034d9b16 vweb: make thread safe; checker: `$if T is Interface {` 2021-05-11 09:30:18 +03:00
yuyi a9eb8931ed
table: minor cleanup of resolve_generic_to_concrete() (#10046) 2021-05-08 22:27:58 +03:00
Uwe Krüger d26ac5692e
all: various fixes for [heap]/auto-heap handling (#10033) 2021-05-07 15:58:48 +03:00
yuyi a6764e3cc3
table: fix generics struct with anon fn fields (#10024) 2021-05-06 20:24:08 +03:00
Delyan Angelov 3aa85bb5d7
v.ast: ensure interface->types info is complete 2021-05-06 19:48:11 +03:00
Delyan Angelov 2eafea6308
v: reduce the memory usage of the compiler (analysed with heaptrack) 2021-05-06 11:44:48 +03:00
Delyan Angelov ae898e77c5
v.markused: handle interface implementation methods, and vweb programs 2021-05-03 18:40:39 +03:00
yuyi 581fe375cc
checker: fix generics with cascaded multi nested generic fn (fix #3815) (#9965) 2021-05-02 19:30:57 +03:00
Delyan Angelov 4b818fa2be
v: implement interface embedding (#9935) 2021-05-02 03:00:47 +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
Lukas Neubert a065d014a2
fmt: keep constant sizes in struct field fixed array types (#9910) 2021-04-28 22:11:15 +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
Uwe Krüger 3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
yuyi b2dc444dd2
ast: minor cleanup in generic_struct_insts_to_concrete() (#9855) 2021-04-23 17:21:16 +03:00
yuyi dd2002cc57
cgen: fix generics with multi generics struct receiver (#9853) 2021-04-23 15:17:57 +03:00
yuyi 431d806dcf
ast, parser: cleanup of generic structs (#9839) 2021-04-22 18:21:01 +03:00
yuyi d02822f456
ast.table: simplify resolve_generic_by_names/types() (#9834) 2021-04-21 12:22:42 +03:00
yuyi 51258923d7
checker: fix generics call with reference arg (fix #9817 #9818) (#9830) 2021-04-21 06:40:11 +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
Enzo c174bfa52f
tools: add a `v bug file.v` tool to automatically report bugs on GitHub (#9746) 2021-04-19 21:40:54 +03:00
Delyan Angelov aa3a8c5245
v.ast: add a customizable ast.Table .panic() method 2021-04-19 15:39:57 +03:00
Delyan Angelov cfcecf898b
v.ast: add .free() methods, so vls can be more decoupled 2021-04-18 10:24:51 +03:00
yuyi cb70ffef59
table: minor simplification and cleanup of resolve_generic (#9772) 2021-04-17 02:38:07 +03:00
yuyi 466dc4540b
all: minor cleanup of generics (#9744) 2021-04-15 11:00:23 +03:00
yuyi c3ccb58450
checker: check generics variadic arg mismatch (#9700) 2021-04-13 02:06:24 +02:00
yuyi 3241611871
v.ast table: minor simplification of generic_struct_insts_to_concrete() (#9667) 2021-04-11 10:29:31 +03:00
yuyi bf6a2f80ef
checker: fix generics with generic struct receiver (#9658) 2021-04-10 04:00:53 +02: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
Alexander Medvednikov 57e6138a61 all: remove byteptr and charptr; replace them with &byte and &char 2021-04-04 17:43:32 +03:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00