Avatar
maybeS = Optional(main.S()) maybeS is P = true maybeS as Any is P = false ------------------------------------------ maybeS = nil maybeS is P = false maybeS as Any is P = false ------------------------------------------stderr:<stdin>:6:23: warning: string interpolation produces a debug description for an optional value; did you mean to make this explicit? print("maybeS = \(maybeS)") ^~~~~~ <stdin>:6:23: note: use 'String(describing:)' to silence this warning print("maybeS = \(maybeS)") ^~~~~~ String(describing: ) <stdin>:6:23: note: provide a default value to avoid this warning print("maybeS = \(maybeS)") ^~~~~~ ?? <#default value#> <stdin>:7:35: warning: checking a value with optional type 'S?' against dynamic type 'P' succeeds whenever the value is non-nil; did you mean to use '!= nil'? print("maybeS is P = \(maybeS is P)") ~~~~~~ ^~~~ != nil