summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sempass2.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 86e569d7a..542120bdf 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -522,7 +522,8 @@ proc procVarcheck(n: PNode) =
 
 proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) =
   let n = n.skipConv
-  procVarcheck skipConvAndClosure(n)
+  if paramType.isNil or paramType.kind != tyTypeDesc:
+    procVarcheck skipConvAndClosure(n)
   #elif n.kind in nkSymChoices:
   #  echo "came here"
   if paramType != nil and tfNotNil in paramType.flags and