Added tests.
This commit is contained in:
parent
804e8b9abf
commit
eb1a70cd16
2 changed files with 46 additions and 0 deletions
24
tests/cases/compiler/errorMessagesIntersectionTypes03.ts
Normal file
24
tests/cases/compiler/errorMessagesIntersectionTypes03.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
interface A {
|
||||
a;
|
||||
}
|
||||
|
||||
interface B {
|
||||
b;
|
||||
}
|
||||
|
||||
function f<T, U extends A, V extends U>(): void {
|
||||
let t: T;
|
||||
let u: U;
|
||||
let v: V;
|
||||
|
||||
let a_and_b: A & B;
|
||||
let t_and_b: T & B;
|
||||
|
||||
t = a_and_b;
|
||||
u = a_and_b;
|
||||
v = a_and_b;
|
||||
|
||||
t = t_and_b;
|
||||
u = t_and_b;
|
||||
v = t_and_b;
|
||||
}
|
22
tests/cases/compiler/errorMessagesIntersectionTypes04.ts
Normal file
22
tests/cases/compiler/errorMessagesIntersectionTypes04.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
interface A {
|
||||
a;
|
||||
}
|
||||
|
||||
interface B {
|
||||
b;
|
||||
}
|
||||
|
||||
function f<T, U extends A, V extends U>(): void {
|
||||
let num: number;
|
||||
let bool: boolean;
|
||||
let str: string;
|
||||
|
||||
let a_and_b: A & B;
|
||||
let num_and_bool: number & boolean;
|
||||
|
||||
num = a_and_b;
|
||||
bool = a_and_b;
|
||||
str = a_and_b;
|
||||
|
||||
str = num_and_bool;
|
||||
}
|
Loading…
Reference in a new issue