Update tests

This commit is contained in:
Anders Hejlsberg
2016-09-01 14:22:18 -07:00
parent adc015dc5e
commit 44e1096ea9
2 changed files with 5 additions and 5 deletions

View File

@@ -7,7 +7,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: string) {
function getFalsyPrimitive(x: string): string | number | boolean {
if (x === "string") {
return "";
}
@@ -28,9 +28,9 @@ namespace Consts1 {
const FALSE = getFalsyPrimitive("boolean");
}
const string: "string" = "string"
const number: "number" = "number"
const boolean: "boolean" = "boolean"
const string = "string"
const number = "number"
const boolean = "boolean"
const stringOrNumber = string || number;
const stringOrBoolean = string || boolean;

View File

@@ -3,6 +3,6 @@
declare function f(x: (p: "foo" | "bar") => "foo");
f(y => {
let z = y = "foo";
const z = y = "foo";
return z;
})