Simply recurse into their first child, which is always
a nkDotExpr instead of treating them seperately.
This fixes the rhs sym of a nkCheckedFieldExpr being
checked twice in aliases. This double checking didn't
cause any issues, but was unintentional and redundant.
(cherry picked from commit 3e83d73f27)
* fix nnkBracketExpr not compiling for getImpl on customPragmaNode
* fix test import
* fix alias not working with hasCustomPragmas
(cherry picked from commit 486cb09ec2)
* Apply commit 5da931fe81 that was never merged (was part of a bigger PR). Should fix issue #11932
* add a generic object for custom pragma
(cherry picked from commit 1563cb2f6e)
Instead of rejecting type expressions based on node kind,
evaluate the expression as a type.
This is already the behavior for call results, and it has its own error
for non-types, which is the same error you would normally get
with 2 words swapped.
(cherry picked from commit 08261cb9e3)
* 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>
(cherry picked from commit a93f6e7acc)
* Fix vm's sametype implementation to properly handle generics and typedescs
* actually fixed sametype + have test
* added comments and removed unsafe code
(cherry picked from commit cc984217a9)
* Fixed composite type class proc borrowing
* Moved borrow search into transf
* added borrow check to symbol flag
(cherry picked from commit 8d5a275189)
* SameTypeAux now properly traverses generic distincts
* Smarter traversal of distincts
* Removed redundant check
* Fixed nkConv for jsgen
* Added test for non distinct nkConv
* using skiptypes for distinct now
* Fixed genaddr for nkconv
(cherry picked from commit 83a2515af7)
* fix#20997 calling system.card[T](x: set[T]) with T of int8 or uint8 uses mismatched C array sizes
* fullfil set variant
(cherry picked from commit 0b319fee3d)
In POSIX Base Definitions Section 8.1 Environment Variable Definition,
it is explained that the `COLUMNS` and `LINES` environment variables,
if present, take precedence over any other implementation-defined method
to determine the terminal size. This is useful, for example, to capture
output programmatically in simulations for various terminal sizes.
(cherry picked from commit 75205fee93)
* fixes#21306; don't transform yields in the var section when introducing new local vars
* adds `inVarSection` so the var section in the var section is freshed
* use `isIntroducingNewLocalVars` to avoid yield transformations in var sections
* fixes comments
(cherry picked from commit f2dad94902)
* Add line directives for C code variables
* Refactor genCLineDir to only use toFullPath if necessary
Signed-off-by: Joey Yakimowich-Payne <jyapayne@pm.me>
* fixes#20139; hash types based on its path relative its project
* add a test case
* fixes procs
* better implementation and test case
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit 38d299dfc0)
fixes#20422; emit nimPrepareStrMutationV2 for toOpenArray to keep the abstraction of mutable strings which have immutable string literals
(cherry picked from commit 50baf21eac)
* Add general purpose `setFileSize` (unexported for now). Use to simplify
`memfiles.open` as well as make robust (via hard allocation, not merely
`ftruncate` address space allocation) on systems with `posix_fallocate`.
As part of this, fix a bad `closeHandle` return check bug on Windows and
add `MemFile.resize` for Windows now that setFileSize makes that easier.
* Adapt existing test to exercise newly portable `MemFile.resize`.
* Since Apple has never provided `posix_fallocate`, provide a fallback.
This is presently written in terms of `ftruncate`, but it can be
improved to use `F_PREALLOCATE` instead, as mentioned in a comment.
(cherry picked from commit c91ef1a09f)