mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
* produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
24 lines
365 B
Nim
24 lines
365 B
Nim
discard """
|
|
matrix: "--gc:refc; --gc:arc"
|
|
"""
|
|
|
|
# bug #16607
|
|
|
|
type
|
|
O {.requiresInit.} = object
|
|
initialized: bool
|
|
|
|
proc `=destroy`(o: var O) =
|
|
doAssert o.initialized, "O was destroyed before initialization!"
|
|
|
|
proc initO(): O =
|
|
O(initialized: true)
|
|
|
|
proc pair(): tuple[a, b: O] =
|
|
result = (a: initO(), b: initO())
|
|
|
|
proc main() =
|
|
discard pair()
|
|
|
|
main()
|