public enum Foo
{
case VALID
case INVALID
}
public class FooContainer
{
let foo: Foo
let name: String
public init(foo: Foo, name: String)
{
self.foo = foo
self.name = name
}
}
let theFoos = [
FooContainer(foo: Foo.VALID, name: "The valid one"),
FooContainer(foo: Foo.INVALID, name: "The invalid one")
]
if let validFoo = theFoos.filter({$0.foo == .VALID}).first
{
print("Valid foo: " + validFoo.name)
}
This gives these compilation errors on the if let validFoo... line on Fire build 1925. (Project: FilterFail.zip (306.0 KB))
Program.swift(24,19): error E62: Type mismatch, cannot assign "<error>" to "Boolean"
Program.swift(24,19): error E513: Parenthesis are required to call method first()
It is okay in Xcode so I guess there is a missing feature in Fire’s compiler?