Skip to content

Commit 60aa49d

Browse files
committed
merge fixup
1 parent 399332b commit 60aa49d

File tree

8 files changed

+13
-47
lines changed

8 files changed

+13
-47
lines changed

include/swift/AST/Expr.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,40 +2870,6 @@ class UnderlyingToOpaqueExpr : public ImplicitConversionExpr {
28702870
}
28712871
};
28722872

2873-
/// TupleShuffleExpr - This represents a permutation of a tuple value to a new
2874-
/// tuple type.
2875-
class TupleShuffleExpr final : public ImplicitConversionExpr,
2876-
private llvm::TrailingObjects<TupleShuffleExpr, unsigned> {
2877-
friend TrailingObjects;
2878-
2879-
size_t numTrailingObjects(OverloadToken<unsigned>) const {
2880-
return Bits.TupleShuffleExpr.NumElementMappings;
2881-
}
2882-
2883-
private:
2884-
TupleShuffleExpr(Expr *subExpr, ArrayRef<unsigned> elementMapping,
2885-
Type ty)
2886-
: ImplicitConversionExpr(ExprKind::TupleShuffle, subExpr, ty) {
2887-
Bits.TupleShuffleExpr.NumElementMappings = elementMapping.size();
2888-
std::uninitialized_copy(elementMapping.begin(), elementMapping.end(),
2889-
getTrailingObjects<unsigned>());
2890-
}
2891-
2892-
public:
2893-
static TupleShuffleExpr *create(ASTContext &ctx, Expr *subExpr,
2894-
ArrayRef<unsigned> elementMapping,
2895-
Type ty);
2896-
2897-
ArrayRef<unsigned> getElementMapping() const {
2898-
return {getTrailingObjects<unsigned>(),
2899-
static_cast<size_t>(Bits.TupleShuffleExpr.NumElementMappings)};
2900-
}
2901-
2902-
static bool classof(const Expr *E) {
2903-
return E->getKind() == ExprKind::TupleShuffle;
2904-
}
2905-
};
2906-
29072873
/// DestructureTupleExpr - Destructure a tuple value produced by a source
29082874
/// expression, binding the elements to OpaqueValueExprs, then evaluate the
29092875
/// result expression written in terms of the OpaqueValueExprs.

