Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
show
for MethodList
when methods are from another module
When a type is defined in one module but its methods are defined elsewhere, `show_method_table` errors due to an incorrect lookup of the defining module used to determine colors for printing. In particular, the code had been assuming that the type is defined in the module in which its constructor's first method (in the sense of `first(methods())`) is defined, which isn't always true. To fix this, we can look through the available methods and choose the first in which the type is defined in the method's module, falling back to the method table's module otherwise. Fixes #49382 Fixes #49403 Fixes #52043
- Loading branch information