Conversation
After the receiver context change, the tag of a runtime type error names
the class the method is checked for: the hooked class in `rbs test`.
When the method is called on a subclass or on a class that includes or
extends a module, the message doesn't tell which receiver it was.
Record the receiver class in the error structs as `receiver_class`, and
append it to `Errors.to_string` when it differs from the class in the
tag:
[Foo.make] ReturnTypeError: expected `instance` but returns `#<Foo>` (receiver: SubFoo)
`RBS::UnitTest::TypeAssertions` passes the `testing` target as `owner:`,
so assertion failures are tagged the same way. The overload warning log
appends the note once rather than to every detail. Anonymous classes are
shown with `inspect` instead of an empty name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ksss
force-pushed
the
type-check-error-owner
branch
from
October 3, 2026 15:54
b9af1e3 to
4395772
Compare
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.
Stacked on #3194. Please review that one first.
With the receiver context from #3194, a method can be checked against a receiver of a different class than the one the error is reported on. For example,
rbs testreportsFoo.makecalled onSubFooas[Foo.make], and nothing in the message tells which receiver it was.This PR records the receiver class in the errors and appends it to the message when it differs from the class in the tag:
RBS::UnitTest::TypeAssertionsnow reports errors on thetestingtarget, likerbs testdoes on the hooked class. Before this, the tag used the receiver's class.🤖 Generated with Claude Code