summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix #12517 Allow single branch when nimvm statements (#20577)Can Lehmann2022-10-171-3/+6
| | | Allow single branch when statements
* fixes #3748 (#20563)Andreas Rumpf2022-10-141-3/+4
| | | | | | | | | * fixes #3748 * fix the regression * don't use the new allocator for the SSL wrapper * fixes regression
* Automatic dereferencing is removed (#20531)ringabout2022-10-101-6/+0
|
* fix #18886 crash on ambiguous proc cast (#20472)Bung2022-10-101-0/+2
| | | | | * fix #18886 crash on ambiguous proc cast * follow suggestion
* add default field support for object in ARC/ORC (#20480)ringabout2022-10-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fresh start * add cpp target * add result support * add nimPreviewRangeDefault * reduce * use orc * refactor common parts * add tuple support * add testcase for tuple * cleanup; fixes nimsuggest tests * there is something wrong with cpp * remove * add support for seqs * fixes style * addd initial distinct support * remove links * typo * fixes tuple defaults * add rangedefault * add cpp support * fixes one more bugs * add more hasDefaults * fixes ordinal types * add testcase for #16744 * add testcase for #3608 * fixes docgen * small fix * recursive * fixes * cleanup and remove tuple support * fixes nimsuggest * fixes generics procs * refactor * increases timeout * refactor hasDefault * zero default; disable i386 * add tuples back * fixes bugs * fixes tuple * add more tests * fix one more bug regarding tuples * more tests and cleanup * remove messy distinct types which must be initialized by original types * add tests * fixes zero default * fixes grammar * fixes tests * fixes tests * fixes tests * fixes comments * fixes and add testcase * undo default values for results Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* closed ambiguous enum defaults to first overload (#20457)metagn2022-10-011-0/+8
| | | | | | | | | * closed ambiguous enum defaults to first overload * add warning * turn to hint * work around config
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
* Update message for checking `cast` (#20145)konsumlamm2022-09-281-5/+5
| | | | | * Update message for checking `cast` * Update error messages in tests
* no ropes WIP (#20433)Andreas Rumpf2022-09-271-2/+2
| | | | | | | | | | | | | * refactorings in preparation for ropes elimination of the C code generator; mostly the usual ': Rope' -> 'result: var Rope' rewrite * rewrote ccgcalls.nim * refactored ccgexprs.nim * ccgliterals: refactoring * refactoring: code dealing with name mangling * refactoring: getRecordFieldsAux * ropes are strings (insert obscene joke here) * optimize JS code gen * optimizations and code improvements * more optimizations * final cleanups
* minor improvements to follow up recent PRs (#20342)metagn2022-09-141-1/+1
| | | | | | put mOpenArrayToSeq in compile-time evaluation whitelist (it was mNone before which was whitelisted), homogenize "ordinal type expected" errors, put overloadable enums in non-experimental manual
* overloadable enums no longer experimental (#20298)metagn2022-09-051-4/+1
| | | depends on #20126
* only allow enums to overload enums + extra test (#20126)metagn2022-09-031-2/+2
| | | mirror behavior without overloadableEnums
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-241-122/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* new .redefine pragma for templates, warn on redefinition without it (#20211)metagn2022-08-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test CI for template redefinitions * adapt asyncmacro * fix quote * fix again * try something else * revert * fix ioselectors_select, disable packages CI * adapt more tests & simplify * more * more * more * rename to redefine, warn on implicit redefinition * basic documentation [skip ci] * Update compiler/lineinfos.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-231-27/+0
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Warn when casting to a larger type (#20103)konsumlamm2022-07-281-8/+10
| | | | | * Warn when casting to a larger type * Revert change to error message to fix CI
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change `styleCheck` to ignore foreign packages * Symbols from foreign packages are now ignored. * Fixed `styleCheck` violations in `compiler` package. * Added symbol ownership to custom annotation pragmas. * Minor refactors to cleanup style check callsites. * Minor internal documentation of reasons why a symbol isn't checked. Style violations were fixed in the compiler after thet were exposed by the changes. The compiler wouldn't compile otherwise. Symbol ownership for custom pragma annotations is needed for checking the annotation's style. A NPE was raised otherwise. Fixes #10201 See also nim-lang/RFCs#456 * Fix a misunderstanding about excluding field style checks I had refactored the callsites of `styleCheckUse` to apply the DRY principle, but I misunderstood the field access handling in a template as a general case. This corrects it. * Fix some `styleCheck` violations in `compiler/evalffi` The violations were exposed in CI when the compiler was built with libffi. * Removed some uneeded transitionary code * Add changelog entry Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* allow dots in defined() (#20010)metagn2022-07-121-1/+13
| | | | | | | * allow dots in defined() refs https://github.com/nim-lang/RFCs/issues/181 * mention accents in older versions
* Allow recursive closure iterators (#19939)Tanguy2022-06-301-1/+2
|
* Fix fixAbstractType for user defined typeclasses, fixes #19730 & #18409 (#19732)nc-x2022-04-301-1/+1
|
* Make sure that field usage preserves the original line info (#19751)Ivan Yonchovski2022-04-291-0/+2
| | | | Currently `struct.field` will generate a node with `info` that points to the symbol definition instead of having the actual node location.
* fix stylecheck bug with nre (#19356)flywind2022-04-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stylecheck usages part two: stdlib cleanup typeinfo.nim: importCompilerProc => importcompilerproc nre.nim: newLineFlags => newlineFlags system.nim: JSRoot => JsRoot ref #19319 * prefer importCompilerProc * fix stylecheck error with asyncdispatch it is a partial regression since #12842 * add tests * don't use echo in tests * fix stylecheck bug with nre * Update compiler/linter.nim * no need to check dotexpr again * neither did let/var/const
* fixes #19603; some pragmas were really only supported as top level ↵Andreas Rumpf2022-03-261-1/+7
| | | | statements. Now this is enforced properly. (#19646)
* apply changes from #18017 and some fixes (#19571)flywind2022-03-011-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/369 * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * merge * remove * fix bug Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fixed object field access of static objects in generics (#19283) [backport]Jason Beetham2021-12-231-1/+1
|
* accept object type node from macros (#19179)hlaaftana2021-11-241-1/+1
|
* add ghci like type annotation buildEchoStmt (1049) (#18875)林亦恩2021-10-131-0/+1
| | | | | | | | | | | | * add ghci like type annotation buildEchoStmt (1049) * Update compiler/semexprs.nim * Update compiler/semexprs.nim Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* alternative to #18918 (#18927)flywind2021-09-301-0/+2
| | | | | * fix #16558 * add testcase
* closes #16132 [backport] (#18880)Andreas Rumpf2021-09-221-5/+8
| | | | | * closes #16132 [backport] * fixes #16132 [backport]
* fixes #18856 [backport] (#18879)Andreas Rumpf2021-09-221-1/+1
|
* Fixed borrowing dot from aliases (#18854)Jason Beetham2021-09-161-2/+2
|
* Dotborrow now works with generic distincts (#18848)Jason Beetham2021-09-141-2/+2
|
* Generic pointer procs now error if no types supplied (#18832)Jason Beetham2021-09-111-1/+1
| | | | | | | * more precise logic for pointer procs * added test for generic pointer procs * Fixed generic getting bracket expr if erroring
* Fixes implicit and explicit generics in procedures (#18808)Jason Beetham2021-09-061-5/+23
| | | | | | | | | | | * Fixes implicit and explicit generics * moved block logic into 'maybeInstantiateGeneric' * Added more tests * Update compiler/semexprs.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* '[]' can now be used for iterators (#18814)Jason Beetham2021-09-061-1/+1
|
* implements https://github.com/nim-lang/RFCs/issues/407 (#18793)Andreas Rumpf2021-09-031-4/+12
|
* implements overloadable enum values; WIP (#18470)Andreas Rumpf2021-07-281-1/+35
| | | | | * implements overloadable enum values * simpler code
* refactoring: removed dead code (#18567)Andreas Rumpf2021-07-241-12/+7
|
* undo RFC #294, it breaks code for no good reason, the compiler can wa… ↵Andreas Rumpf2021-07-211-3/+1
| | | | | | | | | | | | | (#18546) * undo RFC #294, it breaks code for no good reason, the compiler can warn about the construct instead * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * enable test case Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* improve `--declaredLocs` to help disambiguate types (generics, aliases etc) ↵Timothee Cour2021-07-081-1/+1
| | | | | | | | | (#18389) * improve --declaredlocs to help disambiguate types (generics, aliases etc) * avoid a cyclic deps * fix test after rebase
* fixes #16270 (#18388)Andreas Rumpf2021-06-291-0/+1
|
* add more APIs to compiler/debugutils; re-export it (#18243)Timothee Cour2021-06-181-0/+7
|
* Renamed `-d:nimCompilerStackraceHints` to `-d:nimCompilerStacktraceHints`. ↵Timothee Cour2021-06-171-2/+2
| | | | (#18283)
* fixes #15884 (#18230)Andreas Rumpf2021-06-101-1/+1
| | | | | * fixes #15884 * micro optimization
* fixes #18059 (#18140)Andreas Rumpf2021-06-021-2/+26
| | | | * fixes #18059
* feature: the compiler can warn when you use the implicit 'result' variable ↵Andreas Rumpf2021-05-101-0/+3
| | | | | (#17988) [backport:1.2] * implements #17855
* add colon (#17834)flywind2021-04-241-1/+1
|
* `typeof(voidStmt)` now works (#17807)Timothee Cour2021-04-231-1/+3
| | | | | | | | * `typeof(voidStmt)` now works * remove typeOrVoid * add condsyms, and reference cligen https://github.com/c-blake/cligen/pull/193 * fixup * changelog [skip ci] * fixup
* fix #7535(Poor error message for spawn when a procedure (without calling ↵flywind2021-04-211-2/+5
| | | | it)) (#17774)
* Revert localErrorNode param order changes (#17809)Clyybber2021-04-211-1/+1
| | | | | | | * Revert localErrorNode param order changes * Remove unused globalError overload * heh