-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Type tyAnything can't be matched to proc argument of typedesc type #13193
Comments
Test case is not complete, it doesn't reproduce the issue |
It does for me on commit bc14453 |
Apologies, I managed to replicate this issue. I had a look, issue is not type trait specific. Generally type proc mycheck(t: typedesc): bool =
true
type
CpuStorage[T] {.shallow.} = ref object
when mycheck(T):
raw_buffer*: ptr UncheckedArray[T] # 8 bytes
memalloc*: pointer # 8 bytes
isMemOwner*: bool # 1 byte
else: # Tensors of strings, other ref types or non-trivial destructors
raw_buffer*: seq[T] # 8 bytes (16 for seq v2 backed by destructors?)
proc foo(t: CpuStorage): bool =
# This breaks
return false |
tyTypeDesc
tyTypeDesc
The underlying issue here is that in Both examples compile after replacing |
For posterity, from our IRC discussion back in April From IRC: https://irclogs.nim-lang.org/21-04-2020.html#14:46:18 |
Both examples above seem to work now? Probably because of #22029 |
Building on #13095 and its fix #13181, supportsCopyMem in a type section doesn't work with implicit generic parameters.
The error message in particular mentions
type any
which makes it hard to debug as there is notype any
in the codebase.Test case
Error
The text was updated successfully, but these errors were encountered: