agda / agda

Agda is a dependently typed programming language / interactive theorem prover.
https://wiki.portal.chalmers.se/agda/pmwiki.php
Other
2.39k stars 337 forks source link

INJECTIVE_FOR_INFERENCE silently ignored on non-functions #7245

Closed andreasabel closed 2 weeks ago

andreasabel commented 4 weeks ago

Pragma INJECTIVE_FOR_INFERENCE is currently silently ignored if applied to a non-function. We would like to be warned about the UselessInjectiveForInferencePragma. https://github.com/agda/agda/blob/185d9d4761db0c5a261fd449fbfef04bf9319377/src/full/Agda/TypeChecking/Rules/Decl.hs#L778 Notably, the implementation is framed by cases that make more effort (StaticPragma, NotProjectionLikePragma, InlinePragma): https://github.com/agda/agda/blob/185d9d4761db0c5a261fd449fbfef04bf9319377/src/full/Agda/TypeChecking/Rules/Decl.hs#L772-L791 I am saying "more effort" here because these cases have some deficiencies:

ATTN: @WhatisRT @UlfNorell