include/swift/AST/TypeRepr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,8 @@ class SILBoxTypeReprField {
10201020
/// should be abstracted from callers, given a set of generic constraints that
10211021
/// the concrete return type satisfies:
10221022
///
1023-
/// func foo() -> opaque Collection { return [1,2,3] }
1024-
/// var bar: opaque SignedInteger = 1
1023+
/// func foo() -> some Collection { return [1,2,3] }
1024+
/// var bar: some SignedInteger = 1
10251025
///
10261026
/// It is currently illegal for this to appear in any other position.
10271027
class OpaqueReturnTypeRepr : public TypeRepr {

lib/SILGen/SILGenConvert.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ ManagedValue SILGenFunction::emitExistentialErasure(
776776
auto upcast =
777777
B.createInitExistentialMetatype(loc, metatype,
778778
existentialTL.getLoweredType(),
779-
cast<MetatypeType>(concreteFormalType).getInstanceType(),
780779
conformances);
781780
return ManagedValue::forUnmanaged(upcast);
782781
}

lib/SILGen/SILGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ void SILGenFunction::emitArtificialTopLevel(ClassDecl *mainClass) {
510510
SILType::getPrimitiveObjectType(mainClassMetaty));
511511
metaTy = B.createInitExistentialMetatype(mainClass, metaTy,
512512
SILType::getPrimitiveObjectType(anyObjectMetaTy),
513-
mainClassTy, {});
513+
{});
514514
SILValue optNameValue = B.createApply(
515515
mainClass, NSStringFromClass, NSStringFromClass->getType(),
516516
SILType::getPrimitiveObjectType(OptNSStringTy), {}, metaTy);

lib/SILGen/SILGenLValue.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,6 @@ namespace {
949949
loc,
950950
payload,
951951
base.getType().getObjectType(),
952-
OpenedArchetype,
953952
SGF.getASTContext().AllocateCopy(conformances));
954953
} else {
955954
assert(getSubstFormalType()->isBridgeableObjectType());

lib/Sema/TypeCheckAccess.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,7 @@ class ExportabilityChecker : public DeclVisitor<ExportabilityChecker> {
16661666
UNINTERESTING(EnumCase) // Handled at the EnumElement level.
16671667
UNINTERESTING(Destructor) // Always correct.
16681668
UNINTERESTING(Accessor) // Handled by the Var or Subscript.
1669+
UNINTERESTING(OpaqueType) // TODO
16691670

16701671
// Handled at the PatternBinding level; if the pattern has a simple
16711672
// "name: TheType" form, we can get better results by diagnosing the TypeRepr.

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,8 @@ class swift::DeclDeserializer {
30373037
MF.getDeclContext(contextID),
30383038
MF.getGenericSignature(interfaceSigID),
30393039
MF.getType(interfaceTypeID)->castTo<GenericTypeParamType>());
3040+
declOrOffset = opaqueDecl;
3041+
30403042
auto genericEnv = MF.getGenericEnvironment(genericEnvID);
30413043
opaqueDecl->setGenericEnvironment(genericEnv);
30423044
if (underlyingTypeID)
@@ -3049,7 +3051,6 @@ class swift::DeclDeserializer {
30493051
auto opaqueTy = OpaqueTypeArchetypeType::get(opaqueDecl, subs);
30503052
auto metatype = MetatypeType::get(opaqueTy);
30513053
opaqueDecl->setInterfaceType(metatype);
3052-
30533054
return opaqueDecl;
30543055
}
30553056

test/ParseableInterface/opaque-result-types.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public func foo(_: Int) -> some Foo {
1616
return 679
1717
}
1818

19-
// CHECK-LABEL: public func foo<T>(_ x: T) -> some Foo where T : Foo
19+
// CHECK-LABEL: public func foo<T>(_ x: T) -> some Foo where T : OpaqueResultTypes.Foo
2020
public func foo<T: Foo>(_ x: T) -> some Foo {
2121
return x
2222
}
@@ -39,7 +39,7 @@ public struct Bar<T>: AssocTypeInference {
3939
return 219
4040
}
4141

42-
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : Foo
42+
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : OpaqueResultTypes.Foo
4343
public func foo<U: Foo>(_ x: U) -> some Foo {
4444
return x
4545
}
@@ -56,7 +56,7 @@ public struct Bar<T>: AssocTypeInference {
5656
return 219
5757
}
5858

59-
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : Foo
59+
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : OpaqueResultTypes.Foo
6060
public func foo<U: Foo>(_ x: U) -> some Foo {
6161
return x
6262
}
@@ -81,7 +81,7 @@ public struct Bar<T>: AssocTypeInference {
8181
return x
8282
}
8383

84-
// CHECK-LABEL: public func foo<V>(_ x: V) -> some Foo where V : Foo
84+
// CHECK-LABEL: public func foo<V>(_ x: V) -> some Foo where V : OpaqueResultTypes.Foo
8585
public func foo<V: Foo>(_ x: V) -> some Foo {
8686
return x
8787
}
@@ -103,7 +103,7 @@ public struct Zim: AssocTypeInference {
103103
return 219
104104
}
105105

106-
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : Foo
106+
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : OpaqueResultTypes.Foo
107107
public func foo<U: Foo>(_ x: U) -> some Foo {
108108
return x
109109
}
@@ -119,7 +119,7 @@ public struct Zim: AssocTypeInference {
119119
return 219
120120
}
121121

122-
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : Foo
122+
// CHECK-LABEL: public func foo<U>(_ x: U) -> some Foo where U : OpaqueResultTypes.Foo
123123
public func foo<U: Foo>(_ x: U) -> some Foo {
124124
return x
125125
}
@@ -141,7 +141,7 @@ public struct Zim: AssocTypeInference {
141141
return x
142142
}
143143

144-
// CHECK-LABEL: public func foo<V>(_ x: V) -> some Foo where V : Foo
144+
// CHECK-LABEL: public func foo<V>(_ x: V) -> some Foo where V : OpaqueResultTypes.Foo
145145
public func foo<V: Foo>(_ x: V) -> some Foo {
146146
return x
147147
}

0 commit comments

Comments
 (0)