Skip to content

Fix UndefRefError from LoweredCodeUtils from InfiniteMPS method signatures - #540

Merged
lkdvos merged 1 commit into
mainfrom
bd/lowered
Oct 13, 2026
Merged

lkdvos merged 1 commit into
mainfrom
bd/lowered

Conversation

@borisdevos

Copy link
Copy Markdown
Member

Description

No clue what the origin of the issue was, so I asked my robot friend for a fix and a brief explanation. Here me paraphrasing it: "Writing S <: Union{Int, <:IndexSpace} puts an anonymous type variable inside the bound of S. For methods with keyword arguments, Revise (through LoweredCodeUtils) re-runs the method's signature to find the generated keyword-body function. It doesn't handle that inner type variable correctly, fails with UndefRefError, and skips the method with a warning. Union{Int, <:IndexSpace} == Union{Int, IndexSpace}, so writing S <: Union{Int, IndexSpace} defines the same methods and avoids the warning."

This would occasionally freeze my REPL in some Revise retrigger, which was very annoying.

Checklist

  • Tests pass locally (julia --project=test test/runtests.jl, or the relevant subset)
  • Documentation updated, if this PR changes public API (docstrings, docs/src/)
  • Runic formatter is run
  • Changelog entry added under [Unreleased] in docs/src/changelog.md, if this PR is user-facing (new feature, behavior change, bug fix, deprecation, or removal)

@lkdvos

lkdvos commented Oct 13, 2026

Copy link
Copy Markdown
Member

fair enough, can you also open an issue for Revise itself?

@lkdvos
lkdvos merged commit 21056b6 into main Oct 13, 2026
1 of 4 checks passed
@lkdvos
lkdvos deleted the bd/lowered branch October 13, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants