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

Fix bug in scoping for default arguments #3318

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Feb 4, 2025

when we have:

f {arg : Nat := X} ...

then arg should not be in scope in X.

Before this pr, if arg was used in X, we got an impossible error in the typechecker.
E.g. typechecking the following results in a crash. After this pr, it gives a scoping error.

module bug;

type T := mkT;

f {x : T := x} : T := mkT;

@janmasrovira janmasrovira force-pushed the default-arguments-bug branch from 0ebc7ed to 28ff62b Compare February 4, 2025 08:38
@janmasrovira janmasrovira marked this pull request as ready for review February 4, 2025 08:57
@janmasrovira janmasrovira requested a review from lukaszcz February 4, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant