Skip to content

Commit

Permalink
followup nim-lang#12911 typed/untyped params only allowed in magic procs
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 17, 2019
1 parent 5848f00 commit b3af688
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
# TODO: Disallow typed/untyped in procs in the compiler/stdlib
if kind == skProc and (typ.kind == tyTyped or typ.kind == tyUntyped):
if not isMagic(sym):
if (owner.kind != skModule or (owner.owner.name.s != "stdlib")):
localError(c.config, a[^2].info, "'" & typ.sym.name.s & "' is only allowed in templates and macros or magic procs")
localError(c.config, a[^2].info, "'" & typ.sym.name.s & "' is only allowed in templates and macros or magic procs")

if hasDefault:
def = a[^1]
Expand Down

0 comments on commit b3af688

Please sign in to comment.