Referring to arguments by their type

Last modified on


A: What if we could refer to arguments by types?

def foo(c: Context, b: Int): Unit = {
  // ...
  @Context.blah = b
  // ...
}

If they are uniquely identifiable.

E: Why?

A: Just a thought. I was thinking how it is often hard to read Scala code because there are way.too.many.nested.method.calls and you can't see types without an IDE. Particularly anything related to Scala compiler, traumatic experience.

E: Make all params implicit.

T: Local variables to the rescue!

A: It is not like people explicitly type ascribe local variables ;)