Allow augmented assignments on dynamic receivers

This commit is contained in:
Andrey Breslav
2014-11-27 09:19:50 +03:00
parent cc210c2950
commit 53bbf20b0d
5 changed files with 47 additions and 21 deletions
+2
View File
@@ -70,6 +70,8 @@ Internally, `dynamic` is represented as a flexible type `Nothing..Any?`, with th
the code may change its semantics just because somebody added some extension in another file.
- This means that an extension to a normal, non-dynamic type **can not** be called on a `dynamic` receiver.
If needed, one can force a call to an extension by casting the receiver to a static type: `(d as Foo).bar()`
- Augmented assignments on dynamic receivers (e.g. `dyn += foo`) are resolved to `plusAssign()` function, not `plus`, for generality:
this permits calling them on vals (e.g. those holding collection-like objects)
## Type Argument Inference