Skip to content

Conversation

@vishal2005025
Copy link
Contributor

Summary

Add a diagnostic hint for MethodErrors raised by transpose and adjoint when applied to arrays with unsupported element types, guiding users to use permutedims for dimension reordering.

Changes

  • Add a diagnostic hint in base/errorshow.jl for transpose / adjoint MethodErrors on unsupported element types
  • Explain that these operations are linear-algebra operations applied recursively to elements
  • Suggest permutedims as the correct alternative for permuting dimensions
  • Add tests following the existing errorshow.jl error-hint testing pattern

Testing

Added tests verifying that:

  • The original MethodError is preserved for both transpose and adjoint
  • The new diagnostic hint appears for element types without transpose/adjoint support

Related Issues

Fixes #39938

@vishal2005025
Copy link
Contributor Author

@timholy @simeonschaub please take a look and let me know if any changes are required.

@adienes
Copy link
Member

adienes commented Jan 3, 2026

@vishal2005025 you have been told on multiple occasions to stop pinging people directly like this. I appreciate the contributions but this is feedback that would be very important to take.

@vishal2005025
Copy link
Contributor Author

vishal2005025 commented Jan 3, 2026

Understood - sorry about that. I missed the earlier comment before opening the PR. I appreciate the feedback and will stop pinging people directly going forward.

@vishal2005025 vishal2005025 force-pushed the transpose-adjoint-hint branch 3 times, most recently from 928b219 to 24c5584 Compare January 4, 2026 20:04
@vishal2005025 vishal2005025 force-pushed the transpose-adjoint-hint branch from 24c5584 to 547808f Compare January 5, 2026 04:02
@LilithHafner LilithHafner added the ai Significant generative AI usage is allowed and must be disclosed label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Significant generative AI usage is allowed and must be disclosed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add hint for MethodError on transpose/adjoint

4 participants