* fix #18886 crash on ambiguous proc cast * follow suggestion
This commit is contained in:
parent
0f2775aacf
commit
db3d2971cf
3 changed files with 29 additions and 2 deletions
|
|
@ -371,6 +371,8 @@ proc semCast(c: PContext, n: PNode): PNode =
|
|||
checkSonsLen(n, 2, c.config)
|
||||
let targetType = semTypeNode(c, n[0], nil)
|
||||
let castedExpr = semExprWithType(c, n[1])
|
||||
if castedExpr.kind == nkClosedSymChoice:
|
||||
errorUseQualifier(c, n[1].info, castedExpr)
|
||||
if tfHasMeta in targetType.flags:
|
||||
localError(c.config, n[0].info, "cannot cast to a non concrete type: '$1'" % $targetType)
|
||||
if not isCastable(c, targetType, castedExpr.typ, n.info):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue