mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:29:11 -06:00
Accepted baselines.
This commit is contained in:
parent
2cc6c4cc28
commit
5ef8a30642
@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(11,10): error TS2354: No best common type exists among return expressions.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(7,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts (1 errors) ====
|
||||
@ -9,12 +9,12 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads01.ts(11,
|
||||
function getFalsyPrimitive(x: "number"): number;
|
||||
function getFalsyPrimitive(x: "boolean"): boolean;
|
||||
function getFalsyPrimitive(x: "boolean" | "string"): boolean | string;
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
function getFalsyPrimitive(x: "boolean" | "number"): boolean | number;
|
||||
function getFalsyPrimitive(x: "number" | "string"): number | string;
|
||||
function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean;
|
||||
function getFalsyPrimitive(x: PrimitiveName) {
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2354: No best common type exists among return expressions.
|
||||
function getFalsyPrimitive(x: PrimitiveName): number | string | boolean {
|
||||
if (x === "string") {
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ function getFalsyPrimitive(x: "boolean" | "string"): boolean | string;
|
||||
function getFalsyPrimitive(x: "boolean" | "number"): boolean | number;
|
||||
function getFalsyPrimitive(x: "number" | "string"): number | string;
|
||||
function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean;
|
||||
function getFalsyPrimitive(x: PrimitiveName) {
|
||||
function getFalsyPrimitive(x: PrimitiveName): number | string | boolean {
|
||||
if (x === "string") {
|
||||
return "";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user