This code worked just fine in Swift 2.3 and I don\'t understand why I have to unwrap TestClass to check if number is bigger than 4. This is whole point of chain
TestClass
Optional comparison operators are removed from Swift 3. SE-0121
You need to write something like this:
if test?.optionalInt ?? 0 > 4 { }