Fire 9 bug setting value of array element

this code compiles in Xcode, but in Fire it gives me error E111: Variable expected for _array[index] in the setter.

class Bug1<T>
{
	var _array = [T]()
	
	subscript (index: Int) -> T
	{
		get { return _array[index] }
		
		set
		{
			_array[index] = newValue
		}
	}
}

actually its even simpler… this fails too…

class Bug1<T>
{
	var _array = [T]()
	
	func xx(value: T)
	{
		_array[0] = value
	}
}

and actually nothing to do with generics either…

class Bug1
{
	var _array = [String]()
	
	func xx(value: String)
	{
		_array[0] = value
	}
}

not sure if it helps… but this gets a no matching overload on insert() too… which seems like it may be related?
append() is OK

func xx(value: String)
{
	var ray = ["zero"]
	ray[0] = value
	
	ray.insert(value, at: 0)
	ray.append(value)

}

What target platform?

yeah, sorry.
Android
although pretty sure it happens on .NET too

Thanks, logged as bugs://77094

the problem with insert() is that it’s called insert(_ , atIIndex) in SBL. Might be a leftover rename from Swift2/Swift3 that we haven’t fixed yet; i’ll check and adjust SBL. Logged an issue for the subscript not working.

thanks guys.
appreciate your responsiveness.

1 Like

SBL is fixed, btw. you can grab the newer v from github, and the next beta will have it prebuilt.

bugs://77094 got closed with status fixed.

Fixed for v10

Logged as bugs://i64859.

bugs://i64859 was closed as fixed.