mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
22 lines
362 B
Nim
22 lines
362 B
Nim
discard """
|
|
errormsg: "The `to` macro does not support ref objects with cycles."
|
|
file: "tjsonmacro_reject2.nim"
|
|
line: 10
|
|
"""
|
|
import json
|
|
|
|
type
|
|
Misdirection = object
|
|
cycle: Cycle
|
|
|
|
Cycle = ref object
|
|
foo: string
|
|
cycle: Misdirection
|
|
|
|
let data = """
|
|
{"cycle": null}
|
|
"""
|
|
|
|
let dataParsed = parseJson(data)
|
|
let dataDeser = to(dataParsed, Cycle)
|