49 lines
948 B
Text
49 lines
948 B
Text
=== 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
|
|
>1 : 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
|
|
>'hm' : string
|
|
|
|
var c: string = x['doStuff']();
|
|
>c : string
|
|
>x['doStuff']() : string
|
|
>x['doStuff'] : () => string
|
|
>x : number
|
|
>'doStuff' : string
|
|
|
|
var d: string = x['doOtherStuff']('hm');
|
|
>d : string
|
|
>x['doOtherStuff']('hm') : string
|
|
>x['doOtherStuff'] : <T>(x: T) => T
|
|
>x : number
|
|
>'doOtherStuff' : string
|
|
>'hm' : string
|
|
|