Skip to content

Commit

Permalink
Temporarily disable type parameters that are themselves tuples
Browse files Browse the repository at this point in the history
On 0.4, we can't differentiate between these and tuples of types that
were saved by earlier versions of Julia. In earlier versions of Julia,
such tuples were not bits typed so they would not have been usable
anyway. We can revisit this when we're ready to change the file format
(perhaps as part of #204/#218)
  • Loading branch information
simonster committed Apr 24, 2015
1 parent 15ad05a commit 6bb6d9b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -834,13 +834,15 @@ function full_typename(io::IO, file::JldFile, tv::TypeVar)
print(io, ')')
end
end
function full_typename(io::IO, file::JldFile, jltype::@compat Tuple{Vararg{Type}})
print(io, '(')
for t in jltype
full_typename(io, file, t)
print(io, ',')
if VERSION < v"0.4.0-dev+4319"
function full_typename(io::IO, file::JldFile, jltype::@compat Tuple{Vararg{Type}})
print(io, '(')
for t in jltype
full_typename(io, file, t)
print(io, ',')
end
print(io, ')')
end
print(io, ')')
end
function full_typename(io::IO, ::JldFile, x)
# Only allow bitstypes that show as AST literals and make sure that they
Expand All @@ -849,7 +851,7 @@ function full_typename(io::IO, ::JldFile, x)
# A different implementation will be required to support custom immutables
# or things as simple as Int16(1).
s = sprint(show, x)
if isbits(x) && parse(s) === x
if isbits(x) && parse(s) === x && !isa(x, Tuple)
print(io, s)
else
error("type parameters with objects of type ", typeof(x), " are currently unsupported")
Expand Down

0 comments on commit 6bb6d9b

Please sign in to comment.