mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
fixes #24476; fold proc convs if they are same types for backend
This commit is contained in:
@@ -777,7 +777,8 @@ proc getConstExpr(m: PSym, n: PNode; idgen: IdGenerator; g: ModuleGraph): PNode
|
||||
var a = getConstExpr(m, n[1], idgen, g)
|
||||
if a == nil: return
|
||||
if n.typ != nil and n.typ.kind in NilableTypes and
|
||||
not (n.typ.kind == tyProc and a.typ.kind == tyProc):
|
||||
(n.typ.kind != tyProc or a.typ.kind != tyProc or
|
||||
sameBackendType(n.typ, a.typ)):
|
||||
# we allow compile-time 'cast' for pointer types:
|
||||
result = a
|
||||
result.typ() = n.typ
|
||||
|
||||
Reference in New Issue
Block a user