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

Stack overflow with polymorphic recursion #952

Open
lukechu10 opened this issue Jun 18, 2023 · 1 comment
Open

Stack overflow with polymorphic recursion #952

lukechu10 opened this issue Jun 18, 2023 · 1 comment

Comments

@lukechu10
Copy link

The following code currently produces a stack overflow:

type Foo a = | FooA a
let f x = f (FooA x)

Polymorphic recursion is generally not allowed is other languages because it makes type inference undecidable. I'm guessing the stack overflow is because it's not possible to unify the type of f here?

@Marwes
Copy link
Member

Marwes commented Jun 19, 2023

Yeah, that should be an error just that the error isn't detected (might have had detection for it, but I guess I broke it in that case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants