From 9bb5f6aec0e94cfd39e4208a4a1bad25f6e36c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 11 Apr 2024 18:50:11 +0200 Subject: [PATCH] Small enhancement --- src/AbstractAlgebra.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AbstractAlgebra.jl b/src/AbstractAlgebra.jl index 62eb9e6b8..1ec67c4f9 100644 --- a/src/AbstractAlgebra.jl +++ b/src/AbstractAlgebra.jl @@ -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 @@ -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