Skip to content

Commit cf646da

Browse files
authored
Merge pull request #36888 from slavapestov/opaque-result-type-with-tuple
SIL: A tuple type can be lowered with an opaque result type as the original type
2 parents 9a72b77 + a0c215b commit cf646da

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/SIL/IR/AbstractionPattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ bool AbstractionPattern::matchesTuple(CanTupleType substType) {
317317
case Kind::ClangType:
318318
case Kind::Type:
319319
case Kind::Discard: {
320-
if (isTypeParameter())
320+
if (isTypeParameterOrOpaqueArchetype())
321321
return true;
322322
auto type = getType();
323323
if (auto tuple = dyn_cast<TupleType>(type))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-frontend -emit-ir %s -disable-availability-checking
2+
3+
public struct MyList: Sequence {
4+
var _list: [(Int, Int)]
5+
6+
public func makeIterator() -> some IteratorProtocol {
7+
return _list.makeIterator()
8+
}
9+
}

0 commit comments

Comments
 (0)