Skip to content

Conversation

@oxinabox
Copy link
Member

@oxinabox oxinabox commented Jun 24, 2021

the old way caused errors because sig.parameters can't be used if sig is a UnionAll

end
# New rule should not have appeared
@test collect(_rule_list(rrule)) == old_rrule_list
# Above would error if we were not handling UnionAll's right
Copy link
Member

@mzgubic mzgubic Jun 24, 2021

Choose a reason for hiding this comment

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

What part is the UnionAll?

I can't construct a method which has a signature of UnionAll actually

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a UnionAll over all values F can take

julia> function alt_rrule(
           ::RuleConfig{>:Union{HasForwardsMode,HasReverseMode}}, sum, f::F, xs
       ) where F <: Function
           return 1.0, x->(x,x,x) # this will not be call so return doesn't matter
       end
alt_rrule (generic function with 1 method)

julia> method = first(methods(alt_rrule))
alt_rrule(::RuleConfig{var"#s3"} where var"#s3">:Union{HasForwardsMode, HasReverseMode}, sum, f::F, xs) where F<:Function in Main at REPL[9]:1

julia> method.sig
Tuple{typeof(alt_rrule), RuleConfig{var"#s3"} where var"#s3">:Union{HasForwardsMode, HasReverseMode}, Any, F, Any} where F<:Function

julia> typeof(method.sig)
UnionAll

@oxinabox oxinabox merged commit 7033b82 into master Jun 24, 2021
@codecov
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.29%. Comparing base (f73a842) to head (bcb8400).

Additional details and impacted files
@@           Coverage Diff           @@
##           master       #6   +/-   ##
=======================================
  Coverage   96.29%   96.29%           
=======================================
  Files           2        2           
  Lines          54       54           
=======================================
  Hits           52       52           
  Misses          2        2           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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