commit
94131e1e56
1 changed files with 3 additions and 1 deletions
|
|
@ -185,13 +185,15 @@ 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}
|
||||||
|
if skipTypes(dst, abstractInst-{tyOpenArray}).kind == tyOpenArray:
|
||||||
|
return false
|
||||||
var dstSize, srcSize: BiggestInt
|
var dstSize, srcSize: BiggestInt
|
||||||
|
|
||||||
dstSize = computeSize(dst)
|
dstSize = computeSize(dst)
|
||||||
srcSize = computeSize(src)
|
srcSize = computeSize(src)
|
||||||
if dstSize < 0:
|
if dstSize < 0:
|
||||||
result = false
|
result = false
|
||||||
elif srcSize < 0:
|
elif srcSize < 0:
|
||||||
result = false
|
result = false
|
||||||
elif not typeAllowed(dst, skParam):
|
elif not typeAllowed(dst, skParam):
|
||||||
result = false
|
result = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue