-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @oscardssmith!
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...) |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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).
Co-authored-by: Théo Galy-Fajou <theo.galyfajou@gmail.com>
Codecov ReportAttention: Patch coverage is
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. |
should this be merged? |
Base.promte_op
is a strictly less sketchy version.