Reject casts to builtin typeclasses (#14788)
* Closes #14231, closes #14452 * Merge test to tcast.nim
This commit is contained in:
parent
3e5743d6f7
commit
80952cadaa
2 changed files with 10 additions and 1 deletions
|
|
@ -191,6 +191,8 @@ proc isCastable(conf: ConfigRef; dst, src: PType): bool =
|
|||
return false
|
||||
if skipTypes(src, abstractInst-{tyTypeDesc}).kind == tyTypeDesc:
|
||||
return false
|
||||
if skipTypes(dst, abstractInst).kind == tyBuiltInTypeClass:
|
||||
return false
|
||||
if conf.selectedGC in {gcArc, gcOrc}:
|
||||
let d = skipTypes(dst, abstractInst)
|
||||
let s = skipTypes(src, abstractInst)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue