enum ACType {
case noType
case natural
case armour
case shield
case deflection
case dodge
case sacred
case luck
case other(String)
static func Stacks(type : ACType) -> Bool {
return type == ACType.noType || type == ACType.dodge || type == ACType.other
}
}
I get an error concerning ‘type == ACType.other’.
Compiler blab: Binary operator '==' cannot be applied to operands of type 'ACType' and '(String) -> ACType'
The “==“ operation can only compare concrete instances of the enum.
With “type == ACType.other” the right side is not an instance. as the associated value is missing.
enum ACType {
case noType
case natural
case armour
case shield
case deflection
case dodge
case sacred
case luck
case other(String)
static func Stacks(type : ACType) -> Bool {
return type == ACType.noType || type == ACType.dodge || type == ACType.other
}
}
I get an error concerning ‘type == ACType.other’.
Compiler blab: Binary operator '==' cannot be applied to operands of type 'ACType' and '(String) -> ACType'
On 21 Jan 2017, at 14:23, Rien <Rien@Balancingrock.nl> wrote:
The “==“ operation can only compare concrete instances of the enum.
With “type == ACType.other” the right side is not an instance. as the associated value is missing.
enum ACType {
case noType
case natural
case armour
case shield
case deflection
case dodge
case sacred
case luck
case other(String)
static func Stacks(type : ACType) -> Bool {
return type == ACType.noType || type == ACType.dodge || type == ACType.other
}
}
I get an error concerning ‘type == ACType.other’.
Compiler blab: Binary operator '==' cannot be applied to operands of type 'ACType' and '(String) -> ACType'