Skip to content

Fix: Tip line shows parameterized type name in strategy show#504

Merged
ocots merged 1 commit into
mainfrom
fix/tip-display-parameterized-strategy
Jul 23, 2026
Merged

Fix: Tip line shows parameterized type name in strategy show#504
ocots merged 1 commit into
mainfrom
fix/tip-display-parameterized-strategy

Conversation

@ocots

@ocots ocots commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

The Tip message in Base.show(io, MIME"text/plain", strategy) used type_name (just nameof(T)) instead of display_name (which includes the parameter, e.g. DifferentiationInterface{GPU}).

This caused the Tip to always show describe(DifferentiationInterface) even for parameterized instances like DifferentiationInterface{GPU}().

Changes

  • src/Strategies/contract/abstract_strategy.jl: Changed type_name to display_name in the Tip println call. Updated docstring example to show both non-parameterized and parameterized cases.
  • test/suite/strategies/test_coverage_abstract_strategy.jl: Added fake parameterized strategy (CovFakeParamStrategy{P}) and two test cases verifying the Tip shows the correct type name with and without parameter.

Testing

All 943 tests in the strategies suite pass.

…ized type name

The Tip message in Base.show(io, MIME"text/plain", strategy) used
type_name (just nameof(T)) instead of display_name (which includes the
parameter, e.g. DifferentiationInterface{GPU}). This caused the Tip to
always show describe(DifferentiationInterface) even for parameterized
instances like DifferentiationInterface{GPU}.

Changed type_name to display_name in the Tip println call. Updated the
docstring example to show both non-parameterized and parameterized cases.

Added tests with a fake parameterized strategy (CovFakeParamStrategy{P})
to verify:
- Non-parameterized: Tip shows describe(CovFakeStrategy) without {…}
- Parameterized: Tip shows describe(CovFakeParamStrategy{CPU}) with {CPU}
@ocots
ocots merged commit 0ddbd8b into main Jul 23, 2026
3 checks passed
@ocots
ocots deleted the fix/tip-display-parameterized-strategy branch July 23, 2026 10:06
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.

1 participant