module M
struct Container{T}
value::T
end
const IntContainer = Container{Int}
function IntContainer(x::Float64)
return IntContainer(round(Int, x))
end
end # module M
This yields blue squiggles under the definition of function IntContainer(x::Float64) with the following message:
Cannot define function ; it already has a value. Julia(CannotDefineFuncAlreadyHasValue)
This pattern occurs a lot in my package MultiFloats.jl, where I have a generic type MultiFloat{T,N}, and then I define aliases const Float64x2 = MultiFloat{Float64,2} with their own constructors.
Consider the following Julia code:
This yields blue squiggles under the definition of
function IntContainer(x::Float64)
with the following message:This pattern occurs a lot in my package MultiFloats.jl, where I have a generic type
MultiFloat{T,N}
, and then I define aliasesconst Float64x2 = MultiFloat{Float64,2}
with their own constructors.