Commits

Chris Lattner committed 9c7417edc2c
fix <rdar://problem/19782264> Immutable, optional class members can't have their subproperties read from during init() The problem here was that the _preconditionImplicitlyUnwrappedOptionalHasValue compiler intrinsic was taking the optional/IUO argument as inout as a performance optimization, but DI would reject it (in narrow cases, in inits) because the inout argument looks like a mutation. We could rework this to take it as an @in argument or something, but it is better to just define this problem away: the precondition doesn't actually care about the optional, it is just testing its presence, which SILGen does all the time. Have SILGen open code the switch_enum and just have the stdlib provide a simpler _diagnoseUnexpectedNilOptional() to produce the error message. This avoids the problem completely and produces slightly better -O0 codegen. Swift SVN r25254