mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[TypeChecker] NFC: Add a dedicated method to get outermost attached wrapper
The outermost wrapper is the one at index `0` in the wrapper list but it's easy for humans to make a reverse assumption since outermost is the back of the list. Let's add a dedicated method to reduce error probability of the property wrapper APIs.
This commit is contained in:
@@ -6433,9 +6433,9 @@ void ConstraintSystem::diagnoseFailureFor(SolutionApplicationTarget target) {
|
||||
DE.diagnose(expr->getLoc(), diag::type_of_expression_is_ambiguous)
|
||||
.highlight(expr->getSourceRange());
|
||||
} else if (auto *wrappedVar = target.getAsUninitializedWrappedVar()) {
|
||||
auto *wrapper = wrappedVar->getAttachedPropertyWrappers().back();
|
||||
auto *outerWrapper = wrappedVar->getOutermostAttachedPropertyWrapper();
|
||||
Type propertyType = wrappedVar->getInterfaceType();
|
||||
Type wrapperType = wrapper->getType();
|
||||
Type wrapperType = outerWrapper->getType();
|
||||
|
||||
// Emit the property wrapper fallback diagnostic
|
||||
wrappedVar->diagnose(diag::property_wrapper_incompatible_property,
|
||||
|
||||
Reference in New Issue
Block a user