35 lines
582 B
Plaintext
35 lines
582 B
Plaintext
|
=== tests/cases/compiler/ambiguousOverloadResolution.ts ===
|
||
|
class A { }
|
||
|
>A : A
|
||
|
|
||
|
class B extends A { x: number; }
|
||
|
>B : B
|
||
|
>A : A
|
||
|
>x : number
|
||
|
|
||
|
declare function f(p: A, q: B): number;
|
||
|
>f : { (p: A, q: B): number; (p: B, q: A): string; }
|
||
|
>p : A
|
||
|
>A : A
|
||
|
>q : B
|
||
|
>B : B
|
||
|
|
||
|
declare function f(p: B, q: A): string;
|
||
|
>f : { (p: A, q: B): number; (p: B, q: A): string; }
|
||
|
>p : B
|
||
|
>B : B
|
||
|
>q : A
|
||
|
>A : A
|
||
|
|
||
|
var x: B;
|
||
|
>x : B
|
||
|
>B : B
|
||
|
|
||
|
var t: number = f(x, x); // Not an error
|
||
|
>t : number
|
||
|
>f(x, x) : number
|
||
|
>f : { (p: A, q: B): number; (p: B, q: A): string; }
|
||
|
>x : B
|
||
|
>x : B
|
||
|
|