mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accepted baselines.
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(6,12): error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(14,12): error TS2503: Cannot find namespace 'Foo'.
|
||||
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(22,12): error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(29,12): error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(36,12): error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
|
||||
|
||||
==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts (5 errors) ====
|
||||
namespace Test1 {
|
||||
export interface Foo {
|
||||
bar: string;
|
||||
}
|
||||
|
||||
var x: Foo.bar = "";
|
||||
~~~
|
||||
!!! error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
}
|
||||
|
||||
namespace Test2 {
|
||||
export class Foo {
|
||||
bar: string;
|
||||
}
|
||||
|
||||
var x: Foo.bar = "";
|
||||
~~~
|
||||
!!! error TS2503: Cannot find namespace 'Foo'.
|
||||
}
|
||||
|
||||
namespace Test3 {
|
||||
export type Foo = {
|
||||
bar: string;
|
||||
}
|
||||
|
||||
var x: Foo.bar = "";
|
||||
~~~
|
||||
!!! error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
}
|
||||
|
||||
namespace Test4 {
|
||||
export type Foo = { bar: number }
|
||||
| { bar: string }
|
||||
|
||||
var x: Foo.bar = "";
|
||||
~~~
|
||||
!!! error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
}
|
||||
|
||||
namespace Test5 {
|
||||
export type Foo = { bar: number }
|
||||
| { wat: string }
|
||||
|
||||
var x: Foo.bar = "";
|
||||
~~~
|
||||
!!! error TS2702: 'Foo' only refers to a type, but is being used as a namespace here.
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
//// [errorForUsingPropertyOfTypeAsType01.ts]
|
||||
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 = "";
|
||||
}
|
||||
|
||||
//// [errorForUsingPropertyOfTypeAsType01.js]
|
||||
var Test1;
|
||||
(function (Test1) {
|
||||
var x = "";
|
||||
})(Test1 || (Test1 = {}));
|
||||
var Test2;
|
||||
(function (Test2) {
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
}());
|
||||
Test2.Foo = Foo;
|
||||
var x = "";
|
||||
})(Test2 || (Test2 = {}));
|
||||
var Test3;
|
||||
(function (Test3) {
|
||||
var x = "";
|
||||
})(Test3 || (Test3 = {}));
|
||||
var Test4;
|
||||
(function (Test4) {
|
||||
var x = "";
|
||||
})(Test4 || (Test4 = {}));
|
||||
var Test5;
|
||||
(function (Test5) {
|
||||
var x = "";
|
||||
})(Test5 || (Test5 = {}));
|
||||
Reference in New Issue
Block a user