mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce very basic support for selector-style initializations.
The type checker changes here are a complete hack; I'll be revisiting this shortly. Addresses the rest of <rdar://problem/16031332>. Swift SVN r13858
This commit is contained in:
@@ -253,7 +253,13 @@ namespace {
|
||||
ASTContext &C = CS.getASTContext();
|
||||
|
||||
// Open a member constraint for constructors on the subexpr type.
|
||||
auto baseTy = expr->getSubExpr()->getType()->getRValueType();
|
||||
// FIXME: the getRValueInstanceType() here is a hack to make the
|
||||
// T.init withFoo(foo)
|
||||
// syntax type-check. We shouldn't rely on any kinds of adjustments to
|
||||
// the subexpression's type here, but dealing with this requires us to
|
||||
// clarify when we can refer to constructors with ".init".
|
||||
auto baseTy = expr->getSubExpr()->getType()
|
||||
->getLValueOrInOutObjectType()->getRValueInstanceType();
|
||||
auto argsTy = CS.createTypeVariable(
|
||||
CS.getConstraintLocator(expr),
|
||||
TVO_CanBindToLValue|TVO_PrefersSubtypeBinding);
|
||||
|
||||
Reference in New Issue
Block a user