Skip to content

Commit 735e262

Browse files
authored
Merge pull request #39469 from DougGregor/missing-conformances-silfunctiontype-sr15248
2 parents 28daeae + 293e47a commit 735e262

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

lib/AST/Type.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,8 @@ class IsBindableVisitor
18801880

18811881
for (auto proto : upperBound->getConformsTo()) {
18821882
// Find the DeclContext providing the conformance for the type.
1883-
auto nomConformance = moduleDecl->lookupConformance(substType, proto);
1883+
auto nomConformance = moduleDecl->lookupConformance(
1884+
substType, proto, /*allowMissing=*/true);
18841885
if (!nomConformance)
18851886
return CanType();
18861887
if (nomConformance.isAbstract())
@@ -1916,7 +1917,8 @@ class IsBindableVisitor
19161917
if (substTy->isTypeParameter()) {
19171918
substConformance = ProtocolConformanceRef(proto);
19181919
} else {
1919-
substConformance = moduleDecl->lookupConformance(substTy, proto);
1920+
substConformance = moduleDecl->lookupConformance(
1921+
substTy, proto, /*allowMissing=*/true);
19201922
}
19211923

19221924
LLVM_DEBUG(llvm::dbgs() << "\n` adds conformance for subst type\n";
@@ -2040,7 +2042,8 @@ class IsBindableVisitor
20402042
newConformances.push_back(ProtocolConformanceRef(proto));
20412043
} else {
20422044
auto newConformance
2043-
= moduleDecl->lookupConformance(newSubstTy, proto);
2045+
= moduleDecl->lookupConformance(
2046+
newSubstTy, proto, /*allowMissing=*/true);
20442047
if (!newConformance)
20452048
return CanType();
20462049
newConformances.push_back(newConformance);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
// REQUIRES: concurrency
3+
private struct TransformResult<T> {
4+
var index: Int
5+
var transformedElement: T
6+
7+
init(index: Int, transformedElement: T) {
8+
self.index = index
9+
self.transformedElement = transformedElement
10+
}
11+
}
12+
13+
public extension Collection {
14+
@available(macOS 12.0.0, *)
15+
private func f<T>(_ transform: @escaping (Element) async throws -> T) async throws -> [T] {
16+
return try await withThrowingTaskGroup(of: TransformResult<T>.self) { group in
17+
return []
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)