From f101f09256d5d788a404c1d0a2301ed7853b0f14 Mon Sep 17 00:00:00 2001 From: Alexander Ivanov Date: Fri, 5 Apr 2019 17:43:36 +0300 Subject: Fix astdef typ deref (#10245) --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/semstmts.nim') diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 6fd87d26f..93af6ddbb 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -336,7 +336,7 @@ proc checkNilable(c: PContext; v: PSym) = {tfNotNil, tfNeedsInit} * v.typ.flags != {}: if v.astdef.isNil: message(c.config, v.info, warnProveInit, v.name.s) - elif tfNotNil in v.typ.flags and tfNotNil notin v.astdef.typ.flags: + elif tfNotNil in v.typ.flags and not v.astdef.typ.isNil and tfNotNil notin v.astdef.typ.flags: message(c.config, v.info, warnProveInit, v.name.s) #include liftdestructors -- cgit 1.4.1-2-gfad0