fixes #25572 ICE evaluating closure iter with object conversion (#25575)

This commit is contained in:
Ryan McConnell
2026-03-03 23:45:16 -05:00
committed by GitHub
parent 9ed4077d9a
commit 46cddbccd6
2 changed files with 13 additions and 1 deletions

View File

@@ -727,7 +727,7 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
n[0] = ex
result.add(n)
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv,
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv, nkObjUpConv,
nkDerefExpr, nkHiddenDeref:
var ns = false
for i in ord(n.kind == nkCast)..<n.len:

View File

@@ -0,0 +1,12 @@
discard """
cmd: "nim c $file"
"""
import std/asyncdispatch
type
A {.inheritable.} = ref object
B = ref object of A
method a(x: A): Future[A] {.async, base.} =
B(await a(B()))