Is there a way to refer to shadowed top-level decl...
# announcements
n
Is there a way to refer to shadowed top-level declarations explicitly? E.g. to call a top-level function from a method of an object in the same package that shadows that top-level function?
d
Off the top of my head, you can use a fully qualified call.
your.package.name.topLevelFunction("", 2, .....)
n
👍
Unfortunately when inlining the object method, that will leave fully qualified names at the original call sites, which are a PITA to clean up.
I’m trying to come up with a way to refactor from object methods to top level functions, that leaves the call site looking the same as (or as close as possible to) the original code, because the object and top-level functions provide the syntax of a DSL.
d
Oh? You could rename the object method and then inline it.
n
I think that’s probably the best way, yes.
Cheers!