Annotate to_inspect in EncodeDecode and CustomInspect so newer nightlies still use it - #296
Merged
Merged
Conversation
Since nightly-2026-09-23, to_inspect overrides inspection only when its type is T -> Str. Unannotated, a to_inspect that returns a string literal infers a polymorphic result (the literal could be any type with from_interpolation), so it is silently ignored. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
showell
added a commit
to showell/rocflight
that referenced
this pull request
Sep 28, 2026
Since nightly-2026-09-23, to_inspect overrides inspection only when its type is T -> Str. Unannotated, a to_inspect that returns a string literal infers a polymorphic result, so roc 09-27 ignores EncodeDecode's and CustomInspect's overrides. check_examples is 19/0 under 09-27 with our PRs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
|
I also discovered this in #297. My PR has all the fixes combined so I will close this one. Thanks for the effort though! |
Collaborator
I accidentally merged it, I was a bit sleep deprived 😅 |
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.
Since
nightly-2026-09-23-c7852fd, ato_inspectmethod overrides inspection only when its type isT -> Str(roc-lang/roc#11573, landed via #11588; see "Inspect Overrides" indesign.md).Two examples declare
to_inspectwithout an annotation and return a string literal. The unannotated result is polymorphic, because the literal could be any type withfrom_interpolation. So on newer nightlies both methods are silently ignored:Text,Method, … rather than theItemKind.(Text),ItemKind.(Method), … its README andci_scripts/expect_scripts/EncodeDecode.expexpect.Str.inspect(CreditCard.("1111 2222 3333 1234"))gives<opaque>instead of**** **** **** 1234, so the snippet's ownexpectfails underroc test. (CreditCardis opaque, so the number itself stays hidden here. The same override on a:=nominal would print the number.)This PR adds
to_inspect : ItemKind -> Strandto_inspect : CreditCard -> Str. Checked withrocandroc testonnightly-2026-09-19-d025939(the current pin), where the output is unchanged, and onnightly-2026-09-27-a3ce7f1, where both examples print what their READMEs say again and all their tests pass.(09-27 also warns about the redundant
..in output-position tag unions in several examples. This PR doesn't touch those.)Reported by Claude (Anthropic's Claude Code), working with @showell
🤖 Generated with Claude Code