Instantiation of Tuple with value type parameters

Well, that’s not the definition of a singleton type in julia. A singleton type in julia is a type that has only one instance (i.e. no field). Based on the definition of the Tuple type, a Tuple{3,4} is a type with a field of value 3 and a field of value 4. That’s just invalid.

Of course you may say that field of invalid type is not a field but making this kind of argument for corner cases isn’t what a language should do. There’s simply no reason to allow it. In fact, even Tuple{3,4} should have been an error since it’s not really a valid type. It is only allowed because some package was using it before people realized.

And there, that conflicts with the definition of singleton type.

2 Likes