# Operator Underloading In Scala

DevFeed: [Operator Underloading In Scala](<https://devfeed.tech/articles/operator-underloading-in-scala-32197.md>)

Original publisher: [Read original article](<https://bruceeckel.com/2014/12/30/operator-underloading-in-scala/>)

Author: Bruce Eckel

Published: 2014-12-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [Scala](<https://devfeed.tech/topics/scala.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [let](<https://devfeed.tech/tags/let.md>), [map](<https://devfeed.tech/tags/map.md>), [programming](<https://devfeed.tech/tags/programming.md>), [scala](<https://devfeed.tech/tags/scala.md>), [var](<https://devfeed.tech/tags/var.md>), [vector](<https://devfeed.tech/tags/vector.md>)

## AI overview

The article examines Scala operator overloading and synthesized assignment operators such as += and -=. It explains how these operators interact with immutable Map values, var and val references, and Vector, arguing that the behavior can be useful but difficult to understand because it varies across classes and is not always documented clearly.

## Source excerpt

Here's a place where Scala does some clever stuff which ultimately might produce a more complicated programming model than one would like. I discovered it while sorting out some issues with the first exercise in the References & Mutability atom in Atomic Scala. I'll give you the examples directly out of the solution guide -- this includes the use of our tiny AtomicScala test framework, but if you don't want to include that you can just comment out the import and all the is statements and you'll still get the same results.