parent
26255c72fd
commit
6c8dee4180
2 changed files with 20 additions and 0 deletions
|
|
@ -1129,6 +1129,11 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
|
||||||
#debug s.typ
|
#debug s.typ
|
||||||
s.ast = a
|
s.ast = a
|
||||||
popOwner(c)
|
popOwner(c)
|
||||||
|
# If the right hand side expression was a macro call we replace it with
|
||||||
|
# its evaluated result here so that we don't execute it once again in the
|
||||||
|
# final pass
|
||||||
|
if a[2].kind in nkCallKinds:
|
||||||
|
a[2] = newNodeIT(nkType, a[2].info, t)
|
||||||
if sfExportc in s.flags and s.typ.kind == tyAlias:
|
if sfExportc in s.flags and s.typ.kind == tyAlias:
|
||||||
localError(c.config, name.info, "{.exportc.} not allowed for type aliases")
|
localError(c.config, name.info, "{.exportc.} not allowed for type aliases")
|
||||||
let aa = a.sons[2]
|
let aa = a.sons[2]
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,18 @@ checkType(voidProc(), "void")
|
||||||
checkType(intProc(10, 20.0), "int")
|
checkType(intProc(10, 20.0), "int")
|
||||||
checkType(voidProc, "procTy")
|
checkType(voidProc, "procTy")
|
||||||
checkProcType(voidProc)
|
checkProcType(voidProc)
|
||||||
|
|
||||||
|
# bug #10548
|
||||||
|
block:
|
||||||
|
var c {.compileTime.} = 0
|
||||||
|
|
||||||
|
macro meshImpl(arg: typed): untyped =
|
||||||
|
inc c
|
||||||
|
result = arg
|
||||||
|
|
||||||
|
type
|
||||||
|
Blub = int32
|
||||||
|
Mesh = meshImpl(Club)
|
||||||
|
Club = Blub
|
||||||
|
|
||||||
|
static: doAssert(c == 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue