24 lines
523 B
Text
24 lines
523 B
Text
|
=== tests/cases/compiler/recursiveInference1.ts ===
|
||
|
function fib(x:number) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); }
|
||
|
>fib : (x: number) => any
|
||
|
>x : number
|
||
|
>x <= 1 ? x : fib(x - 1) + fib(x - 2) : any
|
||
|
>x <= 1 : boolean
|
||
|
>x : number
|
||
|
>x : number
|
||
|
>fib(x - 1) + fib(x - 2) : any
|
||
|
>fib(x - 1) : any
|
||
|
>fib : (x: number) => any
|
||
|
>x - 1 : number
|
||
|
>x : number
|
||
|
>fib(x - 2) : any
|
||
|
>fib : (x: number) => any
|
||
|
>x - 2 : number
|
||
|
>x : number
|
||
|
|
||
|
var result = fib(5);
|
||
|
>result : any
|
||
|
>fib(5) : any
|
||
|
>fib : (x: number) => any
|
||
|
|