From ebb931f9f472f3d9cf84c9013a01cab4a52cbe3f Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 3 Apr 2023 14:39:17 +0800 Subject: [PATCH] check refc first --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ac0247630f..69aa5d62d8 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1857,7 +1857,7 @@ proc semOverride(c: PContext, s: PSym, n: PNode) = incl(s.flags, sfOverriden) if name == "=": message(c.config, n.info, warnDeprecated, "Overriding `=` hook is deprecated; Override `=copy` hook instead") - elif name == "=copy" and c.config.selectedGC == gcRefc: + elif c.config.selectedGC == gcRefc and name == "=copy": message(c.config, n.info, warnCopyHookForRefc) let t = s.typ if t.len == 3 and t[0] == nil and t[1].kind == tyVar: