45 lines
870 B
Text
45 lines
870 B
Text
|
=== tests/cases/conformance/types/primitives/boolean/extendBooleanInterface.ts ===
|
||
|
interface Boolean {
|
||
|
>Boolean : Boolean
|
||
|
|
||
|
doStuff(): string;
|
||
|
>doStuff : () => string
|
||
|
|
||
|
doOtherStuff<T>(x: T): T;
|
||
|
>doOtherStuff : <T>(x: T) => T
|
||
|
>T : T
|
||
|
>x : T
|
||
|
>T : T
|
||
|
>T : T
|
||
|
}
|
||
|
|
||
|
var x = true;
|
||
|
>x : boolean
|
||
|
|
||
|
var a: string = x.doStuff();
|
||
|
>a : string
|
||
|
>x.doStuff() : string
|
||
|
>x.doStuff : () => string
|
||
|
>x : boolean
|
||
|
>doStuff : () => string
|
||
|
|
||
|
var b: string = x.doOtherStuff('hm');
|
||
|
>b : string
|
||
|
>x.doOtherStuff('hm') : string
|
||
|
>x.doOtherStuff : <T>(x: T) => T
|
||
|
>x : boolean
|
||
|
>doOtherStuff : <T>(x: T) => T
|
||
|
|
||
|
var c: string = x['doStuff']();
|
||
|
>c : string
|
||
|
>x['doStuff']() : string
|
||
|
>x['doStuff'] : () => string
|
||
|
>x : boolean
|
||
|
|
||
|
var d: string = x['doOtherStuff']('hm');
|
||
|
>d : string
|
||
|
>x['doOtherStuff']('hm') : string
|
||
|
>x['doOtherStuff'] : <T>(x: T) => T
|
||
|
>x : boolean
|
||
|
|