-
Notifications
You must be signed in to change notification settings - Fork 94
Add nospecialize to some very highly specialized methods #2830
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -303,10 +303,10 @@ function MOI.is_valid(model::AbstractModel, ci::MOI.ConstraintIndex) | |
end | ||
|
||
function MOI.supports_constraint( | ||
model::AbstractModel, | ||
::Type{F}, | ||
::Type{S}, | ||
) where {F<:MOI.AbstractFunction,S<:MOI.AbstractSet} | ||
@nospecialize(model::AbstractModel), | ||
@nospecialize(F::Type{<:MOI.AbstractFunction}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one may be more dangerous There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that the inner method will be compiled. It's just this one that isn't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment explaining this ? |
||
@nospecialize(S::Type{<:MOI.AbstractSet}), | ||
) | ||
return MOI.supports_constraint(model.constraints, F, S) | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,9 @@ supported in specific circumstances, for example, `F`-in-`S` constraints cannot | |
combined with another type of constraint, it should still return `true`. | ||
""" | ||
function supports_constraint( | ||
::ModelLike, | ||
::Type{<:AbstractFunction}, | ||
::Type{<:AbstractSet}, | ||
@nospecialize(::ModelLike), | ||
@nospecialize(F::Type{<:AbstractFunction}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's a fallback returning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment explaining this |
||
@nospecialize(S::Type{<:AbstractSet}), | ||
) | ||
return false | ||
end | ||
|
Uh oh!
There was an error while loading. Please reload this page.