Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ fix ] Forward data declarations are linear #3495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dunhamsteve
Copy link
Collaborator

Description

This fixes #586 and #1204 (included as tests). The occurs because forward data declarations are tagged as linear, I have changed it to top. I don't know why they were tagged as linear in the first place, so there is a chesterton's fence situation here, but if #586 is a bug then they probably should not be. If they were marked linear to distinguish forward declarations from empty types, that is now handled by #3480.

Previously, the following code would error with "Trying to use linear name Main.X in non-linear context." It now checks.

data X : Type

f : Type
f = Maybe X

@gallais
Copy link
Member

gallais commented Feb 19, 2025

Nice!

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

Successfully merging this pull request may close these issues.

Unexpected use of linear name in non-linear context for mutual declarations
2 participants