mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSFix] Add a fix to remove invalid optional unwrap
If the base type is not optional, trying to unwrap it is incorrect. Introduce a fix to make it look like base was an optional type which leads solver to move forward towards possible solution.
This commit is contained in:
@@ -213,3 +213,12 @@ AutoClosureForwarding *AutoClosureForwarding::create(ConstraintSystem &cs,
|
||||
ConstraintLocator *locator) {
|
||||
return new (cs.getAllocator()) AutoClosureForwarding(cs, locator);
|
||||
}
|
||||
|
||||
bool RemoveUnwrap::diagnose(Expr *root, bool asNote) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
RemoveUnwrap *RemoveUnwrap::create(ConstraintSystem &cs, Type baseType,
|
||||
ConstraintLocator *locator) {
|
||||
return new (cs.getAllocator()) RemoveUnwrap(cs, baseType, locator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user