TypeScript/tests/baselines/reference/declFileConstructors.types

181 lines
4.1 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/declFileConstructors_0.ts ===
export class SimpleConstructor {
>SimpleConstructor : SimpleConstructor
2014-08-15 23:33:16 +02:00
/** This comment should appear for foo*/
constructor() {
}
}
export class ConstructorWithParameters {
>ConstructorWithParameters : ConstructorWithParameters
2014-08-15 23:33:16 +02:00
/** This is comment for function signature*/
constructor(/** this is comment about a*/a: string,
>a : string
2014-08-15 23:33:16 +02:00
/** this is comment for b*/
b: number) {
>b : number
2014-08-15 23:33:16 +02:00
var d = a;
>d : string
>a : string
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithRestParamters {
>ConstructorWithRestParamters : ConstructorWithRestParamters
2014-08-15 23:33:16 +02:00
constructor(a: string, ...rests: string[]) {
>a : string
>rests : string[]
2014-08-15 23:33:16 +02:00
return a + rests.join("");
>a + rests.join("") : string
>a : string
2014-08-15 23:33:16 +02:00
>rests.join("") : string
>rests.join : (separator?: string) => string
>rests : string[]
>join : (separator?: string) => string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithOverloads {
>ConstructorWithOverloads : ConstructorWithOverloads
2014-08-15 23:33:16 +02:00
constructor(a: string);
>a : string
2014-08-15 23:33:16 +02:00
constructor(a: number);
>a : number
2014-08-15 23:33:16 +02:00
constructor(a: any) {
>a : any
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithPublicParameterProperty {
>ConstructorWithPublicParameterProperty : ConstructorWithPublicParameterProperty
2014-08-15 23:33:16 +02:00
constructor(public x: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithPrivateParameterProperty {
>ConstructorWithPrivateParameterProperty : ConstructorWithPrivateParameterProperty
2014-08-15 23:33:16 +02:00
constructor(private x: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithOptionalParameterProperty {
>ConstructorWithOptionalParameterProperty : ConstructorWithOptionalParameterProperty
2014-08-15 23:33:16 +02:00
constructor(public x?: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
export class ConstructorWithParameterInitializer {
>ConstructorWithParameterInitializer : ConstructorWithParameterInitializer
2014-08-15 23:33:16 +02:00
constructor(public x = "hello") {
>x : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-08-15 23:33:16 +02:00
}
}
=== tests/cases/compiler/declFileConstructors_1.ts ===
class GlobalSimpleConstructor {
>GlobalSimpleConstructor : GlobalSimpleConstructor
2014-08-15 23:33:16 +02:00
/** This comment should appear for foo*/
constructor() {
}
}
class GlobalConstructorWithParameters {
>GlobalConstructorWithParameters : GlobalConstructorWithParameters
2014-08-15 23:33:16 +02:00
/** This is comment for function signature*/
constructor(/** this is comment about a*/a: string,
>a : string
2014-08-15 23:33:16 +02:00
/** this is comment for b*/
b: number) {
>b : number
2014-08-15 23:33:16 +02:00
var d = a;
>d : string
>a : string
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithRestParamters {
>GlobalConstructorWithRestParamters : GlobalConstructorWithRestParamters
2014-08-15 23:33:16 +02:00
constructor(a: string, ...rests: string[]) {
>a : string
>rests : string[]
2014-08-15 23:33:16 +02:00
return a + rests.join("");
>a + rests.join("") : string
>a : string
2014-08-15 23:33:16 +02:00
>rests.join("") : string
>rests.join : (separator?: string) => string
>rests : string[]
>join : (separator?: string) => string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithOverloads {
>GlobalConstructorWithOverloads : GlobalConstructorWithOverloads
2014-08-15 23:33:16 +02:00
constructor(a: string);
>a : string
2014-08-15 23:33:16 +02:00
constructor(a: number);
>a : number
2014-08-15 23:33:16 +02:00
constructor(a: any) {
>a : any
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithPublicParameterProperty {
>GlobalConstructorWithPublicParameterProperty : GlobalConstructorWithPublicParameterProperty
2014-08-15 23:33:16 +02:00
constructor(public x: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithPrivateParameterProperty {
>GlobalConstructorWithPrivateParameterProperty : GlobalConstructorWithPrivateParameterProperty
2014-08-15 23:33:16 +02:00
constructor(private x: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithOptionalParameterProperty {
>GlobalConstructorWithOptionalParameterProperty : GlobalConstructorWithOptionalParameterProperty
2014-08-15 23:33:16 +02:00
constructor(public x?: string) {
>x : string
2014-08-15 23:33:16 +02:00
}
}
class GlobalConstructorWithParameterInitializer {
>GlobalConstructorWithParameterInitializer : GlobalConstructorWithParameterInitializer
2014-08-15 23:33:16 +02:00
constructor(public x = "hello") {
>x : string
2015-04-13 21:36:11 +02:00
>"hello" : string
2014-08-15 23:33:16 +02:00
}
}