Instances don't cache if the expected type isn't known at the time of creation #2696
Closed
1 task done
Labels
bug
Something isn't working
Prerequisites
Description
If the expected type of the expression is not known at the time of adding an expression into the local context. See this example:
The commented versions all succeed, the un-commented one fails.
Context
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Typeclass.20inference.20completely.20fails.20if.20a.20term.20has.20a.20.60let.60 is my thread about the issue; it has some examples of when the issue originally popped up, for example, when using a
let
binding to add the issue.Expected behavior: The instance of
Foo
being available in the cache.Actual behavior: The instance of
Foo
does not appear in the cache.Versions
Lean (version 4.2.0-rc2, commit f98fb8a, Release)
MacOS Sonoma 14.0
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: