summary refs log blame commit diff stats
path: root/tests/stdlib/tjsonmacro_reject.nim
blob: ada365d7d4cc6489fddedea7d25f34c113537bd9 (plain) (tree)
1
2
3
4
           
                                                           

                               












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