Skip to content

Commit 69affb7

Browse files
Accepted baselines.
1 parent 6a244b9 commit 69affb7

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
tests/cases/compiler/errorMessageOnIntersectionsWithDiscriminants01.ts(8,1): error TS2322: Type 'A' is not assignable to type 'B'.
2+
Type '{ test: true; } & { foo: 1; }' is not assignable to type 'B'.
3+
Type '{ test: true; } & { foo: 1; }' is not assignable to type '{ test: false; } & { bar: 1; }'.
4+
Type '{ test: true; } & { foo: 1; }' is not assignable to type '{ test: false; }'.
5+
Types of property 'test' are incompatible.
6+
Type 'true' is not assignable to type 'false'.
7+
8+
9+
==== tests/cases/compiler/errorMessageOnIntersectionsWithDiscriminants01.ts (1 errors) ====
10+
export type Common = { test: true } | { test: false };
11+
export type A = Common & { foo: 1 };
12+
export type B = Common & { bar: 1 };
13+
14+
declare const a: A;
15+
declare let b: B;
16+
17+
b = a;
18+
~
19+
!!! error TS2322: Type 'A' is not assignable to type 'B'.
20+
!!! error TS2322: Type '{ test: true; } & { foo: 1; }' is not assignable to type 'B'.
21+
!!! error TS2322: Type '{ test: true; } & { foo: 1; }' is not assignable to type '{ test: false; } & { bar: 1; }'.
22+
!!! error TS2322: Type '{ test: true; } & { foo: 1; }' is not assignable to type '{ test: false; }'.
23+
!!! error TS2322: Types of property 'test' are incompatible.
24+
!!! error TS2322: Type 'true' is not assignable to type 'false'.
25+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=== tests/cases/compiler/errorMessageOnIntersectionsWithDiscriminants01.ts ===
2+
export type Common = { test: true } | { test: false };
3+
>Common : Symbol(Common, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 0))
4+
>test : Symbol(test, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 22))
5+
>test : Symbol(test, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 39))
6+
7+
export type A = Common & { foo: 1 };
8+
>A : Symbol(A, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 54))
9+
>Common : Symbol(Common, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 0))
10+
>foo : Symbol(foo, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 1, 26))
11+
12+
export type B = Common & { bar: 1 };
13+
>B : Symbol(B, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 1, 36))
14+
>Common : Symbol(Common, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 0))
15+
>bar : Symbol(bar, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 2, 26))
16+
17+
declare const a: A;
18+
>a : Symbol(a, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 4, 13))
19+
>A : Symbol(A, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 0, 54))
20+
21+
declare let b: B;
22+
>b : Symbol(b, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 5, 11))
23+
>B : Symbol(B, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 1, 36))
24+
25+
b = a;
26+
>b : Symbol(b, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 5, 11))
27+
>a : Symbol(a, Decl(errorMessageOnIntersectionsWithDiscriminants01.ts, 4, 13))
28+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=== tests/cases/compiler/errorMessageOnIntersectionsWithDiscriminants01.ts ===
2+
export type Common = { test: true } | { test: false };
3+
>Common : Common
4+
>test : true
5+
>true : true
6+
>test : false
7+
>false : false
8+
9+
export type A = Common & { foo: 1 };
10+
>A : A
11+
>foo : 1
12+
13+
export type B = Common & { bar: 1 };
14+
>B : B
15+
>bar : 1
16+
17+
declare const a: A;
18+
>a : A
19+
20+
declare let b: B;
21+
>b : B
22+
23+
b = a;
24+
>b = a : A
25+
>b : B
26+
>a : A
27+

0 commit comments

Comments
 (0)