one more attempt
This commit is contained in:
parent
c20d1ac1c0
commit
541c2a3fec
1 changed files with 5 additions and 3 deletions
|
|
@ -1692,12 +1692,14 @@ proc isException*(t: PType): bool =
|
||||||
# check if `y` is object type and it inherits from Exception
|
# check if `y` is object type and it inherits from Exception
|
||||||
assert(t != nil)
|
assert(t != nil)
|
||||||
|
|
||||||
|
if t.kind notin {tyObject, tyGenericInst}:
|
||||||
|
return false
|
||||||
|
|
||||||
var base = t
|
var base = t
|
||||||
while base != nil and base.kind in {tyRef, tyObject, tyGenericInst, tyAlias}:
|
while base != nil:
|
||||||
if base.sym != nil and base.sym.magic == mException:
|
if base.sym != nil and base.sym.magic == mException:
|
||||||
return true
|
return true
|
||||||
if base.len == 0: break
|
base = base.lastSon
|
||||||
else: base = base.lastSon
|
|
||||||
return false
|
return false
|
||||||
|
|
||||||
proc isImportedException*(t: PType; conf: ConfigRef): bool =
|
proc isImportedException*(t: PType; conf: ConfigRef): bool =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue