Avatar
Optional("{\"a\":1}")stderr:<stdin>:7:7: warning: expression implicitly coerced from 'String?' to Any print(try String(data: encoder.encode(Foo()), encoding: .utf8)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <stdin>:7:11: note: provide a default value to avoid this warning print(try String(data: encoder.encode(Foo()), encoding: .utf8)) ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ?? <#default value#> <stdin>:7:11: note: force-unwrap the value to avoid this warning print(try String(data: encoder.encode(Foo()), encoding: .utf8)) ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! <stdin>:7:11: note: explicitly cast to Any with 'as Any' to silence this warning print(try String(data: encoder.encode(Foo()), encoding: .utf8)) ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ as Any (edited)