INJECTIVE_FOR_INFERENCE silently ignored on non-functions
andreasabel opened this issue · comments
Pragma INJECTIVE_FOR_INFERENCE
is currently silently ignored if applied to a non-function.
We would like to be warned about the UselessInjectiveForInferencePragma
.
agda/src/full/Agda/TypeChecking/Rules/Decl.hs
Line 778 in 185d9d4
Notably, the implementation is framed by cases that make more effort (
StaticPragma
, NotProjectionLikePragma
, InlinePragma
):agda/src/full/Agda/TypeChecking/Rules/Decl.hs
Lines 772 to 791 in 185d9d4
I am saying "more effort" here because these cases have some deficiencies:
- use of
GenericError
- error instead of warning
- unclear what happens for
abstract
(becausegetConstInfo
might returnAbstractDefn
); there should be comments showing that the implementor was aware ofabstract
and the current implementation works as expected forabstract
ATTN: @WhatisRT @UlfNorell