File tree 2 files changed +23
-2
lines changed
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) {
4040
4040
Builder.emitBlock (typedErrorLoadBB);
4041
4041
4042
4042
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 ());
4045
4046
auto &resultTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silResultTy));
4046
4047
4047
4048
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