From 7366a3da37605b230823dd4b6db07abb70dbd40b Mon Sep 17 00:00:00 2001 From: Saem Ghani Date: Wed, 24 Mar 2021 03:55:58 -0700 Subject: [PATCH] potential fix for semgeneric formal params (#17494) marked locations where analysis of return formal param is done prior to args. This might fix some subtle bugs. --- compiler/isolation_check.nim | 3 +++ compiler/reorder.nim | 1 + compiler/semgnrc.nim | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/isolation_check.nim b/compiler/isolation_check.nim index 9c8ca58b4a..43db5d59b0 100644 --- a/compiler/isolation_check.nim +++ b/compiler/isolation_check.nim @@ -85,6 +85,9 @@ proc checkIsolate*(n: PNode): bool = of nkCharLit..nkNilLit: result = true of nkCallKinds: + # XXX: as long as we don't update the analysis while examining arguments + # we can do an early check of the return type, otherwise this is a + # bug and needs to be moved below if n[0].typ.flags * {tfGcSafe, tfNoSideEffect} == {}: return false for i in 1..