Files
tsgo/testdata/baselines/reference/submodule/compiler/discriminatedUnionErrorMessage.errors.txt

19 lines
651 B
Plaintext

discriminatedUnionErrorMessage.ts(10,5): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Square'.
==== discriminatedUnionErrorMessage.ts (1 errors) ====
type Square = { kind: "sq", size: number }
type Rectangle = { kind: "rt", x: number, y: number }
type Circle = { kind: "cr", radius: number }
type Shape =
| Square
| Rectangle
| Circle;
let shape: Shape = {
kind: "sq",
x: 12,
~
!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type 'Square'.
y: 13,
}