mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] Misc code cleanup (removed unnecessary switch)
Was just reading through the code here and noticed that the result of matchTypes() here is always the returned result from this function, so might as well save code and confusion and return it directly.
This commit is contained in:
@@ -932,23 +932,10 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
|
||||
return SolutionKind::Error;
|
||||
|
||||
// Result type can be covariant (or equal).
|
||||
switch (matchTypes(func1->getResult(), func2->getResult(), subKind,
|
||||
return matchTypes(func1->getResult(), func2->getResult(), subKind,
|
||||
subFlags,
|
||||
locator.withPathElement(
|
||||
ConstraintLocator::FunctionResult))) {
|
||||
case SolutionKind::Error:
|
||||
return SolutionKind::Error;
|
||||
|
||||
case SolutionKind::Solved:
|
||||
result = SolutionKind::Solved;
|
||||
break;
|
||||
|
||||
case SolutionKind::Unsolved:
|
||||
result = SolutionKind::Unsolved;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
ConstraintLocator::FunctionResult));
|
||||
}
|
||||
|
||||
ConstraintSystem::SolutionKind
|
||||
|
||||
Reference in New Issue
Block a user