mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Suggest "as T" rather than "!" for implicit downcast fixes <rdar://problem/17029454>.
Swift SVN r18626
This commit is contained in:
@@ -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 '&'.
|
||||
|
||||
Reference in New Issue
Block a user