bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Generics self increment issue

Open thareh opened this issue 1 year ago • 3 comments

Hey,

Seems like "self increment" i.e. var :+ 1 for instance isn't working properly with generics.

Switch the commented line with the one beneath it and you'll see the issue at hand.

Framework BRL.Blitz
Import BRL.Collections
Import BRL.StandardIO
Import Random.Core
Import BRL.Random

Local map:TTreeMap<Int, Int> = New TTreeMap<Int, Int>()

For Local i:Int = 0 Until 1000
	Local key:Int = Rand(0, 10)
	
'	map[key] :+  1
	map[key] = map[key] + 1
Next

For Local i:Int = EachIn map.Keys()
	Print i + ": " + map[i]
Next

Thanks and have a good day!

thareh avatar Mar 13 '23 20:03 thareh