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)
}
yeah, sorry.
Android
although pretty sure it happens on .NET too
Thanks, logged as bugs://77094
mh
(marc hoffman)
January 11, 2017, 7:05pm
6
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
mh
(marc hoffman)
January 12, 2017, 11:47am
8
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.
bugs://i64859 was closed as fixed.