mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Added tests.
This commit is contained in:
16
tests/cases/compiler/errorMessagesIntersectionTypes01.ts
Normal file
16
tests/cases/compiler/errorMessagesIntersectionTypes01.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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"
|
||||
});
|
||||
16
tests/cases/compiler/errorMessagesIntersectionTypes02.ts
Normal file
16
tests/cases/compiler/errorMessagesIntersectionTypes02.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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"
|
||||
});
|
||||
Reference in New Issue
Block a user