Skip to content

Commit

Permalink
add the long-awaited call=>convert fallback
Browse files Browse the repository at this point in the history
I put `::T` on there for now; we'll see how that goes.
  • Loading branch information
JeffBezanson committed Oct 20, 2014
1 parent bcbb53c commit 39dfd92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ call(T::Type{TopNode}, s::Symbol) = Core.call(T, s)
call(T::Type{Module}, args...) = Core.call(T, args...)
call(T::Type{Task}, f::ANY) = Core.call(T, f)

call{T}(::Type{T}, args...) = convert(T, args...)::T

convert{T}(::Type{T}, x::T) = x

convert(::(), ::()) = ()
Expand Down
1 change: 0 additions & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,6 @@ type Foo4376{T}
end

@test isa(Foo4376{Float32}(Foo4376{Int}(2)), Foo4376{Float32})
@test_throws MethodError Foo4376{Float32}(Foo4376{Float32}(2.0f0))

type _0_test_ctor_syntax_
_0_test_ctor_syntax_{T<:String}(files::Vector{T},step) = 0
Expand Down

0 comments on commit 39dfd92

Please sign in to comment.