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

Aliases don't work with non-recursive definitions #3201

Closed
lukaszcz opened this issue Nov 29, 2024 · 0 comments · Fixed by #3203
Closed

Aliases don't work with non-recursive definitions #3201

lukaszcz opened this issue Nov 29, 2024 · 0 comments · Fixed by #3203

Comments

@lukaszcz
Copy link
Collaborator

Typechecking

module aliases;

import Stdlib.Data.Nat open;

Name : Type := Nat;

syntax alias T := Name;

gives

/home/heliax/Documents/progs/juvix/aliases.juvix:7:19-23: error:
Symbol not in scope: Name
Perhaps you meant: Nat

However, typechecking

module aliases;

import Stdlib.Data.Nat open;

Name (A : Type) : Type := Nat;

syntax alias T := Name;

succeeds.

The problem seems to be that after merging PR #3138 the non-recursive definition names are not pre-reserved. The syntax alias declaration seems to be resolved in an earlier stage using the reserved names instead of using the defined ones later on.

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

Successfully merging a pull request may close this issue.

1 participant