Andreas Rumpf
da29222f86
init checks and 'out' parameters ( #14521 )
...
* I don't care about observable stores
* enforce explicit initializations
* cleaner code for the stdlib
* stdlib: use explicit initializations
* make tests green
* algorithm.nim: set result explicitly
* remove out parameters and bring the PR into a mergable state
* updated the changelog
2020-06-23 10:53:57 +02:00
Zahary Karadjov
66f18037b3
Fix tests/types/tparameterizedparent0
2020-04-01 19:38:44 +02:00
Zahary Karadjov
be95f8fdfa
Turn some of the errors back into warnings
2020-04-01 19:38:44 +02:00
Zahary Karadjov
ce9a4ed124
Replace tfHasRequiresInit with a more accurate mechanism
...
The new mechanism can deal with more complex scenarios such as
not nil field appearing in a non-default case object branch or
a field within a generic object that may depend on a when branch.
The commit also plugs another hole: the user is no longer able
to create illegal default values through seq.setLen(N).
2020-04-01 19:38:44 +02:00
Zahary Karadjov
7b7e42be54
More precise error messages for uninitialized fields in the presence of inheritance
2020-04-01 19:38:44 +02:00
Zahary Karadjov
1b570f2b18
Turn the warning for uninitialized (result) variables into errors
2020-04-01 19:38:44 +02:00
Zahary Karadjov
8ae48292ff
Plug another hole: default(T) forbidden for objects requiring initialization
2020-04-01 19:38:44 +02:00
Zahary Karadjov
05a0ec4adb
Don't allow 'var x: T' for objects that require initialization
2020-04-01 19:38:44 +02:00
Zahary Karadjov
7652aede41
More sophistication; Allow requiresInit to be specified per-field
2020-04-01 19:38:44 +02:00
Zahary Karadjov
a8b6222c86
First steps, the compiler can boot with enforced requiresInit
2020-04-01 19:38:44 +02:00
Araq
a10cc18247
ARC: optimize complete object constructors to use nimNewObjUninit
2020-01-26 13:43:02 +01:00
Jasper Jenkins
3c38edf563
Better case coverage error message for alias and range enum ( #12913 )
2019-12-18 10:29:01 +01:00
Clyybber
7e747d11c6
Cosmetic compiler cleanup ( #12718 )
...
* Cleanup compiler code base
* Unify add calls
* Unify len invocations
* Unify range operators
* Fix oversight
* Remove {.procvar.} pragma
* initCandidate -> newCandidate where reasonable
* Unify safeLen calls
2019-11-28 17:13:04 +01:00
Araq
61ea85687c
refactoring: --newruntime consists of 3 different switches
2019-10-20 08:11:07 +02:00
Federico Ceratto
39290cf88c
Fix spellings ( #12277 ) [backport]
2019-09-27 07:02:54 +02:00
Oscar Nihlgård
4264e9576d
Consider range type of runtime discrim [feature] ( #11432 )
2019-08-20 17:39:49 +02:00
Arne Döring
afbcd1b330
int128 on firstOrd, lastOrd and lengthOrd ( #11701 )
...
* fixes #11847
2019-08-07 15:53:16 +02:00
Andreas Rumpf
045eeab6b4
fixes #11585
2019-07-03 15:38:24 +02:00
Araq
bd55c862a6
fixes #11617
2019-07-01 13:12:04 +02:00
Jasper Jenkins
fc4f0808c4
parameter runtime discriminators ( #11397 )
...
* allow param for runtime discriminator construction
2019-06-04 22:10:39 +02:00
Jasper Jenkins
1286ba3452
fix bool and range ( #11336 )
2019-05-27 07:59:22 +02:00
Jasper Jenkins
f774426095
Smarter variant object construction ( #11273 )
2019-05-26 21:22:02 +02:00
Andreas Rumpf
a6d49c3a81
special typing rules for owned pointers
2019-03-04 15:41:07 +01:00
Andreas Rumpf
dae5450947
WIP: disallow 'nil' for strings and seqs
2018-08-13 11:41:33 +02:00
Andreas Rumpf
40ec7be45c
refactoring: remove idents.legacy global variable and pass the IdentCache around explicitly
2018-05-27 22:09:15 +02:00
Andreas Rumpf
050789a8f4
sem pass compiles again
2018-05-12 21:30:42 +02:00
Andreas Rumpf
ce859d8c16
more modules compile again
2018-05-12 16:35:59 +02:00
Araq
824092be31
fixes a regression about static object case variant checking
2018-04-06 13:01:24 +02:00
Araq
9de05ec3e0
further steps in implementing sink parameters; refs #7041
2018-03-30 02:32:13 +02:00
Andreas Rumpf
31263ef8f3
fixes #5450
2018-02-04 07:35:32 +01:00
Andreas Rumpf
e4081a7201
preparations for language extensions: 'sink' and 'lent' types
2018-01-07 23:09:26 +01:00
Araq
1bb086e7a8
fixes #5999
2017-12-14 20:55:02 +01:00
Andreas Rumpf
d52a1061b3
work in progress: new implementation for 'a[^1]'
2017-10-29 19:46:17 +01:00
Andreas Rumpf
70ea45cdba
deprecated unary '<'
2017-10-29 08:37:13 +01:00
Daniil Yarancev
5c7ae14074
Fixes #5965 ( #6237 )
2017-08-14 17:43:39 +02:00
Zahary Karadjov
34c34cb49b
move the object construction logic to a separate file
2017-04-06 00:46:18 +03:00