mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Various inout improvements:
- purge @inout from comments in the compiler except for places talking about the SIL argument convention. - change diagnostics to not refer to @inout - Change the astprinter to print InoutType without the @, so it doesn't show up in diagnostics or in closure argument types in code completion. - Implement type parsing support for the new inout syntax (before we just handled patterns). - Switch the last couple of uses in the stdlib (in types) to inout. - Various testcase updates (more to come). Swift SVN r13564
This commit is contained in:
@@ -765,7 +765,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
ConstraintLocator::ArrayElementType));
|
||||
|
||||
case TypeKind::InOut:
|
||||
// If the RHS is an @inout type, the LHS must be an @lvalue type.
|
||||
// If the RHS is an inout type, the LHS must be an @lvalue type.
|
||||
if (kind >= TypeMatchKind::OperatorConversion) {
|
||||
if (shouldRecordFailures())
|
||||
recordFailure(getConstraintLocator(locator),
|
||||
@@ -866,7 +866,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, TypeMatchKind kind,
|
||||
}
|
||||
|
||||
if (concrete && kind >= TypeMatchKind::OperatorConversion) {
|
||||
// If the RHS is an @inout type, the LHS must be an @lvalue type.
|
||||
// If the RHS is an inout type, the LHS must be an @lvalue type.
|
||||
if (auto *iot = type2->getAs<InOutType>()) {
|
||||
return matchTypes(type1, LValueType::get(iot->getObjectType()),
|
||||
kind, subFlags,
|
||||
@@ -1716,7 +1716,7 @@ ConstraintSystem::simplifyApplicableFnConstraint(const Constraint &constraint) {
|
||||
"the output of funct1 is a free variable by construction");
|
||||
|
||||
// If this application is part of an operator, then we allow an implicit
|
||||
// lvalue to be compatible with @inout arguments. This is used by
|
||||
// lvalue to be compatible with inout arguments. This is used by
|
||||
// assignment operators.
|
||||
TypeMatchKind ArgConv = TypeMatchKind::Conversion;
|
||||
if (isa<PrefixUnaryExpr>(anchor) || isa<PostfixUnaryExpr>(anchor) ||
|
||||
|
||||
Reference in New Issue
Block a user