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

Stop using Core.Compiler.return_type #140

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link

Base.promte_op is a strictly less sketchy version.

Copy link
Owner

@andyferris andyferris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @oscardssmith!

@andyferris
Copy link
Owner

Hmm, there seems to be an issue with broadcast?

src/broadcast.jl Outdated
@@ -19,7 +19,7 @@ _data(d::BroadcastedDictionary) = getfield(d, :data)
sharetokens = _sharetokens(dicts...)
I = keytype(dicts[1])
Ts = Base.Broadcast.eltypes(data)
T = Core.Compiler.return_type(f, Ts)
T = Base.promote_op(f, Ts...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be Ts.parameters...?

Is that construction inferrable? (If not we can make a pure function with @assume_effects)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it turns out that there already is Base.Broadcast.combine_eltypes that does this functionality (except slightly more correctly).

src/broadcast.jl Outdated Show resolved Hide resolved
Co-authored-by: Théo Galy-Fajou <theo.galyfajou@gmail.com>
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 80.51%. Comparing base (27b59aa) to head (b0a1d3d).
Report is 2 commits behind head on master.

Files Patch % Lines
src/Dictionary.jl 0.00% 2 Missing ⚠️
src/map.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
+ Coverage   80.48%   80.51%   +0.03%     
==========================================
  Files          21       21              
  Lines        2357     2356       -1     
==========================================
  Hits         1897     1897              
+ Misses        460      459       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oscardssmith
Copy link
Author

should this be merged?

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

Successfully merging this pull request may close these issues.

3 participants