hotfix: firstOrd/lastOrd for 'tyLent' as it shows up in strange places, as usual

This commit is contained in:
Andreas Rumpf
2020-07-20 17:44:35 +02:00
parent 70acba7f0d
commit 80d3ef9952

View File

@@ -729,7 +729,7 @@ proc firstOrd*(conf: ConfigRef; t: PType): Int128 =
assert(t.n[0].kind == nkSym)
result = toInt128(t.n[0].sym.position)
of tyGenericInst, tyDistinct, tyTypeDesc, tyAlias, tySink,
tyStatic, tyInferred, tyUserTypeClasses:
tyStatic, tyInferred, tyUserTypeClasses, tyLent:
result = firstOrd(conf, lastSon(t))
of tyOrdinal:
if t.len > 0: result = firstOrd(conf, lastSon(t))
@@ -786,7 +786,7 @@ proc lastOrd*(conf: ConfigRef; t: PType): Int128 =
assert(t.n[^1].kind == nkSym)
result = toInt128(t.n[^1].sym.position)
of tyGenericInst, tyDistinct, tyTypeDesc, tyAlias, tySink,
tyStatic, tyInferred, tyUserTypeClasses:
tyStatic, tyInferred, tyUserTypeClasses, tyLent:
result = lastOrd(conf, lastSon(t))
of tyProxy: result = Zero
of tyOrdinal: