Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix union{} ambiguity #527

Merged
merged 2 commits into from
Dec 13, 2022
Merged

fix union{} ambiguity #527

merged 2 commits into from
Dec 13, 2022

Conversation

Roger-luo
Copy link
Contributor

@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Base: 94.33% // Head: 94.09% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (26b93f7) compared to base (b550b7b).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #527      +/-   ##
==========================================
- Coverage   94.33%   94.09%   -0.24%     
==========================================
  Files           9        9              
  Lines        1270     1270              
==========================================
- Hits         1198     1195       -3     
- Misses         72       75       +3     
Impacted Files Coverage Δ
src/display.jl 100.00% <ø> (ø)
src/utilities.jl 95.60% <0.00%> (-0.74%) ⬇️
src/conversions.jl 99.13% <0.00%> (-0.29%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Roger-luo
Copy link
Contributor Author

I'm wondering if someone could review this? The test coverage drop does not seem related to this PR.

@johnnychen94 johnnychen94 merged commit 1a153e3 into JuliaGraphics:master Dec 13, 2022
@johnnychen94
Copy link
Member

will make a release later

@aplavin
Copy link

aplavin commented Dec 14, 2022

@Roger-luo @johnnychen94 this PR doesn't have any tests to actually confirm the fix, and AFAIK the fix doesn't work.
Union{} <: T <: Color is exactly the same as T <: Color.

@Roger-luo Roger-luo deleted the roger/union-ambiguity branch December 14, 2022 22:22
@Roger-luo
Copy link
Contributor Author

@aplavin yeah I think you are right, I just realize Union{} <: T is always true, thus this won't work unless we type pirate Union{} this MIME type.

But this does not work for show since lots of backends will call the corresponding show by checking if there is a valid show overloaded for the richest MIME type, e.g https://github.com/fonsp/Pluto.jl/blob/0f0b6f596fd4cf27b2665e1d93ddd44d96fe2a99/src/runner/PlutoRunner.jl#L1148 as a result we will see MIME"text/plain" displayed as picture if we overload

MIME"image/svg+xml" => MIME"text/plain"

I don't have a good way to fix this now.

@aplavin
Copy link

aplavin commented Dec 15, 2022

I agree, and think this PR should be reverted so that not to confuse future readers.

johnnychen94 added a commit that referenced this pull request Dec 15, 2022
@johnnychen94
Copy link
Member

@aplavin Thanks for identifying this. I didn't think carefully when merging it -- was checking it on the phone and did a quick merge. Reverted in 9518578

This Union{} would be a nightmare to JuliaImages. Almost every function is written in such a way.

@johnnychen94
Copy link
Member

johnnychen94 commented Dec 15, 2022

I realize that I shouldn't make the release on the master branch since there are plenty of breaking changes made by @kimikage since v0.12.8. Thus I've made a backport release branch https://github.com/JuliaGraphics/Colors.jl/tree/release-0.12 with a new patch release v0.12.10 to supersede v0.12.9.

v0.12.10 includes #521 (@brenhinkeller) and #525(@williamjsdavis) as bug fixes.

I've also submitted a yank patch for v0.12.9 to General JuliaRegistries/General#74192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants