Open david-christiansen opened 2 weeks ago
This should likely be regarded as intended: default instances are a separate synthesis step (as we want to delay them as much as possible) and thus e.g. do not contribute in TC-internal backtracking either.
Description
When working on examples for the reference manual, I noticed some interesting behavior.
Given this definition:
these (silly, inefficient, but instructive) instances allow literals up to 254 on the latest nightly:
That is, these work:
but this doesn't:
But adding them as default instances changes things!
This now works, giving type
Even
:Making that number bigger makes elaboration slower, and heartbeats run out at 892.
Steps to Reproduce
default_instance
attribute is added.Expected behavior:
I would expect the same size/depth limits on default instances that there are on other instances.
Actual behavior:
Much larger/deeper synthesis is performed when the instances involved are default.
Versions
The behavior is visible on all three Lean versions on live.lean-lang.org: nightly-2024-10-31, v4.13.0-rc4, and 4.11.0.
This is on live.lean-lang.org.
Impact
Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.