summary refs log tree commit diff stats
path: root/tests/stdlib/tjsonmacro_reject.nim
blob: 00506449f5fe45d06cf9025e815d03429109e963 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  file: "tjsonmacro_reject.nim"
  line: 11
  errormsg: "Use a named tuple instead of: (string, float)"
"""

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))