Files
Nim/tests/stdlib/tjsonmacro_reject.nim
2018-12-11 21:23:21 +01:00

19 lines
328 B
Nim

discard """
errormsg: "Use a named tuple instead of: (string, float)"
file: "tjsonmacro_reject.nim"
line: 11
"""
import json
type
Car = object
engine: (string, float)
model: string
let j = """
{"engine": {"name": "V8", "capacity": 5.5}, model: "Skyline"}
"""
let parsed = parseJson(j)
echo(to(parsed, Car))