diff --git a/tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts new file mode 100644 index 00000000000..c20102881ea --- /dev/null +++ b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts @@ -0,0 +1,37 @@ +namespace Test1 { + export interface Foo { + bar: string; + } + + var x: Foo.bar = ""; +} + +namespace Test2 { + export class Foo { + bar: string; + } + + var x: Foo.bar = ""; +} + +namespace Test3 { + export type Foo = { + bar: string; + } + + var x: Foo.bar = ""; +} + +namespace Test4 { + export type Foo = { bar: number } + | { bar: string } + + var x: Foo.bar = ""; +} + +namespace Test5 { + export type Foo = { bar: number } + | { wat: string } + + var x: Foo.bar = ""; +} \ No newline at end of file