[SR-10900] propertyDelegate type supersedes explicit type annotation #53290
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
property wrappers
Feature: property wrappers
Environment
Xcode 11.0 beta 1 (11M336w)
Additional Detail from JIRA
md5: 3fcf0f62c44720d56c042465fc0bc633
is duplicated by:
Issue Description:
If you have this code:
it outputs:
In this case I'm surprised that this compiles, because I would expect the explicit `Bool` type annotation to have a mismatch with the property delegate's type. This further confused me because the compiler does error if they're entirely different types:
this outputs:
This might be by design because I did see some example from WWDC that was relying on the inference of a type like `Bool`, yet the property ended up being a `Optional<Bool>` but this surprised me overall since I didn't expect the property with an explicit type annotation to end up possibly being a different type
The text was updated successfully, but these errors were encountered: