TypeScript/tests/baselines/reference/commentsdoNotEmitComments.types

172 lines
6.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/commentsdoNotEmitComments.ts ===
/** Variable comments*/
var myVariable = 10;
2015-04-13 23:01:57 +02:00
>myVariable : number, Symbol(myVariable, Decl(commentsdoNotEmitComments.ts, 2, 3))
2015-04-13 21:36:11 +02:00
>10 : number
2014-08-15 23:33:16 +02:00
/** function comments*/
function foo(/** parameter comment*/p: number) {
2015-04-13 23:01:57 +02:00
>foo : (p: number) => void, Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20))
>p : number, Symbol(p, Decl(commentsdoNotEmitComments.ts, 5, 13))
2014-08-15 23:33:16 +02:00
}
/** variable with function type comment*/
var fooVar: () => void;
2015-04-13 23:01:57 +02:00
>fooVar : () => void, Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3))
2014-08-15 23:33:16 +02:00
foo(50);
>foo(50) : void
2015-04-13 23:01:57 +02:00
>foo : (p: number) => void, Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20))
2015-04-13 21:36:11 +02:00
>50 : number
2014-08-15 23:33:16 +02:00
fooVar();
>fooVar() : void
2015-04-13 23:01:57 +02:00
>fooVar : () => void, Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3))
2014-08-15 23:33:16 +02:00
/**class comment*/
class c {
2015-04-13 23:01:57 +02:00
>c : c, Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
2014-08-15 23:33:16 +02:00
/** constructor comment*/
constructor() {
}
/** property comment */
public b = 10;
2015-04-13 23:01:57 +02:00
>b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
2015-04-13 21:36:11 +02:00
>10 : number
2014-08-15 23:33:16 +02:00
/** function comment */
public myFoo() {
2015-04-13 23:01:57 +02:00
>myFoo : () => number, Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 20, 18))
2014-08-15 23:33:16 +02:00
return this.b;
2015-04-13 23:01:57 +02:00
>this.b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
>this : c, Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
>b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
2014-08-15 23:33:16 +02:00
}
/** getter comment*/
public get prop1() {
2015-04-13 23:01:57 +02:00
>prop1 : number, Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5))
2014-08-15 23:33:16 +02:00
return this.b;
2015-04-13 23:01:57 +02:00
>this.b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
>this : c, Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
>b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
2014-08-15 23:33:16 +02:00
}
/** setter comment*/
public set prop1(val: number) {
2015-04-13 23:01:57 +02:00
>prop1 : number, Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5))
>val : number, Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21))
2014-08-15 23:33:16 +02:00
this.b = val;
>this.b = val : number
2015-04-13 23:01:57 +02:00
>this.b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
>this : c, Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
>b : number, Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
>val : number, Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21))
2014-08-15 23:33:16 +02:00
}
/** overload signature1*/
public foo1(a: number): string;
2015-04-13 23:01:57 +02:00
>foo1 : { (a: number): string; (b: string): string; }, Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
>a : number, Symbol(a, Decl(commentsdoNotEmitComments.ts, 38, 16))
2014-08-15 23:33:16 +02:00
/** Overload signature 2*/
public foo1(b: string): string;
2015-04-13 23:01:57 +02:00
>foo1 : { (a: number): string; (b: string): string; }, Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
>b : string, Symbol(b, Decl(commentsdoNotEmitComments.ts, 40, 16))
2014-08-15 23:33:16 +02:00
/** overload implementation signature*/
public foo1(aOrb) {
2015-04-13 23:01:57 +02:00
>foo1 : { (a: number): string; (b: string): string; }, Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
>aOrb : any, Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16))
2014-08-15 23:33:16 +02:00
return aOrb.toString();
>aOrb.toString() : any
>aOrb.toString : any
2015-04-13 23:01:57 +02:00
>aOrb : any, Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16))
2014-08-15 23:33:16 +02:00
>toString : any
}
}
/**instance comment*/
var i = new c();
2015-04-13 23:01:57 +02:00
>i : c, Symbol(i, Decl(commentsdoNotEmitComments.ts, 48, 3))
2014-08-15 23:33:16 +02:00
>new c() : c
2015-04-13 23:01:57 +02:00
>c : typeof c, Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
2014-08-15 23:33:16 +02:00
/** interface comments*/
interface i1 {
2015-04-13 23:01:57 +02:00
>i1 : i1, Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16))
2014-08-15 23:33:16 +02:00
/** caller comments*/
(a: number): number;
2015-04-13 23:01:57 +02:00
>a : number, Symbol(a, Decl(commentsdoNotEmitComments.ts, 53, 5))
2014-08-15 23:33:16 +02:00
/** new comments*/
new (b: string);
2015-04-13 23:01:57 +02:00
>b : string, Symbol(b, Decl(commentsdoNotEmitComments.ts, 56, 9))
2014-08-15 23:33:16 +02:00
/**indexer property*/
[a: number]: string;
2015-04-13 23:01:57 +02:00
>a : number, Symbol(a, Decl(commentsdoNotEmitComments.ts, 59, 5))
2014-08-15 23:33:16 +02:00
/** function property;*/
myFoo(/*param prop*/a: number): string;
2015-04-13 23:01:57 +02:00
>myFoo : (a: number) => string, Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 59, 24))
>a : number, Symbol(a, Decl(commentsdoNotEmitComments.ts, 62, 10))
2014-08-15 23:33:16 +02:00
/** prop*/
prop: string;
2015-04-13 23:01:57 +02:00
>prop : string, Symbol(prop, Decl(commentsdoNotEmitComments.ts, 62, 43))
2014-08-15 23:33:16 +02:00
}
/**interface instance comments*/
var i1_i: i1;
2015-04-13 23:01:57 +02:00
>i1_i : i1, Symbol(i1_i, Decl(commentsdoNotEmitComments.ts, 69, 3))
>i1 : i1, Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16))
2014-08-15 23:33:16 +02:00
/** this is module comment*/
module m1 {
2015-04-13 23:01:57 +02:00
>m1 : typeof m1, Symbol(m1, Decl(commentsdoNotEmitComments.ts, 69, 13))
2014-08-15 23:33:16 +02:00
/** class b */
export class b {
2015-04-13 23:01:57 +02:00
>b : b, Symbol(b, Decl(commentsdoNotEmitComments.ts, 72, 11))
2014-08-15 23:33:16 +02:00
constructor(public x: number) {
2015-04-13 23:01:57 +02:00
>x : number, Symbol(x, Decl(commentsdoNotEmitComments.ts, 75, 20))
2014-08-15 23:33:16 +02:00
}
}
/// module m2
export module m2 {
2015-04-13 23:01:57 +02:00
>m2 : any, Symbol(m2, Decl(commentsdoNotEmitComments.ts, 78, 5))
2014-08-15 23:33:16 +02:00
}
}
/// this is x
declare var x;
2015-04-13 23:01:57 +02:00
>x : any, Symbol(x, Decl(commentsdoNotEmitComments.ts, 86, 11))
2014-08-15 23:33:16 +02:00
/** const enum member value comment (generated by TS) */
const enum color { red, green, blue }
2015-04-13 23:01:57 +02:00
>color : color, Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
>red : color, Symbol(color.red, Decl(commentsdoNotEmitComments.ts, 90, 18))
>green : color, Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))
>blue : color, Symbol(color.blue, Decl(commentsdoNotEmitComments.ts, 90, 30))
var shade: color = color.green;
2015-04-13 23:01:57 +02:00
>shade : color, Symbol(shade, Decl(commentsdoNotEmitComments.ts, 91, 3))
>color : color, Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
>color.green : color, Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))
>color : typeof color, Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
>green : color, Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))