| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
fixes #19010
`getType` for proc types generated an `nkProcTy` for iterator types
instead of `nkIteratorTy`, and didn't generate a calling convention
pragma unless it was in the proc AST. Iterator types now generate
`nkIteratorTy`, and a calling convention pragma is added if the calling
convention isn't `closure` or was explicitly provided.
|
|
|
|
|
|
| |
fixes #23639
Not sure if these are meant to be supported but it's better than
crashing.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes #1969, closes #7547, closes #7737, closes #11838, closes #12283,
closes #12714, closes #12720, closes #14053, closes #16118, closes
#19670, closes #22645
I was going to wait on these but regression tests even for recent PRs
are turning out to be important in wide reaching PRs like #24010.
The other issues with the working label felt either finnicky (#7385,
#9156, #12732, #15247), excessive to test (#12405, #12424, #17527), or I
just don't know what fixed them/what the issue was (#16128: the PR link
gives a server error by Github, #12457, #12487).
|
|
|
|
|
|
| |
Fix https://github.com/nim-lang/Nim/issues/23547
Tested locally with the included test, the test from constantine and the
original issue.
|
|
|
|
|
|
|
| |
fixes #23784
notes that before https://github.com/nim-lang/Nim/pull/23477, it didn't
fold paths containing `addr`/`unsafeAddr` because it retained the form
of the magic function: `mAddr`.
|
| |
|
|
|
| |
closes #15751
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is in reference to a [feature
request](https://github.com/nim-lang/Nim/issues/22142) that I posted.
I'm making this PR to demonstrate the suggested change and expect that
this should be scrutinized
---------
Co-authored-by: Bung <crc32@qq.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23002, fixes #22841, refs comments in #23097
When an identifier is ambiguous in scope (i.e. multiple imports contain
symbols with the same name), attempt resolving it through type inference
(by creating a symchoice). To do this efficiently, `qualifiedLookUp` had
to be broken up so that `semExpr` can access the ambiguous candidates
directly (now obtained directly via `lookUpCandidates`).
This fixes the linked issues, but an example like:
```nim
let on = 123
{.warning[ProveInit]: on.}
```
will still fail, since `on` is unambiguously the local `let` symbol here
(this is also true for `proc on` but `proc` symbols generate symchoices
anyway).
Type symbols are not considered to not confuse the type inference. This
includes the change in sigmatch, up to this point symchoices with
nonoverloadable symbols could be created, they just wouldn't be
considered during disambiguation. Now every proper symbol except types
are considered in disambiguation, so the correct symbols must be picked
during the creation of the symchoice node. I remember there being a
violating case of this in the compiler, but this was very likely fixed
by excluding type symbols as CI seems to have found no issues.
The pure enum ambiguity test was disabled because ambiguous pure enums
now behave like overloadable enums with this behavior, so we get a
longer error message for `echo amb` like `type mismatch: got <MyEnum |
OtherEnum> but expected T`
|
|
|
|
|
|
| |
Continued from #23096 which was reverted due to breaking a package and
failing docgen tests. Docgen should now work, but ~~a PR is still
pending for the package: https://github.com/SciNim/Unchained/pull/45~~
has been merged
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code will crash `check`/`nimsuggest` since the `ra` register is
uninitialised
```nim
import macros
static:
discard parseExpr("'")
```
Now it assigns an empty node so that it has something
Testament changes were so I could properly write a test. It would pass
even with a segfault since it could find the error
|
|
|
| |
Reverts nim-lang/Nim#23096
|
|
|
| |
fixes #22933
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #14329
Marks `macros.error` as `.noreturn` so that it can be used in
expressions. This also fixes the issue that occurred in #19659 where a
stmt that could be an expression (Due to having `discardable` procs at
the end of other branches) would believe a `noreturn` proc is returning
the same type e.g.
```nim
proc bar(): int {.discardable.} = discard
if true: bar()
else: quit(0) # Says that quit is of type `int` and needs to be used/discarded except it actually has no return type
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the second issue listed in #9918.
Fixed by replacing the logic used in `parseAll` with just a continious
loop to `complexOrSimpleStmt` like what the [normal parser
does](https://github.com/nim-lang/Nim/blob/devel/compiler/passes.nim#L143-L146).
`complexOrSimpleStmt` [guarantees
progress](https://github.com/nim-lang/Nim/blob/devel/compiler/parser.nim#L2541)
so we don't need to check progress ourselves.
Also allows `nimpretty` to parse more valid Nim code such as
```nim
proc foo(); # Would complain about indention here
# ...
proc foo() =
# ...
```
|
|
|
|
|
|
|
|
|
|
|
| |
#23032
---------
Co-authored-by: Nikolay Nikolov <nickysn@gmail.com>
Co-authored-by: Pylgos <43234674+Pylgos@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Jason Beetham <beefers331@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test case haul for old generic/template/macro issues
closes #12582, closes #19552, closes #2465, closes #4596, closes #15246,
closes #12683, closes #7889, closes #4547, closes #12415, closes #2002,
closes #1771, closes #5121
The test for #5648 is also moved into its own test
from `types/tissues_types` due to not being joinable.
* fix template gensym test
|
| |
|
|
|
|
|
| |
* clean up SOME pending/xxx/issue link comments
* great
|
|
|
| |
`semProcAux` has a check for `checkMinSonsLen(n, bodyPos + 1)`
|
|
|
|
|
|
|
|
|
| |
* Extend intVal range to nnkUInt64Lit
Fixes #21593
* Properly cast intVal as unsigned
* Add testcase for #21593
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tuple unpacking for vars as just sugar, allowing nesting
* set temp symbol AST
* hopeful fix some issues, add test for #19364
* always use temp for consts
* document, fix small issue
* fix manual indentation
* actually fix manual
* use helper proc
* don't resem temp tuple assignment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add test cases
* Implement contains for CacheSeq
* Implement contains for CacheTable
* Fix implementation of hasKey
* Remove contains for CacheSeq
Fix runnable examples
I was accidently using --doccmd:skip so I didn't spot the failure locally
* Implement hasKey as a VM callback instead of magic
* Implement suggestions from PR
Co-Authored-By: ringabout <ringabout@users.noreply.github.com>
* Update lib/core/macrocache.nim
---------
Co-authored-by: ringabout <ringabout@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
|
|
|
|
| |
* Implement setLineInfo
* Add tests
|
|
|
|
|
|
|
|
|
| |
* fix #16758 Nim crashes in fixAbstractType
* Update compiler/semexprs.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* defaults to Orc
* bootstrap using refc
* use gc
* init orc defines
* unregister orc
* fix gc
* fix commands
* add prepareMutation for orc
* enable deepcopy for orc
* prepareMutation
* more fixes
* some cases
* bug #20081
* partial fixes
* partial fixes
* fixes command line
* more fixes
* build Nim with refc
* use gc
* more fixes
* rstore
* orc doesn't support threadpool
* more shallowCopy
* more fixes
* fixes unsafeNew
* workarounds
* small
* more fixes
* fixes some megatest
* tcodegenbugs1 refc
* fxies megatest
* build nimble with refc
* workaround tensordsl tests
* replace shallowCopy with move
* fixes action
* workaround
* add todo
* fixes important packages
* unpublic unregisterArcOrc
* fixes cpp
* enable windows
Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove deprecated pragma syntax from 0.20.0
closes #4651, closes #16653 with a cheap fix for now due to
how early `tfFinal` is set
* remove type pragma between name and generics
* undo removal, try removing bind expression (0.8.14)
* fix test, unremove bind expr
* remove again
* Update changelog.md
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* dependencies @ HEAD & weave test dependencies
* try fix package ci
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
| |
|
|
|
|
|
| |
* Allow std/macros.params to work with nnkProcTy
* Add tests for proc params & pragma
|
|
|
| |
close #15118
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* `caseStmtMacros` no longer experimental, experimental manual refactor
* Update doc/manual.rst
* apply review suggestions
* apply review
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #14511 [backport:1.4]
Signed-off-by: Dankr4d <dude569@freenet.de>
* Replaced fix with code from alaviss, for better readability, with small
changes.
Signed-off-by: Dankr4d <dude569@freenet.de>
* - Specified output in test.
Signed-off-by: Dankr4d <dude569@freenet.de>
* Replaced case in nnkRecCase with a simpler version, which just adds the
last son.
Signed-off-by: Dankr4d <dude569@freenet.de>
* Update tests/macros/t14511.nim
* Update tests/macros/t14511.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
| |
* Add testcase
* Fix testcase
* Fix doubly typed forward decls
* Better fix
|
|
|
|
|
|
|
|
|
| |
* Fix #18203
* Add testcase
* Fix testcase
* Fix test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #18235 - proc annotation type macro sym leak
- also fixed a typo
- proc annotations guard symbol exports with shadow scopes
- symbol handling is shadow scope aware
* test for exporting an existing unexported sym
this one is for my homie alaviss.
* Special handling not needed in semProcAnnotation
* Testcasing
* [skip ci] clean-up and add some more comments
* [skip ci] rm trailing whitespace
Co-authored-by: Clyybber <darkmine956@gmail.com>
|
|
|
|
|
|
|
| |
* getType now works with tyInferred (concepts); refs #18220
* avoid cast
* add more docs
|
|
|
|
|
|
|
| |
* macros.treeRepr + friends: collapse SymChoice
* make repr+friends work with invalid symchoice nodes
* address comment
|
|
|
|
|
| |
* Fixes 5034
* address comments
|
|
|
| |
thanks @alaviss for the test
|
|
|
|
|
| |
* close #7875 add testcase
* fix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unify tuple expressions
* fix test
* fix test
* apply feedback
* Handle empty tuples
* Fix rendering named unary tuple
* Protect static NimNode against stripping
* Slightly less hacky
* Revert "Slightly less hacky"
This reverts commit 170c5aec0addc029f637afbc948700ca006b7942.
* Slightly less hacky
* Cleanup
* Fix test
* Fix another test
* Add condsym
* Rebase fallout
* changelog: Move from compiler changes to language changes
* Add stricter tests
* Add empty tuple example to doc/astspec
* Fix test
Co-authored-by: Clyybber <darkmine956@gmail.com>
|
|
|
|
|
| |
* nnkArglist => nnkArgList
* special case stylecheck:error
|
|
|
|
|
|
| |
* Add docs & tests for named procs with sugar.=>
* Remove support for named procs in sugar.=>
* Resolve conflict
* Fix test
|
|
|
|
|
| |
* rename case statement macro from match to `case`
* fix test
|