| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#23102)
refs #23091, especially post merge comments
Unsure if `experimental` and `bind` are the perfect constructs to use
but they seem to get the job done here. Symbol nodes do not get marked
`nfOpenSym` if the `bind` statement is used for their symbol, and
`nfOpenSym` nodes do not get replaced by new local symbols if the
experimental switch is not enabled in the local context (meaning it also
works with `push experimental`). However this incurs a warning as the
fact that the node is marked `nfOpenSym` means we did not `bind` it, so
we might want to do that or turn on the experimental switch if we didn't
intend to bind it.
The experimental switch name is arbitrary and could be changed.
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #22605, separated from #22744
This marks symbol captures in macro calls in generic contexts as
`nfOpenSym`, which means if there is a new symbol in the local
instantiatied body during instantiation time, this symbol replaces the
captured symbol. We have to be careful not to consider symbols outside
of the instantiation body during instantiation, because this will leak
symbols from the instantiation context scope rather than the original
declaration scope. This is done by checking if the local context owner
(maybe should be the symbol of the proc currently getting instantiated
instead? not sure how to get this) is the same as or a parent owner of
the owner of the replacement candidate symbol.
This solution is distinct from the symchoice mechanisms which we
originally assumed had to be related, if this assumption was wrong it
would explain why this solution took so long to arrive at.
|
| |
|
|
|
|
|
|
|
|
|
| |
fixes #20435
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Jake Leahy <jake@leahy.dev>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
fixes #22699
|
|
|
| |
fixes #22373
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* wip; use strictdefs for compiler
* checkpoint
* complete the chores
* more fixes
* first phase cleanup
* Update compiler/bitsets.nim
* cleanup
|
| |
|
|
|
|
|
| |
do not account for the type symbol when doing `a.T()` (#21899)
fix #21883
|
|
|
|
|
|
|
| |
* fix #14254
* use temporary PR branch for neo
* fix url
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* always force open generic dot field symbols?
fixes #21724 but might break code
* alternative, should fix CI
* other alternative, add test for previous CI failure
* not needed
* make sure call doesn't compile too
* ok actual second test
* ok final actual correct test
* apply performance idea
* don't make fromDotExpr static
|
|
|
|
|
|
|
|
|
|
|
| |
(#21667)
* refactoring in preparation for better, simpler name mangling that works with IC flawlessly
* use new disamb field
* see if this makes tests green
* make tests green again
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* alias syntax fixes, improvements and tests
* even better, cannot use alias syntax with generics
* more type tests, improve comment
* fix again
* consistent error message + make t5167_5 work
* more comments, remove {.noalias.}
|
|
|
|
|
|
|
|
|
| |
wrongly in generics (#21554)
* fixes #3770; templates with untyped parameters resolve private fields wrongly
* add a test case for #3770
* rename to `nfSkipFieldChecking`
|
|
|
|
|
| |
* fixes #20572
* added a test case
|
|
|
| |
depends on #20126
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
generic (#17942)
* fix #17941: UnusedImport works for var/let/const/type invoked inside a generic
* fixup
|
|
|
|
| |
marked locations where analysis of return formal param is done prior to
args. This might fix some subtle bugs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
|
|
| |
* Fix #5691
* Cleanup and thoughts
* Use scope approach
* Seperate defined/declared/declaredInScope magics
* Fix declaredInScope
* Update spec accordingly
|
|
|
|
| |
(#14768)
|
|
|
|
| |
was never implemented (#14584)
|
| |
|
|
|
|
| |
a few magic numbers with consts (#13170)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
| |
* Remove sonsLen
* Use Indexable
|
| |
|
|
|
|
| |
--styleCheck:error
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
good nimsuggest integretation
|
| |
|
|
|
|
|
|
|
|
| |
The examples should not enter the generic analysis at all.
The regression was introduced in 4cf704bb as a fix for #8694.
Fixes #9130
Fixes #8694
|
| |
|
|
|
| |
Fixes #7626
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
conventions outlined in NEP-1
|
|
|
|
| |
around explicitly
|