I wrote my own extension function for `sumOf` on `...
# announcements
t
I wrote my own extension function for
sumOf
on
Iterable
for my own numeric-ish type. but I'm unsure on where to put it. If I put it in the file that calls
sumeOf
it works, but if I put my impl in the file where my type is (which is where I think it should live), the compiler can't find it. Is there some magic to tell the compiler where the impl is?
if I add a explicate import for the sumOf function, it works if I put it w/ my impl. The compiler can't just find it in the name-space?
r
yeah, you need to import extension functions, if they are in different file
e
there's no C++-like ADL in Kotlin, nor any other language I know of