mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 02:15:10 -05:00
New Test and Baseline
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'C1'.
|
||||
Property 'x' is missing in type 'C2'.
|
||||
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(12,7): error TS2420: Class 'C3' incorrectly implements interface 'C1'.
|
||||
Property 'y' is missing in type 'C3'.
|
||||
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(16,7): error TS2420: Class 'C4' incorrectly implements interface 'C1'.
|
||||
Property 'x' is missing in type 'C4'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts (3 errors) ====
|
||||
declare class C1 {
|
||||
x : number;
|
||||
}
|
||||
|
||||
interface C1 {
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C2 implements C1 { // error -- missing x
|
||||
~~
|
||||
!!! error TS2420: Class 'C2' incorrectly implements interface 'C1'.
|
||||
!!! error TS2420: Property 'x' is missing in type 'C2'.
|
||||
}
|
||||
|
||||
class C3 implements C1 { // error -- missing y
|
||||
~~
|
||||
!!! error TS2420: Class 'C3' incorrectly implements interface 'C1'.
|
||||
!!! error TS2420: Property 'y' is missing in type 'C3'.
|
||||
x : number;
|
||||
}
|
||||
|
||||
class C4 implements C1 { // error -- missing x
|
||||
~~
|
||||
!!! error TS2420: Class 'C4' incorrectly implements interface 'C1'.
|
||||
!!! error TS2420: Property 'x' is missing in type 'C4'.
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C5 implements C1 { // okay
|
||||
x : number;
|
||||
y : number;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//// [classImplementsMergedClassInterface.ts]
|
||||
declare class C1 {
|
||||
x : number;
|
||||
}
|
||||
|
||||
interface C1 {
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C2 implements C1 { // error -- missing x
|
||||
}
|
||||
|
||||
class C3 implements C1 { // error -- missing y
|
||||
x : number;
|
||||
}
|
||||
|
||||
class C4 implements C1 { // error -- missing x
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C5 implements C1 { // okay
|
||||
x : number;
|
||||
y : number;
|
||||
}
|
||||
|
||||
//// [classImplementsMergedClassInterface.js]
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
}
|
||||
return C2;
|
||||
})();
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
return C3;
|
||||
})();
|
||||
var C4 = (function () {
|
||||
function C4() {
|
||||
}
|
||||
return C4;
|
||||
})();
|
||||
var C5 = (function () {
|
||||
function C5() {
|
||||
}
|
||||
return C5;
|
||||
})();
|
||||
@@ -0,0 +1,23 @@
|
||||
declare class C1 {
|
||||
x : number;
|
||||
}
|
||||
|
||||
interface C1 {
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C2 implements C1 { // error -- missing x
|
||||
}
|
||||
|
||||
class C3 implements C1 { // error -- missing y
|
||||
x : number;
|
||||
}
|
||||
|
||||
class C4 implements C1 { // error -- missing x
|
||||
y : number;
|
||||
}
|
||||
|
||||
class C5 implements C1 { // okay
|
||||
x : number;
|
||||
y : number;
|
||||
}
|
||||
Reference in New Issue
Block a user