Accepted baselines.
This commit is contained in:
parent
5ab5cfd2fd
commit
b0576cdf8e
10 changed files with 46 additions and 30 deletions
|
@ -1,4 +1,5 @@
|
||||||
//// [contextuallyTypeCommaOperator01.ts]
|
//// [contextuallyTypeCommaOperator01.ts]
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
|
|
||||||
x = (100, a => a);
|
x = (100, a => a);
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3))
|
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 0, 8))
|
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 1, 8))
|
||||||
|
|
||||||
x = (100, a => a);
|
x = (100, a => a);
|
||||||
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3))
|
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9))
|
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9))
|
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9))
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
>x : (a: string) => string
|
>x : (a: string) => string
|
||||||
>a : string
|
>a : string
|
||||||
|
|
||||||
x = (100, a => a);
|
x = (100, a => a);
|
||||||
>x = (100, a => a) : (a: any) => any
|
>x = (100, a => a) : (a: string) => string
|
||||||
>x : (a: string) => string
|
>x : (a: string) => string
|
||||||
>(100, a => a) : (a: any) => any
|
>(100, a => a) : (a: string) => string
|
||||||
>100, a => a : (a: any) => any
|
>100, a => a : (a: string) => string
|
||||||
>100 : number
|
>100 : number
|
||||||
>a => a : (a: any) => any
|
>a => a : (a: string) => string
|
||||||
>a : any
|
>a : string
|
||||||
>a : any
|
>a : string
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(3,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(4,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'.
|
||||||
Type 'number' is not assignable to type 'string'.
|
Type 'number' is not assignable to type 'string'.
|
||||||
|
tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(5,11): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||||
|
|
||||||
|
|
||||||
==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (1 errors) ====
|
==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (2 errors) ====
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
|
|
||||||
x = (100, a => {
|
x = (100, a => {
|
||||||
~
|
~
|
||||||
!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'.
|
||||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||||
const b: number = a;
|
const b: number = a;
|
||||||
|
~
|
||||||
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||||
return b;
|
return b;
|
||||||
});
|
});
|
|
@ -1,4 +1,5 @@
|
||||||
//// [contextuallyTypeCommaOperator02.ts]
|
//// [contextuallyTypeCommaOperator02.ts]
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
|
|
||||||
x = (100, a => {
|
x = (100, a => {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//// [contextuallyTypeLogicalAnd01.ts]
|
//// [contextuallyTypeLogicalAnd01.ts]
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
let y = true;
|
let y = true;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3))
|
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 0, 8))
|
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 1, 8))
|
||||||
|
|
||||||
let y = true;
|
let y = true;
|
||||||
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3))
|
||||||
|
|
||||||
x = y && (a => a);
|
x = y && (a => a);
|
||||||
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3))
|
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
||||||
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10))
|
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10))
|
||||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10))
|
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10))
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
>x : (a: string) => string
|
>x : (a: string) => string
|
||||||
>a : string
|
>a : string
|
||||||
|
@ -8,12 +9,12 @@ let y = true;
|
||||||
>true : boolean
|
>true : boolean
|
||||||
|
|
||||||
x = y && (a => a);
|
x = y && (a => a);
|
||||||
>x = y && (a => a) : (a: any) => any
|
>x = y && (a => a) : (a: string) => string
|
||||||
>x : (a: string) => string
|
>x : (a: string) => string
|
||||||
>y && (a => a) : (a: any) => any
|
>y && (a => a) : (a: string) => string
|
||||||
>y : boolean
|
>y : boolean
|
||||||
>(a => a) : (a: any) => any
|
>(a => a) : (a: string) => string
|
||||||
>a => a : (a: any) => any
|
>a => a : (a: string) => string
|
||||||
>a : any
|
>a : string
|
||||||
>a : any
|
>a : string
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(4,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(5,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'.
|
||||||
Type 'number' is not assignable to type 'string'.
|
Type 'number' is not assignable to type 'string'.
|
||||||
|
tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(6,11): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||||
|
|
||||||
|
|
||||||
==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (1 errors) ====
|
==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (2 errors) ====
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
let y = true;
|
let y = true;
|
||||||
|
|
||||||
x = y && (a => {
|
x = y && (a => {
|
||||||
~
|
~
|
||||||
!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'.
|
||||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||||
const b: number = a;
|
const b: number = a;
|
||||||
|
~
|
||||||
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||||
return b;
|
return b;
|
||||||
});
|
});
|
|
@ -1,4 +1,5 @@
|
||||||
//// [contextuallyTypeLogicalAnd02.ts]
|
//// [contextuallyTypeLogicalAnd02.ts]
|
||||||
|
|
||||||
let x: (a: string) => string;
|
let x: (a: string) => string;
|
||||||
let y = true;
|
let y = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue