Skip to content

Conversation

@metagn
Copy link
Contributor

@metagn metagn commented Aug 23, 2023

Below newStorage[T] and newStorageOfCap[T] call getUnderlyingType(T), which shouldn't work because T is a type and getUnderlyingType takes an openArray argument. However it works due to a Nim bug where T is treated as a value of its type.

To make this work with and without the bug fixed, add an additional getUnderlyingType overload that takes a type openArray parameter instead.

Below `newStorage[T]` and `newStorageOfCap[T]` call `getUnderlyingType(T)`, which shouldn't work because `T` is a type and `getUnderlyingType` takes an `openArray` argument. However it works due to a [Nim bug](nim-lang/Nim#20033) where `T` is treated as a *value* of its type.

To make this work with and without the bug fixed, add an additional `getUnderlyingType` overload that takes a `type openArray` parameter instead.
@jangko jangko merged commit 87a7698 into jangko:master Aug 23, 2023
jangko added a commit that referenced this pull request Aug 23, 2023
notable fixes:
- refactor: remove shallowCopy
- avoid nzCompressInit ambiguous call when included (#80)
- make getUnderlyingType work with type argument (#83)
@jangko jangko mentioned this pull request Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants