Accepted baselines.
This commit is contained in:
parent
ffed2484d3
commit
2edabe0ae0
18
tests/baselines/reference/optionalProperties01.errors.txt
Normal file
18
tests/baselines/reference/optionalProperties01.errors.txt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts(9,14): error TS2352: Type '{ required1: string; optional: string; }' cannot be converted to type 'Foo'.
|
||||||
|
Property 'required2' is missing in type '{ required1: string; optional: string; }'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts (1 errors) ====
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
required1: string;
|
||||||
|
required2: string;
|
||||||
|
optional?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const foo1 = { required1: "hello" } as Foo;
|
||||||
|
const foo2 = { required1: "hello", optional: "bar" } as Foo;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
!!! error TS2352: Type '{ required1: string; optional: string; }' cannot be converted to type 'Foo'.
|
||||||
|
!!! error TS2352: Property 'required2' is missing in type '{ required1: string; optional: string; }'.
|
||||||
|
|
25
tests/baselines/reference/optionalProperties01.js
Normal file
25
tests/baselines/reference/optionalProperties01.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//// [optionalProperties01.ts]
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
required1: string;
|
||||||
|
required2: string;
|
||||||
|
optional?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const foo1 = { required1: "hello" } as Foo;
|
||||||
|
const foo2 = { required1: "hello", optional: "bar" } as Foo;
|
||||||
|
|
||||||
|
|
||||||
|
//// [optionalProperties01.js]
|
||||||
|
var foo1 = { required1: "hello" };
|
||||||
|
var foo2 = { required1: "hello", optional: "bar" };
|
||||||
|
|
||||||
|
|
||||||
|
//// [optionalProperties01.d.ts]
|
||||||
|
interface Foo {
|
||||||
|
required1: string;
|
||||||
|
required2: string;
|
||||||
|
optional?: string;
|
||||||
|
}
|
||||||
|
declare const foo1: Foo;
|
||||||
|
declare const foo2: Foo;
|
15
tests/baselines/reference/optionalProperties02.errors.txt
Normal file
15
tests/baselines/reference/optionalProperties02.errors.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts(7,1): error TS2352: Type '{ a: undefined; }' cannot be converted to type 'Foo'.
|
||||||
|
Property 'b' is missing in type '{ a: undefined; }'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts (1 errors) ====
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
a?: string;
|
||||||
|
b: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
<Foo>{ a: undefined };
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
!!! error TS2352: Type '{ a: undefined; }' cannot be converted to type 'Foo'.
|
||||||
|
!!! error TS2352: Property 'b' is missing in type '{ a: undefined; }'.
|
18
tests/baselines/reference/optionalProperties02.js
Normal file
18
tests/baselines/reference/optionalProperties02.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
//// [optionalProperties02.ts]
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
a?: string;
|
||||||
|
b: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
<Foo>{ a: undefined };
|
||||||
|
|
||||||
|
//// [optionalProperties02.js]
|
||||||
|
({ a: undefined });
|
||||||
|
|
||||||
|
|
||||||
|
//// [optionalProperties02.d.ts]
|
||||||
|
interface Foo {
|
||||||
|
a?: string;
|
||||||
|
b: string;
|
||||||
|
}
|
Loading…
Reference in a new issue