Suggest "as T" rather than "!" for implicit downcast fixes <rdar://problem/17029454>.

Swift SVN r18626
This commit is contained in:
Doug Gregor
2014-05-25 19:48:44 +00:00
parent b1914701e9
commit c1de0bf27f
7 changed files with 55 additions and 12 deletions

View File

@@ -1787,9 +1787,10 @@ commit_to_conversions:
// If we have a value of type AnyObject that we're trying to convert to
// a class, force a downcast.
// FIXME: Also allow types bridged through Objective-C classes.
if (objectType1->isAnyObject() &&
type2->getClassOrBoundGenericClass()) {
conversionsOrFixes.push_back(FixKind::ForceDowncast);
conversionsOrFixes.push_back(Fix::getForcedDowncast(*this, type2));
}
// If we're converting an lvalue to an inout type, add the missing '&'.