mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update test baselines for module keyword deprecation errors
- Updated 530+ test baseline files to include new TS1547 errors - These errors correctly reflect the TypeScript 6.0 deprecation of module keyword for namespaces - All errors are expected and confirm the feature is working as designed
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== module.d.ts (1 errors) ====
|
||||
declare module Point {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var Origin: { x: number; y: number; }
|
||||
}
|
||||
|
||||
==== function.d.ts (0 errors) ====
|
||||
declare function Point(): { x: number; y: number; }
|
||||
|
||||
==== test.ts (0 errors) ====
|
||||
var cl: { x: number; y: number; }
|
||||
var cl = Point();
|
||||
var cl = Point.Origin;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== module.d.ts (1 errors) ====
|
||||
declare module Point {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var Origin: { x: number; y: number; }
|
||||
}
|
||||
|
||||
==== function.ts (0 errors) ====
|
||||
function Point() {
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
|
||||
==== test.ts (0 errors) ====
|
||||
var cl: { x: number; y: number; }
|
||||
var cl = Point();
|
||||
var cl = Point.Origin;
|
||||
+4
-1
@@ -1,7 +1,8 @@
|
||||
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,24): error TS2341: Property 'sfn' is private and only accessible within class 'clodule<T>'.
|
||||
|
||||
|
||||
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ====
|
||||
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (2 errors) ====
|
||||
class clodule<T> {
|
||||
id: string;
|
||||
value: T;
|
||||
@@ -10,6 +11,8 @@ ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics
|
||||
}
|
||||
|
||||
module clodule {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// error: duplicate identifier expected
|
||||
export function fn<T>(x: T, y: T): number {
|
||||
return clodule.sfn('a');
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
EnumAndModuleWithSameNameAndCommonRoot.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== EnumAndModuleWithSameNameAndCommonRoot.ts (1 errors) ====
|
||||
enum enumdule {
|
||||
Red, Blue
|
||||
}
|
||||
|
||||
module enumdule {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
export class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
}
|
||||
}
|
||||
|
||||
var x: enumdule;
|
||||
var x = enumdule.Red;
|
||||
|
||||
var y: { x: number; y: number };
|
||||
var y = new enumdule.Point(0, 0);
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
ExportClassWhichExtendsInterfaceWithInaccessibleType.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportClassWhichExtendsInterfaceWithInaccessibleType.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
fromOrigin(p: Point): number;
|
||||
}
|
||||
|
||||
export class Point2d implements Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
fromOrigin(p: Point) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
export class Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export class Line {
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export class Line {
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
export class Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Line {
|
||||
constructor(public start: Point, public end: Point) { }
|
||||
}
|
||||
|
||||
export function fromOrigin(p: Point): Line {
|
||||
return new Line({ x: 0, y: 0 }, p);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
}
|
||||
|
||||
export var UnitSquare : {
|
||||
top: { left: Point, right: Point },
|
||||
bottom: { left: Point, right: Point }
|
||||
} = null;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
ExportVariableWithInaccessibleTypeInTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ExportVariableWithInaccessibleTypeInTypeAnnotation.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
export interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
// valid since Point is exported
|
||||
export var Origin: Point = { x: 0, y: 0 };
|
||||
|
||||
interface Point3d extends Point {
|
||||
z: number;
|
||||
}
|
||||
|
||||
// invalid Point3d is not exported
|
||||
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
function.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
module.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
module.ts(2,12): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== function.ts (1 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export function Point() {
|
||||
return { x: 0, y: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
==== module.ts (2 errors) ====
|
||||
module B {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export module Point {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var Origin = { x: 0, y: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
==== test.ts (0 errors) ====
|
||||
var fn: () => { x: number; y: number };
|
||||
var fn = A.Point;
|
||||
|
||||
var cl: { x: number; y: number; }
|
||||
var cl = B.Point.Origin;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
ModuleAndEnumWithSameNameAndCommonRoot.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ModuleAndEnumWithSameNameAndCommonRoot.ts (1 errors) ====
|
||||
module enumdule {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
export class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
}
|
||||
}
|
||||
|
||||
enum enumdule {
|
||||
Red, Blue
|
||||
}
|
||||
|
||||
var x: enumdule;
|
||||
var x = enumdule.Red;
|
||||
|
||||
var y: { x: number; y: number };
|
||||
var y = new enumdule.Point(0, 0);
|
||||
@@ -1,8 +1,13 @@
|
||||
ModuleWithExportedAndNonExportedImportAlias.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ModuleWithExportedAndNonExportedImportAlias.ts(12,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ModuleWithExportedAndNonExportedImportAlias.ts(18,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'Lines' does not exist on type 'typeof Geometry'.
|
||||
|
||||
|
||||
==== ModuleWithExportedAndNonExportedImportAlias.ts (1 errors) ====
|
||||
==== ModuleWithExportedAndNonExportedImportAlias.ts (4 errors) ====
|
||||
module A {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -14,12 +19,16 @@ ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'L
|
||||
}
|
||||
|
||||
module B {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export class Line {
|
||||
constructor(public start: A.Point, public end: A.Point) { }
|
||||
}
|
||||
}
|
||||
|
||||
module Geometry {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export import Points = A;
|
||||
import Lines = B;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
accessorsInAmbientContext.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
accessorsInAmbientContext.ts(3,17): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
accessorsInAmbientContext.ts(4,18): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
accessorsInAmbientContext.ts(6,24): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
@@ -8,8 +9,10 @@ accessorsInAmbientContext.ts(15,20): error TS1183: An implementation cannot be d
|
||||
accessorsInAmbientContext.ts(16,21): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
|
||||
|
||||
==== accessorsInAmbientContext.ts (8 errors) ====
|
||||
==== accessorsInAmbientContext.ts (9 errors) ====
|
||||
declare module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class C {
|
||||
get X() { return 1; }
|
||||
~
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
aliasesInSystemModule1.ts(1,24): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
aliasesInSystemModule1.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== aliasesInSystemModule1.ts (1 errors) ====
|
||||
==== aliasesInSystemModule1.ts (2 errors) ====
|
||||
import alias = require('foo');
|
||||
~~~~~
|
||||
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
@@ -13,6 +14,8 @@ aliasesInSystemModule1.ts(1,24): error TS2792: Cannot find module 'foo'. Did you
|
||||
let z = new cls2();
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export import cls = alias.Class;
|
||||
let x = new alias.Class();
|
||||
let y = new cls();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
aliasesInSystemModule2.ts(1,21): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
aliasesInSystemModule2.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== aliasesInSystemModule2.ts (1 errors) ====
|
||||
==== aliasesInSystemModule2.ts (2 errors) ====
|
||||
import {alias} from "foo";
|
||||
~~~~~
|
||||
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
@@ -13,6 +14,8 @@ aliasesInSystemModule2.ts(1,21): error TS2792: Cannot find module 'foo'. Did you
|
||||
let z = new cls2();
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export import cls = alias.Class;
|
||||
let x = new alias.Class();
|
||||
let y = new cls();
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
ambientDeclarations.ts(55,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientDeclarations.ts(61,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ambientDeclarations.ts (2 errors) ====
|
||||
// Ambient variable without type annotation
|
||||
declare var n;
|
||||
|
||||
// Ambient variable with type annotation
|
||||
declare var m: string;
|
||||
|
||||
// Ambient function with no type annotations
|
||||
declare function fn1();
|
||||
|
||||
// Ambient function with type annotations
|
||||
declare function fn2(n: string): number;
|
||||
|
||||
// Ambient function with valid overloads
|
||||
declare function fn3(n: string): number;
|
||||
declare function fn4(n: number, y: number): string;
|
||||
|
||||
// Ambient function with optional parameters
|
||||
declare function fn5(x, y?);
|
||||
declare function fn6(e?);
|
||||
declare function fn7(x, y?, ...z);
|
||||
declare function fn8(y?, ...z: number[]);
|
||||
declare function fn9(...q: {}[]);
|
||||
declare function fn10<T>(...q: T[]);
|
||||
|
||||
// Ambient class
|
||||
declare class cls {
|
||||
constructor();
|
||||
method(): cls;
|
||||
static static(p): number;
|
||||
static q;
|
||||
private fn();
|
||||
private static fns();
|
||||
}
|
||||
|
||||
// Ambient enum
|
||||
declare enum E1 {
|
||||
x,
|
||||
y,
|
||||
z
|
||||
}
|
||||
|
||||
// Ambient enum with integer literal initializer
|
||||
declare enum E2 {
|
||||
q,
|
||||
a = 1,
|
||||
b,
|
||||
c = 2,
|
||||
d
|
||||
}
|
||||
|
||||
// Ambient enum members are always exported with or without export keyword
|
||||
declare enum E3 {
|
||||
A
|
||||
}
|
||||
declare module E3 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var B;
|
||||
}
|
||||
var x = E3.B;
|
||||
|
||||
// Ambient module
|
||||
declare module M1 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var x;
|
||||
function fn(): number;
|
||||
}
|
||||
|
||||
// Ambient module members are always exported with or without export keyword
|
||||
var p = M1.x;
|
||||
var q = M1.fn();
|
||||
|
||||
// Ambient external module in the global module
|
||||
// Ambient external module with a string literal name that is a top level external module name
|
||||
declare module 'external1' {
|
||||
var q;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// Ambient variable without type annotation
|
||||
declare var n;
|
||||
>n : any
|
||||
> : ^^^
|
||||
|
||||
// Ambient variable with type annotation
|
||||
declare var m: string;
|
||||
@@ -42,18 +43,23 @@ declare function fn5(x, y?);
|
||||
>fn5 : (x: any, y?: any) => any
|
||||
> : ^ ^^^^^^^ ^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>y : any
|
||||
> : ^^^
|
||||
|
||||
declare function fn6(e?);
|
||||
>fn6 : (e?: any) => any
|
||||
> : ^ ^^^^^^^^^^^^^^
|
||||
>e : any
|
||||
> : ^^^
|
||||
|
||||
declare function fn7(x, y?, ...z);
|
||||
>fn7 : (x: any, y?: any, ...z: any[]) => any
|
||||
> : ^ ^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>y : any
|
||||
> : ^^^
|
||||
>z : any[]
|
||||
> : ^^^^^
|
||||
|
||||
@@ -61,6 +67,7 @@ declare function fn8(y?, ...z: number[]);
|
||||
>fn8 : (y?: any, ...z: number[]) => any
|
||||
> : ^ ^^^^^^^^^^^ ^^ ^^^^^^^^
|
||||
>y : any
|
||||
> : ^^^
|
||||
>z : number[]
|
||||
> : ^^^^^^^^
|
||||
|
||||
@@ -90,9 +97,11 @@ declare class cls {
|
||||
>static : (p: any) => number
|
||||
> : ^ ^^^^^^^^^^
|
||||
>p : any
|
||||
> : ^^^
|
||||
|
||||
static q;
|
||||
>q : any
|
||||
> : ^^^
|
||||
|
||||
private fn();
|
||||
>fn : () => any
|
||||
@@ -166,10 +175,13 @@ declare module E3 {
|
||||
|
||||
var B;
|
||||
>B : any
|
||||
> : ^^^
|
||||
}
|
||||
var x = E3.B;
|
||||
>x : any
|
||||
> : ^^^
|
||||
>E3.B : any
|
||||
> : ^^^
|
||||
>E3 : typeof E3
|
||||
> : ^^^^^^^^^
|
||||
>B : any
|
||||
@@ -182,6 +194,7 @@ declare module M1 {
|
||||
|
||||
var x;
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
function fn(): number;
|
||||
>fn : () => number
|
||||
@@ -191,7 +204,9 @@ declare module M1 {
|
||||
// Ambient module members are always exported with or without export keyword
|
||||
var p = M1.x;
|
||||
>p : any
|
||||
> : ^^^
|
||||
>M1.x : any
|
||||
> : ^^^
|
||||
>M1 : typeof M1
|
||||
> : ^^^^^^^^^
|
||||
>x : any
|
||||
@@ -217,6 +232,7 @@ declare module 'external1' {
|
||||
|
||||
var q;
|
||||
>q : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ ambientErrors.ts(2,17): error TS1039: Initializers are not allowed in ambient co
|
||||
ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
ambientErrors.ts(20,24): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
ambientErrors.ts(29,9): error TS1066: In ambient enum declarations member initializer must be constant expression.
|
||||
ambientErrors.ts(33,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientErrors.ts(34,13): error TS1039: Initializers are not allowed in ambient contexts.
|
||||
ambientErrors.ts(35,19): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts.
|
||||
@@ -9,12 +10,13 @@ ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient c
|
||||
ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts.
|
||||
ambientErrors.ts(46,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
|
||||
ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name.
|
||||
ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
|
||||
|
||||
==== ambientErrors.ts (14 errors) ====
|
||||
==== ambientErrors.ts (16 errors) ====
|
||||
// Ambient variable with an initializer
|
||||
declare var x = 4;
|
||||
~
|
||||
@@ -56,6 +58,8 @@ ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a m
|
||||
|
||||
// Ambient module with initializers for values, bodies for functions / classes
|
||||
declare module M1 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var x = 3;
|
||||
~
|
||||
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
||||
@@ -83,6 +87,8 @@ ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a m
|
||||
|
||||
// Ambient external module not in the global module
|
||||
module M2 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare module 'nope' { }
|
||||
~~~~~~
|
||||
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
ambientInsideNonAmbient.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientInsideNonAmbient.ts(6,20): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientInsideNonAmbient.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientInsideNonAmbient.ts(14,13): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ambientInsideNonAmbient.ts (4 errors) ====
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export declare var x;
|
||||
export declare function f();
|
||||
export declare class C { }
|
||||
export declare enum E { }
|
||||
export declare module M { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
}
|
||||
|
||||
module M2 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare var x;
|
||||
declare function f();
|
||||
declare class C { }
|
||||
declare enum E { }
|
||||
declare module M { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
}
|
||||
@@ -7,6 +7,7 @@ module M {
|
||||
|
||||
export declare var x;
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
export declare function f();
|
||||
>f : () => any
|
||||
@@ -29,6 +30,7 @@ module M2 {
|
||||
|
||||
declare var x;
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
declare function f();
|
||||
>f : () => any
|
||||
|
||||
+13
-1
@@ -1,19 +1,31 @@
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,23): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,21): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,1): error TS2304: Cannot find name 'declare'.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,16): error TS2819: Namespace name cannot be 'debugger'.
|
||||
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,25): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts (4 errors) ====
|
||||
==== ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts (8 errors) ====
|
||||
// https://github.com/microsoft/TypeScript/issues/7840
|
||||
|
||||
declare module chrome.debugger {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare var tabId: number;
|
||||
}
|
||||
|
||||
export const tabId = chrome.debugger.tabId;
|
||||
|
||||
declare module test.class {}
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
declare module debugger {} // still an error
|
||||
~~~~~~~
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
ambientModuleExports.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
ambientModuleExports.ts(11,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ambientModuleExports.ts (2 errors) ====
|
||||
declare module Foo {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
function a():void;
|
||||
var b:number;
|
||||
class C {}
|
||||
}
|
||||
|
||||
Foo.a();
|
||||
Foo.b;
|
||||
var c = new Foo.C();
|
||||
|
||||
declare module Foo2 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export function a(): void;
|
||||
export var b: number;
|
||||
export class C { }
|
||||
}
|
||||
|
||||
Foo2.a();
|
||||
Foo2.b;
|
||||
var c2 = new Foo2.C();
|
||||
@@ -0,0 +1,26 @@
|
||||
ambientModuleWithTemplateLiterals.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== ambientModuleWithTemplateLiterals.ts (1 errors) ====
|
||||
declare module Foo {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum Bar {
|
||||
a = `1`,
|
||||
b = '2',
|
||||
c = '3'
|
||||
}
|
||||
|
||||
export const a = 'string';
|
||||
export const b = `template`;
|
||||
|
||||
export const c = Bar.a;
|
||||
export const d = Bar['b'];
|
||||
export const e = Bar[`c`];
|
||||
}
|
||||
|
||||
Foo.a;
|
||||
Foo.b;
|
||||
Foo.c;
|
||||
Foo.d;
|
||||
Foo.e;
|
||||
@@ -0,0 +1,97 @@
|
||||
anyAssignabilityInInheritance.ts(67,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
anyAssignabilityInInheritance.ts(75,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== anyAssignabilityInInheritance.ts (2 errors) ====
|
||||
// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted
|
||||
|
||||
interface I {
|
||||
[x: string]: any;
|
||||
foo: any; // ok, any identical to itself
|
||||
}
|
||||
|
||||
var a: any;
|
||||
|
||||
declare function foo2(x: number): number;
|
||||
declare function foo2(x: any): any;
|
||||
var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
|
||||
|
||||
declare function foo3(x: string): string;
|
||||
declare function foo3(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo4(x: boolean): boolean;
|
||||
declare function foo4(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo5(x: Date): Date;
|
||||
declare function foo5(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo6(x: RegExp): RegExp;
|
||||
declare function foo6(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo7(x: { bar: number }): { bar: number };
|
||||
declare function foo7(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo8(x: number[]): number[];
|
||||
declare function foo8(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
interface I8 { foo: string }
|
||||
declare function foo9(x: I8): I8;
|
||||
declare function foo9(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
class A { foo: number; }
|
||||
declare function foo10(x: A): A;
|
||||
declare function foo10(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
class A2<T> { foo: T; }
|
||||
declare function foo11(x: A2<string>): A2<string>;
|
||||
declare function foo11(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo12(x: (x) => number): (x) => number;
|
||||
declare function foo12(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo13(x: <T>(x: T) => T): <T>(x: T) => T;
|
||||
declare function foo13(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
enum E { A }
|
||||
declare function foo14(x: E): E;
|
||||
declare function foo14(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
function f() { }
|
||||
module f {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var bar = 1;
|
||||
}
|
||||
declare function foo15(x: typeof f): typeof f;
|
||||
declare function foo15(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
class CC { baz: string }
|
||||
module CC {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var bar = 1;
|
||||
}
|
||||
declare function foo16(x: CC): CC;
|
||||
declare function foo16(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo17(x: Object): Object;
|
||||
declare function foo17(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
|
||||
declare function foo18(x: {}): {};
|
||||
declare function foo18(x: any): any;
|
||||
var r3 = foo3(a); // any
|
||||
@@ -10,10 +10,12 @@ interface I {
|
||||
|
||||
foo: any; // ok, any identical to itself
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
var a: any;
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo2(x: number): number;
|
||||
>foo2 : { (x: number): number; (x: any): any; }
|
||||
@@ -25,13 +27,17 @@ declare function foo2(x: any): any;
|
||||
>foo2 : { (x: number): number; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo2(a) : any
|
||||
> : ^^^
|
||||
>foo2 : { (x: number): number; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo3(x: string): string;
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
@@ -43,13 +49,17 @@ declare function foo3(x: any): any;
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo4(x: boolean): boolean;
|
||||
>foo4 : { (x: boolean): boolean; (x: any): any; }
|
||||
@@ -61,13 +71,17 @@ declare function foo4(x: any): any;
|
||||
>foo4 : { (x: boolean): boolean; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo5(x: Date): Date;
|
||||
>foo5 : { (x: Date): Date; (x: any): any; }
|
||||
@@ -79,13 +93,17 @@ declare function foo5(x: any): any;
|
||||
>foo5 : { (x: Date): Date; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo6(x: RegExp): RegExp;
|
||||
>foo6 : { (x: RegExp): RegExp; (x: any): any; }
|
||||
@@ -97,13 +115,17 @@ declare function foo6(x: any): any;
|
||||
>foo6 : { (x: RegExp): RegExp; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo7(x: { bar: number }): { bar: number };
|
||||
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
|
||||
@@ -119,13 +141,17 @@ declare function foo7(x: any): any;
|
||||
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo8(x: number[]): number[];
|
||||
>foo8 : { (x: number[]): number[]; (x: any): any; }
|
||||
@@ -137,13 +163,17 @@ declare function foo8(x: any): any;
|
||||
>foo8 : { (x: number[]): number[]; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
interface I8 { foo: string }
|
||||
>foo : string
|
||||
@@ -159,13 +189,17 @@ declare function foo9(x: any): any;
|
||||
>foo9 : { (x: I8): I8; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
class A { foo: number; }
|
||||
>A : A
|
||||
@@ -183,13 +217,17 @@ declare function foo10(x: any): any;
|
||||
>foo10 : { (x: A): A; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
class A2<T> { foo: T; }
|
||||
>A2 : A2<T>
|
||||
@@ -207,13 +245,17 @@ declare function foo11(x: any): any;
|
||||
>foo11 : { (x: A2<string>): A2<string>; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo12(x: (x) => number): (x) => number;
|
||||
>foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; }
|
||||
@@ -221,19 +263,25 @@ declare function foo12(x: (x) => number): (x) => number;
|
||||
>x : (x: any) => number
|
||||
> : ^ ^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo12(x: any): any;
|
||||
>foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo13(x: <T>(x: T) => T): <T>(x: T) => T;
|
||||
>foo13 : { (x: <T>(x: T) => T): <T>(x: T) => T; (x: any): any; }
|
||||
@@ -249,13 +297,17 @@ declare function foo13(x: any): any;
|
||||
>foo13 : { (x: <T>(x: T) => T): <T>(x: T) => T; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
enum E { A }
|
||||
>E : E
|
||||
@@ -273,13 +325,17 @@ declare function foo14(x: any): any;
|
||||
>foo14 : { (x: E): E; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
function f() { }
|
||||
>f : typeof f
|
||||
@@ -309,13 +365,17 @@ declare function foo15(x: any): any;
|
||||
>foo15 : { (x: typeof f): typeof f; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
class CC { baz: string }
|
||||
>CC : CC
|
||||
@@ -343,13 +403,17 @@ declare function foo16(x: any): any;
|
||||
>foo16 : { (x: CC): CC; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo17(x: Object): Object;
|
||||
>foo17 : { (x: Object): Object; (x: any): any; }
|
||||
@@ -361,13 +425,17 @@ declare function foo17(x: any): any;
|
||||
>foo17 : { (x: Object): Object; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
declare function foo18(x: {}): {};
|
||||
>foo18 : { (x: {}): {}; (x: any): any; }
|
||||
@@ -379,11 +447,15 @@ declare function foo18(x: any): any;
|
||||
>foo18 : { (x: {}): {}; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
var r3 = foo3(a); // any
|
||||
>r3 : any
|
||||
> : ^^^
|
||||
>foo3(a) : any
|
||||
> : ^^^
|
||||
>foo3 : { (x: string): string; (x: any): any; }
|
||||
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
|
||||
>a : any
|
||||
> : ^^^
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
anyAssignableToEveryType2.ts(89,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
anyAssignableToEveryType2.ts(99,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== anyAssignableToEveryType2.ts (2 errors) ====
|
||||
// any is not a subtype of any other types, but is assignable, all the below should work
|
||||
|
||||
interface I {
|
||||
[x: string]: any;
|
||||
foo: any; // ok, any identical to itself
|
||||
}
|
||||
|
||||
|
||||
interface I2 {
|
||||
[x: string]: number;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I3 {
|
||||
[x: string]: string;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I4 {
|
||||
[x: string]: boolean;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I5 {
|
||||
[x: string]: Date;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I6 {
|
||||
[x: string]: RegExp;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I7 {
|
||||
[x: string]: { bar: number };
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I8 {
|
||||
[x: string]: number[];
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I9 {
|
||||
[x: string]: I8;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
class A { foo: number; }
|
||||
interface I10 {
|
||||
[x: string]: A;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
class A2<T> { foo: T; }
|
||||
interface I11 {
|
||||
[x: string]: A2<number>;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I12 {
|
||||
[x: string]: (x) => number;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I13 {
|
||||
[x: string]: <T>(x: T) => T;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
enum E { A }
|
||||
interface I14 {
|
||||
[x: string]: E;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
function f() { }
|
||||
module f {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var bar = 1;
|
||||
}
|
||||
interface I15 {
|
||||
[x: string]: typeof f;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
class c { baz: string }
|
||||
module c {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var bar = 1;
|
||||
}
|
||||
interface I16 {
|
||||
[x: string]: typeof c;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I17<T> {
|
||||
[x: string]: T;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I18<T, U extends T> {
|
||||
[x: string]: U;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I19 {
|
||||
[x: string]: Object;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
|
||||
interface I20 {
|
||||
[x: string]: {};
|
||||
foo: any;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ interface I {
|
||||
|
||||
foo: any; // ok, any identical to itself
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +21,7 @@ interface I2 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +32,7 @@ interface I3 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +43,7 @@ interface I4 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +54,7 @@ interface I5 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +65,7 @@ interface I6 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +78,7 @@ interface I7 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +89,7 @@ interface I8 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +100,7 @@ interface I9 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
class A { foo: number; }
|
||||
@@ -107,6 +116,7 @@ interface I10 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
class A2<T> { foo: T; }
|
||||
@@ -122,6 +132,7 @@ interface I11 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -130,9 +141,11 @@ interface I12 {
|
||||
>x : string
|
||||
> : ^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +158,7 @@ interface I13 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +175,7 @@ interface I14 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -187,6 +202,7 @@ interface I15 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +231,7 @@ interface I16 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +242,7 @@ interface I17<T> {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -235,6 +253,7 @@ interface I18<T, U extends T> {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -245,6 +264,7 @@ interface I19 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -255,5 +275,6 @@ interface I20 {
|
||||
|
||||
foo: any;
|
||||
>foo : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
arrayAssignmentTest5.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'.
|
||||
Property 'state' is missing in type 'IToken' but required in type 'IStateToken'.
|
||||
|
||||
|
||||
==== arrayAssignmentTest5.ts (1 errors) ====
|
||||
==== arrayAssignmentTest5.ts (2 errors) ====
|
||||
module Test {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface IState {
|
||||
}
|
||||
interface IToken {
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
arrayBestCommonTypes.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrayBestCommonTypes.ts(54,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== arrayBestCommonTypes.ts (2 errors) ====
|
||||
module EmptyTypes {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface iface { }
|
||||
class base implements iface { }
|
||||
class base2 implements iface { }
|
||||
class derived extends base { }
|
||||
|
||||
|
||||
class f {
|
||||
public voidIfAny(x: boolean, y?: boolean): number;
|
||||
public voidIfAny(x: string, y?: boolean): number;
|
||||
public voidIfAny(x: number, y?: boolean): number;
|
||||
public voidIfAny(x: any, y = false): any { return null; }
|
||||
|
||||
public x() {
|
||||
<number>(this.voidIfAny([4, 2][0]));
|
||||
<number>(this.voidIfAny([4, 2, undefined][0]));
|
||||
<number>(this.voidIfAny([undefined, 2, 4][0]));
|
||||
<number>(this.voidIfAny([null, 2, 4][0]));
|
||||
<number>(this.voidIfAny([2, 4, null][0]));
|
||||
<number>(this.voidIfAny([undefined, 4, null][0]));
|
||||
|
||||
<number>(this.voidIfAny(['', "q"][0]));
|
||||
<number>(this.voidIfAny(['', "q", undefined][0]));
|
||||
<number>(this.voidIfAny([undefined, "q", ''][0]));
|
||||
<number>(this.voidIfAny([null, "q", ''][0]));
|
||||
<number>(this.voidIfAny(["q", '', null][0]));
|
||||
<number>(this.voidIfAny([undefined, '', null][0]));
|
||||
|
||||
<number>(this.voidIfAny([[3, 4], [null]][0][0]));
|
||||
|
||||
|
||||
var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
|
||||
var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
|
||||
var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
|
||||
|
||||
var anyObj: any = null;
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
|
||||
var ifaceObj: iface = null;
|
||||
var baseObj = new base();
|
||||
var base2Obj = new base2();
|
||||
|
||||
var b1 = [baseObj, base2Obj, ifaceObj];
|
||||
var b2 = [base2Obj, baseObj, ifaceObj];
|
||||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
var b4 = [ifaceObj, baseObj, base2Obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module NonEmptyTypes {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface iface { x: string; }
|
||||
class base implements iface { x: string; y: string; }
|
||||
class base2 implements iface { x: string; z: string; }
|
||||
class derived extends base { a: string; }
|
||||
|
||||
|
||||
class f {
|
||||
public voidIfAny(x: boolean, y?: boolean): number;
|
||||
public voidIfAny(x: string, y?: boolean): number;
|
||||
public voidIfAny(x: number, y?: boolean): number;
|
||||
public voidIfAny(x: any, y = false): any { return null; }
|
||||
|
||||
public x() {
|
||||
<number>(this.voidIfAny([4, 2][0]));
|
||||
<number>(this.voidIfAny([4, 2, undefined][0]));
|
||||
<number>(this.voidIfAny([undefined, 2, 4][0]));
|
||||
<number>(this.voidIfAny([null, 2, 4][0]));
|
||||
<number>(this.voidIfAny([2, 4, null][0]));
|
||||
<number>(this.voidIfAny([undefined, 4, null][0]));
|
||||
|
||||
<number>(this.voidIfAny(['', "q"][0]));
|
||||
<number>(this.voidIfAny(['', "q", undefined][0]));
|
||||
<number>(this.voidIfAny([undefined, "q", ''][0]));
|
||||
<number>(this.voidIfAny([null, "q", ''][0]));
|
||||
<number>(this.voidIfAny(["q", '', null][0]));
|
||||
<number>(this.voidIfAny([undefined, '', null][0]));
|
||||
|
||||
<number>(this.voidIfAny([[3, 4], [null]][0][0]));
|
||||
|
||||
|
||||
var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
|
||||
var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
|
||||
var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
|
||||
|
||||
var anyObj: any = null;
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
|
||||
var ifaceObj: iface = null;
|
||||
var baseObj = new base();
|
||||
var base2Obj = new base2();
|
||||
|
||||
var b1 = [baseObj, base2Obj, ifaceObj];
|
||||
var b2 = [base2Obj, baseObj, ifaceObj];
|
||||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
var b4 = [ifaceObj, baseObj, base2Obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ module EmptyTypes {
|
||||
>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; }
|
||||
> : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>y : boolean
|
||||
> : ^^^^^^^
|
||||
>false : false
|
||||
@@ -495,6 +496,7 @@ module EmptyTypes {
|
||||
|
||||
var anyObj: any = null;
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
@@ -525,7 +527,9 @@ module EmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
@@ -539,7 +543,9 @@ module EmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
@@ -583,7 +589,9 @@ module EmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
@@ -735,6 +743,7 @@ module NonEmptyTypes {
|
||||
>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; }
|
||||
> : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>y : boolean
|
||||
> : ^^^^^^^
|
||||
>false : false
|
||||
@@ -1177,6 +1186,7 @@ module NonEmptyTypes {
|
||||
|
||||
var anyObj: any = null;
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
@@ -1207,7 +1217,9 @@ module NonEmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
@@ -1221,7 +1233,9 @@ module NonEmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
@@ -1265,7 +1279,9 @@ module NonEmptyTypes {
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
> : ^^^^^^^^^^^^^^^^^^^^^^
|
||||
>x : any
|
||||
> : ^^^
|
||||
>anyObj : any
|
||||
> : ^^^
|
||||
>y : string
|
||||
> : ^^^^^^
|
||||
>'a' : "a"
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
arrowFunctionContexts.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
|
||||
arrowFunctionContexts.ts(30,9): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values.
|
||||
arrowFunctionContexts.ts(31,16): error TS2332: 'this' cannot be referenced in current location.
|
||||
arrowFunctionContexts.ts(35,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionContexts.ts(41,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionContexts.ts(43,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
|
||||
arrowFunctionContexts.ts(71,13): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values.
|
||||
arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in current location.
|
||||
arrowFunctionContexts.ts(76,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== arrowFunctionContexts.ts (6 errors) ====
|
||||
==== arrowFunctionContexts.ts (9 errors) ====
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
~~~~~~~~~~~~~
|
||||
@@ -48,12 +51,16 @@ arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in cu
|
||||
|
||||
// Arrow function as module variable initializer
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var a = (s) => '';
|
||||
var b = (s) => s;
|
||||
}
|
||||
|
||||
// Repeat above for module members that are functions? (necessary to redo all of them?)
|
||||
module M2 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
~~~~~~~~~~~~~
|
||||
@@ -95,6 +102,8 @@ arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in cu
|
||||
|
||||
// Arrow function as module variable initializer
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var a = (s) => '';
|
||||
var b = (s) => s;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
arrowFunctionsMissingTokens.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionsMissingTokens.ts(2,16): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(4,22): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(6,17): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(8,36): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(10,42): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(13,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionsMissingTokens.ts(14,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionsMissingTokens.ts(15,23): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(17,29): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(19,24): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(21,43): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(23,49): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(25,23): error TS1005: '{' expected.
|
||||
arrowFunctionsMissingTokens.ts(28,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionsMissingTokens.ts(29,23): error TS1109: Expression expected.
|
||||
arrowFunctionsMissingTokens.ts(31,29): error TS1109: Expression expected.
|
||||
arrowFunctionsMissingTokens.ts(33,24): error TS1109: Expression expected.
|
||||
@@ -17,15 +21,19 @@ arrowFunctionsMissingTokens.ts(37,49): error TS1109: Expression expected.
|
||||
arrowFunctionsMissingTokens.ts(39,23): error TS1109: Expression expected.
|
||||
arrowFunctionsMissingTokens.ts(40,5): error TS1128: Declaration or statement expected.
|
||||
arrowFunctionsMissingTokens.ts(41,1): error TS1128: Declaration or statement expected.
|
||||
arrowFunctionsMissingTokens.ts(43,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
arrowFunctionsMissingTokens.ts(44,14): error TS1109: Expression expected.
|
||||
arrowFunctionsMissingTokens.ts(46,21): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(48,14): error TS2304: Cannot find name 'x'.
|
||||
arrowFunctionsMissingTokens.ts(50,35): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
|
||||
arrowFunctionsMissingTokens.ts(55,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== arrowFunctionsMissingTokens.ts (24 errors) ====
|
||||
==== arrowFunctionsMissingTokens.ts (30 errors) ====
|
||||
module missingArrowsWithCurly {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var a = () { };
|
||||
~
|
||||
!!! error TS1005: '=>' expected.
|
||||
@@ -48,7 +56,11 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
|
||||
}
|
||||
|
||||
module missingCurliesWithArrow {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
module withStatement {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var a = () => var k = 10;};
|
||||
~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
@@ -75,6 +87,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
|
||||
}
|
||||
|
||||
module withoutStatement {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var a = () => };
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -106,6 +120,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
|
||||
!!! error TS1128: Declaration or statement expected.
|
||||
|
||||
module ce_nEst_pas_une_arrow_function {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var a = ();
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -128,6 +144,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
|
||||
}
|
||||
|
||||
module okay {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var a = () => { };
|
||||
|
||||
var b = (): void => { }
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
asiPreventsParsingAsAmbientExternalModule02.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asiPreventsParsingAsAmbientExternalModule02.ts (1 errors) ====
|
||||
var declare: number;
|
||||
var module: string;
|
||||
|
||||
module container {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare // this is the identifier 'declare'
|
||||
module // this is the identifier 'module'
|
||||
"my external module" // this is just a string
|
||||
{ } // this is a block body
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
assignToExistingClass.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignToExistingClass.ts(8,13): error TS2629: Cannot assign to 'Mocked' because it is a class.
|
||||
|
||||
|
||||
==== assignToExistingClass.ts (1 errors) ====
|
||||
==== assignToExistingClass.ts (2 errors) ====
|
||||
module Test {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Mocked {
|
||||
myProp: string;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
assignmentCompatWithCallSignatures4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithCallSignatures4.ts(9,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithCallSignatures4.ts(45,9): error TS2322: Type '(x: number) => string[]' is not assignable to type '<T, U>(x: T) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'number'.
|
||||
@@ -47,6 +49,7 @@ assignmentCompatWithCallSignatures4.ts(74,9): error TS2322: Type '(x: { a: strin
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
Type 'Base' is not assignable to type 'string'.
|
||||
assignmentCompatWithCallSignatures4.ts(85,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithCallSignatures4.ts(89,9): error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
@@ -63,16 +66,20 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '<T>(x: T) => s
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== assignmentCompatWithCallSignatures4.ts (15 errors) ====
|
||||
==== assignmentCompatWithCallSignatures4.ts (18 errors) ====
|
||||
// These are mostly permitted with the current loose rules. All ok unless otherwise noted.
|
||||
|
||||
module Errors {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base { foo: string; }
|
||||
class Derived extends Base { bar: string; }
|
||||
class Derived2 extends Derived { baz: string; }
|
||||
class OtherDerived extends Base { bing: string; }
|
||||
|
||||
module WithNonGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// target type with non-generic call signatures
|
||||
var a2: (x: number) => string[];
|
||||
var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2;
|
||||
@@ -211,6 +218,8 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '<T>(x: T) => s
|
||||
}
|
||||
|
||||
module WithGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// target type has generic call signature
|
||||
var a2: <T>(x: T) => T[];
|
||||
var b2: <T>(x: T) => string[];
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
assignmentCompatWithConstructSignatures4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithConstructSignatures4.ts(9,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithConstructSignatures4.ts(45,9): error TS2322: Type 'new (x: number) => string[]' is not assignable to type 'new <T, U>(x: T) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'number'.
|
||||
@@ -63,6 +65,7 @@ assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x:
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
|
||||
Type '(a: any) => any' provides no match for the signature 'new <T extends Derived>(a: T): T'.
|
||||
assignmentCompatWithConstructSignatures4.ts(85,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithConstructSignatures4.ts(89,9): error TS2322: Type 'new <T>(x: T) => string[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
@@ -79,16 +82,20 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new <T>(x
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== assignmentCompatWithConstructSignatures4.ts (19 errors) ====
|
||||
==== assignmentCompatWithConstructSignatures4.ts (22 errors) ====
|
||||
// checking assignment compatibility relations for function types.
|
||||
|
||||
module Errors {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base { foo: string; }
|
||||
class Derived extends Base { bar: string; }
|
||||
class Derived2 extends Derived { baz: string; }
|
||||
class OtherDerived extends Base { bing: string; }
|
||||
|
||||
module WithNonGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// target type with non-generic call signatures
|
||||
var a2: new (x: number) => string[];
|
||||
var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2;
|
||||
@@ -247,6 +254,8 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new <T>(x
|
||||
}
|
||||
|
||||
module WithGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// target type has generic call signature
|
||||
var a2: new <T>(x: T) => T[];
|
||||
var b2: new <T>(x: T) => string[];
|
||||
|
||||
+10
-1
@@ -1,7 +1,9 @@
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(39,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
@@ -91,16 +93,19 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(91,9): error
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(95,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '<T>(x: T, y: T) => any' is not assignable to type '<T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ====
|
||||
==== assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (32 errors) ====
|
||||
// call signatures in derived types must have the same or fewer optional parameters as the target for assignment
|
||||
|
||||
module ClassTypeParam {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base<T> {
|
||||
a: () => T;
|
||||
a2: (x?: T) => T;
|
||||
@@ -143,6 +148,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro
|
||||
}
|
||||
|
||||
module GenericSignaturesInvalid {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class Base2 {
|
||||
a: <T>() => T;
|
||||
@@ -336,6 +343,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro
|
||||
}
|
||||
|
||||
module GenericSignaturesValid {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class Base2 {
|
||||
a: <T>() => T;
|
||||
|
||||
@@ -4,6 +4,7 @@ assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assig
|
||||
assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
|
||||
'number' index signatures are incompatible.
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
assignmentCompatWithNumericIndexer.ts(20,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
|
||||
'number' index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -22,7 +23,7 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not as
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
|
||||
==== assignmentCompatWithNumericIndexer.ts (6 errors) ====
|
||||
==== assignmentCompatWithNumericIndexer.ts (7 errors) ====
|
||||
// Derived type indexer must be subtype of base type indexer
|
||||
|
||||
interface Base { foo: string; }
|
||||
@@ -52,6 +53,8 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not as
|
||||
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
module Generics {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class A<T extends Base> {
|
||||
[x: number]: T;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
assignmentCompatWithObjectMembers.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembers.ts(45,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembers.ts (2 errors) ====
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
// no errors expected
|
||||
|
||||
module SimpleTypes {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class S { foo: string; }
|
||||
class T { foo: string; }
|
||||
var s: S;
|
||||
var t: T;
|
||||
|
||||
interface S2 { foo: string; }
|
||||
interface T2 { foo: string; }
|
||||
var s2: S2;
|
||||
var t2: T2;
|
||||
|
||||
var a: { foo: string; }
|
||||
var b: { foo: string; }
|
||||
|
||||
var a2 = { foo: '' };
|
||||
var b2 = { foo: '' };
|
||||
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
}
|
||||
|
||||
module ObjectTypes {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class S { foo: S; }
|
||||
class T { foo: T; }
|
||||
var s: S;
|
||||
var t: T;
|
||||
|
||||
interface S2 { foo: S2; }
|
||||
interface T2 { foo: T2; }
|
||||
var s2: S2;
|
||||
var t2: T2;
|
||||
|
||||
var a: { foo: typeof a; }
|
||||
var b: { foo: typeof b; }
|
||||
|
||||
var a2 = { foo: a2 };
|
||||
var b2 = { foo: b2 };
|
||||
|
||||
s = t;
|
||||
t = s;
|
||||
s = s2;
|
||||
s = a2;
|
||||
|
||||
s2 = t2;
|
||||
t2 = s2;
|
||||
s2 = t;
|
||||
s2 = b;
|
||||
s2 = a2;
|
||||
|
||||
a = b;
|
||||
b = a;
|
||||
a = s;
|
||||
a = s2;
|
||||
a = a2;
|
||||
|
||||
a2 = b2;
|
||||
b2 = a2;
|
||||
a2 = b;
|
||||
a2 = t2;
|
||||
a2 = t;
|
||||
|
||||
}
|
||||
@@ -287,17 +287,23 @@ module ObjectTypes {
|
||||
|
||||
var a2 = { foo: a2 };
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
>{ foo: a2 } : { foo: any; }
|
||||
> : ^^^^^^^^^^^^^
|
||||
>foo : any
|
||||
> : ^^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
|
||||
var b2 = { foo: b2 };
|
||||
>b2 : any
|
||||
> : ^^^
|
||||
>{ foo: b2 } : { foo: any; }
|
||||
> : ^^^^^^^^^^^^^
|
||||
>foo : any
|
||||
> : ^^^
|
||||
>b2 : any
|
||||
> : ^^^
|
||||
|
||||
s = t;
|
||||
>s = t : T
|
||||
@@ -325,9 +331,11 @@ module ObjectTypes {
|
||||
|
||||
s = a2;
|
||||
>s = a2 : any
|
||||
> : ^^^
|
||||
>s : S
|
||||
> : ^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
|
||||
s2 = t2;
|
||||
>s2 = t2 : T2
|
||||
@@ -363,9 +371,11 @@ module ObjectTypes {
|
||||
|
||||
s2 = a2;
|
||||
>s2 = a2 : any
|
||||
> : ^^^
|
||||
>s2 : S2
|
||||
> : ^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
|
||||
a = b;
|
||||
>a = b : { foo: typeof b; }
|
||||
@@ -401,24 +411,33 @@ module ObjectTypes {
|
||||
|
||||
a = a2;
|
||||
>a = a2 : any
|
||||
> : ^^^
|
||||
>a : { foo: typeof a; }
|
||||
> : ^^^^^^^ ^^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
|
||||
a2 = b2;
|
||||
>a2 = b2 : any
|
||||
> : ^^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
>b2 : any
|
||||
> : ^^^
|
||||
|
||||
b2 = a2;
|
||||
>b2 = a2 : any
|
||||
> : ^^^
|
||||
>b2 : any
|
||||
> : ^^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
|
||||
a2 = b;
|
||||
>a2 = b : { foo: typeof b; }
|
||||
> : ^^^^^^^ ^^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
>b : { foo: typeof b; }
|
||||
> : ^^^^^^^ ^^^
|
||||
|
||||
@@ -426,6 +445,7 @@ module ObjectTypes {
|
||||
>a2 = t2 : T2
|
||||
> : ^^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
>t2 : T2
|
||||
> : ^^
|
||||
|
||||
@@ -433,6 +453,7 @@ module ObjectTypes {
|
||||
>a2 = t : T
|
||||
> : ^
|
||||
>a2 : any
|
||||
> : ^^^
|
||||
>t : T
|
||||
> : ^
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
assignmentCompatWithObjectMembers4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
|
||||
@@ -37,6 +38,7 @@ assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assi
|
||||
assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
|
||||
assignmentCompatWithObjectMembers4.ts(48,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
|
||||
@@ -51,10 +53,12 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
|
||||
Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembers4.ts (17 errors) ====
|
||||
==== assignmentCompatWithObjectMembers4.ts (19 errors) ====
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M
|
||||
|
||||
module OnlyDerived {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base { foo: string; }
|
||||
class Derived extends Base { bar: string; }
|
||||
class Derived2 extends Base { baz: string; }
|
||||
@@ -165,6 +169,8 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
|
||||
}
|
||||
|
||||
module WithBase {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base { foo: string; }
|
||||
class Derived extends Base { bar: string; }
|
||||
class Derived2 extends Base { baz: string; }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
|
||||
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'.
|
||||
@@ -14,6 +15,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I'
|
||||
Property 'foo' is private in type 'E' but not in type 'I'.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'.
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(56,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
|
||||
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
|
||||
assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
|
||||
@@ -48,10 +50,12 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
|
||||
Property 'foo' is private in type 'E' but not in type 'D'.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ====
|
||||
==== assignmentCompatWithObjectMembersAccessibility.ts (26 errors) ====
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
|
||||
module TargetIsPublic {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
class Base {
|
||||
public foo: string;
|
||||
@@ -129,6 +133,8 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
|
||||
}
|
||||
|
||||
module TargetIsPublic {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
class Base {
|
||||
private foo: string;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
assignmentCompatWithObjectMembersOptionality.ts(7,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersOptionality.ts(49,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C'.
|
||||
Property 'opt' is optional in type 'D' but required in type 'C'.
|
||||
assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C'.
|
||||
@@ -12,7 +14,7 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
|
||||
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembersOptionality.ts (6 errors) ====
|
||||
==== assignmentCompatWithObjectMembersOptionality.ts (8 errors) ====
|
||||
// Derived member is not optional but base member is, should be ok
|
||||
|
||||
class Base { foo: string; }
|
||||
@@ -20,6 +22,8 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
|
||||
class Derived2 extends Derived { baz: string; }
|
||||
|
||||
module TargetHasOptional {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
interface C {
|
||||
opt?: Base
|
||||
@@ -62,6 +66,8 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
|
||||
}
|
||||
|
||||
module SourceHasOptional {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
interface C {
|
||||
opt: Base
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(33,5): error TS2559: Type 'D' has no properties in common with type 'C'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(34,5): error TS2559: Type 'E' has no properties in common with type 'C'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(35,5): error TS2559: Type 'F' has no properties in common with type 'C'.
|
||||
@@ -7,6 +8,7 @@ assignmentCompatWithObjectMembersOptionality2.ts(38,5): error TS2559: Type 'F' h
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(39,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(50,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2741: Property 'opt' is missing in type 'D' but required in type 'C'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2741: Property 'opt' is missing in type 'E' but required in type 'C'.
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2741: Property 'opt' is missing in type 'F' but required in type 'C'.
|
||||
@@ -18,7 +20,7 @@ assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2741: Property '
|
||||
assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property 'opt' is missing in type 'F' but required in type '{ opt: Base; }'.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembersOptionality2.ts (18 errors) ====
|
||||
==== assignmentCompatWithObjectMembersOptionality2.ts (20 errors) ====
|
||||
// M is optional and S contains no property with the same name as M
|
||||
// N is optional and T contains no property with the same name as N
|
||||
|
||||
@@ -27,6 +29,8 @@ assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property '
|
||||
class Derived2 extends Derived { baz: string; }
|
||||
|
||||
module TargetHasOptional {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
interface C {
|
||||
opt?: Base
|
||||
@@ -87,6 +91,8 @@ assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property '
|
||||
}
|
||||
|
||||
module SourceHasOptional {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// targets
|
||||
interface C {
|
||||
opt: Base
|
||||
|
||||
+7
-1
@@ -1,3 +1,4 @@
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2741: Property ''1'' is missing in type 'T' but required in type 'S'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2741: Property ''1.'' is missing in type 'S' but required in type 'T'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S'.
|
||||
@@ -14,6 +15,7 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2741: Prop
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2741: Property ''1.0'' is missing in type '{ '1': string; }' but required in type '{ '1.0': string; }'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type '{ '1': string; }'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2741: Property ''1.0'' is missing in type 'T' but required in type '{ '1.0': string; }'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(45,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S2'.
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2741: Property ''1.'' is missing in type '{ 1: string; baz?: string; }' but required in type '{ '1.': string; bar?: string; }'.
|
||||
@@ -29,11 +31,13 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2741: Prop
|
||||
assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2741: Property ''1.0'' is missing in type 'T' but required in type '{ '1.0': string; }'.
|
||||
|
||||
|
||||
==== assignmentCompatWithObjectMembersStringNumericNames.ts (29 errors) ====
|
||||
==== assignmentCompatWithObjectMembersStringNumericNames.ts (31 errors) ====
|
||||
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
|
||||
// string named numeric properties work correctly, errors below unless otherwise noted
|
||||
|
||||
module JustStrings {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class S { '1': string; }
|
||||
class T { '1.': string; }
|
||||
var s: S;
|
||||
@@ -123,6 +127,8 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2741: Prop
|
||||
}
|
||||
|
||||
module NumbersAndStrings {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class S { '1': string; }
|
||||
class T { 1: string; }
|
||||
var s: S;
|
||||
|
||||
@@ -4,6 +4,7 @@ assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assign
|
||||
assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
'string' index signatures are incompatible.
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
assignmentCompatWithStringIndexer.ts(21,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
'string' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
@@ -28,7 +29,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
|
||||
==== assignmentCompatWithStringIndexer.ts (8 errors) ====
|
||||
==== assignmentCompatWithStringIndexer.ts (9 errors) ====
|
||||
// index signatures must be compatible in assignments
|
||||
|
||||
interface Base { foo: string; }
|
||||
@@ -59,6 +60,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
|
||||
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
module Generics {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class A<T extends Base> {
|
||||
[x: string]: T;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assig
|
||||
assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
'string' index signatures are incompatible.
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
assignmentCompatWithStringIndexer2.ts(21,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
'string' index signatures are incompatible.
|
||||
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
|
||||
@@ -28,7 +29,7 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not as
|
||||
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
|
||||
==== assignmentCompatWithStringIndexer2.ts (8 errors) ====
|
||||
==== assignmentCompatWithStringIndexer2.ts (9 errors) ====
|
||||
// index signatures must be compatible in assignments
|
||||
|
||||
interface Base { foo: string; }
|
||||
@@ -59,6 +60,8 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not as
|
||||
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
|
||||
|
||||
module Generics {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface A<T extends Base> {
|
||||
[x: string]: T;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
assignmentCompatability1.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability1.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatability1.ts (2 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa = {};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability11.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability11.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== assignmentCompatability11.ts (1 errors) ====
|
||||
==== assignmentCompatability11.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: 1};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability12.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability12.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== assignmentCompatability12.ts (1 errors) ====
|
||||
==== assignmentCompatability12.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: "1"};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability13.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability13.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
|
||||
|
||||
==== assignmentCompatability13.ts (1 errors) ====
|
||||
==== assignmentCompatability13.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: "1"};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability14.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability14.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== assignmentCompatability14.ts (1 errors) ====
|
||||
==== assignmentCompatability14.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: true};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability15.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability15.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== assignmentCompatability15.ts (1 errors) ====
|
||||
==== assignmentCompatability15.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: true};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability16.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability16.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'any[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability16.ts (1 errors) ====
|
||||
==== assignmentCompatability16.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: <any[]>[1]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability17.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability17.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'any[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability17.ts (1 errors) ====
|
||||
==== assignmentCompatability17.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: <any[]>[1]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability18.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability18.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'number[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability18.ts (1 errors) ====
|
||||
==== assignmentCompatability18.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: [1]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability19.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability19.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'number[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability19.ts (1 errors) ====
|
||||
==== assignmentCompatability19.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: [1]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
assignmentCompatability2.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability2.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatability2.ts (2 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability20.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability20.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'string[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability20.ts (1 errors) ====
|
||||
==== assignmentCompatability20.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: ["1"]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability21.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability21.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'string[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability21.ts (1 errors) ====
|
||||
==== assignmentCompatability21.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: ["1"]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability22.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability22.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'boolean[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability22.ts (1 errors) ====
|
||||
==== assignmentCompatability22.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: [true]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability23.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability23.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'boolean[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability23.ts (1 errors) ====
|
||||
==== assignmentCompatability23.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {two: [true]};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability24.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability24.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
|
||||
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'.
|
||||
|
||||
|
||||
==== assignmentCompatability24.ts (1 errors) ====
|
||||
==== assignmentCompatability24.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = function f<Tstring>(a: Tstring) { return a; };;
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability25.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability25.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number; }'.
|
||||
Types of property 'two' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== assignmentCompatability25.ts (1 errors) ====
|
||||
==== assignmentCompatability25.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{two:number;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability26.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability26.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== assignmentCompatability26.ts (1 errors) ====
|
||||
==== assignmentCompatability26.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:string;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability27.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability27.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string; }'.
|
||||
Property 'two' is optional in type 'interfaceWithPublicAndOptional<number, string>' but required in type '{ two: string; }'.
|
||||
|
||||
|
||||
==== assignmentCompatability27.ts (1 errors) ====
|
||||
==== assignmentCompatability27.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{two:string;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability28.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability28.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== assignmentCompatability28.ts (1 errors) ====
|
||||
==== assignmentCompatability28.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:boolean;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability29.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability29.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'any[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability29.ts (1 errors) ====
|
||||
==== assignmentCompatability29.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:any[];};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
assignmentCompatability3.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability3.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatability3.ts (2 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj = {one: 1};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
__test2__.__val__obj = __test1__.__val__obj4
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability30.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability30.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'number[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability30.ts (1 errors) ====
|
||||
==== assignmentCompatability30.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:number[];};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability31.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability31.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'string[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability31.ts (1 errors) ====
|
||||
==== assignmentCompatability31.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:string[];};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
assignmentCompatability32.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability32.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }'.
|
||||
Types of property 'one' are incompatible.
|
||||
Type 'number' is not assignable to type 'boolean[]'.
|
||||
|
||||
|
||||
==== assignmentCompatability32.ts (1 errors) ====
|
||||
==== assignmentCompatability32.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:boolean[];};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability33.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability33.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
|
||||
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'.
|
||||
|
||||
|
||||
==== assignmentCompatability33.ts (1 errors) ====
|
||||
==== assignmentCompatability33.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj: { <Tstring>(a: Tstring): Tstring; };
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability34.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability34.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
|
||||
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tnumber>(a: Tnumber): Tnumber'.
|
||||
|
||||
|
||||
==== assignmentCompatability34.ts (1 errors) ====
|
||||
==== assignmentCompatability34.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var obj: { <Tnumber>(a:Tnumber):Tnumber;};
|
||||
export var __val__obj = obj;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability35.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability35.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [index: number]: number; }'.
|
||||
Index signature for type 'number' is missing in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== assignmentCompatability35.ts (1 errors) ====
|
||||
==== assignmentCompatability35.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{[index:number]:number;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
assignmentCompatability36.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability36.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatability36.ts (2 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{[index:string]:any;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability37.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability37.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
|
||||
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tnumber>(param: Tnumber): any'.
|
||||
|
||||
|
||||
==== assignmentCompatability37.ts (1 errors) ====
|
||||
==== assignmentCompatability37.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{ new <Tnumber>(param: Tnumber); };;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
assignmentCompatability38.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability38.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
|
||||
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tstring>(param: Tstring): any'.
|
||||
|
||||
|
||||
==== assignmentCompatability38.ts (1 errors) ====
|
||||
==== assignmentCompatability38.ts (3 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{ new <Tstring>(param: Tstring); };;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
assignmentCompatability4.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentCompatability4.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== assignmentCompatability4.ts (2 errors) ====
|
||||
module __test1__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var aa:{one:number;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
@@ -3,6 +3,7 @@ assignmentLHSIsValue.ts(7,13): error TS2364: The left-hand side of an assignment
|
||||
assignmentLHSIsValue.ts(8,21): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
assignmentLHSIsValue.ts(11,18): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
assignmentLHSIsValue.ts(13,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
assignmentLHSIsValue.ts(16,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentLHSIsValue.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
|
||||
assignmentLHSIsValue.ts(19,1): error TS2629: Cannot assign to 'C' because it is a class.
|
||||
assignmentLHSIsValue.ts(22,1): error TS2628: Cannot assign to 'E' because it is an enum.
|
||||
@@ -39,7 +40,7 @@ assignmentLHSIsValue.ts(69,1): error TS2364: The left-hand side of an assignment
|
||||
assignmentLHSIsValue.ts(70,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
|
||||
|
||||
==== assignmentLHSIsValue.ts (39 errors) ====
|
||||
==== assignmentLHSIsValue.ts (40 errors) ====
|
||||
// expected error for all the LHS of assignments
|
||||
var value: any;
|
||||
|
||||
@@ -66,6 +67,8 @@ assignmentLHSIsValue.ts(70,1): error TS2364: The left-hand side of an assignment
|
||||
|
||||
// identifiers: module, class, enum, function
|
||||
module M { export var a; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
M = value;
|
||||
~
|
||||
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(7,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
|
||||
assignmentToParenthesizedIdentifiers.ts(18,2): error TS2631: Cannot assign to 'M' because it is a namespace.
|
||||
assignmentToParenthesizedIdentifiers.ts(20,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentToParenthesizedIdentifiers.ts(21,12): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
assignmentToParenthesizedIdentifiers.ts(25,5): error TS2631: Cannot assign to 'M3' because it is a namespace.
|
||||
assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
@@ -24,7 +27,7 @@ assignmentToParenthesizedIdentifiers.ts(69,1): error TS2629: Cannot assign to 'C
|
||||
assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C' because it is a class.
|
||||
|
||||
|
||||
==== assignmentToParenthesizedIdentifiers.ts (24 errors) ====
|
||||
==== assignmentToParenthesizedIdentifiers.ts (27 errors) ====
|
||||
var x: number;
|
||||
x = 3; // OK
|
||||
(x) = 3; // OK
|
||||
@@ -36,6 +39,8 @@ assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var y: number;
|
||||
}
|
||||
M.y = 3; // OK
|
||||
@@ -59,7 +64,11 @@ assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C
|
||||
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
|
||||
|
||||
module M2 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export module M3 {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var x: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
asyncAwaitIsolatedModules_es2017.ts(1,27): error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
asyncAwaitIsolatedModules_es2017.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwaitIsolatedModules_es2017.ts (1 errors) ====
|
||||
==== asyncAwaitIsolatedModules_es2017.ts (2 errors) ====
|
||||
import { MyPromise } from "missing";
|
||||
~~~~~~~~~
|
||||
!!! error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es2017.ts(1,27): error TS2792: Cannot find module 'mis
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
asyncAwaitIsolatedModules_es5.ts(1,27): error TS2307: Cannot find module 'missing' or its corresponding type declarations.
|
||||
asyncAwaitIsolatedModules_es5.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwaitIsolatedModules_es5.ts (1 errors) ====
|
||||
==== asyncAwaitIsolatedModules_es5.ts (2 errors) ====
|
||||
import { MyPromise } from "missing";
|
||||
~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'missing' or its corresponding type declarations.
|
||||
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es5.ts(1,27): error TS2307: Cannot find module 'missin
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
asyncAwaitIsolatedModules_es6.ts(1,27): error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
asyncAwaitIsolatedModules_es6.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwaitIsolatedModules_es6.ts (1 errors) ====
|
||||
==== asyncAwaitIsolatedModules_es6.ts (2 errors) ====
|
||||
import { MyPromise } from "missing";
|
||||
~~~~~~~~~
|
||||
!!! error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
|
||||
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es6.ts(1,27): error TS2792: Cannot find module 'missin
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
asyncAwait_es2017.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwait_es2017.ts (1 errors) ====
|
||||
type MyPromise<T> = Promise<T>;
|
||||
declare var MyPromise: typeof Promise;
|
||||
declare var p: Promise<number>;
|
||||
declare var mp: MyPromise<number>;
|
||||
|
||||
async function f0() { }
|
||||
async function f1(): Promise<void> { }
|
||||
async function f3(): MyPromise<void> { }
|
||||
|
||||
let f4 = async function() { }
|
||||
let f5 = async function(): Promise<void> { }
|
||||
let f6 = async function(): MyPromise<void> { }
|
||||
|
||||
let f7 = async () => { };
|
||||
let f8 = async (): Promise<void> => { };
|
||||
let f9 = async (): MyPromise<void> => { };
|
||||
let f10 = async () => p;
|
||||
let f11 = async () => mp;
|
||||
let f12 = async (): Promise<number> => mp;
|
||||
let f13 = async (): MyPromise<number> => p;
|
||||
|
||||
let o = {
|
||||
async m1() { },
|
||||
async m2(): Promise<void> { },
|
||||
async m3(): MyPromise<void> { }
|
||||
};
|
||||
|
||||
class C {
|
||||
async m1() { }
|
||||
async m2(): Promise<void> { }
|
||||
async m3(): MyPromise<void> { }
|
||||
static async m4() { }
|
||||
static async m5(): Promise<void> { }
|
||||
static async m6(): MyPromise<void> { }
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
|
||||
async function f14() {
|
||||
block: {
|
||||
await 1;
|
||||
break block;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
asyncAwait_es5.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwait_es5.ts (1 errors) ====
|
||||
type MyPromise<T> = Promise<T>;
|
||||
declare var MyPromise: typeof Promise;
|
||||
declare var p: Promise<number>;
|
||||
declare var mp: MyPromise<number>;
|
||||
|
||||
async function f0() { }
|
||||
async function f1(): Promise<void> { }
|
||||
async function f3(): MyPromise<void> { }
|
||||
|
||||
let f4 = async function() { }
|
||||
let f5 = async function(): Promise<void> { }
|
||||
let f6 = async function(): MyPromise<void> { }
|
||||
|
||||
let f7 = async () => { };
|
||||
let f8 = async (): Promise<void> => { };
|
||||
let f9 = async (): MyPromise<void> => { };
|
||||
let f10 = async () => p;
|
||||
let f11 = async () => mp;
|
||||
let f12 = async (): Promise<number> => mp;
|
||||
let f13 = async (): MyPromise<number> => p;
|
||||
|
||||
let o = {
|
||||
async m1() { },
|
||||
async m2(): Promise<void> { },
|
||||
async m3(): MyPromise<void> { }
|
||||
};
|
||||
|
||||
class C {
|
||||
async m1() { }
|
||||
async m2(): Promise<void> { }
|
||||
async m3(): MyPromise<void> { }
|
||||
static async m4() { }
|
||||
static async m5(): Promise<void> { }
|
||||
static async m6(): MyPromise<void> { }
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
|
||||
async function f14() {
|
||||
block: {
|
||||
await 1;
|
||||
break block;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
asyncAwait_es6.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== asyncAwait_es6.ts (1 errors) ====
|
||||
type MyPromise<T> = Promise<T>;
|
||||
declare var MyPromise: typeof Promise;
|
||||
declare var p: Promise<number>;
|
||||
declare var mp: MyPromise<number>;
|
||||
|
||||
async function f0() { }
|
||||
async function f1(): Promise<void> { }
|
||||
async function f3(): MyPromise<void> { }
|
||||
|
||||
let f4 = async function() { }
|
||||
let f5 = async function(): Promise<void> { }
|
||||
let f6 = async function(): MyPromise<void> { }
|
||||
|
||||
let f7 = async () => { };
|
||||
let f8 = async (): Promise<void> => { };
|
||||
let f9 = async (): MyPromise<void> => { };
|
||||
let f10 = async () => p;
|
||||
let f11 = async () => mp;
|
||||
let f12 = async (): Promise<number> => mp;
|
||||
let f13 = async (): MyPromise<number> => p;
|
||||
|
||||
let o = {
|
||||
async m1() { },
|
||||
async m2(): Promise<void> { },
|
||||
async m3(): MyPromise<void> { }
|
||||
};
|
||||
|
||||
class C {
|
||||
async m1() { }
|
||||
async m2(): Promise<void> { }
|
||||
async m3(): MyPromise<void> { }
|
||||
static async m4() { }
|
||||
static async m5(): Promise<void> { }
|
||||
static async m6(): MyPromise<void> { }
|
||||
}
|
||||
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export async function f1() { }
|
||||
}
|
||||
|
||||
async function f14() {
|
||||
block: {
|
||||
await 1;
|
||||
break block;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
express.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== express.d.ts (1 errors) ====
|
||||
declare module Express {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface Request { }
|
||||
export interface Response { }
|
||||
export interface Application { }
|
||||
}
|
||||
|
||||
declare module "express" {
|
||||
function e(): e.Express;
|
||||
namespace e {
|
||||
interface IRoute {
|
||||
all(...handler: RequestHandler[]): IRoute;
|
||||
}
|
||||
|
||||
interface IRouterMatcher<T> {
|
||||
(name: string|RegExp, ...handlers: RequestHandler[]): T;
|
||||
}
|
||||
|
||||
interface IRouter<T> extends RequestHandler {
|
||||
route(path: string): IRoute;
|
||||
}
|
||||
|
||||
export function Router(options?: any): Router;
|
||||
|
||||
export interface Router extends IRouter<Router> {}
|
||||
|
||||
interface Errback { (err: Error): void; }
|
||||
|
||||
interface Request extends Express.Request {
|
||||
|
||||
get (name: string): string;
|
||||
}
|
||||
|
||||
interface Response extends Express.Response {
|
||||
charset: string;
|
||||
}
|
||||
|
||||
interface ErrorRequestHandler {
|
||||
(err: any, req: Request, res: Response, next: Function): any;
|
||||
}
|
||||
|
||||
interface RequestHandler {
|
||||
(req: Request, res: Response, next: Function): any;
|
||||
}
|
||||
|
||||
interface Handler extends RequestHandler {}
|
||||
|
||||
interface RequestParamHandler {
|
||||
(req: Request, res: Response, next: Function, param: any): any;
|
||||
}
|
||||
|
||||
interface Application extends IRouter<Application>, Express.Application {
|
||||
routes: any;
|
||||
}
|
||||
|
||||
interface Express extends Application {
|
||||
createApplication(): Application;
|
||||
}
|
||||
|
||||
var static: any;
|
||||
}
|
||||
|
||||
export = e;
|
||||
}
|
||||
|
||||
==== augmentation.ts (0 errors) ====
|
||||
/// <reference path="express.d.ts"/>
|
||||
import * as e from "express";
|
||||
declare module "express" {
|
||||
interface Request {
|
||||
id: number;
|
||||
}
|
||||
}
|
||||
|
||||
==== consumer.ts (0 errors) ====
|
||||
import { Request } from "express";
|
||||
import "./augmentation";
|
||||
let x: Request;
|
||||
const y = x.id;
|
||||
@@ -49,6 +49,7 @@ declare module "express" {
|
||||
>Router : (options?: any) => Router
|
||||
> : ^ ^^^ ^^^^^
|
||||
>options : any
|
||||
> : ^^^
|
||||
|
||||
export interface Router extends IRouter<Router> {}
|
||||
|
||||
@@ -79,6 +80,7 @@ declare module "express" {
|
||||
interface ErrorRequestHandler {
|
||||
(err: any, req: Request, res: Response, next: Function): any;
|
||||
>err : any
|
||||
> : ^^^
|
||||
>req : Request
|
||||
> : ^^^^^^^
|
||||
>res : Response
|
||||
@@ -108,6 +110,7 @@ declare module "express" {
|
||||
>next : Function
|
||||
> : ^^^^^^^^
|
||||
>param : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
interface Application extends IRouter<Application>, Express.Application {
|
||||
@@ -116,6 +119,7 @@ declare module "express" {
|
||||
|
||||
routes: any;
|
||||
>routes : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
interface Express extends Application {
|
||||
@@ -126,6 +130,7 @@ declare module "express" {
|
||||
|
||||
var static: any;
|
||||
>static : any
|
||||
> : ^^^
|
||||
}
|
||||
|
||||
export = e;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
augmentedTypesClass3.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesClass3.ts(6,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesClass3.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== augmentedTypesClass3.ts (3 errors) ====
|
||||
// class then module
|
||||
class c5 { public foo() { } }
|
||||
module c5 { } // should be ok
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class c5a { public foo() { } }
|
||||
module c5a { var y = 2; } // should be ok
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class c5b { public foo() { } }
|
||||
module c5b { export var y = 2; } // should be ok
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
//// class then import
|
||||
class c5c { public foo() { } }
|
||||
//import c5c = require('');
|
||||
@@ -10,9 +10,13 @@ augmentedTypesFunction.ts(16,10): error TS2814: Function with bodies can only me
|
||||
augmentedTypesFunction.ts(17,7): error TS2813: Class declaration cannot implement overload list for 'y3a'.
|
||||
augmentedTypesFunction.ts(20,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
||||
augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
|
||||
augmentedTypesFunction.ts(25,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesFunction.ts(28,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesFunction.ts(31,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesFunction.ts(34,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== augmentedTypesFunction.ts (12 errors) ====
|
||||
==== augmentedTypesFunction.ts (16 errors) ====
|
||||
// function then var
|
||||
function y1() { } // error
|
||||
~~
|
||||
@@ -66,15 +70,23 @@ augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge
|
||||
// function then internal module
|
||||
function y5() { }
|
||||
module y5 { } // ok since module is not instantiated
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
function y5a() { }
|
||||
module y5a { var y = 2; } // should be an error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
function y5b() { }
|
||||
module y5b { export var y = 3; } // should be an error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
function y5c() { }
|
||||
module y5c { export interface I { foo(): void } } // should be an error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
// function then import, messes with other errors
|
||||
//function y6() { }
|
||||
|
||||
@@ -1,20 +1,53 @@
|
||||
augmentedTypesModules.ts(2,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(5,8): error TS2300: Duplicate identifier 'm1a'.
|
||||
augmentedTypesModules.ts(6,5): error TS2300: Duplicate identifier 'm1a'.
|
||||
augmentedTypesModules.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(8,8): error TS2300: Duplicate identifier 'm1b'.
|
||||
augmentedTypesModules.ts(9,5): error TS2300: Duplicate identifier 'm1b'.
|
||||
augmentedTypesModules.ts(11,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(16,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(16,8): error TS2300: Duplicate identifier 'm1d'.
|
||||
augmentedTypesModules.ts(19,5): error TS2300: Duplicate identifier 'm1d'.
|
||||
augmentedTypesModules.ts(22,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(25,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(25,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
augmentedTypesModules.ts(28,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(28,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
augmentedTypesModules.ts(33,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(35,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(39,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(42,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(45,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(48,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(51,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
augmentedTypesModules.ts(55,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(58,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(61,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(63,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(67,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(70,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(74,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(77,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(80,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(83,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(86,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(91,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(92,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
augmentedTypesModules.ts(95,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== augmentedTypesModules.ts (9 errors) ====
|
||||
==== augmentedTypesModules.ts (38 errors) ====
|
||||
// module then var
|
||||
module m1 { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
var m1 = 1; // Should be allowed
|
||||
|
||||
module m1a { var y = 2; } // error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1a'.
|
||||
var m1a = 1; // error
|
||||
@@ -22,6 +55,8 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be
|
||||
!!! error TS2300: Duplicate identifier 'm1a'.
|
||||
|
||||
module m1b { export var y = 2; } // error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1b'.
|
||||
var m1b = 1; // error
|
||||
@@ -29,11 +64,15 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be
|
||||
!!! error TS2300: Duplicate identifier 'm1b'.
|
||||
|
||||
module m1c {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface I { foo(): void; }
|
||||
}
|
||||
var m1c = 1; // Should be allowed
|
||||
|
||||
module m1d { // error
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1d'.
|
||||
export class I { foo() { } }
|
||||
@@ -44,14 +83,20 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be
|
||||
|
||||
// module then function
|
||||
module m2 { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
function m2() { }; // ok since the module is not instantiated
|
||||
|
||||
module m2a { var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
function m2a() { }; // error since the module is instantiated
|
||||
|
||||
module m2b { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
function m2b() { }; // error since the module is instantiated
|
||||
@@ -59,69 +104,111 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be
|
||||
// should be errors to have function first
|
||||
function m2c() { };
|
||||
module m2c { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
module m2d { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare function m2d(): void;
|
||||
|
||||
declare function m2e(): void;
|
||||
module m2e { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
function m2f() { };
|
||||
module m2f { export interface I { foo(): void } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
function m2g() { };
|
||||
module m2g { export class C { foo() { } } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
// module then class
|
||||
module m3 { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class m3 { } // ok since the module is not instantiated
|
||||
|
||||
module m3a { var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
~~~
|
||||
!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
|
||||
class m3a { foo() { } } // error, class isn't ambient or declared before the module
|
||||
|
||||
class m3b { foo() { } }
|
||||
module m3b { var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
class m3c { foo() { } }
|
||||
module m3c { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
declare class m3d { foo(): void }
|
||||
module m3d { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
module m3e { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
declare class m3e { foo(): void }
|
||||
|
||||
declare class m3f { foo(): void }
|
||||
module m3f { export interface I { foo(): void } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
declare class m3g { foo(): void }
|
||||
module m3g { export class C { foo() { } } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
// module then enum
|
||||
// should be errors
|
||||
module m4 { }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum m4 { }
|
||||
|
||||
module m4a { var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum m4a { One }
|
||||
|
||||
module m4b { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum m4b { One }
|
||||
|
||||
module m4c { interface I { foo(): void } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum m4c { One }
|
||||
|
||||
module m4d { class C { foo() { } } }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
enum m4d { One }
|
||||
|
||||
//// module then module
|
||||
|
||||
module m5 { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
module m5 { export interface I { foo(): void } } // should already be reasonably well covered
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
// module then import
|
||||
module m6 { export var y = 2; }
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
//import m6 = require('');
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
binopAssignmentShouldHaveType.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== binopAssignmentShouldHaveType.ts (1 errors) ====
|
||||
declare var console;
|
||||
"use strict";
|
||||
module Test {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export class Bug {
|
||||
getName():string {
|
||||
return "name";
|
||||
}
|
||||
bug() {
|
||||
var name:string= null;
|
||||
if ((name= this.getName()).length > 0) {
|
||||
console.log(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
=== binopAssignmentShouldHaveType.ts ===
|
||||
declare var console;
|
||||
>console : any
|
||||
> : ^^^
|
||||
|
||||
"use strict";
|
||||
>"use strict" : "use strict"
|
||||
@@ -58,7 +59,9 @@ module Test {
|
||||
|
||||
console.log(name);
|
||||
>console.log(name) : any
|
||||
> : ^^^
|
||||
>console.log : any
|
||||
> : ^^^
|
||||
>console : any
|
||||
> : ^^^
|
||||
>log : any
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
bitwiseNotOperatorWithAnyOtherType.ts(20,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
bitwiseNotOperatorWithAnyOtherType.ts(34,24): error TS18050: The value 'undefined' cannot be used here.
|
||||
bitwiseNotOperatorWithAnyOtherType.ts(35,24): error TS18050: The value 'null' cannot be used here.
|
||||
bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'.
|
||||
@@ -5,7 +6,7 @@ bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot
|
||||
bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
|
||||
|
||||
==== bitwiseNotOperatorWithAnyOtherType.ts (5 errors) ====
|
||||
==== bitwiseNotOperatorWithAnyOtherType.ts (6 errors) ====
|
||||
// ~ operator on any type
|
||||
|
||||
var ANY: any;
|
||||
@@ -26,6 +27,8 @@ bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot
|
||||
}
|
||||
}
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var n: any;
|
||||
}
|
||||
var objA = new A();
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
bitwiseNotOperatorWithNumberType.ts(11,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== bitwiseNotOperatorWithNumberType.ts (1 errors) ====
|
||||
// ~ operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
function foo(): number { return 1; }
|
||||
|
||||
class A {
|
||||
public a: number;
|
||||
static foo() { return 1; }
|
||||
}
|
||||
module M {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export var n: number;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// number type var
|
||||
var ResultIsNumber1 = ~NUMBER;
|
||||
var ResultIsNumber2 = ~NUMBER1;
|
||||
|
||||
// number type literal
|
||||
var ResultIsNumber3 = ~1;
|
||||
var ResultIsNumber4 = ~{ x: 1, y: 2};
|
||||
var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } };
|
||||
|
||||
// number type expressions
|
||||
var ResultIsNumber6 = ~objA.a;
|
||||
var ResultIsNumber7 = ~M.n;
|
||||
var ResultIsNumber8 = ~NUMBER1[0];
|
||||
var ResultIsNumber9 = ~foo();
|
||||
var ResultIsNumber10 = ~A.foo();
|
||||
var ResultIsNumber11 = ~(NUMBER + NUMBER);
|
||||
|
||||
// multiple ~ operators
|
||||
var ResultIsNumber12 = ~~NUMBER;
|
||||
var ResultIsNumber13 = ~~~(NUMBER + NUMBER);
|
||||
|
||||
// miss assignment operators
|
||||
~NUMBER;
|
||||
~NUMBER1;
|
||||
~foo();
|
||||
~objA.a;
|
||||
~M.n;
|
||||
~objA.a, M.n;
|
||||
@@ -5,9 +5,10 @@ bluebirdStaticThis.ts(57,109): error TS2694: Namespace '"bluebirdStaticThis".Pro
|
||||
bluebirdStaticThis.ts(58,91): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'.
|
||||
bluebirdStaticThis.ts(59,91): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'.
|
||||
bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'.
|
||||
bluebirdStaticThis.ts(111,16): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
|
||||
|
||||
==== bluebirdStaticThis.ts (6 errors) ====
|
||||
==== bluebirdStaticThis.ts (7 errors) ====
|
||||
// This version is reduced from the full d.ts by removing almost all the tests
|
||||
// and all the comments.
|
||||
// Then it adds explicit `this` arguments to the static members.
|
||||
@@ -133,6 +134,8 @@ bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"bluebirdStaticThis".Prom
|
||||
}
|
||||
|
||||
export declare module Promise {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
export interface Thenable<R> {
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
callSignatureAssignabilityInInheritance.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
callSignatureAssignabilityInInheritance.ts(34,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a(...)' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
@@ -7,8 +9,10 @@ callSignatureAssignabilityInInheritance.ts(63,15): error TS2430: Interface 'I3'
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== callSignatureAssignabilityInInheritance.ts (2 errors) ====
|
||||
==== callSignatureAssignabilityInInheritance.ts (4 errors) ====
|
||||
module CallSignature {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface Base { // T
|
||||
// M's
|
||||
(x: number): void;
|
||||
@@ -42,6 +46,8 @@ callSignatureAssignabilityInInheritance.ts(63,15): error TS2430: Interface 'I3'
|
||||
}
|
||||
|
||||
module MemberWithCallSignature {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
interface Base { // T
|
||||
// M's
|
||||
a: (x: number) => void;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
callSignatureAssignabilityInInheritance3.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
callSignatureAssignabilityInInheritance3.ts(10,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
|
||||
@@ -26,6 +28,7 @@ callSignatureAssignabilityInInheritance3.ts(80,19): error TS2430: Interface 'I7'
|
||||
Type '{ a: string; b: number; }' is not assignable to type '{ a: Base; b: Base; }'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'string' is not assignable to type 'Base'.
|
||||
callSignatureAssignabilityInInheritance3.ts(94,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
callSignatureAssignabilityInInheritance3.ts(100,19): error TS2430: Interface 'I6' incorrectly extends interface 'B'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
@@ -37,17 +40,21 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== callSignatureAssignabilityInInheritance3.ts (6 errors) ====
|
||||
==== callSignatureAssignabilityInInheritance3.ts (9 errors) ====
|
||||
// checking subtype relations for function types as it relates to contextual signature instantiation
|
||||
// error cases
|
||||
|
||||
module Errors {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
class Base { foo: string; }
|
||||
class Derived extends Base { bar: string; }
|
||||
class Derived2 extends Derived { baz: string; }
|
||||
class OtherDerived extends Base { bing: string; }
|
||||
|
||||
module WithNonGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// base type with non-generic call signatures
|
||||
interface A {
|
||||
a2: (x: number) => string[];
|
||||
@@ -164,6 +171,8 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7
|
||||
}
|
||||
|
||||
module WithGenericSignaturesInBaseType {
|
||||
~~~~~~
|
||||
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
|
||||
// base type has generic call signature
|
||||
interface B {
|
||||
a2: <T>(x: T) => T[];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user