summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* refactorings to prepare the compiler for IC (#15935)Andreas Rumpf2020-12-171-5/+26
| | | | | | | | | | | | | | * added ic specific Nim code; WIP * make the symbol import mechanism lazy; WIP * ensure that modules can be imported multiple times * ambiguity checking * handle converters and TR macros properly * make 'enum' test category green again * special logic for semi-pure enums * makes nimsuggest tests green again * fixes nimdata * makes nimpy green again * makes more important packages work
* fix #16150 improve type mismatch errors (#16152)Timothee Cour2020-12-091-1/+1
| | | | | | | * fix #16150 improve type mismatch errors * allow -d:nimLegacyTypeMismatch * address comment
* cmdline: improve command processing (#16056)Timothee Cour2020-11-261-2/+2
|
* Disallow nil dereference at compile time (#16032)cooldome2020-11-181-0/+5
| | | | | | | | | | | | | * bring back the semfold of nil * remove space * fix test * proc type can't be dereferenced * disallow nil dereference at compile time * changelog
* Correct all eggs (#15906)Miran2020-11-101-1/+1
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* honor --declaredLocs in more places, including type mismatch errors; also ↵Timothee Cour2020-10-271-2/+3
| | | | | | | show `kind` with --declaredLocs (#15673) * honor --declaredLocs in more places, including type mismatch errors * fix tests * show declaration location also when type mismatch names clash
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-28/+26
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* spec for view types (#15424)Andreas Rumpf2020-09-291-3/+3
| | | | | | | | | | | * spec for view types * spec additions * refactoring; there are two different kinds of views * refactorings and spec additions * enforce that view types are initialized * enforce borrowing from the first formal parameter * enforce lifetimes for borrowing of locals * typo in the manual * clarify in the implementation what a borrow operation really is
* better support for slices as views (#15414)Andreas Rumpf2020-09-271-4/+6
| | | | | | * moved view tests to tests/views * refactoring * more refactorings * better support for system.toOpenArray for first class view types
* Fix #15389 (#15390)cooldome2020-09-241-7/+11
| | | | | | | | | * allow result symbol reuse * try different approach * Revert "try different approach" This reverts commit abcfb6b75983c2f798cc887342ff1a9ff10c0324.
* borrow checking (#15282)Andreas Rumpf2020-09-091-9/+12
| | | | | | | | | | | * refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
* Expand hoisted default params in sem (#15270)Clyybber2020-09-051-7/+52
| | | | | | | | | * Expand hoisted default params in sem Introduce ast.newTree{I,IT} Add test for default params in procs * Cleanup * Simplify hoist transformation and expand test
* Big compiler Cleanup (#14777)Clyybber2020-08-281-1/+1
|
* Fix #5691 (#15158)Clyybber2020-08-271-20/+22
| | | | | | | | * Fix #5691 * Cleanup and thoughts * Use scope approach * Seperate defined/declared/declaredInScope magics * Fix declaredInScope * Update spec accordingly
* Fix forward declaration issues in template/macro context (#15091)Clyybber2020-07-291-12/+1
| | | | | | | | | | | | | | | | | | | | | | | * Fix forward declaration issues in template/macro context * Correct forward declaration resolving for overloads * Remove old dead code * WIP consistent gensym ids * Minimize diff * Remove obsoleted hack * Add templInstCounter to give unique IDs to template instantiations * Remove obsoleted code * Eh, init in myOpen, not myProcess... * Remove optNimV019 * Add testcase for #13484
* fix #6608 (#14963)flywind2020-07-141-1/+10
| | | | * fix #6608
* Fix #14911 (#14922) [backport]Clyybber2020-07-071-1/+1
| | | | | | | * Fix #14911 * Add testcase * Fix test
* Reject casts to builtin typeclasses (#14788)Danil Yarantsev2020-06-241-0/+2
| | | | | * Closes #14231, closes #14452 * Merge test to tcast.nim
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-3/+3
| | | | | | | | | | | * 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
* * honor --errorMax even for tools (eg drnim, nim doc) (#14546)Timothee Cour2020-06-021-2/+1
| | | * fix a bug that prevented nim doc compiler/nim on windows
* Fix `compiles` for nimsuggest [backport] (#14527)Danil Yarantsev2020-06-011-0/+7
| | | | * Handle nimsuggest in tryExpr * Added test
* fixes #14498 [backport:1.2] (#14503)Andreas Rumpf2020-05-301-1/+1
|
* make it easier to figure out how to debug issues (#14477)Timothee Cour2020-05-281-4/+5
|
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-1/+1
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* allow generic typedesc field access (#12220)Jasper Jenkins2020-04-201-57/+53
| | | Co-authored-by: Clyybber <darkmine956@gmail.com>
* fixes #12741 (#14005)Andreas Rumpf2020-04-191-7/+9
| | | | * fixes #12741 * updated tests
* error msg for #13864 (#13962)cooldome2020-04-131-0/+5
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #13848: make var result work with nim cpp (#13959)Timothee Cour2020-04-131-1/+5
| | | | | * fix #13848 * add exhaustive tests for var result
* fix ICE in isUnresolvedSym (#13925)cooldome2020-04-081-5/+6
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* Turn some of the errors back into warningsZahary Karadjov2020-04-011-14/+0
|
* Replace tfHasRequiresInit with a more accurate mechanismZahary Karadjov2020-04-011-4/+10
| | | | | | | | | 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).
* Fix tests/parallel/tguard2.nimZahary Karadjov2020-04-011-1/+1
|
* Fix https://github.com/nim-lang/Nim/issues/4907Zahary Karadjov2020-04-011-0/+3
|
* Perform nil checks during object construction and within compiles()Zahary Karadjov2020-04-011-1/+4
| | | | Close https://github.com/nim-lang/Nim/issues/6494
* not nil types are illegal to construct through default(T)Zahary Karadjov2020-04-011-0/+2
|
* Enable the requiresInit checks only for objectsZahary Karadjov2020-04-011-1/+1
|
* Plug another hole: default(T) forbidden for objects requiring initializationZahary Karadjov2020-04-011-0/+6
|
* stacktraces can now show custom runtime msgs per frame (#13351)Timothee Cour2020-03-301-0/+5
| | | | | | | | * stacktraces can now show custom runtime msgs * improve tests/stdlib/tstackframes.nim * fix test for --gc:arc * test --stacktraceMsgs:on and --stacktraceMsgs:off * --stacktracemsgs:off by default
* Continue bool conversion fixing (#13751)cooldome2020-03-251-1/+3
| | | | | | | | | * continue fixing #13744 * improve style * improve test Co-authored-by: cooldome <ariabushenko@bk.ru>
* make 'nim check' more robust for illdefined constantsAraq2020-03-201-1/+1
|
* fixes #13671 [backport] (#13678)Andreas Rumpf2020-03-181-1/+1
|
* fixes #13646Araq2020-03-161-3/+9
|
* fix #8312 --hints:off and --warnings:off now honored everywhere (#13489)Timothee Cour2020-02-261-1/+1
|
* fix `is` with generic types; fix `genericHead(Foo[T])` (#13303)Timothee Cour2020-02-091-1/+10
| | | | | * fix #9855, fix #9855, fix genericHead * render TTypeKind via toHumanStr
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-7/+7
| | | | a few magic numbers with consts (#13170)
* fixes #12945 (#12959)cooldome2019-12-241-6/+6
|
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-171-1/+1
| | | | | | | | | | | | | * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-387/+385
| | | | | | | | | | | | | | | | | | * 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
* Fix compiler crash caused by top level return (#12501)Oscar Nihlgård2019-10-241-1/+1
|
* refactoring: --newruntime consists of 3 different switchesAraq2019-10-201-1/+1
|