Commit Graph

182 Commits

Author SHA1 Message Date
flywind
40b58a0a18 fix #11009 (#14935) 2020-07-09 09:57:35 +02:00
Timothee Cour
0d0ea3a11e no more code duplication bw liMessage and rawMessage + several bug fixes (#14415)
* no more code duplication bw rawMessage and liMessage; fixes some bugs in rawMessage
* all compiler messages work with hint:msgorigin
2020-05-22 12:02:10 +02:00
cooldome
9295251e68 Implements RFCs #209 (#13995)
* add test
* add changelod entry
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-16 21:04:05 +02:00
Andreas Rumpf
9c46927fad new feature: ability to turn specific warnings to errors 2020-04-04 22:56:03 +02:00
Zahary Karadjov
08afa03075 The raises list can now use expressions referencing the generic params 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
d374c6373b Fix tests/parallel/tguard2.nim 2020-04-01 19:38:44 +02: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
cooldome
e1b1759439 fixes #5050; fixes #11826 (#12606) [backport] 2019-11-07 14:47:26 +01:00
Clyybber
ed1d41c51e Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
2019-09-09 11:54:15 +02:00
Araq
0e4a8bfb28 fixes 'unused module' feature for 32 bit builds of Nim for good [nobackport] 2019-08-09 16:38:10 +02:00
Araq
da37177ac2 make tests green again on 32bit systems 2019-08-09 10:12:32 +02:00
Andreas Rumpf
04708742e7 fixes #11809 2019-08-08 21:41:05 +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
25e6c53bb5 makes the -d:nimIncremental compiler mode compile again 2019-07-27 14:01:28 +02:00
Andrii Riabushenko
4c73139316 revert changes 2019-07-25 23:18:20 +01:00
Andrii Riabushenko
d7bc4e43a2 fixes #11826 2019-07-25 23:02:04 +01:00
Andreas Rumpf
fbb0642e27 Merge branch 'devel' into araq-detect-unused-imports 2019-07-18 18:16:32 +02:00
Araq
07d465ca42 [refactoring] remove unused imports in the compiler and in some stdlib modules 2019-07-18 00:36:03 +02:00
Araq
4137a4dbf3 [feature] detect unused imports 2019-07-17 22:36:23 +02:00
Jasper Jenkins
f774426095 Smarter variant object construction (#11273) 2019-05-26 21:22:02 +02:00
Arne Döring
b92fd30282 rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227) 2019-05-11 10:11:08 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Araq
750f50b6c0 destructors: internal compiler refactoring 2019-04-18 00:53:02 +02:00
Andreas Rumpf
aa072b9525 fixes #10930 2019-03-30 23:45:40 +01:00
Andreas Rumpf
bf592c4e94 more destructor based changes (#10885)
* mark user defined destructors with sfOverriden to simplify the logic
* refactoring in preparation to merge liftings and generic instantiations for destructors
* ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on
* renamed 'patterns' switch to 'trmacros' as it was totally misleading before
* destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking
* test for invalid/too late destructor introductions
* liftdestructors: make code robust for nimsuggest
* --newruntime works for hello world again
* newruntime: code generation for closures
2019-03-23 00:12:05 +01:00
cooldome
1e63f1edb3 destructors: first step towards fixing #9617 (#10341) 2019-01-18 08:51:22 +01:00
Araq
366b6be4fb compiler refactoring: TSymSeq is gone for good 2018-12-11 12:37:05 +01:00
LemonBoy
33458894da Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448
Fixes #4384
2018-10-09 19:58:23 +02:00
Andreas Rumpf
1948eadc24 change runnableExamples implementation; fixes #8641; fixes #7135; runnableExamples works for templates and generics 2018-09-02 22:56:26 +02:00
Araq
c0c8828d9f allow .experimental in a .push/pop environment; refs #8676 2018-08-27 11:20:30 +02:00
Andreas Rumpf
dae5450947 WIP: disallow 'nil' for strings and seqs 2018-08-13 11:41:33 +02:00
Zahary Karadjov
a49b06a52a Implement the is operator for the new static and typedesc type classes
This also makes the first baby steps towards a sound treatment of
higher-order kinds (type type int).

Adds test cases showcasing the new features.

* Also fixes breakage after the rebase
2018-06-16 16:46:32 +03:00
Andreas Rumpf
61fb83ecbb baby steps for incremental compilation 2018-05-30 23:50:34 +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
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Andreas Rumpf
f86ca02960 make semantic checking free of globals 2018-05-18 15:59:44 +02:00
Andreas Rumpf
bf6c2c5ccf preparations of making compiler/msgs.nim free of global variables 2018-05-17 15:21:22 +02:00
Araq
5526252fa0 fixes testament compilation 2018-05-14 17:45:44 +02:00
Andreas Rumpf
328e7a1005 options.nim: no global variables anymore 2018-05-13 17:52:21 +02:00
Andreas Rumpf
e1a921ce4f lookups compiles again 2018-05-10 15:05:05 +02:00
Zahary Karadjov
2b8bf8fc4a A motivating example for the new bindSym behavior.
The example is a proof-of-concept logging library, allowing you to define
lexically-scoped environments where certain logging attributes are applied
automatically to all logging statements.

fixes tmacro1 (use of `bindSym` inside static blocks)
2018-05-07 09:37:49 +02:00
Andreas Rumpf
f697596faf semcheck: code cleanups 2018-04-28 07:49:36 +02:00
Andreas Rumpf
ee366f1746 .experimental can now be used to enable specific features 2018-04-24 09:34:29 +02:00
Andreas Rumpf
33b69f0ed0 refactoring: make FileIndex a distinct type; make line information an uint16; fixes #7654 2018-04-21 08:13:37 +02:00
Andreas Rumpf
e4081a7201 preparations for language extensions: 'sink' and 'lent' types 2018-01-07 23:09:26 +01:00
Araq
8d1a5dc8e7 the documentation generator now supports system.runnableExamples 2017-11-26 02:51:11 +01:00
Fabian Keller
7c03c882f5 Remove more usages of unary lt (fixes #6634) (#6641)
* fixes #6634

* remove more usages of unary <
2017-10-31 19:48:01 +01:00
Andreas Rumpf
f1dab39086 remove old implementation of the roof operator; make tests green again; close #6292 2017-10-29 20:36:07 +01:00
Araq
3aa7c2232e destructors: supportsCopyMem finally works for recursive types 2017-10-26 00:55:23 +02:00