For example, given
object ~ {
def foo = ???
}
How do I access this method?
None of them work:
~.foo
`~`.foo
With the compiler complains "illegal start of a simple expression."
And yes, I know that I probably shouldn't call the classes “~”, but both the standard library and some other libraries, and sometimes you need to work with them.
Added: Looking at sschaef answer , I tried
$tilde.foo
And it really works. Not sure if this is intended or just a detailed implementation of how these names translate into JVM identifiers. And will this work in other scala variants (e.g. Scala.js)?
I will leave it open to see, maybe someone is calling with a more extensive answer.