File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -4040,8 +4040,9 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
40404040 Builder.emitBlock (typedErrorLoadBB);
40414041
40424042 auto &errorTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (errorType));
4043- auto silResultTy = CurSILFn->mapTypeIntoContext (
4044- substConv.getSILResultType (IGM.getMaximalTypeExpansionContext ()));
4043+ auto silResultTy =
4044+ substConv.getSILResultType (IGM.getMaximalTypeExpansionContext ());
4045+ ASSERT (!silResultTy.hasTypeParameter ());
40454046 auto &resultTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silResultTy));
40464047
40474048 auto &resultSchema = resultTI.nativeReturnValueSchema (IGM);
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -primary-file %s -emit-irgen
2+
3+ // https://github.com/swiftlang/swift/issues/80020
4+ //
5+ // We used to assert if you had a loadable return type that contained
6+ // a generic parameter.
7+
8+ public enum MyError : Error {
9+ case error
10+ }
11+
12+ public struct G < T> { } // Note: G<T> is loadable
13+
14+ public func f< T> ( t: T ) throws ( MyError) -> G < T > {
15+ return G < T > ( )
16+ }
17+
18+ public func g< U> ( u: U ? ) throws ( MyError) -> G < U ? > {
19+ return try f ( t: u)
20+ }
You can’t perform that action at this time.
0 commit comments