-
Notifications
You must be signed in to change notification settings - Fork 105
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
Segmentation fault: 11 when trying to define a method which returns a new “instance” of a class #3057
Comments
Heh, if the good old identity functor fails, then all bets are off! ;-) |
I bet this is a mutual recursion problem. I have seen OCaml segfaulting when exhausting the stack several times. |
Interesting... |
If anyone has any suggestions on how to tackle this I can try to take a look. |
@paulyoung is this a curiosity problem ("let's code up some Haskell idioms in Motoko") or appearing in your production code? |
@nomeata you have squashed "not lazy enough reference" bugs in the past. Maybe this rings a bell? |
Not in the typechecker… :-) |
@ggreif I’m trying to do the former to see if there’s something interesting to write about and perhaps promote Motoko, but bugs like this are preventing me from reaching the latter. |
I think this type should actually be rejected as expansive since it involves polymorphic recursion. c.f.
Hacky branch investigating the bug with sad attempts to alter the expansiveness check here are in branch |
By which definition of polymorphic recursion? It would be polymorphic recursion when the type variable ( EDIT: Maybe you are right, after re-reading the wikipedia article — "where the type parameter changes with each recursive invocation" I can see that |
I’m sure I brought this up before but I ran into it again and couldn’t find anything about it.
Here’s a fairly minimal example that reproduces the issue when run with
--check
:The text was updated successfully, but these errors were encountered: