| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #22826
I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.
Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache
---------
Co-authored-by: SirOlaf <>
|
|
|
|
|
|
|
|
| |
fixes #22753
## Future work
We should turn all the error nodes into nodes of a nkError kind, which
could be a industrious task. But perhaps we can add a special treatment
for error nodes to make the transition smooth.
|
|
|
|
| |
closes #8390, closes #11726, closes #8446, closes #21221, closes #7461,
closes #7995
|
|
|
| |
fixes #22699
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #21742
Checking if there's any side-effects and if just changing typeRel is
adequate for this issue before trying to look into related ones.
`skipBoth` is also not that great, it can lead to code that works
sometimes but fails when the proc is instantiated with branching
aliases. This is mostly an issue with error clarity though.
---------
Co-authored-by: SirOlaf <unknown>
Co-authored-by: SirOlaf <>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #17509
Current knowledge:
- delaying cache fixes the issue
- changing return of `if inst.len < key.len:` in `searchInstTypes` to
`continue` fixes the issue. With return the broken types are also cached
over and over
Related issues are completely unaffected as of now, so there must be
something deeper.
I am also still trying to find the true cause, so feel free to ignore
for now
---------
Co-authored-by: SirOlaf <>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #22639 for the third time
Nodes generated by `getType` for `tyGenericInst` types, instead of
having the original `tyGenericInst` type, will have the type of the last
child (due to the `mapTypeToAst` calls which set the type to the given
argument). This will cause subsequent `getType` calls to lose
information and think it's OK to use the sym of the instantiated type
rather than fully expand the generic instantiation.
To prevent this, update the type of the node from the `mapTypeToAst`
calls to the full generic instantiation type.
|
|
|
|
|
|
|
| |
reverts #22642, reopens #22639, closes #22646, refs #22650, refs
https://github.com/alaviss/union/issues/51, refs #22652
The fallout is too much from #22642, we can come back to it if we can
account for all the affected code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #22639
A `tyGenericInst` has its last son as the instantiated body of the
original generic type. However this type keeps its original `sym` field
from the original generic types, which means the sym's type is
uninstantiated. This causes problems in the implementation of `getType`,
where it uses the `sym` fields of types to represent them in AST, the
relevant example for the issue being
[here](https://github.com/nim-lang/Nim/blob/d13aab50cf465a7f2edf9c37a4fa30e128892e72/compiler/vmdeps.nim#L191)
called from
[here](https://github.com/nim-lang/Nim/blob/d13aab50cf465a7f2edf9c37a4fa30e128892e72/compiler/vmdeps.nim#L143).
To fix this, create a new symbol from the original symbol for the
instantiated body during the creation of `tyGenericInst`s with the
appropriate type. Normally `replaceTypeVarsS` would be used for this,
but here it seems to cause some recursion issue (immediately gives an
error like "cannot instantiate HSlice[T, U]"), so we directly set the
symbol's type to the instantiated type.
Avoiding recursion means we also cannot use `replaceTypeVarsN` for the
symbol AST, and the symbol not having any AST crashes the implementation
of `getType` again
[here](https://github.com/nim-lang/Nim/blob/d13aab50cf465a7f2edf9c37a4fa30e128892e72/compiler/vmdeps.nim#L167),
so the symbol AST is set to the original generic type AST for now which
is what it was before anyway.
Not sure about this because not sure why the recursion issue is
happening, putting it at the end of the proc doesn't help either. Also
not sure if the `cl.owner != nil and s.owner != cl.owner` condition from
`replaceTypeVarsS` is relevant here. This might also break some code if
it depended on the original generic type symbol being given.
|
|
|
| |
fixes #9040
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes internal error: no generic body fixes #1500
* adds guard
* adds guard
* removes unnecessary test
* refactor: extracts containsGenericInvocationWithForward
|
|
|
|
|
| |
resolve local symbols in generic type call
fixes #14509
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove call-specific replaceTypeVarsN
* Run for all call kinds and ignore typedesc
* Testcase
---------
Co-authored-by: SirOlaf <>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix #12938 nim compiler assertion fail when literal integer is passed as template argument for array size
* use new flag tfImplicitStatic
* fix
* fix #14193
* correct tfUnresolved add condition
* clean test
|
|
|
| |
fixes #22373
|
|
|
|
|
| |
(#20683)
* fix #18823 Passing Natural to bitops.BitsRange[T] parameter in generic proc is compile error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Play with typeRel
* Temp solution: Fixup call's param types
* Test result type with two generic params
* Asserts
* Tiny cleanup
* Skip sink
* Ignore proc
* Use changeType
* Remove conversion
* Remove last bits of conversion
* Flag
---------
Co-authored-by: SirOlaf <>
|
|
|
|
|
|
|
| |
* Add test case
* Add in a bounds check when accessing generic types
Removes idnex out of bounds exception when comparing a generic that isn't fully instantiated
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Infer generic bindings
* Simple test
* Add t
* Allow it to work for templates too
* Fix some builds by putting bindings in a template
* Fix builtins
* Slightly more exotic seq test
* Test value-based generics using array
* Pass expectedType into buildBindings
* Put buildBindings into a proc
* Manual entry
* Remove leftover `
* Improve language used in the manual
* Experimental flag and fix basic constructors
* Tiny commend cleanup
* Move to experimental manual
* Use 'kind' so tuples continue to fail like before
* Explicitly disallow tuples
* Table test and document tuples
* Test type reduction
* Disable inferGenericTypes check for CI tests
* Remove tuple info in manual
* Always reduce types. Testing CI
* Fixes
* Ignore tyGenericInst
* Prevent binding already bound generic params
* tyUncheckedArray
* Few more types
* Update manual and check for flag again
* Update tests/generics/treturn_inference.nim
* var candidate, remove flag check again for CI
* Enable check once more
---------
Co-authored-by: SirOlaf <>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
refs #22029, refs https://github.com/status-im/nim-libp2p/actions/runs/5263850340/jobs/9514434659
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sacrifice "tgenericshardcases" for working statics
* legacy switch for CI, maybe experimental later
* convert to experimental
* apparently untyped needs the experimental switch
* try special case call semcheck
* try fix
* fix compilation
* final cleanup, not experimental, make `when` work
* remove last needed use of untyped
* fix unused warning in test
* remove untyped feature
|
|
|
| |
closes #9899, closes #14708, refs #21017
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* clean up some test categories
* mention exact slice issue
* magics into system
* move trangechecks into overflow
* move tmemory to system
* try fix CI
* try fix CI
* final CI fix
|
| |
|
|
|
| |
Add anti-regression test to close #21958
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
fails to build (#21649)
* fixes #20900; Calling template through from generic function across module fails to build
* sanother way
|
|
|
|
|
|
|
|
|
| |
wrongly in generics (#21554)
* fixes #3770; templates with untyped parameters resolve private fields wrongly
* add a test case for #3770
* rename to `nfSkipFieldChecking`
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* fix #20996
* hopefully fix
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural'
* try fix
|
|
|
|
|
| |
* 'lock levels' are deprecated, now a noop
* fixes tests
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
| |
has been generated by the compiler (#20377)
Fixes #20348
|
|
|
|
|
|
|
|
|
| |
* fixes Thread initializer for ARC/ORC
* another try
* fix
* use int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Parameters now can constrain static in type definitions
resolved regression with generic procedures
* Update compiler/sigmatch.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
| |
* style usages (openArray)
* revert doc changes
|