From 4ee2b41552a6bc95465c12ca66146d69b354317b Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 17 Oct 2014 17:08:02 -0400 Subject: [PATCH] sharpen the result of tmerge() for Tuple types change a comprehension in Pkg.Reqs.Requirement that depended on type inference. due to `call` constructors we simply cannot get its type anymore, although the other change in this commit helps a lot. --- base/inference.jl | 5 ++++- base/pkg/reqs.jl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base/inference.jl b/base/inference.jl index d108a3cda5ad0..7e56e5b565e90 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -1154,7 +1154,10 @@ function tmerge(typea::ANY, typeb::ANY) if typeb <: typea return typea end - if typea <: Tuple && typeb <: Tuple + if isa(typea, Tuple) && isa(typeb, Tuple) + if length(typea) == length(typeb) && !isvatuple(typea) && !isvatuple(typeb) + return typejoin(typea, typeb) + end return Tuple end u = Union(typea, typeb) diff --git a/base/pkg/reqs.jl b/base/pkg/reqs.jl index abcd861364fcd..e901adc3e721d 100644 --- a/base/pkg/reqs.jl +++ b/base/pkg/reqs.jl @@ -24,7 +24,7 @@ immutable Requirement <: Line package = shift!(fields) all(field->ismatch(Base.VERSION_REGEX, field), fields) || error("invalid requires entry for $package: $content") - versions = [VersionNumber(field) for field in fields] + versions = VersionNumber[fields...] issorted(versions) || error("invalid requires entry for $package: $content") new(content, package, VersionSet(versions), system) end