From 0eb62881668e63052c5429810e2b12228cb3701f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Dec 2015 15:08:29 -0500 Subject: [PATCH] Accepted baselines. --- ...ralTypesOverloadAssignability01.errors.txt | 25 ++++++++++++ ...ringLiteralTypesOverloadAssignability01.js | 36 ++++++++++++++++++ ...ralTypesOverloadAssignability02.errors.txt | 31 +++++++++++++++ ...ringLiteralTypesOverloadAssignability02.js | 36 ++++++++++++++++++ ...ralTypesOverloadAssignability03.errors.txt | 25 ++++++++++++ ...ringLiteralTypesOverloadAssignability03.js | 36 ++++++++++++++++++ ...ralTypesOverloadAssignability04.errors.txt | 31 +++++++++++++++ ...ringLiteralTypesOverloadAssignability04.js | 36 ++++++++++++++++++ ...ralTypesOverloadAssignability05.errors.txt | 28 ++++++++++++++ ...ringLiteralTypesOverloadAssignability05.js | 38 +++++++++++++++++++ 10 files changed, 322 insertions(+) create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability01.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability01.js create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability02.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability02.js create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability03.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability03.js create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability04.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability04.js create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability05.errors.txt create mode 100644 tests/baselines/reference/stringLiteralTypesOverloadAssignability05.js diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.errors.txt new file mode 100644 index 00000000000..56fa60a795c --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.errors.txt @@ -0,0 +1,25 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability01.ts(2,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability01.ts(7,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability01.ts (2 errors) ==== + + function f(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function f(x: string): number { + return 0; + } + + function g(x: "bar"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function g(x: string): number { + return 0; + } + + let a = f; + let b = g; + + a = b; + b = a; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.js b/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.js new file mode 100644 index 00000000000..7b7c84165f3 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability01.js @@ -0,0 +1,36 @@ +//// [stringLiteralTypesOverloadAssignability01.ts] + +function f(x: "foo"): number; +function f(x: string): number { + return 0; +} + +function g(x: "bar"): number; +function g(x: string): number { + return 0; +} + +let a = f; +let b = g; + +a = b; +b = a; + +//// [stringLiteralTypesOverloadAssignability01.js] +function f(x) { + return 0; +} +function g(x) { + return 0; +} +var a = f; +var b = g; +a = b; +b = a; + + +//// [stringLiteralTypesOverloadAssignability01.d.ts] +declare function f(x: "foo"): number; +declare function g(x: "bar"): number; +declare let a: typeof f; +declare let b: typeof g; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.errors.txt new file mode 100644 index 00000000000..47862617afa --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.errors.txt @@ -0,0 +1,31 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability02.ts(2,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability02.ts(3,10): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability02.ts(7,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability02.ts(8,10): error TS2381: A signature with an implementation cannot use a string literal type. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability02.ts (4 errors) ==== + + function f(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function f(x: "foo"): number { + ~ +!!! error TS2381: A signature with an implementation cannot use a string literal type. + return 0; + } + + function g(x: "bar"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function g(x: "bar"): number { + ~ +!!! error TS2381: A signature with an implementation cannot use a string literal type. + return 0; + } + + let a = f; + let b = g; + + a = b; + b = a; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.js b/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.js new file mode 100644 index 00000000000..7a8db4722a6 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability02.js @@ -0,0 +1,36 @@ +//// [stringLiteralTypesOverloadAssignability02.ts] + +function f(x: "foo"): number; +function f(x: "foo"): number { + return 0; +} + +function g(x: "bar"): number; +function g(x: "bar"): number { + return 0; +} + +let a = f; +let b = g; + +a = b; +b = a; + +//// [stringLiteralTypesOverloadAssignability02.js] +function f(x) { + return 0; +} +function g(x) { + return 0; +} +var a = f; +var b = g; +a = b; +b = a; + + +//// [stringLiteralTypesOverloadAssignability02.d.ts] +declare function f(x: "foo"): number; +declare function g(x: "bar"): number; +declare let a: typeof f; +declare let b: typeof g; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.errors.txt new file mode 100644 index 00000000000..1e58fc9028f --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.errors.txt @@ -0,0 +1,25 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability03.ts(2,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability03.ts(7,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability03.ts (2 errors) ==== + + function f(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function f(x: string): number { + return 0; + } + + function g(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function g(x: string): number { + return 0; + } + + let a = f; + let b = g; + + a = b; + b = a; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.js b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.js new file mode 100644 index 00000000000..1d9452a9c65 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.js @@ -0,0 +1,36 @@ +//// [stringLiteralTypesOverloadAssignability03.ts] + +function f(x: "foo"): number; +function f(x: string): number { + return 0; +} + +function g(x: "foo"): number; +function g(x: string): number { + return 0; +} + +let a = f; +let b = g; + +a = b; +b = a; + +//// [stringLiteralTypesOverloadAssignability03.js] +function f(x) { + return 0; +} +function g(x) { + return 0; +} +var a = f; +var b = g; +a = b; +b = a; + + +//// [stringLiteralTypesOverloadAssignability03.d.ts] +declare function f(x: "foo"): number; +declare function g(x: "foo"): number; +declare let a: typeof f; +declare let b: typeof g; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.errors.txt new file mode 100644 index 00000000000..1b179b95fe6 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.errors.txt @@ -0,0 +1,31 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability04.ts(2,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability04.ts(3,10): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability04.ts(7,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability04.ts(8,10): error TS2381: A signature with an implementation cannot use a string literal type. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability04.ts (4 errors) ==== + + function f(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function f(x: "foo"): number { + ~ +!!! error TS2381: A signature with an implementation cannot use a string literal type. + return 0; + } + + function g(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function g(x: "foo"): number { + ~ +!!! error TS2381: A signature with an implementation cannot use a string literal type. + return 0; + } + + let a = f; + let b = g; + + a = b; + b = a; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.js b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.js new file mode 100644 index 00000000000..975c7d80cb5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.js @@ -0,0 +1,36 @@ +//// [stringLiteralTypesOverloadAssignability04.ts] + +function f(x: "foo"): number; +function f(x: "foo"): number { + return 0; +} + +function g(x: "foo"): number; +function g(x: "foo"): number { + return 0; +} + +let a = f; +let b = g; + +a = b; +b = a; + +//// [stringLiteralTypesOverloadAssignability04.js] +function f(x) { + return 0; +} +function g(x) { + return 0; +} +var a = f; +var b = g; +a = b; +b = a; + + +//// [stringLiteralTypesOverloadAssignability04.d.ts] +declare function f(x: "foo"): number; +declare function g(x: "foo"): number; +declare let a: typeof f; +declare let b: typeof g; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.errors.txt new file mode 100644 index 00000000000..0830f08fb80 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability05.ts(8,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability05.ts(16,1): error TS2322: Type '(x: "foo") => number' is not assignable to type '{ (x: "foo"): number; (x: string): number; }'. + Type '(x: "foo") => number' provides no match for the signature '(x: string): number' + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability05.ts (2 errors) ==== + + function f(x: "foo"): number; + function f(x: string): number; + function f(x: string): number { + return 0; + } + + function g(x: "foo"): number; + ~ +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + function g(x: string): number { + return 0; + } + + let a = f; + let b = g; + + a = b; + ~ +!!! error TS2322: Type '(x: "foo") => number' is not assignable to type '{ (x: "foo"): number; (x: string): number; }'. +!!! error TS2322: Type '(x: "foo") => number' provides no match for the signature '(x: string): number' + b = a; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.js b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.js new file mode 100644 index 00000000000..b08dbc04082 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.js @@ -0,0 +1,38 @@ +//// [stringLiteralTypesOverloadAssignability05.ts] + +function f(x: "foo"): number; +function f(x: string): number; +function f(x: string): number { + return 0; +} + +function g(x: "foo"): number; +function g(x: string): number { + return 0; +} + +let a = f; +let b = g; + +a = b; +b = a; + +//// [stringLiteralTypesOverloadAssignability05.js] +function f(x) { + return 0; +} +function g(x) { + return 0; +} +var a = f; +var b = g; +a = b; +b = a; + + +//// [stringLiteralTypesOverloadAssignability05.d.ts] +declare function f(x: "foo"): number; +declare function f(x: string): number; +declare function g(x: "foo"): number; +declare let a: typeof f; +declare let b: typeof g;