struct Foo
x::Int32
end
x = Foo(1)
struct Foo end
using Serialization
Serialization.serialize("test.jls", x)
println(x) # prints "@world(Foo, 38778:38781)(1)"
println(Serialization.deserialize("test.jls")) # prints "Foo()"
In the the other order, this even breaks the serialization format:
struct Foo end
x = Foo()
struct Foo
x::Int32
end
using Serialization
Serialization.serialize("test.jls", x)
println(x) # prints "@world(Foo, 38775:38777)()"
println(Serialization.deserialize("test.jls")) # ERROR: EOFError: read end of file
This errors:
ERROR: EOFError: read end of file
Stacktrace:
[1] read(s::IOStream, ::Type{UInt8})
@ Base ./iostream.jl:424