Skip to content

Commit

Permalink
Small enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Apr 11, 2024
1 parent 9e82859 commit 9bb5f6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ include("PrintHelper.jl")
# parent(b) == a && return a
# return force_coerce(a, b)
#
function force_coerce(a, b, throw_error::Val{T} = Val(true)) where {T}
if throw_error isa Val{true}
function force_coerce(a, b, Val{throw_error} = Val(true)) where {throw_error}
if throw_error
error("coercion not possible")
end
return nothing
Expand All @@ -117,8 +117,8 @@ end
# a common over structure
# designed(?) to be minimally invasive in AA and Nemo, but filled with
# content in Hecke/Oscar
function force_op(op::Function, throw_error::Val{T}, a...) where {T}
if throw_error isa Val{true}
function force_op(op::Function, Val{throw_error}, a...) where {throw_error}
if throw_error
error("no common overstructure for the arguments found")
end
return false
Expand Down

0 comments on commit 9bb5f6a

Please sign in to comment.