Repository navigation
Print local interface range values, their %T, and compare array rows (DEV-164) - #219
tylerlaprade wants to merge 2 commits into
Conversation
…(DEV-164)
Ranging over a slice of a local interface and printing the element did not
compile: the bare-interface print shortcut assumed an unwrapped value, but a
range variable is a wrapped cell. %T on a local interface printed the
interface name instead of the dynamic type. Comparing rows of [][3]int or
[]Point unwrapped the element as a cell. A pointer implementor printed as an
address rather than &{...}, ignoring a String method on *T.
- rangeVarHoldsWrappedCell keeps wrapped range vars off the shortcut.
- writeLocalInterfaceTypeNameFormatArg registers Go type names for the
current package's implementors (including the *T wrapper) and prints
__go_type_name of the dynamic value.
- sequenceElementIsBareValue makes NeedsUnwrapping false for array and
struct elements of slices and arrays.
- pointerLocalInterfaceWrapperDisplay prints &{...}, or the pointee's
String when *T has one. This changes the Display impl in 73 snapshots.
Agent: claude-chat
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TkCXVghVg3khqYkpQSWyEM
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Sorry @tylerlaprade, this account has used its review budget of 1,500,000 diff characters for the last 7 days. You can request another review in 1 day and 11 hours by commenting |
Fixes DEV-164, found by a realistic probe program.
rangeloop now compiles. The bare-interface print shortcut skips wrapped range variables.%Tof a local interface value prints the dynamic type (main.Circle,*main.Rect), not the interface name.grid[i] == grid[j]on rows of[][3]intor[]Pointcompiles. Array and struct elements of slices and arrays are no longer unwrapped as cells.&{...}like Go, or calls the pointee'sStringwhen*Thas one. This changes the generatedDisplayimpl in 73 snapshots; outputs are unchanged.New fixtures:
tests/interface_range_print_and_row_compareand_goroutines. New Go tests ingo/interface_range_print_test.go. Ratchet unchanged (33 known).— agent: claude-chat
Generated by Claude Code
Summary by Sourcery
Fix local interface formatting and composite-value comparisons to match Go semantics.
New Features:
%T.Bug Fixes:
Stringmethods and struct pointer formatting.Enhancements:
Tests:
Chores: