{
"checker": { "name": "typescript", "version": "6.0.3" },
"cases": [
{
"id": "primitive-valid",
"source": "/*😀*/ const items:number[]=[1];items[0].toFixed();",
"tsxSource": "/*😀*/ const items:number[]=[1];items[0].toFixed();const view=<></>;view;",
"diagnostics": []
},
{
"id": "primitive-assignment",
"source": "/*😀*/ const items:number[]=1;items;",
"tsxSource": "/*😀*/ const items:number[]=1;items;const view=<></>;view;",
"diagnostics": [
{
"code": 2322,
"category": 1,
"message": "Type 'number' is not assignable to type 'number[]'.",
"start": 13,
"length": 5,
"authored": "items"
}
]
},
{
"id": "structural-valid",
"source": "/*😀*/ const items:{id:number}[]=[{id:1}];items[0].id;",
"tsxSource": "/*😀*/ const items:{id:number}[]=[{id:1}];items[0].id;const view=<></>;view;",
"diagnostics": []
},
{
"id": "structural-assignment",
"source": "/*😀*/ const items:{id:number}[]=[{id:\"bad\"}];items[0].id;",
"tsxSource": "/*😀*/ const items:{id:number}[]=[{id:\"bad\"}];items[0].id;const view=<></>;view;",
"diagnostics": [
{
"code": 2322,
"category": 1,
"message": "Type 'string' is not assignable to type 'number'.",
"start": 35,
"length": 2,
"authored": "id",
"related": [
{
"code": 6500,
"category": 3,
"message": "The expected type comes from property 'id' which is declared here on type '{ id: number; }'",
"start": 20,
"length": 2,
"authored": "id"
}
]
}
]
},
{
"id": "ordered-unicode",
"source": "/*😀*/ const 日本語:{id:number}[]=[{id:\"é\"}];\r\n日本語[0].missing;",
"tsxSource": "/*😀*/ const 日本語:{id:number}[]=[{id:\"é\"}];\r\n日本語[0].missing;const view=<></>;view;",
"diagnostics": [
{
"code": 2322,
"category": 1,
"message": "Type 'string' is not assignable to type 'number'.",
"start": 33,
"length": 2,
"authored": "id",
"related": [
{
"code": 6500,
"category": 3,
"message": "The expected type comes from property 'id' which is declared here on type '{ id: number; }'",
"start": 18,
"length": 2,
"authored": "id"
}
]
},
{
"code": 2339,
"category": 1,
"message": "Property 'missing' does not exist on type '{ id: number; }'.",
"start": 51,
"length": 7,
"authored": "missing"
}
]
}
]
}