mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
Close #22713
---------
Co-authored-by: SirOlaf <>
(cherry picked from commit fcf4c1ae17)
This commit is contained in:
@@ -433,10 +433,9 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
|
||||
typ.paddingAtEnd = typ.base.paddingAtEnd
|
||||
|
||||
of tyForward:
|
||||
# is this really illegal recursion, or maybe just unknown?
|
||||
typ.size = szIllegalRecursion
|
||||
typ.align = szIllegalRecursion
|
||||
typ.paddingAtEnd = szIllegalRecursion
|
||||
typ.size = szUnknownSize
|
||||
typ.align = szUnknownSize
|
||||
typ.paddingAtEnd = szUnknownSize
|
||||
|
||||
of tyStatic:
|
||||
if typ.n != nil:
|
||||
|
||||
12
tests/pragmas/t22713.nim
Normal file
12
tests/pragmas/t22713.nim
Normal file
@@ -0,0 +1,12 @@
|
||||
import std/macros
|
||||
|
||||
|
||||
template myPragma(x: int) {.pragma.}
|
||||
|
||||
type
|
||||
A = object
|
||||
x: int64
|
||||
|
||||
B {.myPragma(sizeof(A)).} = object
|
||||
|
||||
doAssert B.getCustomPragmaVal(myPragma) == 8
|
||||
Reference in New Issue
Block a user