Skip to content

Commit d15926d

Browse files
committed
Add test
1 parent 7d5f5fd commit d15926d

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [independentPropertyVariance.ts]
2+
// Verify that properties can vary idependently in comparable relationship
3+
4+
declare const x: { a: 1, b: string };
5+
declare const y: { a: number, b: 'a' };
6+
7+
x === y;
8+
9+
10+
//// [independentPropertyVariance.js]
11+
"use strict";
12+
// Verify that properties can vary idependently in comparable relationship
13+
x === y;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== tests/cases/conformance/types/typeRelationships/comparable/independentPropertyVariance.ts ===
2+
// Verify that properties can vary idependently in comparable relationship
3+
4+
declare const x: { a: 1, b: string };
5+
>x : Symbol(x, Decl(independentPropertyVariance.ts, 2, 13))
6+
>a : Symbol(a, Decl(independentPropertyVariance.ts, 2, 18))
7+
>b : Symbol(b, Decl(independentPropertyVariance.ts, 2, 24))
8+
9+
declare const y: { a: number, b: 'a' };
10+
>y : Symbol(y, Decl(independentPropertyVariance.ts, 3, 13))
11+
>a : Symbol(a, Decl(independentPropertyVariance.ts, 3, 18))
12+
>b : Symbol(b, Decl(independentPropertyVariance.ts, 3, 29))
13+
14+
x === y;
15+
>x : Symbol(x, Decl(independentPropertyVariance.ts, 2, 13))
16+
>y : Symbol(y, Decl(independentPropertyVariance.ts, 3, 13))
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== tests/cases/conformance/types/typeRelationships/comparable/independentPropertyVariance.ts ===
2+
// Verify that properties can vary idependently in comparable relationship
3+
4+
declare const x: { a: 1, b: string };
5+
>x : { a: 1; b: string; }
6+
>a : 1
7+
>b : string
8+
9+
declare const y: { a: number, b: 'a' };
10+
>y : { a: number; b: "a"; }
11+
>a : number
12+
>b : "a"
13+
14+
x === y;
15+
>x === y : boolean
16+
>x : { a: 1; b: string; }
17+
>y : { a: number; b: "a"; }
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @strict: true
2+
3+
// Verify that properties can vary idependently in comparable relationship
4+
5+
declare const x: { a: 1, b: string };
6+
declare const y: { a: number, b: 'a' };
7+
8+
x === y;

0 commit comments

Comments
 (0)