Skip to content

Commit fa28d14

Browse files
committed
IRGen: Small fix for opaque return types with variadic types
1 parent 0896540 commit fa28d14

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/IRGen/GenReflection.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,8 @@ IRGenModule::emitWitnessTableRefString(CanType type,
490490
type = genericEnv->mapTypeIntoContext(type)->getCanonicalType();
491491
}
492492
if (origType->hasTypeParameter()) {
493-
auto origSig = genericEnv->getGenericSignature();
494493
conformance = conformance.subst(origType,
495-
QueryInterfaceTypeSubstitutions(genericEnv),
496-
LookUpConformanceInSignature(origSig.getPointer()));
494+
genericEnv->getForwardingSubstitutionMap());
497495
}
498496
auto ret = emitWitnessTableRef(IGF, type, conformance);
499497
IGF.Builder.CreateRet(ret);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature VariadicGenerics -disable-availability-checking
2+
3+
// Because of -enable-experimental-feature VariadicGenerics
4+
// REQUIRES: asserts
5+
6+
// FIXME: Add more tests
7+
8+
public protocol P {}
9+
10+
public struct G<each T>: P {}
11+
12+
public func returnsG<each T>(_ t: repeat each T) -> some P {
13+
return G<repeat each T>()
14+
}

0 commit comments

Comments
 (0)