mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Strongly prefer available declarations to unavailable ones in type checking.
Fixes rdar://problem/18847642, rdar://problem/16554496, and the current 1_stdlib/Array.swift. Swift SVN r25212
This commit is contained in:
@@ -1311,6 +1311,11 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
refType = ImplicitlyUnwrappedOptionalType::get(refType->getRValueType());
|
||||
}
|
||||
|
||||
// If the declaration is unavailable, note that in the score.
|
||||
if (choice.getDecl()->getAttrs().isUnavailable(getASTContext())) {
|
||||
increaseScore(SK_Unavailable);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user