I the following warnings when i execute the code written below
WARNING: Method definition (::Type{Main.Vector2D})(Real, Real) in
module Main at /…/juliaIntro.jl:13
overwritten at /…/juliaIntro.jl:13.
WARNING: Method definition (::Type{Main.Vector2D})(Any, Any) in module
Main at /…/juliaIntro.jl:13 overwritten
at /…/pythonlab/juliaIntro.jl:13.
And these warning are not consistent like it doesn’t show up for every execution, it randomly shows up. Sometimes the code just executes fine without any warning. Any pointers on why these warning are showing up. I am running Julia Version 0.5.1 on Mac 10.12.4
import Base.+
+(s1::String, s2::String) = string(s1, " ",s2)
println("Hello" + "World")
+(s1:: String, s2::Number) = s1 + " $s2"
+(s1:: Number, s2::String) = "$s1 " + s2
println("Hello World" + 46)
println(46 + "Hello World" + 46)
immutable Vector2D
x::Real
y::Real
end
v = Vector2D(3,5)
w = Vector2D(9.0,8.0)
println(v)
println(w)