This commit is contained in:
ringabout
2026-02-03 21:13:41 +08:00
parent eb81ea5721
commit a9bd087835

View File

@@ -176,7 +176,7 @@ proc shouldWarnRangeConversion(conf: ConfigRef; formalType, argType: PType): boo
if f.kind == tyRange:
# Only warn if formal range doesn't fully contain argument range
# Check if the ranges don't perfectly overlap
if f.sym != nil and (f.sym.name.s == "Positive" or
if a.kind == tyInt and f.sym != nil and (f.sym.name.s == "Positive" or
f.sym.name.s == "Natural"):
# Positive and Natural are special cases that we never warn on
result = false