You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constCacheLineSize=128typeEnqueueable=concept x, type T
x isptr
x.next isAtomic[pointer]
MyChannel*[T: Enqueueable] =object
pad: array[CacheLineSize-sizeof(default(T)[]), byte]
dummy: typeof(default(T)[])
.../bug_sizeof.nim(9, 46) template/generic instantiation of `default` from here
../.choosenim/toolchains/nim-1.0.2/lib/system.nim(1818, 16) Error: invalid type: 'T: Enqueueable' in this context: 'proc (T: type T: Enqueueable): T: Enqueueable{.noSideEffect.}' for proc
Unfortunately there is no workaround since typedesc are now NimNode in macros (nim-lang/RFCs#148 and #11400) and there is no way to convert in NimNode back into a typedesc (#6785)
Otherwise somehing like this would probably work
macrosizeofDeref(T: typedesc): untyped=let x =default(T)[]
result=newLitsizeof(x)
The text was updated successfully, but these errors were encountered:
In a similar vein to #12714 and #12636
Unfortunately there is no workaround since typedesc are now NimNode in macros (nim-lang/RFCs#148 and #11400) and there is no way to convert in NimNode back into a typedesc (#6785)
Otherwise somehing like this would probably work
The text was updated successfully, but these errors were encountered: