feat: add backward.isDefEq.respectTransparency.types option#13280
Merged
Conversation
This PR adds a new option `backward.isDefEq.respectTransparency.types` to control the transparency used when checking whether the type of a metavariable matches the type of the term being assigned to it. Previously, `checkTypesAndAssign` always bumped transparency to `.default`, which is overly permissive. The new option allows using `.instances` transparency instead, matching the behavior already used for implicit arguments. The option defaults to `false` (preserving old behavior) until stage0 is updated. When `diagnostics` is enabled, a trace message is emitted if the stricter transparency fails but `.default` would have succeeded, helping identify affected code. Also renames `withInstanceConfig` to `withImplicitConfig` since it now serves implicit argument and type checking, not just instances. Registers the `diagnostics` trace class in `CoreM`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
volodeyka
pushed a commit
that referenced
this pull request
Apr 16, 2026
This PR adds a new option `backward.isDefEq.respectTransparency.types` that controls the transparency used when checking whether the type of a metavariable matches the type of the term being assigned to it during `checkTypesAndAssign`. Previously, this check always bumped transparency to `.default` (via `withInferTypeConfig`), which is overly permissive. The new option uses `.instances` transparency instead (via `withImplicitConfig`), matching the behavior already used for implicit arguments. The option defaults to `false` (preserving old behavior) until stage0 is updated and breakage is assessed. If `backward.isDefEq.respectTransparency` (already in v4.29) is set to `false`, then `backward.isDefEq.respectTransparency.types` is automatically treated as `false` too. When `diagnostics` is enabled, a trace message is emitted if the stricter transparency fails but `.default` would have succeeded, helping identify affected code. To investigate failures when enabling `backward.isDefEq.respectTransparency.types`, use: ``` set_option diagnostics true set_option trace.diagnostics true ``` Also renames `withInstanceConfig` to `withImplicitConfig` since it now serves implicit argument and type checking, not just instances. Registers the `diagnostics` trace class in `CoreM`. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new option
backward.isDefEq.respectTransparency.typesthat controls the transparency used when checking whether the type of a metavariable matches the type of the term being assigned to it duringcheckTypesAndAssign. Previously, this check always bumped transparency to.default(viawithInferTypeConfig), which is overly permissive. The new option uses.instancestransparency instead (viawithImplicitConfig), matching the behavior already used for implicit arguments.The option defaults to
false(preserving old behavior) until stage0 is updated and breakage is assessed. Ifbackward.isDefEq.respectTransparency(already in v4.29) is set tofalse, thenbackward.isDefEq.respectTransparency.typesis automatically treated asfalsetoo.When
diagnosticsis enabled, a trace message is emitted if the stricter transparency fails but.defaultwould have succeeded, helping identify affected code. To investigate failures when enablingbackward.isDefEq.respectTransparency.types, use:Also renames
withInstanceConfigtowithImplicitConfigsince it now serves implicit argument and type checking, not just instances. Registers thediagnosticstrace class inCoreM.