luckily the necessary functionality already exists in the form of `addPPExplicitToExposeDiff`. But it is not cheap, and we should not run this code when the error message isn’t shown, so we should do this lazily. We already had `MessageData.ofPPFormat` to assemble the error message lazily, but it was restricted to returning `FormatWithInfo`, a data type that doesn’t admit a nice API to compose more complex messages (like `Format` or `MessageData` has; an attempt to fix that is in #3926). Therefore we split the functionality of `.ofPPFormat` into `.ofFormatWithInfo` and `.ofLazy`, and use `.ofLazy` to compute the more complex error message of `apply`. Fixes #3232. --------- Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk> Co-authored-by: Wojciech Nawrocki <wjnawrocki@protonmail.com>
16 lines
402 B
Text
16 lines
402 B
Text
issue3232.lean:5:2-5:9: error: tactic 'apply' failed, failed to unify
|
|
@foo 42
|
|
with
|
|
@foo 23
|
|
h : foo
|
|
⊢ foo
|
|
issue3232.lean:8:2-8:29: error: tactic 'apply' failed, failed to unify
|
|
@OfNat.ofNat Int 1 instOfNat = 1
|
|
with
|
|
@OfNat.ofNat Nat 1 (instOfNatNat 1) = 1
|
|
⊢ 1 = 1
|
|
issue3232.lean:11:2-11:25: error: tactic 'apply' failed, failed to unify
|
|
PUnit = PUnit
|
|
with
|
|
PUnit = PUnit
|
|
⊢ PUnit = PUnit
|