45 lines
856 B
Plaintext
45 lines
856 B
Plaintext
|
=== tests/cases/conformance/types/primitives/number/extendNumberInterface.ts ===
|
||
|
interface Number {
|
||
|
>Number : Number
|
||
|
|
||
|
doStuff(): string;
|
||
|
>doStuff : () => string
|
||
|
|
||
|
doOtherStuff<T>(x:T): T;
|
||
|
>doOtherStuff : <T>(x: T) => T
|
||
|
>T : T
|
||
|
>x : T
|
||
|
>T : T
|
||
|
>T : T
|
||
|
}
|
||
|
|
||
|
var x = 1;
|
||
|
>x : number
|
||
|
|
||
|
var a: string = x.doStuff();
|
||
|
>a : string
|
||
|
>x.doStuff() : string
|
||
|
>x.doStuff : () => string
|
||
|
>x : number
|
||
|
>doStuff : () => string
|
||
|
|
||
|
var b: string = x.doOtherStuff('hm');
|
||
|
>b : string
|
||
|
>x.doOtherStuff('hm') : string
|
||
|
>x.doOtherStuff : <T>(x: T) => T
|
||
|
>x : number
|
||
|
>doOtherStuff : <T>(x: T) => T
|
||
|
|
||
|
var c: string = x['doStuff']();
|
||
|
>c : string
|
||
|
>x['doStuff']() : string
|
||
|
>x['doStuff'] : () => string
|
||
|
>x : number
|
||
|
|
||
|
var d: string = x['doOtherStuff']('hm');
|
||
|
>d : string
|
||
|
>x['doOtherStuff']('hm') : string
|
||
|
>x['doOtherStuff'] : <T>(x: T) => T
|
||
|
>x : number
|
||
|
|