mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
fixes #24631 [Object constructors](793baf34ff/compiler/semobjconstr.nim (L462)), [casts](793baf34ff/compiler/semexprs.nim (L494)) and [type conversions](793baf34ff/compiler/semexprs.nim (L419)) copy their type nodes verbatim instead of producing semchecked type nodes. This causes a crash in transf when an untyped expression in the type node has `nil` type. To deal with this, don't try to transform the type node in these expressions at all. I couldn't reproduce the problem with type conversion nodes though so those are unchanged in transf.
16 lines
228 B
Nim
16 lines
228 B
Nim
discard """
|
|
matrix: "--skipParentCfg"
|
|
"""
|
|
|
|
# issue #24631
|
|
|
|
type
|
|
V[d: static bool] = object
|
|
l: int
|
|
|
|
template y(): V[false] = V[false](l: 0)
|
|
discard y()
|
|
|
|
template z(): V[false] = cast[V[false]](V[false](l: 0))
|
|
discard z()
|