Load the following file:
data A : Set where
bad : A
very : A → A
pattern good = very bad
-- {-# DISPLAY very bad = good #-}
data P : A → Set where
data Q : A → Set where
cons : ∀ {q} → P q → Q q
Wrap : Set
Wrap = Q good
x : Wrap
x = cons {! !}
y : Q (very bad)
y = ?
Agda 2.8.0 displays:
Visible Goals:
?0 : (P (very bad))
?1 : Q good
I would expect something closer to what happens if I un-comment the explicit DISPLAY pragma:
Visible Goals:
?0 : (P good)
?1 : Q good
[there's also the question of P good getting parenthesized for no particular reason, but that one is less pressing]
This is especially puzzling considering that the documentation for pattern synonyms states:
For each pattern pattern lhs = rhs, Agda declares a DISPLAY pragma refolding rhs to lhs (see The DISPLAY pragma for more details).