mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Guard feature behind experimental flag.
This commit is contained in:
@@ -10826,6 +10826,9 @@ static ConstraintFix *validateInitializerRef(ConstraintSystem &cs,
|
||||
// which means MetatypeType has to be added after finding a type variable.
|
||||
if (baseLocator->isLastElement<LocatorPathElt::MemberRefBase>())
|
||||
baseType = MetatypeType::get(baseType);
|
||||
} else if (auto *keyPathExpr = getAsExpr<KeyPathExpr>(anchor)) {
|
||||
// Key path can't refer to initializers e.g. `\Type.init`
|
||||
return AllowInvalidRefInKeyPath::forRef(cs, baseType, init, locator);
|
||||
}
|
||||
|
||||
if (!baseType)
|
||||
|
||||
Reference in New Issue
Block a user