I ran into similar mental difficulty regarding whether type Any is a superset of any other types. I did not find anything to read, but simply accepted the fact through painstaking experiments.

I think the word "Any" here is confusing. The English definition of it means that it ought to include any types. Perhaps we should seek other word to define this type. Word like "Mixed" might be more appropriate for this?

On 2014年11月27日 08:17, Patrick O'Leary wrote:

You've hit type invariance. In Julia, parametric types are invariant--that is, Dict{ASCIIString,Float64} is not a subtype of Dict{ASCIIString,Any}.

For more information on why we use invariant parametric types, search the list for "parametric invariant" or similar; there have been a few discussions on the topic.

Patrick

Reply via email to