Split promote methods for MatrixElem#2420
Open
lgoettgens wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2420 +/- ##
==========================================
+ Coverage 88.12% 88.14% +0.01%
==========================================
Files 130 130
Lines 32955 33002 +47
==========================================
+ Hits 29043 29088 +45
- Misses 3912 3914 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jun 8, 2026
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.
Split off from #2280. This currently also contains #2419 since I get a bunch of ambiguity issues without it.
One could think that this is breaking due to removing the dispatch for
Base.promote(x::MatSpaceElem{S}, ::MatRingElem{T})(and the other way around). But this is not the case, as this dispatch used to run into an ambiguity error:With this PR, the behavior is as follows:
I am not sure if we want to keep the last line like that. What happens is that the coefficient ring of the matrix space gets extended to the matrix ring, mapping the original coefficients to diagonal matrices.
However, we have to be careful with adding explicit errors here to not mess up with genuine use-cases where people use MatRingElems as coefficients in their matrices.