# Compiler Error: Assignment operators ambiguity. All these functions match

**URL:** <https://discuss.kotlinlang.org/t/compiler-error-assignment-operators-ambiguity-all-these-functions-match/5069>\
**Category:** Support\
**Created:** [October 22, 2017, 5:06am UTC](https://discuss.kotlinlang.org/t/compiler-error-assignment-operators-ambiguity-all-these-functions-match/5069 "2017-10-22T05:06:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![youhansr](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/youhansr/32/4052_2.png) [@youhansr](https://discuss.kotlinlang.org/u/youhansr)\
**Post date:** [October 22, 2017, 5:06am UTC](https://discuss.kotlinlang.org/t/compiler-error-assignment-operators-ambiguity-all-these-functions-match/5069/1 "2017-10-22T05:06:35Z")

</div>

I used `plusAssign` operator function to add an item to a mutable list.

```auto
var attendances: MutableList<Attendance> = mutableListOf()

attendances += Attendance(request.newTime)

```

But it has a compiler error shown by IntelliJ IDEA which says:  
`Assignment operators ambiguity. All these functions match`

 ![59](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/4/48e88634893e3ae1ba35958090ac6caa0846739d.png)

It this a kotlin bug?

Note: If I change the `var` to `val` the error will be resolved.

---

<div class="post-metadata">

**Author:** ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)\
**Post date:** [October 22, 2017, 3:32pm UTC](https://discuss.kotlinlang.org/t/compiler-error-assignment-operators-ambiguity-all-these-functions-match/5069/2 "2017-10-22T15:32:44Z")

</div>

No, this is not a bug. Using the `+=` operation with a mutable list has two possible interpretations - either to append an item to the existing list or to create a new list by appending the new value to the old list and to store the reference to the new list in the variable. Because the compiler can’t choose how to interpret this, it reports an ambiguity error.
