Commit Graph

432 Commits

Author SHA1 Message Date
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
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