diff --git a/tests/cases/compiler/unionTypeErrorMessageTypeRefs01.ts b/tests/cases/compiler/unionTypeErrorMessageTypeRefs01.ts new file mode 100644 index 00000000000..5dfd27ded88 --- /dev/null +++ b/tests/cases/compiler/unionTypeErrorMessageTypeRefs01.ts @@ -0,0 +1,51 @@ + +interface Foo { foo: any } +interface Bar { bar: any } +interface Baz { baz: any } +interface Kwah { kwah: any } + +//////// + +interface A { + aProp: T; +} + +interface B { + bProp: T; +} + +interface C { + cProp: T; +} + +declare const a: A; +declare const b: B; +declare const c: C; +declare let thingOfInterfaces: A | B | C; + +thingOfInterfaces = a; +thingOfInterfaces = b; +thingOfInterfaces = c; + +//////// + +type X = { + xProp: T; +} + +type Y = { + yProp: T; +} + +type Z = { + zProp: T; +} + +declare const x: X; +declare const y: Y; +declare const z: Z; +declare let thingOfTypeAliases: X | Y | Z; + +thingOfTypeAliases = x; +thingOfTypeAliases = y; +thingOfTypeAliases = z; \ No newline at end of file