mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
sema: accept an array literal of enum case references as compile-time constant
This commit is contained in:
@@ -1961,14 +1961,8 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
|
||||
auto *locator = cs.getConstraintLocator(loc);
|
||||
SourceRange range;
|
||||
// simplify locator so the anchor is the exact argument.
|
||||
locator = simplifyLocator(cs, locator, range);
|
||||
if (locator->getPath().empty() &&
|
||||
locator->getAnchor().isExpr(ExprKind::UnresolvedMemberChainResult)) {
|
||||
locator =
|
||||
cs.getConstraintLocator(cast<UnresolvedMemberChainResultExpr>(
|
||||
locator->getAnchor().get<Expr*>())->getSubExpr());
|
||||
}
|
||||
cs.recordFix(NotCompileTimeConst::create(cs, paramTy, locator));
|
||||
cs.recordFix(NotCompileTimeConst::create(cs, paramTy,
|
||||
simplifyLocator(cs, locator, range)));
|
||||
}
|
||||
|
||||
cs.addConstraint(
|
||||
|
||||
Reference in New Issue
Block a user