diff --git a/src/services/Serialization.jl b/src/services/Serialization.jl index b84dc096..3cf3723c 100644 --- a/src/services/Serialization.jl +++ b/src/services/Serialization.jl @@ -55,9 +55,21 @@ function parseVariableType(_typeString::AbstractString) typeString = _typeString end - all_subtypes = Dict(map(s -> nameof(s) => s, subtypes(InferenceVariable))) + split_typeSyms = Symbol.(split(typeString, ".")) - subtype = get(all_subtypes, Symbol(split(typeString, ".")[end]), nothing) + subtype = nothing + + if length(split_typeSyms) == 1 + @warn "Module not found in variable '$typeString'." maxlog = 1 + subtype = getfield(Main, split_typeSyms[1]) # no module specified, use Main + #FIXME interm fallback for backwards compatibility in IIFTypes and RoMETypes + elseif split_typeSyms[1] in Symbol.(values(Base.loaded_modules)) + m = getfield(Main, split_typeSyms[1]) + subtype = getfield(m, split_typeSyms[end]) + else + @warn "Module not found in Main, using Main for type '$typeString'." maxlog = 1 + subtype = getfield(Main, split_typeSyms[end]) + end if isnothing(subtype) throw(SerializationError("Unable to deserialize type $(_typeString), not found")) diff --git a/test/runtests.jl b/test/runtests.jl index 434bd5ec..cdd7951b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -63,10 +63,22 @@ end if get(ENV, "IIF_TEST", "true") == "true" # Switch to our upstream test branch. + #FIXME This is a temporary fix to use the develop branch of IIF. + # Pkg.add(PackageSpec(; name = "IncrementalInference", rev = "upstream/dfg_integration_test")) + # Pkg.add(PackageSpec(; name = "IncrementalInference", rev = "develop")) Pkg.add( - #FIXME This is a temporary fix to use the refactored factor branch. - # PackageSpec(; name = "IncrementalInference", rev = "upstream/dfg_integration_test"), - PackageSpec(; name = "IncrementalInference", rev = "develop"), + PackageSpec(; + url = "https://github.com/JuliaRobotics/IncrementalInference.jl.git", + subdir = "IncrementalInferenceTypes", + rev = "develop", + ), + ) + Pkg.add( + PackageSpec(; + url = "https://github.com/JuliaRobotics/IncrementalInference.jl.git", + subdir = "IncrementalInference", + rev = "develop", + ), ) @info "------------------------------------------------------------------------" @info "These tests are using IncrementalInference to do additional driver tests"