I want to define a type around a FixedSizeArrays.Vec{N,T} where N is a function of the type parameter:
using FixedSizeArrays
type MT{N}
x::Vec{N,Int}
y::Vec{N+1,Int}
end
This results in the error message:
ERROR: MethodError: `+` has no method matching +(::TypeVar, ::Int64)
Closest candidates are:
+(::Any, ::Any, ::Any, ::Any...)
+(::Int64, ::Int64)
+(::Complex{Bool}, ::Real)
...
Apparently, simple arithmetic with integer type parameters is not allowed, even if the result can be known at compile time. Does anyone know of a workaround for this limitation?