Core concept

def close(x: { def close(): Unit }) = x.close()
Advertisement

How it works

Reflection cost historically. Scala 3 uses different mechanism.

Advertisement

Trade-offs + gotchas

Interop with libraries where fixed types are wrong.