mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #24847 Object constructors call `fillObjectFields` when a field inside the constructor does not have a location, however when the field is from a base type this does not process it. Now `fillObjectFields` also calls itself for the base type to fix this but not sure if this is a good solution as `fillObjectFields` is used in other places too.
31 lines
556 B
Nim
31 lines
556 B
Nim
# issue #24847
|
|
|
|
block: # original issue test
|
|
type
|
|
R[C] = ref object of RootObj
|
|
b: C
|
|
K[S] = ref object of R[S]
|
|
W[J] = object
|
|
case y: bool
|
|
of false, true: discard
|
|
|
|
proc e[T]() = discard K[T]()
|
|
iterator h(): int {.closure.} = e[W[int]]()
|
|
let _ = h
|
|
type U = distinct int
|
|
e[W[U]]()
|
|
|
|
block: # simplified
|
|
type
|
|
R[C] = ref object of RootObj
|
|
b: C
|
|
K[S] = ref object of R[S]
|
|
W[J] = object
|
|
case y: bool
|
|
of false, true: discard
|
|
|
|
type U = distinct int
|
|
|
|
discard K[W[int]]()
|
|
discard K[W[U]]()
|