summary refs log tree commit diff stats
path: root/compiler/seminst.nim
Commit message (Collapse)AuthorAgeFilesLines
* replaces `pairs` with `keys` and `items`; saves 8 bytes (#21319)ringabout2023-02-021-1/+1
| | | replace `pairs` with `keys` and `items`
* fix #19882 Improve error message when instantiating generics that lac… ↵Bung2022-09-191-1/+2
| | | | | | | | | (#20356) * fix #19882 Improve error message when instantiating generics that lack a type * Update tests/errmsgs/t19882.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-231-22/+2
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fixed distinct composite type class proc borrowing (#18904)Jason Beetham2021-10-261-1/+5
| | | | | | | * Fixed composite type class proc borrowing * Moved borrow search into transf * added borrow check to symbol flag
* fixes #16246 (#18800)Andreas Rumpf2021-09-041-1/+2
|
* fixes #18030 (#18415)Andreas Rumpf2021-07-011-1/+1
|
* semLambda removed, semProcAux reworked (#17379)Saem Ghani2021-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * simplified proc-like name ident to symbol code * wip - reworking generic param sem * wip - closer to removing nkEmpty generic params * it's hacky but tests pass * slowly tweaking semProcAux to take on semLambda * fix pragma superset check proto vs current * Set the symbol owner earlier * partial progress reworking proto found bug where default values between forward and impl lead to overload resolution issues. * simplified pragma handling and callConv checks Co-authored-by: Clyybber <Clyybber@users.noreply.github.com> * partially working * cgexprs issue * It works! * comment clean-up * clean-up asserts, comments, and other bits * add isGenericParams, inline isGeneric queries * seeing if this is sufficiently consistent * can use this approach or continue it in a further PR * commentary about nullary generics and clean-ups * fixed a mistake in PNode isGenericRoutine * Some small cleanups * Small cleanup * for func lambdas ensure we use lambda pragmas * add some basic compileTime func tests * [ci skip] remove comments Co-authored-by: Clyybber <Clyybber@users.noreply.github.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
* fixes #11225; generic sandwich problems; [backport:1.2] (#17255)Andreas Rumpf2021-03-091-0/+13
| | | | | * fixes #11225; generic sandwich problems; [backport:1.2] * progress * delegating these symbols must be done via 'bind'
* new-style concepts implementation, WIP (#15251)Andreas Rumpf2021-02-241-23/+22
| | | | | | | | | | | | | * fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
* use typeof instead type (#16962)flywind2021-02-081-2/+2
|
* IC: final implementation steps (#16801)Andreas Rumpf2021-01-251-1/+1
| | | | | | | | * removed dead code * we need even more laziness for the generic caches * make it bootstrap on older Nims * wrote more deserialization code * IC: replay required methods information
* IC: next steps (#16729)Andreas Rumpf2021-01-231-4/+4
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
* IC: next steps (#16550)Andreas Rumpf2021-01-071-2/+2
| | | | | | | | | | | | | | | | | | * cleanups * ast.nim: cleanups * IC: no more sym.tab field, stored externally in the module graph * nimble compiles again * rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly * rodfiles: added compilerproc and export sections * rodfiles: added all the missing sections * rodfiles: track the missing information * IC: architecture for lazy loading of proc bodies * make tests green again * completed the lazy loading of proc bodies * symbol lookup integration, part 1 * symbol lookup integration, part 2 * symbol lookup integration, part 3 * make tcompilerapi work again * rodfiles: fixed config change handling
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-5/+8
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-9/+9
| | | | | | | | | | | | | | | | | * 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)
* Big compiler Cleanup (#14777)Clyybber2020-08-281-1/+1
|
* avoid unsafe Nim features in preparation for --gc:arc (#14431)Andreas Rumpf2020-05-221-4/+4
|
* Make ./koch temp --gc:arc work (#14186)Clyybber2020-05-011-1/+1
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-28/+28
| | | | | | | | | | | | | | | | | | * 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 spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* fixes #12051Araq2019-09-101-1/+1
|
* fixes #11515 (#11624)Andreas Rumpf2019-07-011-1/+1
| | | | | | * fixes #11515 * better fix for #11515; make tests green
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-3/+3
|
* more destructor based changes (#10885)Andreas Rumpf2019-03-231-1/+1
| | | | | | | | | | | * 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
* gc:destructors: progressAndreas Rumpf2019-02-281-0/+2
|
* fixes nested gensym'ed parameters; fixes #9476Araq2018-12-081-1/+1
|
* IC: further progressAraq2018-12-011-2/+2
|
* Change the order of compilation passes, transformation is made lazy at code ↵cooldome2018-10-181-3/+2
| | | | | | | | | | | | | | | gen (#8489) * Ast no transformation * Add getImplNoTransform to the macros module * progress on delaying transf * Fix methods tranformation * Fix lazy lambdalifting * fix create thread wrapper * transform for lambda lifting * improve getImplTransformed * Fix destructor tests * try to fix nimprof for linux
* replace deprecated `safeAdd` with `add` (#9416)Miran2018-10-181-1/+1
|
* compiler: show name of instantiating context in error traces (#6763) (#9207)xzfc2018-10-111-1/+1
|
* fixes #4766Araq2018-08-281-1/+2
|
* WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-4/+3
|
* allow referencing other parameters in default parameter valuesZahary Karadjov2018-06-161-2/+24
| | | | | | | | fix #7756 fix #1201 fix #7000 fix #3002 fix #1046
* fix #6928; fix #7208Zahary Karadjov2018-06-161-3/+4
|
* Support default type parametersZahary Karadjov2018-06-161-3/+16
| | | | progress on #7516
* fixes #7222; fixes #5595; fixes #3747Zahary Karadjov2018-06-161-17/+20
| | | | | | | | | | * late instantiation for the generic procs' default param values * automatic mixin behaviour in concepts Other fixes: * don't render the automatically inserted default params in calls * better rendering of tyFromExpr
* remove more global variables in the Nim compilerAndreas Rumpf2018-05-271-6/+6
|
* remove ast.emptyNode global; cleanup configuration.nimAraq2018-05-161-1/+1
|
* make tests green againAraq2018-05-141-2/+2
|
* more modules compile againAndreas Rumpf2018-05-121-13/+14
|
* added toOpenArray builtin for zero-copy slices; syntax sugar yet to comeAraq2018-03-241-1/+3
|
* Static[T] fixes (#7333)zah2018-03-241-0/+30
| | | | | | | | | | | * fix the usage of unresolved static[T] parameters in proc signatures * fix tsametype and tmacrogenerics * Allow creating composite type classes with concepts and using them in type signatures * Allow integers to be used in ident concatenations * Support using imported C++ generic types in proc signatures * fixes #7230 * closes #7379 * re-enable some metatype tests
* fixes #6489Araq2017-11-231-0/+2
|
* deprecated unary '<'Andreas Rumpf2017-10-291-4/+4
|
* first implementation of the 'func' keywordAndreas Rumpf2017-09-231-1/+1
|
* Fix #5962Zahary Karadjov2017-06-201-3/+8
| | | | | | | | | | | | | | | During the instantiation of a generic type A, some other generic type B may be instantiated multiple times with different parameters. We can think about each instantiation as a function call that should temporary bind the parameter names to concrete types. The problem with the existing implementation in semtypinst was that it was performing this binding within a shared global table. In this sense, it was executing the code as a programming language featuring only global variables. In such a language, re-entrant functions cannot be defined properly and hence this was leading to problems with similar types. The solution is simple - just like we need to introduce stack frames to handle re-entrant functions, we introduce a stack of type bindings that are pushed and popped during the generic instantiations.
* introduce a pre-processing pass for the concept bodiesZahary Karadjov2017-06-201-3/+3
| | | | | | | fixes #4982 fixes #3805 close #3414
* fixes tproctypecache_falsepositive.nim test caseAraq2017-06-081-1/+2
|
* Restore the Nim's 0.14 proper handling of generic aliasesZahary Karadjov2017-04-081-1/+2
| | | | | | | | | | | A more efficient implementation is possible by restoring the old lifting ot tyGenericInvocation to tyGenericInst in liftTypeParam, but this fix will suffice for now. fixes #5087 fixes #5602 fixes #5641 fixes #5570
* fix tgenericshardcasesZahary Karadjov2017-03-241-1/+2
|