-
Couldn't load subscription status.
- Fork 28
Open
Description
The following code and rule incorrectly result in a NEAL failure.
public class MyObject {
public func myFunc(_ object: Any) -> Bool {
return object as? Dictionary<AnyHashable, Any> != nil
}
}
rule Bang {
Swift::TypeIdentifier where ImplicitlyUnwrappedOptional == true {
fail("No forced unwrapping allowed")
}
}
Since there is no force unwrap the test should not fail.
When parens are added the rule no longer results in a NEAL failure.
public class MyObject {
public func myFunc(_ object: Any) -> Bool {
return (object as? Dictionary<AnyHashable, Any>) != nil
}
}
Metadata
Metadata
Assignees
Labels
No labels