From cee7eb10ed87a27b868c7fbc84752c6a8c3e7374 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Dec 2015 16:20:34 -0500 Subject: [PATCH] Accepted baselines. --- .../stringLiteralTypesOverloads05.errors.txt | 18 +++++++++ .../stringLiteralTypesOverloads05.js | 37 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 tests/baselines/reference/stringLiteralTypesOverloads05.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloads05.js diff --git a/tests/baselines/reference/stringLiteralTypesOverloads05.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloads05.errors.txt new file mode 100644 index 00000000000..e57327ab0e0 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads05.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts(7,10): error TS2394: Overload signature is not compatible with function implementation. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts (1 errors) ==== + + interface Animal { animal: {} }; + interface Dog extends Animal { dog: {} } + interface Cat extends Animal { cat: {} } + interface Moose extends Animal { moose: {} } + + function doThing(x: "dog"): Dog; + ~~~~~~~ +!!! error TS2394: Overload signature is not compatible with function implementation. + function doThing(x: "cat"): Cat; + function doThing(x: string): Animal; + function doThing(x: string, y?: string): Moose { + return undefined; + } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloads05.js b/tests/baselines/reference/stringLiteralTypesOverloads05.js new file mode 100644 index 00000000000..23be3dac1e1 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads05.js @@ -0,0 +1,37 @@ +//// [stringLiteralTypesOverloads05.ts] + +interface Animal { animal: {} }; +interface Dog extends Animal { dog: {} } +interface Cat extends Animal { cat: {} } +interface Moose extends Animal { moose: {} } + +function doThing(x: "dog"): Dog; +function doThing(x: "cat"): Cat; +function doThing(x: string): Animal; +function doThing(x: string, y?: string): Moose { + return undefined; +} + +//// [stringLiteralTypesOverloads05.js] +; +function doThing(x, y) { + return undefined; +} + + +//// [stringLiteralTypesOverloads05.d.ts] +interface Animal { + animal: {}; +} +interface Dog extends Animal { + dog: {}; +} +interface Cat extends Animal { + cat: {}; +} +interface Moose extends Animal { + moose: {}; +} +declare function doThing(x: "dog"): Dog; +declare function doThing(x: "cat"): Cat; +declare function doThing(x: string): Animal;