From b36dc53bf2c270590f7e8af995f419a57b858a05 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 17 Sep 2025 22:58:09 +0800 Subject: [PATCH] oops --- compiler/semmagic.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 667abb9aaf..af9ccde850 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -588,7 +588,7 @@ proc checkDefault(c: PContext, n: PNode; isDefault: bool): PNode = if constructed.requiresInit and constructed.skipTypes({tyGenericInst}).kind != tyRange: # TODO: sorts out `nimPreviewRangeDefault` with `ranges` in the future # TODO: be lenient with views and notnil types for now - if isDefault and c.config.features * {views, notnil} != {}: + if isDefault and c.config.features * {views, notnil} == {}: localError(c.config, n.info, "The '$1' type doesn't have a valid default value" % typeToString(constructed)) else: message(c.config, n.info, warnUnsafeDefault, typeToString(constructed))