Skip to content

Commit 425a3d0

Browse files
committed
Equality of callable references with context parameters
1 parent da7ee6c commit 425a3d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

proposals/context-parameters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ context(users: UserService) fun saveAll(users: List<User>): Unit =
424424
users.forEach(::save) // ::save is resolved as (User) -> Unit
425425
```
426426

427-
**§5.3** *(callable references, future)*: We consider as **future** improvement a more complex resolution of callables, in which the context is taken into account when the callable is used as an argument of a function that expects a function type with context.
427+
**§5.3** *(callable references, equality)*: Captured context parameters should be treated in the same way as captured receivers for the purposes of function equality and hashing.
428+
429+
**§5.4** *(callable references, future)*: We consider as **future** improvement a more complex resolution of callables, in which the context is taken into account when the callable is used as an argument of a function that expects a function type with context.
428430

429431
## Context and classes
430432

0 commit comments

Comments
 (0)