mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
fix <rdar://problem/19259730> Using mutating methods in a struct initializer with a let property is rejected
while we're at it, improve the QoI for actually-invalid mutating method calls in struct initalizers. Swift SVN r24030
This commit is contained in:
@@ -673,7 +673,13 @@ void LifetimeChecker::doIt() {
|
||||
diag::return_from_init_without_self_init);
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (isa<ApplyInst>(Inst) && TheMemory.isStructInitSelf()) {
|
||||
if (shouldEmitError(Inst)) {
|
||||
diagnose(Module, Inst->getLoc(),
|
||||
diag::use_of_self_before_fully_init);
|
||||
noteUninitializedMembers(Use);
|
||||
}
|
||||
break;
|
||||
} else if (isa<MarkFunctionEscapeInst>(Inst))
|
||||
DiagMessage = diag::global_variable_function_use_uninit;
|
||||
else if (isa<AddressToPointerInst>(Inst))
|
||||
|
||||
Reference in New Issue
Block a user