PRE SIP: ThisFunction | scope injection (similar to kotlin receiver function)

When I see value.method(arguments) I expect that either method is defined on type of value or there is implicit conversion in scope that provides that method. It doesn’t seem helpful to add receiver methods to that list. I would need to search in three kinds of places instead of two.

Also, Rust compiler has no problems suggesting that you forgot to add:

import some.word.that.i.always.forget._

to enable certain extension methods. Look here:

Note that Rust has keyword use instead of import.

1 Like