Rename some variables in the isCastable code
This commit is contained in:
parent
c4f77ecd9a
commit
9d68fe3782
1 changed files with 6 additions and 6 deletions
|
|
@ -184,18 +184,18 @@ proc isCastable(dst, src: PType): bool =
|
||||||
# castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString,
|
# castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString,
|
||||||
# tySequence, tyPointer, tyNil, tyOpenArray,
|
# tySequence, tyPointer, tyNil, tyOpenArray,
|
||||||
# tyProc, tySet, tyEnum, tyBool, tyChar}
|
# tyProc, tySet, tyEnum, tyBool, tyChar}
|
||||||
var ds, ss: BiggestInt
|
var dstSize, srcSize: BiggestInt
|
||||||
|
|
||||||
ds = computeSize(dst)
|
dstSize = computeSize(dst)
|
||||||
ss = computeSize(src)
|
srcSize = computeSize(src)
|
||||||
if ds < 0:
|
if dstSize < 0:
|
||||||
result = false
|
result = false
|
||||||
elif ss < 0:
|
elif srcSize < 0:
|
||||||
result = false
|
result = false
|
||||||
elif not typeAllowed(dst, skParam):
|
elif not typeAllowed(dst, skParam):
|
||||||
result = false
|
result = false
|
||||||
else:
|
else:
|
||||||
result = (ds >= ss) or
|
result = (dstSize >= srcSize) or
|
||||||
(skipTypes(dst, abstractInst).kind in IntegralTypes) or
|
(skipTypes(dst, abstractInst).kind in IntegralTypes) or
|
||||||
(skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes)
|
(skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue