Skip to content

Commit 3a3479d

Browse files
author
Arthur Ozga
committed
New Test and Baseline
1 parent 5ef426c commit 3a3479d

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'C1'.
2+
Property 'x' is missing in type 'C2'.
3+
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(12,7): error TS2420: Class 'C3' incorrectly implements interface 'C1'.
4+
Property 'y' is missing in type 'C3'.
5+
tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts(16,7): error TS2420: Class 'C4' incorrectly implements interface 'C1'.
6+
Property 'x' is missing in type 'C4'.
7+
8+
9+
==== tests/cases/conformance/classes/classDeclarations/classImplementsMergedClassInterface.ts (3 errors) ====
10+
declare class C1 {
11+
x : number;
12+
}
13+
14+
interface C1 {
15+
y : number;
16+
}
17+
18+
class C2 implements C1 { // error -- missing x
19+
~~
20+
!!! error TS2420: Class 'C2' incorrectly implements interface 'C1'.
21+
!!! error TS2420: Property 'x' is missing in type 'C2'.
22+
}
23+
24+
class C3 implements C1 { // error -- missing y
25+
~~
26+
!!! error TS2420: Class 'C3' incorrectly implements interface 'C1'.
27+
!!! error TS2420: Property 'y' is missing in type 'C3'.
28+
x : number;
29+
}
30+
31+
class C4 implements C1 { // error -- missing x
32+
~~
33+
!!! error TS2420: Class 'C4' incorrectly implements interface 'C1'.
34+
!!! error TS2420: Property 'x' is missing in type 'C4'.
35+
y : number;
36+
}
37+
38+
class C5 implements C1 { // okay
39+
x : number;
40+
y : number;
41+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//// [classImplementsMergedClassInterface.ts]
2+
declare class C1 {
3+
x : number;
4+
}
5+
6+
interface C1 {
7+
y : number;
8+
}
9+
10+
class C2 implements C1 { // error -- missing x
11+
}
12+
13+
class C3 implements C1 { // error -- missing y
14+
x : number;
15+
}
16+
17+
class C4 implements C1 { // error -- missing x
18+
y : number;
19+
}
20+
21+
class C5 implements C1 { // okay
22+
x : number;
23+
y : number;
24+
}
25+
26+
//// [classImplementsMergedClassInterface.js]
27+
var C2 = (function () {
28+
function C2() {
29+
}
30+
return C2;
31+
})();
32+
var C3 = (function () {
33+
function C3() {
34+
}
35+
return C3;
36+
})();
37+
var C4 = (function () {
38+
function C4() {
39+
}
40+
return C4;
41+
})();
42+
var C5 = (function () {
43+
function C5() {
44+
}
45+
return C5;
46+
})();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
declare class C1 {
2+
x : number;
3+
}
4+
5+
interface C1 {
6+
y : number;
7+
}
8+
9+
class C2 implements C1 { // error -- missing x
10+
}
11+
12+
class C3 implements C1 { // error -- missing y
13+
x : number;
14+
}
15+
16+
class C4 implements C1 { // error -- missing x
17+
y : number;
18+
}
19+
20+
class C5 implements C1 { // okay
21+
x : number;
22+
y : number;
23+
}

0 commit comments

Comments
 (0)