Avatar
Avatar
nanasi
@swift-5.6.3 @swift-5.5.3 import Foundation @propertyWrapper struct Wrapper { var wrappedValue: Int? var projectedValue: String? init(wrappedValue: Int?) { self.wrappedValue = wrappedValue } init(projectedValue: String?) { self.projectedValue = projectedValue } } func foo(@Wrapper value: Int?) { print(value) } foo(value: 100) foo($value: "string")
swift55 BOT 2/8/2022 3:23 AM
exit status: 1 with stderr:<stdin>:21:1: error: type of expression is ambiguous without more context foo(value: 100) ^~~~~~~~~~~~~~~ <stdin>:18:9: warning: expression implicitly coerced from 'Int?' to 'Any' print(value) ^~~~~ <stdin>:18:9: note: provide a default value to avoid this warning print(value) ^~~~~ ?? <#default value#> <stdin>:18:9: note: force-unwrap the value to avoid this warning print(value) ^~~~~ ! <stdin>:18:9: note: explicitly cast to 'Any' with 'as Any' to silence this warning print(value) ^~~~~ as Any