mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added tests.
This commit is contained in:
1 parent
b0100100a1
commit
60e7b5d17e
2 files changed
+38
No files matched your search
@@ -0,0 +1,19 @@
|
||||
// @declaration: true
|
||||
|
||||
interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export type Bar = Omit<Foo, "c">;
|
||||
export type Baz = Omit<Foo, "b" | "c">;
|
||||
|
||||
export function getBarC(bar: Bar) {
|
||||
return bar.c;
|
||||
}
|
||||
|
||||
export function getBazB(baz: Baz) {
|
||||
return baz.b;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// @declaration: true
|
||||
|
||||
interface Foo {
|
||||
a: string;
|
||||
b: number;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
export type Bar = Omit<Foo, "c">;
|
||||
export type Baz = Omit<Foo, "b" | "c">;
|
||||
|
||||
export function getBarA(bar: Bar) {
|
||||
return bar.a;
|
||||
}
|
||||
|
||||
export function getBazA(baz: Baz) {
|
||||
return baz.a;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user