Skip to content

Commit e602da9

Browse files
authored
Merge pull request #812 from JuliaRobotics/21Q4/enh/noreturn
don't force return types, esp non-concrete type
2 parents 5069847 + 0b70bc7 commit e602da9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ end
360360
#Alias
361361
deleteVariable!(dfg::CloudGraphsDFG, variable::DFGVariable) = deleteVariable!(dfg, variable.label)
362362

363-
function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol; suppressGetFactor::Bool=false)::Union{Nothing, DFGFactor}
363+
# return ::DFGFactor, or workaround ::Nothing, #809
364+
function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol; suppressGetFactor::Bool=false)
364365
factor = suppressGetFactor ? nothing : getFactor(dfg, label)
365366
if factor === nothing && !suppressGetFactor
366367
error("Unable to retrieve the ID for factor '$label'. Please check your connection to the database and that the factor exists.")
@@ -378,7 +379,7 @@ function deleteFactor!(dfg::CloudGraphsDFG, label::Symbol; suppressGetFactor::Bo
378379
end
379380

380381
# Alias
381-
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; suppressGetFactor::Bool=false)::Union{Nothing, DFGFactor} = deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)
382+
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; suppressGetFactor::Bool=false) = deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)
382383

383384
function getVariables(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=nothing; tags::Vector{Symbol}=Symbol[], solvable::Int=0)::Vector{DFGVariable}
384385
variableIds = listVariables(dfg, regexFilter, tags=tags, solvable=solvable)
@@ -980,4 +981,4 @@ function SkeletonDFG(cfg::CloudGraphsDFG)
980981
addVariable!.(sfg, _getSkeletonVariables(cfg))
981982
addFactor!.(sfg, _getSkeletonFactors(cfg))
982983
return sfg
983-
end
984+
end

0 commit comments

Comments
 (0)