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
Function definition is ignored #92
Comments
Maybe I was wrong because |
Now I'm determined to keep this pattern matching as it is except for ignoring |
You are correct, this bug is due to a leak in the pattern match. As far as I can see in the debug mode, your fix solves this issue, and the stack overflow seems to be a type inference bug, not a parser bug. In the meantime, could you please send me a PR that fixes this bug? |
I fixed the infinite recursion issue in #96. |
Thank you for information! I will open PR soon. |
Describe the bug
Function declaration ignored, i.e. like encountering
NameError
onf(1)
afterf x = x
.Reproducible code
Expected behavior
Call
f
.Additional context
Actually I found it's originated in
Desugarer::desugar_pattern
.Its matching ignores
Expr::Def(Def { sig: Signature::Subr(v)..})
like:Thus, function parsed as
Subr
vanishes there.However just fixing this as
produces stack overflow (eternal recursion) in compile process.
Maybe compiler also have some bug as the eternal recursion is not desireble if it's fatal error, but we have to add desugaring logic for
Signature::Subr
here first, rather than just passing it through this matching, right?If so, I'm willing to implement them as it seems to be good first implementation to get used to
Erg
's syntax.(And maybe fixing compiler bug is also not difficult and I'm willing to do it too.)
The text was updated successfully, but these errors were encountered: