mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accepted baselines.
This commit is contained in:
@@ -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<T>(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"
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [errorMessagesIntersectionTypes01.ts]
|
||||
interface Foo {
|
||||
fooProp: boolean;
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
barProp: string;
|
||||
}
|
||||
|
||||
interface FooBar extends Foo, Bar {
|
||||
}
|
||||
|
||||
declare function mixBar<T>(obj: T): T & Bar;
|
||||
|
||||
let fooBar: FooBar = mixBar({
|
||||
fooProp: "frizzlebizzle"
|
||||
});
|
||||
|
||||
//// [errorMessagesIntersectionTypes01.js]
|
||||
var fooBar = mixBar({
|
||||
fooProp: "frizzlebizzle"
|
||||
});
|
||||
@@ -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<T>(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"
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
//// [errorMessagesIntersectionTypes02.ts]
|
||||
interface Foo {
|
||||
fooProp: "hello" | "world";
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
barProp: string;
|
||||
}
|
||||
|
||||
interface FooBar extends Foo, Bar {
|
||||
}
|
||||
|
||||
declare function mixBar<T>(obj: T): T & Bar;
|
||||
|
||||
let fooBar: FooBar = mixBar({
|
||||
fooProp: "frizzlebizzle"
|
||||
});
|
||||
|
||||
//// [errorMessagesIntersectionTypes02.js]
|
||||
var fooBar = mixBar({
|
||||
fooProp: "frizzlebizzle"
|
||||
});
|
||||
Reference in New Issue
Block a user