So I have a declaration as below
abstract type C end
struct A <:C
x::Float64
y::Float64
end
function pattern(ant::A, pos::Float64)
return pos^2
end
struct B <: C
x::Float64
y::Float64
z::Float64
end
function pattern(ant::B, pos::Float64)
return B.z*pos^2
end
and the warning generated is that ant is unused in the first pattern method-- this is logical because that is the case. However, the object is being passed into the function to differentiate it from application of the pattern function to another object, where the object is relevant – multiple dispatch at work. I don’t suppose there is any way of suppressing the compiler warning for this instance, is there? Its probably not a big deal.
/K