-
Notifications
You must be signed in to change notification settings - Fork 382
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
Access modifiers of definitions overwrite forward definitions #1236
Comments
I'm going to go ahead and tag this as good first issue because I assume it's something silly |
Right now, f76c4c4307 "fixes" this by forcing the maximum visibility to apply. This makes any combination of the three modifiers on either of the forward or actual declaration result in the higher of the two, e.g. module Mutual
private
data Foo : Type
export
data Foo : Type where module Mutual
export
data Foo : Type
private
data Foo : Type where both work as if a single declaration with We can either leave it like this and close the issue (unsatisfying) or modify the max-merge to instead check whether they're the same and throw an error if not - this however makes the following not work anymore: module Mutual
export
data Foo : Type
-- no visibility
data Foo : Type where Which, while technically consistent (no visibility == Making the above I'll put this up here before I tackle solving it, so please add your input which solution would be the best! Might even be a good idea to add votes, so:
|
If only we had a gadget that allowed us to express that something is the default |
Are you suggesting I use this to implement Nr. 3? Or just a general comment? |
Yeah I think it'd be nice to complain if there are conflicting declarations which means changing |
Is this still an issue? It seems like we get correctly warned now... |
Steps to Reproduce
Expected Behavior
Type-checking
Mutual.idr
should report an error because the access modifiers are incompatible.Observed Behavior
The latest definition overwrites the access modifier, and
Import.idr
type-checks fine.The text was updated successfully, but these errors were encountered: