Saturday, 31 August 2013

Is it possible to reference a package from not within an import statement?

Is it possible to reference a package from not within an import statement?

I'm writing a documentation about a Scala library. When I reference a
certain package I do this with a String, e.g. "com.my.example" but would
rather prefer to do this in a manner that gives me compile errors if
anything breaks (e.g. (com.my.example).mkString).
Of course my IDE will warn me about such situations when refactoring and
propose to fix those Strings for me. I'd just prefer to rely on the
compiler instead of the IDE. Is this in some way possible? (Creating
pseudo classes in each package to reference is not an option).

No comments:

Post a Comment