JuliaLang/julia — Issue #357: Update "Conversion and Promotion" section in manual
Author: ViralBShah
Created: 2012-02-05 16:42:36+00:00
State: open
Labels: documentation

As reported on the mailing list by Jason Aten:

On this page, https://github.com/JuliaLang/julia/wiki/Types, there is the following statement, and I cannot reproduce the claim in my build (see below for example). Certainly could be user error; I'm new.

"Since the type of of the desired object is fully specified in this form, the provided arguments need not match the expected field type exactly, and will be converted (see Conversion and Promotion) automatically to the expected type"

~/pkg/julia/julia$ ./julia-debug-readline
_
_ _ _(_)_ |
(_) | (_) (_) | A fresh approach to technical computing
_ _ _| |_ __ _ |
| | | | | | |/ _` | | Version 0.0.0-prerelease
| | |_| | | | (_| | | Commit 23b578a9be (2012-02-04 00:35:50)
_/ |\__'_|_|_|\__'_| |
|__/ |

julia> type Point{T} ; x::T ; y::T; end

julia> Point{Float64}(1,2.5)
no method Point(Int64,Float64)
in method_missing, /home/jaten/pkg/julia/julia/j/base.j:58
in _jl_eval_user_input, /home/jaten/pkg/julia/julia/j/client.j:59
in run_repl, /home/jaten/pkg/julia/julia/j/client.j:92
in _start, /home/jaten/pkg/julia/julia/j/client.j:206