From 169d3fda0020ec5c904f70f9026a2d3bd59f9599 Mon Sep 17 00:00:00 2001 From: Bung Date: Thu, 13 Oct 2022 12:39:43 +0800 Subject: fix #18136 tests/proc/t17157.nim now gives SIGSEGV instead of error (#20555) --- compiler/semtypes.nim | 1 + tests/proc/t17157.nim | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 8b1abdd01..e254965c9 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -1257,6 +1257,7 @@ proc newProcType(c: PContext; info: TLineInfo; prev: PType = nil): PType = result.n.add newNodeI(nkEffectList, info) proc isMagic(sym: PSym): bool = + if sym.ast == nil: return false let nPragmas = sym.ast[pragmasPos] return hasPragma(nPragmas, wMagic) diff --git a/tests/proc/t17157.nim b/tests/proc/t17157.nim index 2927eeee8..020e93fce 100644 --- a/tests/proc/t17157.nim +++ b/tests/proc/t17157.nim @@ -1,6 +1,5 @@ discard """ errormsg: "'untyped' is only allowed in templates and macros or magic procs" - disabled: true """ template something(op: proc (v: untyped): void): void = -- cgit 1.4.1-2-gfad0