Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make getUnderlyingType work with type argument #83

Merged
merged 1 commit into from
Aug 23, 2023
Merged

make getUnderlyingType work with type argument #83

merged 1 commit into from
Aug 23, 2023

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