-
Notifications
You must be signed in to change notification settings - Fork 374
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
Add a warning for incompatible visibilities on forward decls and definitions. #3063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I think we're close!
fac0fce
to
5d22fd9
Compare
@gallais Encapsulated {def : a} -> TTC a => TTC (WithDefault a def) where
toBuf b def = if isDefault def
then tag 0
else do tag 1
toBuf b $ collapseDefault def
|
Regarding the failing CI test, it appears to be ubuntu-test-elab, which pulls in Z-snail's prettier and tries to build it, failing because it needs to be updated with regards to the |
You can open PRs to these repos to get the fixes merged upstream. |
Some more changes to accomodate the LSP package on |
By default we squash on merge so there is no need to clean up the history. |
Also adds onWithDefault, an analogue to `maybe` that allows for reducing a WithDefault value differently depending on whether it was set or not -- mainly to improve the TTC/Reflect instances.
e3b0e98
to
e9b66a1
Compare
Is this just stuck ebcause of |
No, not really, |
I'm confused as to where this is blocking now, is it because of LSP? |
I'm sorry, I lost track of this. Currently blocked because of the LSP, but potentially other stuff in |
ba4bbc1
to
3e7d5aa
Compare
I think we should move ahead with this PR. |
Hey Guillaume, thanks for the kind words. I actually renamed a couple of functions & the data constructors due to feedback ( Edit: Pushed too eagerly, ah. Will update with the new, fixed tests again. |
|
Idris2-lsp also received a pending PR. Some other libraries in pack currently don't compile, but I'll work on PRs for those after this. |
Actually needed one small change to let |
I'm happy to merge this today. |
Should be good, PRs to libraries in Pack have been submitted and I can check the collection in a docker container with those modified dependencies, and all compile (some tests are failing but that's neither a blocker nor caused by this change, necessarily). |
As far as I understand, LSP's PR won't be merged until this PR is merged because they use this repo as a submodule. I'm ready to merge the accodring update to |
Sure, let's go. |
|
LSP has been updated with the commit of the new main. 👍 |
With v0.7.0 out, should I already create a patch changing this into a hard error that we can merge later, or can that wait? |
Description
This addresses #1236 by introducing a warning when a forward declaration and actual definition of a
data
orrecord
type have differing visibility modifiers, unless the definition has none at all - thus it allows code like the following:This makes
Foo
be publicly exported, yet eitherexport
orprivate
would be a warning as suggested by @andrevidela so it can be turned into an error after an upcoming release.Current behaviour is to take the maximum of the two visibility modifiers, so this is technically a breaking change (though taking the max felt like a buggy behaviour).
The special-casing of an absent visibility modifier required the addition of
Libraries.Data.WithDefault
, adapted from @gallais's post on explicit defaults. I had to therefore add to the TTC format since this field is stored in theIData
andIRecord
constructors, and also modiy the TTImp datatypes used inReflection
, making this truly a breaking change.Should this change go in the CHANGELOG?
implementation, I have updated
CHANGELOG.md
(and potentially alsoCONTRIBUTORS.md
).