Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JordanBoltonMN opened this issue Jun 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@JordanBoltonMN
Copy link
Contributor

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 JordanBoltonMN added the bug Something isn't working label Jun 6, 2023
@JordanBoltonMN JordanBoltonMN self-assigned this Jun 6, 2023
@JordanBoltonMN
Copy link
Contributor Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant