Commit Graph

418 Commits

Author SHA1 Message Date
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
Neelesh Chandola
1f1d7b1088 Fix semRecordCase 2018-12-13 12:11:56 +05:30
Andreas Rumpf
03c4231951 Merge pull request #9909 from nc-x/fix-regression
Fix enum regression
2018-12-11 08:36:15 +01:00
Neelesh Chandola
47c38cb98e Better fix 2018-12-11 10:34:10 +05:30
Neelesh Chandola
e44641b6cb Float values are invalid in enum 2018-12-09 14:20:01 +05:30
Neelesh Chandola
b0f860d90f Fix enum regression 2018-12-09 10:28:34 +05:30
Araq
e874705971 fixes nested gensym'ed parameters; fixes #9476 2018-12-08 13:30:06 +01:00
Araq
abbafe606e IC: further progress 2018-12-01 00:36:14 +01:00
Andreas Rumpf
350396e1ca gc:destructors: more progress 2018-11-29 20:10:52 +01:00
Andreas Rumpf
7d82df20be gc:destructors further progress 2018-11-29 01:13:32 +01:00
Andreas Rumpf
6e8ed8c6fa added first version of a nimfind tool for the poor souls that don't have a good nimsuggest integretation 2018-11-14 16:04:54 +01:00
Araq
c735b75f6f compiler cleanup: flag tfOldSchoolExprStmt is gone 2018-11-06 13:55:03 +01:00
Andreas Rumpf
ae27f8ac58 fixes #9611 2018-11-03 19:11:10 +01:00
Araq
e844e536bf Nim style checker: document the switch; fixes #9564 2018-10-30 15:03:28 +01:00
Araq
f9eec2aa1e fixes #9532 2018-10-28 13:23:27 +01:00
Araq
963292f725 added system.typeof operation; fixes #9093 2018-10-24 17:09:51 +02:00
Timothee Cour
745f1642d6 implement sizeof and alignof operator (manually squashed #5664) (#9356) 2018-10-14 00:52:28 +02:00
cooldome
7a5b614edc fixes #9297 (#9298)
* fixes #9297

* improve spacing
2018-10-11 09:54:50 +02:00
LemonBoy
0ead36dae6 Unchecked arrays now have their own type (#9267) 2018-10-10 21:03:18 +02:00
Araq
f673fbd91f fixes #6533 2018-10-02 19:54:02 +02:00
Andreas Rumpf
539fc5d58b improve the error message for 'attempt to redefine X'; fixes #447 2018-09-17 19:54:56 +02:00
Andreas Rumpf
84d122b5c8 extended system.type/typeof to support an upcoming 'collect' macro that works much better than sugar.lc 2018-09-11 19:02:05 +02:00
Araq
30597e643f fixes merge conflict 2018-08-23 11:30:55 +02:00
LemonBoy
d94ee75d1c Pick skParam symbols when resolving type idents (#8720)
Fixes #8357
2018-08-22 15:49:43 +02:00
zah
96de224a63 Fix #8126 (#8712)
This is a temporary fix that will be reworked in a follow up commit
that aims to eliminate the tfExplicit flag from the compiler. The
complete and proper fix was considered too risky for inclusion just
before our 0.19 release.
2018-08-21 22:14:12 +02:00