From c14ff00bcfd35678613b056d2c7c17696db9c4ba Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 27 Jul 2017 11:22:12 -0700 Subject: [PATCH] Added test case. --- .../errorForUsingPropertyOfTypeAsType01.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts 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