Files
tsgo/testdata/baselines/reference/submodule/conformance/assignmentCompatWithCallSignatures.symbols

131 lines
5.0 KiB
Plaintext

//// [tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts] ////
=== assignmentCompatWithCallSignatures.ts ===
// void returning call signatures can be assigned a non-void returning call signature that otherwise matches
interface T {
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 0, 0))
(x: number): void;
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 3, 5))
}
declare var t: T;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 0, 0))
declare var a: { (x: number): void };
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 6, 18))
t = a;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
a = t;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
interface S {
>S : Symbol(S, Decl(assignmentCompatWithCallSignatures.ts, 9, 6))
(x: number): string;
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 12, 5))
}
declare var s: S;
>s : Symbol(s, Decl(assignmentCompatWithCallSignatures.ts, 14, 11))
>S : Symbol(S, Decl(assignmentCompatWithCallSignatures.ts, 9, 6))
declare var a2: { (x: number): string };
>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures.ts, 15, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 15, 19))
t = s;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>s : Symbol(s, Decl(assignmentCompatWithCallSignatures.ts, 14, 11))
t = a2;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures.ts, 15, 11))
a = s;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>s : Symbol(s, Decl(assignmentCompatWithCallSignatures.ts, 14, 11))
a = a2;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures.ts, 15, 11))
t = <T>(x: T) => 1;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 21, 5))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 21, 8))
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 21, 5))
t = () => 1;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
t = function (x: number) { return ''; }
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 23, 14))
a = <T>(x: T) => 1;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 24, 5))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 24, 8))
>T : Symbol(T, Decl(assignmentCompatWithCallSignatures.ts, 24, 5))
a = () => 1;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
a = function (x: number) { return ''; }
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 26, 14))
interface S2 {
>S2 : Symbol(S2, Decl(assignmentCompatWithCallSignatures.ts, 26, 39))
(x: string): void;
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 29, 5))
}
declare var s2: S2;
>s2 : Symbol(s2, Decl(assignmentCompatWithCallSignatures.ts, 31, 11))
>S2 : Symbol(S2, Decl(assignmentCompatWithCallSignatures.ts, 26, 39))
declare var a3: { (x: string): void };
>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures.ts, 32, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 32, 19))
// these are errors
t = s2;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>s2 : Symbol(s2, Decl(assignmentCompatWithCallSignatures.ts, 31, 11))
t = a3;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures.ts, 32, 11))
t = (x: string) => 1;
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 36, 5))
t = function (x: string) { return ''; }
>t : Symbol(t, Decl(assignmentCompatWithCallSignatures.ts, 5, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 37, 14))
a = s2;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>s2 : Symbol(s2, Decl(assignmentCompatWithCallSignatures.ts, 31, 11))
a = a3;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures.ts, 32, 11))
a = (x: string) => 1;
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 40, 5))
a = function (x: string) { return ''; }
>a : Symbol(a, Decl(assignmentCompatWithCallSignatures.ts, 6, 11))
>x : Symbol(x, Decl(assignmentCompatWithCallSignatures.ts, 41, 14))