Skip to content

Commit ce80375

Browse files
authored
Merge pull request #511 from JuliaParallel/isless-invalidations
Add type restrictions to Base.isless() methods to fix invalidations
2 parents 4e4f4d5 + a9ac65b commit ce80375

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/scopes.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ Constructs a scope that is the intersection of scopes `x` and `y`.
150150
constrain(x, y) = x < y ? constrain(y, x) : throw(MethodError(constrain, x, y))
151151

152152
Base.isless(::AnyScope, ::AnyScope) = false
153-
Base.isless(::AnyScope, x) = false
154-
Base.isless(x, ::AnyScope) = true
153+
Base.isless(::AnyScope, ::AbstractScope) = false
154+
Base.isless(::AbstractScope, ::AnyScope) = true
155155
constrain(::AnyScope, ::AnyScope) = AnyScope()
156156
constrain(::AnyScope, y) = y
157157

@@ -161,8 +161,8 @@ taint_match(::DefaultEnabledTaint, x::Processor) = default_enabled(x)
161161
taint_match(::ProcessorTypeTaint{T}, x::Processor) where T = x isa T
162162
Base.isless(::TaintScope, ::TaintScope) = false
163163
Base.isless(::TaintScope, ::AnyScope) = true
164-
Base.isless(::TaintScope, x) = false
165-
Base.isless(x, ::TaintScope) = true
164+
Base.isless(::TaintScope, ::AbstractScope) = false
165+
Base.isless(::AbstractScope, ::TaintScope) = true
166166
function constrain(x::TaintScope, y::TaintScope)
167167
scope = constrain(x.scope, y.scope)
168168
if scope isa InvalidScope

0 commit comments

Comments
 (0)