powerquery-language-services icon indicating copy to clipboard operation
powerquery-language-services copied to clipboard

[BUG] Infinite loop in type analysis in regards to recursive functions

Open JordanBoltonMN opened this issue 2 years ago • 1 comments

Expected behavior The type system to not experience infinite loops.

Actual behavior The type system is experiencing an infinite loop.

To Reproduce Attempt to resolve the type for the following expression:

let count = (x as number) => if x = 0 then 0 else 1 + @count(x - 1) in @count(10)

JordanBoltonMN avatar Jun 06 '23 15:06 JordanBoltonMN

@mattmasson, how do you think we should handle the typing for recursive functions? For now I'm thinking of adding some recursion detection which assigns it as either any/unknown. Thoughts?

JordanBoltonMN avatar Jun 06 '23 15:06 JordanBoltonMN