fix warnings for deprecated low and high (#15291)

This commit is contained in:
Miran 2020-09-11 01:04:07 +02:00 • committed by GitHub
commit 6a621b35e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View file

@ -611,7 +611,7 @@ proc genField(c: PCtx; n: PNode): TRegister =
if n.kind != nkSym or n.sym.kind != skField:
globalError(c.config, n.info, "no field symbol")
let s = n.sym
if s.position > high(result):
if s.position > high(typeof(result)):
globalError(c.config, n.info,
"too large offset! cannot generate code for: " & s.name.s)
result = s.position