Skip to content

feat: add backward.isDefEq.respectTransparency.types option#13280

Merged
leodemoura merged 1 commit into
masterfrom
grind_defeq_todo_2
Apr 4, 2026
Merged

feat: add backward.isDefEq.respectTransparency.types option#13280
leodemoura merged 1 commit into
masterfrom
grind_defeq_todo_2

Conversation

@leodemoura
Copy link
Copy Markdown
Member

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.

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>
@leodemoura leodemoura added the changelog-language Language features and metaprograms label Apr 4, 2026
@leodemoura leodemoura enabled auto-merge April 4, 2026 17:43
@leodemoura leodemoura added this pull request to the merge queue Apr 4, 2026
Merged via the queue into master with commit 9f49ea6 Apr 4, 2026
23 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant