| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
fixes jsbigint64 regression
|
|
|
|
| |
fixes #23932
ref https://github.com/jmgomez/NimForUE/issues/36
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
actually fixes #23865 following up #23873
In the handling of `nkIdent` in `semExpr`, the compiler looks for the
closest symbol with the name and [checks the symbol
kind](https://github.com/nim-lang/Nim/blob/6126a0bf46f4e29a368b8baefea69a2bcae54e93/compiler/semexprs.nim#L3171)
to also consider the overloads if the symbol kind is overloadable. But
it treats the normally overloadable template/macro/module sym kinds the
same as non-overloadable symbols, just calling `semSym` on it. We need
to mirror this behavior in `semOpenSym`; we treat the captured symchoice
as a fresh identifier, so if the symbol we find is a
template/macro/module, we use that symbol immediately as opposed to
waiting for overloads.
|
|
|
|
|
|
|
|
|
|
| |
fixes #14522
fixes #22085
fixes #12700
fixes #23132
closes https://github.com/nim-lang/Nim/pull/22343 (succeeded by this PR)
completes https://github.com/nim-lang/RFCs/issues/175
follow up https://github.com/nim-lang/Nim/pull/12688
|
|
|
|
|
| |
follows up https://github.com/nim-lang/Nim/pull/23064
fixes #23914
|
|
|
| |
fixes #23907
|
|
|
| |
fixes #23902
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we need keep readabilities for functions' names, we might put the
original names in the comments or in the identifiers like what currently
has been done.
The new nimble having been shipped since Nim 2.0.0 uses a directory
ending with a full hash of a commit for cloned repos, the function names
are burderen by this. This PR strips these from package paths and
prepends "pkg" for readability.
Before:
raiseNilAccess__OOZOOZOnimbleZpkgs2Zthreading450O2O045288108d1dfa34d5ade5ce4d922af51909c83cebfZthreadingZsmartptrs_u4
After:
raiseNilAccess__pkgZthreadingZsmartptrs_u4
|
|
|
| |
fixes #13391
|
|
|
|
|
|
|
| |
(#23895)
fixes #23894
keeps it consistent with `inc`
|
|
|
|
|
|
|
|
|
|
| |
fixes #23865
The node flag `nfOpenSym` implemented in #23091 for sym nodes is now
also implemented for open symchoices. This means the intended behavior
is still achieved when multiple overloads are in scope to be captured,
so the issue is fixed. The code for the flag is documented and moved
into a helper proc and the experimental switch is now enabled for the
compiler test suite.
|
|
|
| |
The test case diff is self explanatory
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/19821
dights cannot clash with letters 'Z' and 'O'
For `threading-0.2.0-288108d1dfa34d5ade5ce4d922af51909c83cebf`
Before:
raiseNilAccess__OOZOOZOnimbleZpkgs50Zthreading4548O50O4845505656494856d49dfa5152d53ade53ce52d575050af5349574857c5651cebfZthreadingZsmartptrs_u4
After:
raiseNilAccess__OOZOOZOnimbleZpkgs2Zthreading450O2O045288108d1dfa34d5ade5ce4d922af51909c83cebfZthreadingZsmartptrs_u4
<del> nimble or something might use `git rev-parse --short HEAD` to
shorten the length of package version names ref
https://github.com/nim-lang/nimble/pull/913 </del>
|
|
|
|
|
|
| |
mutable (#23882)
Makes `toOpenArray(x: ptr UncheckedArray)` always return a `var
openArray` regardless of if `x` is mutable.
|
|
|
|
|
|
|
|
| |
fixes #23867
fixes #23316
follow up https://github.com/nim-lang/Nim/pull/22805; fixes
https://github.com/nim-lang/Nim/issues/22794 in a different method
|
| |
|
|
|
|
|
|
|
| |
Still have to look this over some. We'll see. I put sink in this branch
simply because I saw `tyVar` there and for no other reason. In any case
the problem appears to be coming from `liftParamType` as it removes the
`sink` type from the formals.
#23869
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/14763
|
|
|
|
|
|
| |
Ref https://github.com/nim-lang/Nim/issues/23836#issuecomment-2233957324
Their types are basically equivalent so they should behave the same way
for type relations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #19819, fixes #23339
Since #22029 `tyFromExpr` does not match anything in overloading, so
generic bodies can know which call expressions to delay until the type
can be evaluated. However generic type invocations also run overloading
to check for generic constraints even in generic bodies. To prevent them
from failing early from the overload not matching, pretend that
`tyFromExpr` matches. This mirrors the behavior of the compiler in more
basic cases like:
```nim
type
Foo[T: int] = object
x: T
Bar[T] = object
y: Foo[T]
```
Unfortunately this case doesn't respect the constraint (#21181, some
other bugs) but `tyFromExpr` should easily use the same principle when
it does.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
related to https://github.com/nim-lang/Nim/pull/19584
On Vscode wsl2
Before:

After

|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23853
Since #22610 generics turns the `Name` in the `GT.Name` expression in
the test code into a sym choice. The problem is when the compiler tries
to instantiate `GT.Name` it also instantiates the sym choice symbols.
`Name` has type `template (E: type ExtensionField)` which contains the
unresolved generic type `ExtensionField`, which the compiler mistakes as
an uninstantiated node, when it's just part of the type of the template.
The compilation of the node itself and hence overloading will handle the
instantiation of the proc, so we avoid instantiating it in `semtypinst`,
similar to how the first nodes of call nodes aren't instantiated.
|
|
|
|
|
|
| |
fixes #23858
We should not assign fields to fields for returns of function calls
because calls might have side effects.
|
|
|
|
|
|
| |
Fix https://github.com/nim-lang/Nim/issues/23547
Tested locally with the included test, the test from constantine and the
original issue.
|
|
|
| |
fixes #23848
|
|
|
| |
fixes #23837
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23813, partially reverts #23392
Before #23392, if a `gensym` symbol was defined before a proc with the
same name in a template even with an `inject` annotation, the proc would
be `gensym`. After #23392 the proc was instead changed to be `inject` as
long as no `gensym` annotation was given. Now, to keep compatibility
with the old behavior, the behavior is changed back to infer the proc as
`gensym` when no `inject` annotation is given, however an explicit
`inject` annotation will still inject the proc. This is also documented
in the manual as the old behavior was undocumented and the new behavior
is slightly different.
|
|
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/23681
ref https://forum.nim-lang.org/t/11987
|
|
|
|
|
|
|
|
| |
simple analysis (#23839)
follow up https://github.com/nim-lang/Nim/pull/23681
ref https://forum.nim-lang.org/t/11987
ref https://github.com/nim-lang/Nim/issues/23836#issuecomment-2227267251
|
| |
|
| |
|
|
|
| |
#23823
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #3011
In https://github.com/nim-lang/Nim/pull/23532, meta fields that defined
in the object are handled.
In this PR, RefObjectTy is handled as well:
```nim
type
Type = ref object
context: ref object
```
Ref alias won't trigger mata fields checking so there won't have
cascaded errors on `TypeBase`.
```nim
type
TypeBase = object
context: ref object
Type = ref TypeBase
context: ref object
```
|
|
|
|
| |
fixes #20865
fixes #20987
|
|
|
|
| |
fixes #22389;
fixes #19840
|
|
|
| |
ref https://github.com/nim-lang/nif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've been working on making some basic cuda examples work, both with
cuda (nvcc) and with AMD HIP (hipcc) https://github.com/monofuel/hippo
- hipcc is just a drop-in replacement for clang and works out of the box
with clang settings in Nim. hipcc is capable of compiling for AMD ROCm
or to CUDA, depending on how HIP_PLATFORM is set.
- nvcc is a little quirky. we can use `-x cu` to tell it to handle nim's
`.cpp` files as if they were `.cu` files. nvcc expects all backend
compiler flags to be wrapped with a special `-Xcompiler=""` flag when
compiling and also when linking.
I manually tested on a linux desktop with amd and a laptop with nvidia.
|
|
|
|
|
| |
functions in cpp (#23800)
fixes #23796
|
|
|
| |
fixes #23790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pr redefines the relation between lambda lifting and closureiter
transformation.
Key takeaways:
- Lambdalifting now has less distinction between closureiters and
regular closures. Namely instead of lifting _all_ closureiter variables,
it lifts only those variables it would also lift for simple closure,
i.e. those not owned by the closure.
- It is now closureiter transformation's responsibility to lift all the
locals that need lifting and are not lifted by lambdalifting. So now we
lift only those locals that appear in more than one state. The rest
remains on stack, yay!
- Closureiter transformation always relies on the closure env param
created by lambdalifting. Special care taken to make lambdalifting
create it even in cases when it's "too early" to lift.
- Environments created by lambdalifting will contain `:state` only for
closureiters, whereas previously any closure env contained it.
IMO this is a more reasonable approach as it simplifies not only
lambdalifting, but transf too (e.g. freshVarsForClosureIters is now gone
for good).
I tried to organize the changes logically by commits, so it might be
easier to review this on per commit basis.
Some ugliness:
- Adding lifting to closureiters transformation I had to repeat this
matching of `return result = value` node. I tried to understand why it
is needed, but that was just another rabbit hole, so I left it for
another time. @Araq your input is welcome.
- In the last commit I've reused currently undocumented `liftLocals`
pragma for symbols so that closureiter transformation will forcefully
lift those even if they don't require lifting otherwise. This is needed
for [yasync](https://github.com/yglukhov/yasync) or else it will be very
sad.
Overall I'm quite happy with the results, I'm seeing some noticeable
code size reductions in my projects. Heavy closureiter/async users,
please give it a go.
|
|
|
|
|
|
|
| |
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`.
|
|
|
| |
fixes #23775
|
|
|
|
|
|
|
| |
#23755
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
| |
arguments (#23769)
fixes #23748
|
|
|
| |
fixes #23759
|
|
|
|
|
| |
refc [backport] (#23761)
fixes #9940
|
|
|
|
|
|
|
|
| |
fixes #23749, refs #22716
`semIndirectOp` is used here because of the callback expressions, in
this case `db.getProc(...)`, and `semIndirectOp` calls `semOpAux` to
type its arguments before overloading starts. Hence it can opt in to
symchoices since overloading will resolve them.
|
|
|
| |
fixes #23711
|
|
|
|
| |
compatibility (#23736)
|