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

Better error when compiling level definitions #355

Closed
omelkonian opened this issue Sep 2, 2024 · 1 comment
Closed

Better error when compiling level definitions #355

omelkonian opened this issue Sep 2, 2024 · 1 comment
Assignees
Milestone

Comments

@omelkonian
Copy link
Contributor

A user is allowed to compile a level definition, resulting in confusing error messages:

open import Agda.Primitive using (Level; lzero)

zeroLvl : Level
zeroLvl = lzero
{-# COMPILE AGDA2HS zeroLvl #-}
Functions defined with absurd patterns exclusively are not supported. Use function `error` from the Haskell.Prelude instead.

We should give a more appropriate level (e.g. Cannot compile level definitions), or at least a warning for the user to not use compile pragmas on level definitions.

@omelkonian
Copy link
Contributor Author

This was fixed by PR #358, which now more adequately reports:

Bad Haskell type: Level

@jespercockx jespercockx added this to the 1.3 milestone Sep 26, 2024
@jespercockx jespercockx self-assigned this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants