Skip to content

typename: use nameof instead of reading UnionAll fields - #37

Merged
ablaom merged 1 commit into
JuliaAI:devfrom
KenoAIStaging:fix-typename-unionall
Oct 12, 2026
Merged

ablaom merged 1 commit into
JuliaAI:devfrom
KenoAIStaging:fix-typename-unionall

Conversation

@Keno

@Keno Keno commented Oct 12, 2026

Copy link
Copy Markdown

typename probed isdefined(M, :name) and M.name.name, then M.body for a UnionAll. Julia 1.14 (JuliaLang/julia#63530) stores a UnionAll's binder name in a field called name, so the first branch returned the type variable's name instead of the type's. nameof gives the unqualified type name for both DataType and UnionAll on every supported Julia version.

Assisted-by: Claude Code (Mythos 5.1)

typename probed isdefined(M, :name) and M.name.name, then M.body for a
UnionAll. Julia 1.14 (JuliaLang/julia#63530) stores a UnionAll's binder name
in a field called name, so the first branch returned the type variable's name
instead of the type's. nameof gives the unqualified type name for both
DataType and UnionAll on every supported Julia version.

Assisted-by: Claude Code (Mythos 5.1)
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.50%. Comparing base (8603f6b) to head (74a6bef).
⚠️ Report is 17 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff             @@
##               dev      #37      +/-   ##
===========================================
- Coverage   100.00%   98.50%   -1.50%     
===========================================
  Files            1        1              
  Lines           68       67       -1     
===========================================
- Hits            68       66       -2     
- Misses           0        1       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ablaom

ablaom commented Oct 12, 2026

Copy link
Copy Markdown
Member

@Keno Great to have this fix to a hack. I'm surprised it lasted this long. Wish I'd known about nameof before.

@ablaom
ablaom merged commit 29c19a5 into JuliaAI:dev Oct 12, 2026
4 of 5 checks passed
This was referenced Oct 12, 2026
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.

3 participants