From 60e7b5d17e9fc7ebfc7c55154cc000db0d773721 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 24 Apr 2019 16:43:17 -0700 Subject: [PATCH] Added tests. --- tests/cases/compiler/omitTypeTestErrors01.ts | 19 +++++++++++++++++++ tests/cases/compiler/omitTypeTests01.ts | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/cases/compiler/omitTypeTestErrors01.ts create mode 100644 tests/cases/compiler/omitTypeTests01.ts diff --git a/tests/cases/compiler/omitTypeTestErrors01.ts b/tests/cases/compiler/omitTypeTestErrors01.ts new file mode 100644 index 0000000000000..fd3f5fc1e5d2a --- /dev/null +++ b/tests/cases/compiler/omitTypeTestErrors01.ts @@ -0,0 +1,19 @@ +// @declaration: true + +interface Foo { + a: string; + b: number; + c: boolean; +} + +export type Bar = Omit; +export type Baz = Omit; + +export function getBarC(bar: Bar) { + return bar.c; +} + +export function getBazB(baz: Baz) { + return baz.b; +} + diff --git a/tests/cases/compiler/omitTypeTests01.ts b/tests/cases/compiler/omitTypeTests01.ts new file mode 100644 index 0000000000000..d3b2ce26e1ec4 --- /dev/null +++ b/tests/cases/compiler/omitTypeTests01.ts @@ -0,0 +1,19 @@ +// @declaration: true + +interface Foo { + a: string; + b: number; + c: boolean; +} + +export type Bar = Omit; +export type Baz = Omit; + +export function getBarA(bar: Bar) { + return bar.a; +} + +export function getBazA(baz: Baz) { + return baz.a; +} +