-
Notifications
You must be signed in to change notification settings - Fork 339
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
Weird warning for instance declarations of bad type #6379
Comments
More precise:
I think bound variable is no longer a valid form for instances. That should also be fixed in the docs. |
Yes: addTypedInstance x t = do
(tel , n) <- getOutputTypeName t
case n of
OutputTypeName n -> addNamedInstance x n
OutputTypeNameNotYetKnown{} -> addUnknownInstance x
NoOutputTypeName -> warning $ WrongInstanceDeclaration
OutputTypeVar -> warning $ WrongInstanceDeclaration
OutputTypeVisiblePi -> warning $ InstanceWithExplicitArg x |
I'm a bit confused that the following checks without warning: module _ (B : Set) where
use : {{t : B}} → B
use {{t}} = t but when we declare an instance of the type, there is a warning: module _ (B : Set) where
postulate b : B
instance _ = b
use : {{t : B}} → B
use {{t}} = t produces:
(That's already the new warning message from #6381) |
Never mind everyone, I got it and have to update #6381 ... |
For instance declarations, I would stick with the warning message above. For the types of instance arguments, I think the following makes sense (it is at least something I would have understood): InstanceNoOutputTypeName b -> fsep $
pwords "Instance arguments whose type is not {Γ} → C vs, where C evaluates to a variable or the name of a data or record type, are never considered by instance search," ++
pwords "so having an instance argument" ++ [return b] ++ pwords "has no effect." |
When writing something like this:
I get the following error message:
It should be more helpful to write more or less, what the manual says:
The text was updated successfully, but these errors were encountered: