Commit Graph

442 Commits

Author SHA1 Message Date
Andreas Rumpf
a5d28e686f fixes #11817 (#11889)
(cherry picked from commit 42e83ac24c)
2019-08-13 16:59:49 +02:00
Andreas Rumpf
ae04734031 fixes tcompiletimerange [bugfix] (#11720)
(cherry picked from commit 2895ad70c8)
2019-07-15 08:06:47 +02:00
Araq
2b4a7ff6f6 fixes linter regressions
(cherry picked from commit 73cc029fec)
2019-07-15 07:59:14 +02:00
Araq
694d57c899 styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error
(cherry picked from commit c94647aeca)
2019-07-15 07:58:45 +02:00
Araq
40c2f504fb better error message for invalid types
(cherry picked from commit 7c62de0cb7)
2019-07-15 07:58:26 +02:00
Arne Döring
8501971a60 introduce internal Int128 type, use it to fix case stmt checks (#11652)
* initial version of int128
* use int128 in case stmt
* fixes #11552

(cherry picked from commit 7d5d9f7703)
2019-07-08 11:28:42 +02:00
Andreas Rumpf
3e8c4519d4 newruntime for async (#11650)
* fixes overloading resolution for passing owned(Future[string]) to Future[T]
* WIP: make --newruntime work with .async
* memtracker: make it compile again
* make Nimble compile again

(cherry picked from commit 5f515410af)
2019-07-08 11:28:41 +02:00
Arne Döring
cb45527e37 pass typedesc as NimNode to macros (#11400)
* change typedesc's design in macros

* Manual and changelog entry.

* add link to RFC
2019-06-05 09:17:04 +02:00
Arne Döring
f94ec363ab Allow void macro result (#11286)
* allow void macro result
* add test for void macro result type
2019-05-21 21:31:40 +02:00
Jasper Jenkins
90ed904c4d range/case fixes (#11264) 2019-05-16 16:36:40 +02:00
Jasper Jenkins
07eca7decd Fixes #4140 (#11238)
* correct error

* cleaner

* fix line info
2019-05-13 07:47:30 +01:00
Arne Döring
b92fd30282 rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227) 2019-05-11 10:11:08 +02:00
Miran
e54546bcff fixes #7569, all credit to @vincentvidal (#11213) 2019-05-10 08:48:12 +02:00
Clyybber
cc28eef38e Replace countup(x, y) with x .. y 2019-05-07 12:37:28 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Clyybber
9ffab44c35 Remove mStaticTy and mTypeTy 2019-05-07 11:23:03 +02:00
Clyybber
4fd79f5b47 Fix #11058 (#11172) 2019-05-05 08:26:22 +02:00
Jasper Jenkins
6e4ea40475 empty container param error msg (#11158) 2019-05-04 23:28:09 +02:00
genotrance
45759b5e90 Fix 105, few fixes for 101 (#11148) 2019-05-04 22:38:52 +02:00
Arne Döring
a432aedb54 Generic tuple recursion fix (#11115)
* fixes #1145
* unify error messages
2019-04-28 10:11:41 +02:00
Araq
28b4db4470 be consistent, strings have destructors for --gc:destructors 2019-04-10 11:04:38 +02:00
Araq
cce8d3da27 fixes #10934 2019-03-31 19:59:17 +02: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
Arne Döring
97c3b113a5 Size ptr tuple (#10846)
* fixes #10117
* Add support for recursive tuples
* detect in generics
2019-03-18 11:37:09 +01:00
Andreas Rumpf
2ab6b2c657 --newruntime: work in progress 2019-03-14 07:59:44 +01:00
Andreas Rumpf
4be36d77f6 introduce tfHasOwned for fast must-move checkings; removed tfAcyclic as the GC has ignored this hint for quite some time now 2019-03-05 19:58:54 +01:00
Arne Döring
30ab7e6bdd fixes #10678 (#10681) 2019-02-23 10:58:40 +01:00
Andreas Rumpf
ea409fb15a first steps in implementing 'owned' pointers; undocumented, do not use 2019-02-23 08:44:08 +01:00
Andreas Rumpf
721bf7188b code cleanup: there is no tyOptRef 2019-02-22 19:42:11 +01:00
Araq
6c10d331db gc:destructors: slightly more stuff compiles 2019-02-20 14:29:18 +01:00
Araq
f31d1fa98b fixes #10195 2019-02-19 16:25:57 +01:00
Arne Döring
43a0dd42bc Print missing case labels (#10600) 2019-02-13 23:30:14 +01:00
Andreas Rumpf
dee8e6e98a gc: destructors is beginning to work (#10483)
* kochdocs.nim: code cleanup
* docgen: nicer indentation
* parser.nim: code cleanup
* fixes #10458
* make tests green again
* make =destroy mixins
* gc:destructors: produced C code is almost working
* --gc:destructors simple program compiles (but leaks memory)
* gc:destructors make examples compile in C++ mode
* destructors: string implementation bugfixes
* strs.nim: minor code cleanup
* destructors: builtin seqs are beginning to work
* remove debugging helpers
2019-01-29 15:12:16 +01:00
alaviss
35d96d8749 compiler/sem*: better lineinfo for templates (#10428)
* compiler/sem*: better lineinfo for templates

Lineinfo for templates is inconsistant across the compiler, for example:

    doAssert true
    ^        ^

    a[int](10)
    ^^    ^

The `^` marks where the compiler thinks the template starts.

For qualified call, we got the same situation with `proc`s before #10427:

    system.once
          ^

Generics lineinfo within template declaration is also incorrect, for
example, this is where the compiler believes the `T` in `[T]` is:

    template a[T](b: T)
                  ^

This PR addresses all of these problems.

* nimsuggest: add tests for template highlighting
2019-01-23 16:35:34 +01:00
Vindaar
d9ee377517 fix #10339 by returning type attached to nkEmpty (#10370)
* fix #10339 by checking for nkObjConstr

* revert check for nkObjConstr, return type from nkEmpty node

The correct type needed in `semObjConstr` to fix #10339 is indeed
available, but attached to an `nkEmpty` node. These were previously
discarded in `semTypeNode`, which is used to extract the type for the
object.

* simplify return of PType from  `nkEmpty`

* also fixes #9866, add test case
2019-01-23 11:17:32 +01:00
Andreas Rumpf
05c52ff34f fixes #10203 (#10290)
* fixes #10203
* make typredef test green again
* fixes the regressions differently
2019-01-15 10:15:27 +01:00
Neelesh Chandola
8922063bd8 typed/untyped return type is invalid for everything except templates and macros (#10275) 2019-01-15 08:08:12 +01:00
Araq
825e08b046 fixes #7524 2019-01-14 12:15:40 +01:00
Neelesh Chandola
6ed9676af5 Show field not initialized warning only when notnil used (#10155) 2019-01-01 18:49:44 +01:00
Neelesh Chandola
9faad7591e Deprecate gc v2 (#10151)
* Deprecate gc v2

* warnDeprecated now has custom messages
2019-01-01 13:50:48 +01:00
Neelesh Chandola
c5ad4c10cb Deprecated pragma is now supported on enum fields (#10113)
* {.deprecated.} pragma is now supported for enum fields
* Add tests
* Simplify code
2018-12-30 09:43:59 +01:00
Neelesh Chandola
730b1b2b87 proc does not take untyped/typed as argument (#9981)
* proc does not take untyped/typed as argument

* Add TODO
2018-12-19 16:18:57 +01:00
Andreas Rumpf
3f917c8d91 Merge pull request #9959 from nc-x/better-error-message
Better error messages in enums which don't have ordinal types
2018-12-19 10:03:55 +01:00
Andreas Rumpf
72500420d3 Fixes #3060 and adds error checking for invalid else branches in object variants (#9957)
* Fix semRecordCase

* Fix ftpclient.nim

* Check for ordinal type

* Check tyRange for exhaustiveness
2018-12-19 10:03:22 +01:00
Andreas Rumpf
e3a668a33b --gc:destructors: baby steps 2018-12-15 13:54:41 +01:00
Neelesh Chandola
f233b2fe8b Merge remote-tracking branch 'upstream/devel' into better-error-message 2018-12-14 09:34:46 +05:30
Neelesh Chandola
6bdf7fdbce enum types can now be assigned values from enum with holes (#9958)
* Fixes https://github.com/nim-lang/Nim/issues/9952

* Remove workaround from vccexe
2018-12-13 12:14:25 +01:00
Neelesh Chandola
31cff752e0 Better error messages in enums which don't have ordinal types 2018-12-13 15:07:36 +05:30
Neelesh Chandola
e6c510bbbd Check tyRange for exhaustiveness 2018-12-13 14:40:22 +05:30
Neelesh Chandola
fa4644006a Check for ordinal type 2018-12-13 14:12:22 +05:30