mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Accepted baselines.
This commit is contained in:
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user