Julia: TypeVars in tuples in type parameters

Created on 1 Dec 2016  ·  3Comments  ·  Source: JuliaLang/julia

julia> type Foo{N} end

julia> Foo{(true, true)}
Foo{(true,true)}

julia> typealias Bar{N} Foo{N}
Foo{N}

julia> Bar{(true, true)}
Foo{(true,true)}

julia> typealias Baz Foo{(true, true)}
Foo{(true,true)}

julia> typealias Quuz{M, N} Foo{(M, N)}
TypeError: Foo: in parameter, expected Type{T}, got Tuple{TypeVar,TypeVar}

Yes, those are supposed to be tuples and not tuple types. I blame @Keno (https://github.com/Keno/Cxx.jl/blob/master/src/cxxtypes.jl#L52).

I fully expect this to be unsupported, but I hope that gets @Keno to change (true, false, false) to Tuple{Val{true}, Val{false}, Val{false}} in Cxx.jl.

types and dispatch won't change

All 3 comments

In my defense those used to be one and the same.

That's legit. I'm also digging into Cxx implementation details in order to dispatch on Cxx types, which maybe you hoped people wouldn't do.

Tuple{true, false, false} also works (although slightly weird since it can't actually be the type of anything).

Closing as wontfix, since I don't think we're planning to be able to quantify over tuples.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wilburtownsend picture wilburtownsend  ·  3Comments

i-apellaniz picture i-apellaniz  ·  3Comments

m-j-w picture m-j-w  ·  3Comments

ararslan picture ararslan  ·  3Comments

StefanKarpinski picture StefanKarpinski  ·  3Comments