diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 258836ca38..0df5d2020f 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -330,7 +330,7 @@ proc expectDynlibNode(c: PContext, n: PNode): PNode = # {.dynlib: myGetProcAddr(...).} result = c.semExpr(c, n[1]) if result.kind == nkSym and result.sym.kind == skConst: - result = result.sym.astdef # look it up + result = c.semConstExpr(c, result) # fold const if result.typ == nil or result.typ.kind notin {tyPointer, tyString, tyProc}: localError(c.config, n.info, errStringLiteralExpected) result = newEmptyStrNode(c, n)