From 07412a285a856300129c4a8505f05044742c91b4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 23 Feb 2016 13:10:40 -0800 Subject: [PATCH] Accepted baselines. --- ...rrorMessagesIntersectionTypes01.errors.txt | 26 +++++++++++++++++++ .../errorMessagesIntersectionTypes01.js | 22 ++++++++++++++++ ...rrorMessagesIntersectionTypes02.errors.txt | 26 +++++++++++++++++++ .../errorMessagesIntersectionTypes02.js | 22 ++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 tests/baselines/reference/errorMessagesIntersectionTypes01.errors.txt create mode 100644 tests/baselines/reference/errorMessagesIntersectionTypes01.js create mode 100644 tests/baselines/reference/errorMessagesIntersectionTypes02.errors.txt create mode 100644 tests/baselines/reference/errorMessagesIntersectionTypes02.js diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes01.errors.txt b/tests/baselines/reference/errorMessagesIntersectionTypes01.errors.txt new file mode 100644 index 00000000000..5ea490fb0db --- /dev/null +++ b/tests/baselines/reference/errorMessagesIntersectionTypes01.errors.txt @@ -0,0 +1,26 @@ +tests/cases/compiler/errorMessagesIntersectionTypes01.ts(14,5): error TS2322: Type '{ fooProp: string; } & Bar' is not assignable to type 'FooBar'. + Type 'Bar' is not assignable to type 'FooBar'. + Property 'fooProp' is missing in type 'Bar'. + + +==== tests/cases/compiler/errorMessagesIntersectionTypes01.ts (1 errors) ==== + interface Foo { + fooProp: boolean; + } + + interface Bar { + barProp: string; + } + + interface FooBar extends Foo, Bar { + } + + declare function mixBar(obj: T): T & Bar; + + let fooBar: FooBar = mixBar({ + ~~~~~~ +!!! error TS2322: Type '{ fooProp: string; } & Bar' is not assignable to type 'FooBar'. +!!! error TS2322: Type 'Bar' is not assignable to type 'FooBar'. +!!! error TS2322: Property 'fooProp' is missing in type 'Bar'. + fooProp: "frizzlebizzle" + }); \ No newline at end of file diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes01.js b/tests/baselines/reference/errorMessagesIntersectionTypes01.js new file mode 100644 index 00000000000..d0cd23ac53d --- /dev/null +++ b/tests/baselines/reference/errorMessagesIntersectionTypes01.js @@ -0,0 +1,22 @@ +//// [errorMessagesIntersectionTypes01.ts] +interface Foo { + fooProp: boolean; +} + +interface Bar { + barProp: string; +} + +interface FooBar extends Foo, Bar { +} + +declare function mixBar(obj: T): T & Bar; + +let fooBar: FooBar = mixBar({ + fooProp: "frizzlebizzle" +}); + +//// [errorMessagesIntersectionTypes01.js] +var fooBar = mixBar({ + fooProp: "frizzlebizzle" +}); diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes02.errors.txt b/tests/baselines/reference/errorMessagesIntersectionTypes02.errors.txt new file mode 100644 index 00000000000..3c6da0b99a0 --- /dev/null +++ b/tests/baselines/reference/errorMessagesIntersectionTypes02.errors.txt @@ -0,0 +1,26 @@ +tests/cases/compiler/errorMessagesIntersectionTypes02.ts(14,5): error TS2322: Type '{ fooProp: string; } & Bar' is not assignable to type 'FooBar'. + Type 'Bar' is not assignable to type 'FooBar'. + Property 'fooProp' is missing in type 'Bar'. + + +==== tests/cases/compiler/errorMessagesIntersectionTypes02.ts (1 errors) ==== + interface Foo { + fooProp: "hello" | "world"; + } + + interface Bar { + barProp: string; + } + + interface FooBar extends Foo, Bar { + } + + declare function mixBar(obj: T): T & Bar; + + let fooBar: FooBar = mixBar({ + ~~~~~~ +!!! error TS2322: Type '{ fooProp: string; } & Bar' is not assignable to type 'FooBar'. +!!! error TS2322: Type 'Bar' is not assignable to type 'FooBar'. +!!! error TS2322: Property 'fooProp' is missing in type 'Bar'. + fooProp: "frizzlebizzle" + }); \ No newline at end of file diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes02.js b/tests/baselines/reference/errorMessagesIntersectionTypes02.js new file mode 100644 index 00000000000..c5c24031877 --- /dev/null +++ b/tests/baselines/reference/errorMessagesIntersectionTypes02.js @@ -0,0 +1,22 @@ +//// [errorMessagesIntersectionTypes02.ts] +interface Foo { + fooProp: "hello" | "world"; +} + +interface Bar { + barProp: string; +} + +interface FooBar extends Foo, Bar { +} + +declare function mixBar(obj: T): T & Bar; + +let fooBar: FooBar = mixBar({ + fooProp: "frizzlebizzle" +}); + +//// [errorMessagesIntersectionTypes02.js] +var fooBar = mixBar({ + fooProp: "frizzlebizzle" +});