Accepted baselines.
This commit is contained in:
parent
24a108936f
commit
4484ca062e
|
@ -0,0 +1,8 @@
|
|||
//// [contextuallyTypeCommaOperator01.ts]
|
||||
let x: (a: string) => string;
|
||||
|
||||
x = (100, a => a);
|
||||
|
||||
//// [contextuallyTypeCommaOperator01.js]
|
||||
var x;
|
||||
x = (100, function (a) { return a; });
|
|
@ -0,0 +1,10 @@
|
|||
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
||||
let x: (a: string) => string;
|
||||
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3))
|
||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 0, 8))
|
||||
|
||||
x = (100, a => a);
|
||||
>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3))
|
||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9))
|
||||
>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9))
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
=== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts ===
|
||||
let x: (a: string) => string;
|
||||
>x : (a: string) => string
|
||||
>a : string
|
||||
|
||||
x = (100, a => a);
|
||||
>x = (100, a => a) : (a: any) => any
|
||||
>x : (a: string) => string
|
||||
>(100, a => a) : (a: any) => any
|
||||
>100, a => a : (a: any) => any
|
||||
>100 : number
|
||||
>a => a : (a: any) => any
|
||||
>a : any
|
||||
>a : any
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(3,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (1 errors) ====
|
||||
let x: (a: string) => string;
|
||||
|
||||
x = (100, a => {
|
||||
~
|
||||
!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
const b: number = a;
|
||||
return b;
|
||||
});
|
14
tests/baselines/reference/contextuallyTypeCommaOperator02.js
Normal file
14
tests/baselines/reference/contextuallyTypeCommaOperator02.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
//// [contextuallyTypeCommaOperator02.ts]
|
||||
let x: (a: string) => string;
|
||||
|
||||
x = (100, a => {
|
||||
const b: number = a;
|
||||
return b;
|
||||
});
|
||||
|
||||
//// [contextuallyTypeCommaOperator02.js]
|
||||
var x;
|
||||
x = (100, function (a) {
|
||||
var b = a;
|
||||
return b;
|
||||
});
|
10
tests/baselines/reference/contextuallyTypeLogicalAnd01.js
Normal file
10
tests/baselines/reference/contextuallyTypeLogicalAnd01.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
//// [contextuallyTypeLogicalAnd01.ts]
|
||||
let x: (a: string) => string;
|
||||
let y = true;
|
||||
|
||||
x = y && (a => a);
|
||||
|
||||
//// [contextuallyTypeLogicalAnd01.js]
|
||||
var x;
|
||||
var y = true;
|
||||
x = y && (function (a) { return a; });
|
|
@ -0,0 +1,14 @@
|
|||
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
||||
let x: (a: string) => string;
|
||||
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3))
|
||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 0, 8))
|
||||
|
||||
let y = true;
|
||||
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
||||
|
||||
x = y && (a => a);
|
||||
>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3))
|
||||
>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3))
|
||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10))
|
||||
>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10))
|
||||
|
19
tests/baselines/reference/contextuallyTypeLogicalAnd01.types
Normal file
19
tests/baselines/reference/contextuallyTypeLogicalAnd01.types
Normal file
|
@ -0,0 +1,19 @@
|
|||
=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts ===
|
||||
let x: (a: string) => string;
|
||||
>x : (a: string) => string
|
||||
>a : string
|
||||
|
||||
let y = true;
|
||||
>y : boolean
|
||||
>true : boolean
|
||||
|
||||
x = y && (a => a);
|
||||
>x = y && (a => a) : (a: any) => any
|
||||
>x : (a: string) => string
|
||||
>y && (a => a) : (a: any) => any
|
||||
>y : boolean
|
||||
>(a => a) : (a: any) => any
|
||||
>a => a : (a: any) => any
|
||||
>a : any
|
||||
>a : any
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(4,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (1 errors) ====
|
||||
let x: (a: string) => string;
|
||||
let y = true;
|
||||
|
||||
x = y && (a => {
|
||||
~
|
||||
!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
const b: number = a;
|
||||
return b;
|
||||
});
|
16
tests/baselines/reference/contextuallyTypeLogicalAnd02.js
Normal file
16
tests/baselines/reference/contextuallyTypeLogicalAnd02.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
//// [contextuallyTypeLogicalAnd02.ts]
|
||||
let x: (a: string) => string;
|
||||
let y = true;
|
||||
|
||||
x = y && (a => {
|
||||
const b: number = a;
|
||||
return b;
|
||||
});
|
||||
|
||||
//// [contextuallyTypeLogicalAnd02.js]
|
||||
var x;
|
||||
var y = true;
|
||||
x = y && (function (a) {
|
||||
var b = a;
|
||||
return b;
|
||||
});
|
Loading…
Reference in a new issue