463 lines
8.7 KiB
Text
463 lines
8.7 KiB
Text
=== tests/cases/compiler/commentsOverloads.ts ===
|
|
/** this is signature 1*/
|
|
function f1(/**param a*/a: number): number;
|
|
>f1 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
function f1(b: string): number;
|
|
>f1 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
function f1(aOrb: any) {
|
|
>f1 : { (a: number): number; (b: string): number; }
|
|
>aOrb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
f1("hello");
|
|
>f1("hello") : number
|
|
>f1 : { (a: number): number; (b: string): number; }
|
|
>"hello" : string
|
|
|
|
f1(10);
|
|
>f1(10) : number
|
|
>f1 : { (a: number): number; (b: string): number; }
|
|
>10 : number
|
|
|
|
function f2(a: number): number;
|
|
>f2 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** this is signature 2*/
|
|
function f2(b: string): number;
|
|
>f2 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
/** this is f2 var comment*/
|
|
function f2(aOrb: any) {
|
|
>f2 : { (a: number): number; (b: string): number; }
|
|
>aOrb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
f2("hello");
|
|
>f2("hello") : number
|
|
>f2 : { (a: number): number; (b: string): number; }
|
|
>"hello" : string
|
|
|
|
f2(10);
|
|
>f2(10) : number
|
|
>f2 : { (a: number): number; (b: string): number; }
|
|
>10 : number
|
|
|
|
function f3(a: number): number;
|
|
>f3 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
function f3(b: string): number;
|
|
>f3 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
function f3(aOrb: any) {
|
|
>f3 : { (a: number): number; (b: string): number; }
|
|
>aOrb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
f3("hello");
|
|
>f3("hello") : number
|
|
>f3 : { (a: number): number; (b: string): number; }
|
|
>"hello" : string
|
|
|
|
f3(10);
|
|
>f3(10) : number
|
|
>f3 : { (a: number): number; (b: string): number; }
|
|
>10 : number
|
|
|
|
/** this is signature 4 - with number parameter*/
|
|
function f4(/**param a*/a: number): number;
|
|
>f4 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** this is signature 4 - with string parameter*/
|
|
function f4(b: string): number;
|
|
>f4 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
function f4(aOrb: any) {
|
|
>f4 : { (a: number): number; (b: string): number; }
|
|
>aOrb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
f4("hello");
|
|
>f4("hello") : number
|
|
>f4 : { (a: number): number; (b: string): number; }
|
|
>"hello" : string
|
|
|
|
f4(10);
|
|
>f4(10) : number
|
|
>f4 : { (a: number): number; (b: string): number; }
|
|
>10 : number
|
|
|
|
interface i1 {
|
|
>i1 : i1
|
|
|
|
/**this signature 1*/
|
|
(/**param a*/ a: number): number;
|
|
>a : number
|
|
|
|
/**this is signature 2*/
|
|
(b: string): number;
|
|
>b : string
|
|
|
|
/** foo 1*/
|
|
foo(a: number): number;
|
|
>foo : { (a: number): number; (b: string): number; (arr: number[]): number; (arr: string[]): number; }
|
|
>a : number
|
|
|
|
/** foo 2*/
|
|
foo(b: string): number;
|
|
>foo : { (a: number): number; (b: string): number; (arr: number[]): number; (arr: string[]): number; }
|
|
>b : string
|
|
|
|
// foo 3
|
|
foo(arr: number[]): number;
|
|
>foo : { (a: number): number; (b: string): number; (arr: number[]): number; (arr: string[]): number; }
|
|
>arr : number[]
|
|
|
|
/** foo 4 */
|
|
foo(arr: string[]): number;
|
|
>foo : { (a: number): number; (b: string): number; (arr: number[]): number; (arr: string[]): number; }
|
|
>arr : string[]
|
|
|
|
foo2(a: number): number;
|
|
>foo2 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** foo2 2*/
|
|
foo2(b: string): number;
|
|
>foo2 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
foo3(a: number): number;
|
|
>foo3 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
foo3(b: string): number;
|
|
>foo3 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
/** foo4 1*/
|
|
foo4(a: number): number;
|
|
>foo4 : { (a: number): number; (b: string): number; (c: any): any; }
|
|
>a : number
|
|
|
|
foo4(b: string): number;
|
|
>foo4 : { (a: number): number; (b: string): number; (c: any): any; }
|
|
>b : string
|
|
|
|
/** foo4 any */
|
|
foo4(c: any): any;
|
|
>foo4 : { (a: number): number; (b: string): number; (c: any): any; }
|
|
>c : any
|
|
|
|
/// new 1
|
|
new (a: string);
|
|
>a : string
|
|
|
|
/** new 1*/
|
|
new (b: number);
|
|
>b : number
|
|
}
|
|
var i1_i: i1;
|
|
>i1_i : i1
|
|
>i1 : i1
|
|
|
|
interface i2 {
|
|
>i2 : i2
|
|
|
|
new (a: string);
|
|
>a : string
|
|
|
|
/** new 2*/
|
|
new (b: number);
|
|
>b : number
|
|
|
|
(a: number): number;
|
|
>a : number
|
|
|
|
/**this is signature 2*/
|
|
(b: string): number;
|
|
>b : string
|
|
}
|
|
var i2_i: i2;
|
|
>i2_i : i2
|
|
>i2 : i2
|
|
|
|
interface i3 {
|
|
>i3 : i3
|
|
|
|
/** new 1*/
|
|
new (a: string);
|
|
>a : string
|
|
|
|
/** new 2*/
|
|
new (b: number);
|
|
>b : number
|
|
|
|
/**this is signature 1*/
|
|
(a: number): number;
|
|
>a : number
|
|
|
|
(b: string): number;
|
|
>b : string
|
|
}
|
|
var i3_i: i3;
|
|
>i3_i : i3
|
|
>i3 : i3
|
|
|
|
interface i4 {
|
|
>i4 : i4
|
|
|
|
new (a: string);
|
|
>a : string
|
|
|
|
new (b: number);
|
|
>b : number
|
|
|
|
(a: number): number;
|
|
>a : number
|
|
|
|
(b: string): number;
|
|
>b : string
|
|
}
|
|
class c {
|
|
>c : c
|
|
|
|
public prop1(a: number): number;
|
|
>prop1 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
public prop1(b: string): number;
|
|
>prop1 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
public prop1(aorb: any) {
|
|
>prop1 : { (a: number): number; (b: string): number; }
|
|
>aorb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
/** prop2 1*/
|
|
public prop2(a: number): number;
|
|
>prop2 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
public prop2(b: string): number;
|
|
>prop2 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
public prop2(aorb: any) {
|
|
>prop2 : { (a: number): number; (b: string): number; }
|
|
>aorb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
public prop3(a: number): number;
|
|
>prop3 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** prop3 2*/
|
|
public prop3(b: string): number;
|
|
>prop3 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
public prop3(aorb: any) {
|
|
>prop3 : { (a: number): number; (b: string): number; }
|
|
>aorb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
/** prop4 1*/
|
|
public prop4(a: number): number;
|
|
>prop4 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** prop4 2*/
|
|
public prop4(b: string): number;
|
|
>prop4 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
public prop4(aorb: any) {
|
|
>prop4 : { (a: number): number; (b: string): number; }
|
|
>aorb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
/** prop5 1*/
|
|
public prop5(a: number): number;
|
|
>prop5 : { (a: number): number; (b: string): number; }
|
|
>a : number
|
|
|
|
/** prop5 2*/
|
|
public prop5(b: string): number;
|
|
>prop5 : { (a: number): number; (b: string): number; }
|
|
>b : string
|
|
|
|
/** Prop5 implementaion*/
|
|
public prop5(aorb: any) {
|
|
>prop5 : { (a: number): number; (b: string): number; }
|
|
>aorb : any
|
|
|
|
return 10;
|
|
>10 : number
|
|
}
|
|
}
|
|
class c1 {
|
|
>c1 : c1
|
|
|
|
constructor(a: number);
|
|
>a : number
|
|
|
|
constructor(b: string);
|
|
>b : string
|
|
|
|
constructor(aorb: any) {
|
|
>aorb : any
|
|
}
|
|
}
|
|
class c2 {
|
|
>c2 : c2
|
|
|
|
/** c2 1*/
|
|
constructor(a: number);
|
|
>a : number
|
|
|
|
// c2 2
|
|
constructor(b: string);
|
|
>b : string
|
|
|
|
constructor(aorb: any) {
|
|
>aorb : any
|
|
}
|
|
}
|
|
class c3 {
|
|
>c3 : c3
|
|
|
|
constructor(a: number);
|
|
>a : number
|
|
|
|
/** c3 2*/
|
|
constructor(b: string);
|
|
>b : string
|
|
|
|
constructor(aorb: any) {
|
|
>aorb : any
|
|
}
|
|
}
|
|
class c4 {
|
|
>c4 : c4
|
|
|
|
/** c4 1*/
|
|
constructor(a: number);
|
|
>a : number
|
|
|
|
/** c4 2*/
|
|
constructor(b: string);
|
|
>b : string
|
|
|
|
/** c4 3 */
|
|
constructor(aorb: any) {
|
|
>aorb : any
|
|
}
|
|
}
|
|
class c5 {
|
|
>c5 : c5
|
|
|
|
/** c5 1*/
|
|
constructor(a: number);
|
|
>a : number
|
|
|
|
/** c5 2*/
|
|
constructor(b: string);
|
|
>b : string
|
|
|
|
/** c5 implementation*/
|
|
constructor(aorb: any) {
|
|
>aorb : any
|
|
}
|
|
}
|
|
var c_i = new c();
|
|
>c_i : c
|
|
>new c() : c
|
|
>c : typeof c
|
|
|
|
var c1_i_1 = new c1(10);
|
|
>c1_i_1 : c1
|
|
>new c1(10) : c1
|
|
>c1 : typeof c1
|
|
>10 : number
|
|
|
|
var c1_i_2 = new c1("hello");
|
|
>c1_i_2 : c1
|
|
>new c1("hello") : c1
|
|
>c1 : typeof c1
|
|
>"hello" : string
|
|
|
|
var c2_i_1 = new c2(10);
|
|
>c2_i_1 : c2
|
|
>new c2(10) : c2
|
|
>c2 : typeof c2
|
|
>10 : number
|
|
|
|
var c2_i_2 = new c2("hello");
|
|
>c2_i_2 : c2
|
|
>new c2("hello") : c2
|
|
>c2 : typeof c2
|
|
>"hello" : string
|
|
|
|
var c3_i_1 = new c3(10);
|
|
>c3_i_1 : c3
|
|
>new c3(10) : c3
|
|
>c3 : typeof c3
|
|
>10 : number
|
|
|
|
var c3_i_2 = new c3("hello");
|
|
>c3_i_2 : c3
|
|
>new c3("hello") : c3
|
|
>c3 : typeof c3
|
|
>"hello" : string
|
|
|
|
var c4_i_1 = new c4(10);
|
|
>c4_i_1 : c4
|
|
>new c4(10) : c4
|
|
>c4 : typeof c4
|
|
>10 : number
|
|
|
|
var c4_i_2 = new c4("hello");
|
|
>c4_i_2 : c4
|
|
>new c4("hello") : c4
|
|
>c4 : typeof c4
|
|
>"hello" : string
|
|
|
|
var c5_i_1 = new c5(10);
|
|
>c5_i_1 : c5
|
|
>new c5(10) : c5
|
|
>c5 : typeof c5
|
|
>10 : number
|
|
|
|
var c5_i_2 = new c5("hello");
|
|
>c5_i_2 : c5
|
|
>new c5("hello") : c5
|
|
>c5 : typeof c5
|
|
>"hello" : string
|
|
|