Skip to content

Commit 198c588

Browse files
authored
Merge pull request #672 from JuliaRobotics/feat/4Q20/bettervarserialize
deserialize vartype{T} fix #671
2 parents 81245b0 + 0ef7244 commit 198c588

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.10.5"
3+
version = "0.10.6"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/services/Serialization.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ function getTypeFromSerializationModule(softtypeString::String)
8484
else
8585
m = Main
8686
end
87-
return getfield(m, Symbol(split_st[end]))
87+
noparams = split(split_st[end], r"{")
88+
ret = if 1 < length(noparams)
89+
# fix #671, but does not work with specific module yet
90+
bidx = findfirst(r"{", split_st[end])[1]
91+
eval(Base.Meta.parse("Main.$(noparams[1])$(split_st[end][bidx:end])"))
92+
else
93+
getfield(m, Symbol(split_st[end]))
94+
end
95+
96+
return ret
8897

8998
catch ex
9099
@error "Unable to deserialize soft type $(softtypeString)"

0 commit comments

Comments
 (0)