Your `tt` only works for `Float64`: `tt(1.0 , 2.0)` works. To make your code generic, remove the type specification.
On Tuesday, April 5, 2016 at 4:09:18 PM UTC+2, FANG Colin wrote: > > Sorry if this has been discussed somewhere as I am unable to find the > relative post. > > immutable TT > x::Float64 > y::Float64 > end > > function tt(x::Float64, y::Float64) > x + y > > end > tt(1,2) # doesn't work > TT(1,2) # works > > What rule applies here for TT(1,2)? >