This behavior seems to be broken (I am using Scala 2.9.1)
var b= new StringBuilder
These are OK:
b+='a'
b.append('b')
b.append("de")
This produces compile error:
b+="de"
Any idea as to why only StringBuilder#+=(c: Char) exists whereas both StringBuilder#append(c:Char) and StringBuilder#append(s:String) happily co-exist? What is wrong with declaring and implementing StringBuilder#+=(s: String)?
Is it oversight or some deeper problem in the Scala type system?
Try
b ++= "de". AStringis considered a collection ofChars.