You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> type Example{T}
value::TExample(v::T) =new(v)
end
julia>Example(20)
ERROR:`Example{T}` has no method matching Example{T}(::Int64)
julia>Example{T}(a::T) =Example{T}(a)
Example{T} (constructor with 1 method)
julia>Example(20)
Example{Int64}(20)
Maybe I'm missing something, but a I think the type parameter T in the constructor should be inferred as in the method.
The text was updated successfully, but these errors were encountered:
When you define an inner constructor, no default constructors are given. The outer constructor one you defined is exactly the one that would be provided by default if no inner constructors were given. This is all documented in http://docs.julialang.org/en/release-0.3/manual/constructors/#inner-constructor-methods. If you find any of the documentation is unclear, please feel free to make documentation enhancements.
Maybe I'm missing something, but a I think the type parameter T in the constructor should be inferred as in the method.
The text was updated successfully, but these errors were encountered: