mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 21:07:52 -05:00
Updated tests
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// @declaration: true
|
||||
|
||||
// @Filename: file1.ts
|
||||
interface I { }
|
||||
class C1 { }
|
||||
class C2 { }
|
||||
function f() { }
|
||||
var v = 3;
|
||||
|
||||
class Foo {
|
||||
static x: number;
|
||||
}
|
||||
|
||||
module N {
|
||||
export module F {
|
||||
var t;
|
||||
}
|
||||
}
|
||||
|
||||
// @Filename: file2.ts
|
||||
class I { } // error -- cannot merge interface with non-ambient class
|
||||
interface C1 { } // error -- cannot merge interface with non-ambient class
|
||||
function C2() { } // error -- cannot merge function with non-ambient class
|
||||
class f { } // error -- cannot merge function with non-ambient class
|
||||
var v = 3;
|
||||
|
||||
module Foo {
|
||||
export var x: number; // error for redeclaring var in a different parent
|
||||
}
|
||||
|
||||
declare module N {
|
||||
export function F(); // no error because function is ambient
|
||||
}
|
||||
25
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMerge.d.ts
vendored
Normal file
25
tests/cases/conformance/classes/classDeclarations/classAndInterfaceMerge.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
interface C { }
|
||||
|
||||
declare class C { }
|
||||
|
||||
interface C { }
|
||||
|
||||
interface C { }
|
||||
|
||||
declare module M {
|
||||
|
||||
interface C1 { }
|
||||
|
||||
class C1 { }
|
||||
|
||||
interface C1 { }
|
||||
|
||||
interface C1 { }
|
||||
|
||||
export class C2 { }
|
||||
}
|
||||
|
||||
declare module M {
|
||||
export interface C2 { }
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
// @Filename: file1.ts
|
||||
|
||||
declare class C1 {}
|
||||
|
||||
declare class C1 {}
|
||||
@@ -6,4 +9,12 @@ declare class C2 {}
|
||||
|
||||
interface C2 {}
|
||||
|
||||
declare class C2 {}
|
||||
declare class C2 {}
|
||||
|
||||
// @Filename: file2.ts
|
||||
|
||||
declare class C3 { }
|
||||
|
||||
// @Filename: file3.ts
|
||||
|
||||
declare class C3 { }
|
||||
@@ -1,11 +1,54 @@
|
||||
declare class C1 {}
|
||||
// @declaration: true
|
||||
|
||||
interface C1 {}
|
||||
// @Filename: file1.ts
|
||||
|
||||
interface C2 {}
|
||||
declare class C1 { }
|
||||
|
||||
declare class C2 {}
|
||||
interface C1 { }
|
||||
|
||||
interface C2 {}
|
||||
interface C2 { }
|
||||
|
||||
interface C2 {}
|
||||
declare class C2 { }
|
||||
|
||||
class C3 { } // error -- cannot merge non-ambient class and interface
|
||||
|
||||
interface C3 { } // error -- cannot merge non-ambient class and interface
|
||||
|
||||
interface C4 { } // error -- cannot merge non-ambient class and interface
|
||||
|
||||
class C4 { } // error -- cannot merge non-ambient class and interface
|
||||
|
||||
interface C5 {
|
||||
x1: number;
|
||||
}
|
||||
|
||||
declare class C5 {
|
||||
x2: number;
|
||||
}
|
||||
|
||||
interface C5 {
|
||||
x3: number;
|
||||
}
|
||||
|
||||
interface C5 {
|
||||
x4: number;
|
||||
}
|
||||
|
||||
// checks if properties actually were merged
|
||||
var c5 : C5;
|
||||
c5.x1;
|
||||
c5.x2;
|
||||
c5.x3;
|
||||
c5.x4;
|
||||
|
||||
// @Filename: file2.ts
|
||||
|
||||
declare class C6 { }
|
||||
|
||||
interface C7 { }
|
||||
|
||||
// @Filename: file3.ts
|
||||
|
||||
interface C6 { }
|
||||
|
||||
declare class C7 { }
|
||||
Reference in New Issue
Block a user