mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
@@ -217,6 +217,8 @@ proc isCastable(c: PContext; dst, src: PType): bool =
|
||||
let s = skipTypes(src, abstractInst)
|
||||
if d.kind == tyRef and s.kind == tyRef and s[0].isFinal != d[0].isFinal:
|
||||
return false
|
||||
elif d.kind in IntegralTypes and s.kind in {tyString, tySequence}:
|
||||
return false
|
||||
|
||||
var dstSize, srcSize: BiggestInt
|
||||
dstSize = computeSize(conf, dst)
|
||||
|
||||
9
tests/arc/t16558.nim
Normal file
9
tests/arc/t16558.nim
Normal file
@@ -0,0 +1,9 @@
|
||||
discard """
|
||||
matrix: "--gc:arc"
|
||||
errormsg: "expression cannot be cast to int"
|
||||
"""
|
||||
|
||||
block: # bug #16558
|
||||
var value = "hi there"
|
||||
var keepInt: int
|
||||
keepInt = cast[int](value)
|
||||
Reference in New Issue
Block a user