mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
Accepted baselines.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
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; }'.
|
||||
|
||||
26
tests/baselines/reference/optionalProperties01.symbols
Normal file
26
tests/baselines/reference/optionalProperties01.symbols
Normal file
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts ===
|
||||
|
||||
interface Foo {
|
||||
>Foo : Symbol(Foo, Decl(optionalProperties01.ts, 0, 0))
|
||||
|
||||
required1: string;
|
||||
>required1 : Symbol(Foo.required1, Decl(optionalProperties01.ts, 1, 15))
|
||||
|
||||
required2: string;
|
||||
>required2 : Symbol(Foo.required2, Decl(optionalProperties01.ts, 2, 20))
|
||||
|
||||
optional?: string;
|
||||
>optional : Symbol(Foo.optional, Decl(optionalProperties01.ts, 3, 20))
|
||||
}
|
||||
|
||||
const foo1 = { required1: "hello" } as Foo;
|
||||
>foo1 : Symbol(foo1, Decl(optionalProperties01.ts, 7, 5))
|
||||
>required1 : Symbol(required1, Decl(optionalProperties01.ts, 7, 14))
|
||||
>Foo : Symbol(Foo, Decl(optionalProperties01.ts, 0, 0))
|
||||
|
||||
const foo2 = { required1: "hello", optional: "bar" } as Foo;
|
||||
>foo2 : Symbol(foo2, Decl(optionalProperties01.ts, 8, 5))
|
||||
>required1 : Symbol(required1, Decl(optionalProperties01.ts, 8, 14))
|
||||
>optional : Symbol(optional, Decl(optionalProperties01.ts, 8, 34))
|
||||
>Foo : Symbol(Foo, Decl(optionalProperties01.ts, 0, 0))
|
||||
|
||||
33
tests/baselines/reference/optionalProperties01.types
Normal file
33
tests/baselines/reference/optionalProperties01.types
Normal file
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts ===
|
||||
|
||||
interface Foo {
|
||||
>Foo : Foo
|
||||
|
||||
required1: string;
|
||||
>required1 : string
|
||||
|
||||
required2: string;
|
||||
>required2 : string
|
||||
|
||||
optional?: string;
|
||||
>optional : string | undefined
|
||||
}
|
||||
|
||||
const foo1 = { required1: "hello" } as Foo;
|
||||
>foo1 : Foo
|
||||
>{ required1: "hello" } as Foo : Foo
|
||||
>{ required1: "hello" } : { required1: string; }
|
||||
>required1 : string
|
||||
>"hello" : "hello"
|
||||
>Foo : Foo
|
||||
|
||||
const foo2 = { required1: "hello", optional: "bar" } as Foo;
|
||||
>foo2 : Foo
|
||||
>{ required1: "hello", optional: "bar" } as Foo : Foo
|
||||
>{ required1: "hello", optional: "bar" } : { required1: string; optional: string; }
|
||||
>required1 : string
|
||||
>"hello" : "hello"
|
||||
>optional : string
|
||||
>"bar" : "bar"
|
||||
>Foo : Foo
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
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; }'.
|
||||
17
tests/baselines/reference/optionalProperties02.symbols
Normal file
17
tests/baselines/reference/optionalProperties02.symbols
Normal file
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts ===
|
||||
|
||||
interface Foo {
|
||||
>Foo : Symbol(Foo, Decl(optionalProperties02.ts, 0, 0))
|
||||
|
||||
a?: string;
|
||||
>a : Symbol(Foo.a, Decl(optionalProperties02.ts, 1, 15))
|
||||
|
||||
b: string;
|
||||
>b : Symbol(Foo.b, Decl(optionalProperties02.ts, 2, 15))
|
||||
}
|
||||
|
||||
<Foo>{ a: undefined };
|
||||
>Foo : Symbol(Foo, Decl(optionalProperties02.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(optionalProperties02.ts, 6, 6))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
19
tests/baselines/reference/optionalProperties02.types
Normal file
19
tests/baselines/reference/optionalProperties02.types
Normal file
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts ===
|
||||
|
||||
interface Foo {
|
||||
>Foo : Foo
|
||||
|
||||
a?: string;
|
||||
>a : string | undefined
|
||||
|
||||
b: string;
|
||||
>b : string
|
||||
}
|
||||
|
||||
<Foo>{ a: undefined };
|
||||
><Foo>{ a: undefined } : Foo
|
||||
>Foo : Foo
|
||||
>{ a: undefined } : { a: undefined; }
|
||||
>a : undefined
|
||||
>undefined : undefined
|
||||
|
||||
Reference in New Issue
Block a user