Skip to content

Commit

Permalink
Merge pull request #812 from JuliaRobotics/21Q4/enh/noreturn
Browse files Browse the repository at this point in the history
don't force return types, esp non-concrete type
  • Loading branch information
dehann authored Oct 17, 2021
2 parents 5069847 + 0b70bc7 commit e602da9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/CloudGraphsDFG/services/CloudGraphsDFG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ end
#Alias
deleteVariable!(dfg::CloudGraphsDFG, variable::DFGVariable) = deleteVariable!(dfg, variable.label)

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

# Alias
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; suppressGetFactor::Bool=false)::Union{Nothing, DFGFactor} = deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)
deleteFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; suppressGetFactor::Bool=false) = deleteFactor!(dfg, factor.label, suppressGetFactor=suppressGetFactor)

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

0 comments on commit e602da9

Please sign in to comment.