From 6c8d367b355fa48b8e10c4372ca4288290cc2b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Wed, 8 Apr 2026 14:58:18 +0200 Subject: [PATCH] Remove type piracy --- src/jump_moi_overloads.jl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/jump_moi_overloads.jl b/src/jump_moi_overloads.jl index f0d22008..2bf0952c 100644 --- a/src/jump_moi_overloads.jl +++ b/src/jump_moi_overloads.jl @@ -321,20 +321,6 @@ end MOI.constant(func::IndexMappedFunction) = MOI.constant(func.func) -# Support JuMP.coefficient on plain MOI functions returned by native solvers -function JuMP.coefficient( - func::MOI.ScalarAffineFunction{T}, - vi::MOI.VariableIndex, -) where {T} - coef = zero(T) - for term in func.terms - if term.variable == vi - coef += term.coefficient - end - end - return coef -end - function JuMP.coefficient(func::IndexMappedFunction, vi::MOI.VariableIndex) return JuMP.coefficient(func.func, func.index_map[vi]) end