Having a tough time calling a more “generic” form a function from one that is specialized (i.e call a function for a “base” type from a version of the function for a subtype).
abstract foo type bar <: foo end function doStuff(a::foo) println("Generic!") end function doStuff(a::bar) println("Specialized!") doStuff(convert(foo, a)) end b = bar() doStuff(b)
doStuff(convert(foo, a)) represents my obviously failing attempt to do this… as this code goes into infinite recursion calling
I can see a way to fix it by making
doStuff() parametric and then explicitly specifying the parametric type to call… but I was hoping to avoid that (or, I guess, I was thinking that there should be a way to do this without resorting to that). Surely I’ve just missed something important here…
Any advice would be appreciated!