You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
descr := "maximum number of nested `synthPending` invocations. When resolving unification constraints, pending type class problems may need to be synthesized. These type class problems may create new unification constraints that again require solving new type class problems. This option puts a threshold on how many nested problems are created."
501
538
}
502
539
540
+
/--
541
+
Accumulated `synthPending` decisions of a type class query, used by the type class
542
+
resolution cache to bound the `synthPendingDepth` values at which the result may be reused.
543
+
See `SynthInstanceCacheEntry.relSynthPendingDepth`.
544
+
-/
545
+
structureSynthPendingActivitywhere
546
+
/-- Maximum `synthPendingDepth` at which a `synthPending` decision was reached. -/
547
+
maxDepth : Option Nat := none
548
+
/-- Whether some `synthPending` invocation gave up because of `maxSynthPendingDepth`. -/
549
+
guardHit : Bool := false
550
+
503
551
/--
504
552
Contextual information for the `MetaM` monad.
505
553
-/
@@ -540,6 +588,15 @@ structure Context where
540
588
Remark: `synthPending` fails if `synthPendingDepth > maxSynthPendingDepth`.
541
589
-/
542
590
synthPendingDepth : Nat := 0
591
+
/--
592
+
When set, the reference accumulates the `synthPending` decisions reached during the
593
+
current type class query, i.e. behavior that may depend on `synthPendingDepth`. The type
594
+
class resolution cache uses this to decide at which depths a result may be reused; see
595
+
`SynthInstanceCacheKey.synthPendingDepth` and `SynthInstanceCacheEntry.relSynthPendingDepth`.
596
+
The reference is intentionally not part of the backtrackable state: a `synthPending`
597
+
invocation in a discarded search branch still influenced the search outcome.
0 commit comments