@@ -2822,10 +2822,6 @@ CanSILFunctionType SILGenFunction::buildThunkType(
2822
2822
? DefaultThickCalleeConvention
2823
2823
: ParameterConvention::Direct_Unowned});
2824
2824
2825
- auto getCanonicalType = [&](Type t) -> CanType {
2826
- return t->getCanonicalType (genericSig);
2827
- };
2828
-
2829
2825
// Map the parameter and expected types out of context to get the interface
2830
2826
// type of the thunk.
2831
2827
SmallVector<SILParameterInfo, 4 > interfaceParams;
@@ -2834,15 +2830,16 @@ CanSILFunctionType SILGenFunction::buildThunkType(
2834
2830
auto paramIfaceTy = GenericEnvironment::mapTypeOutOfContext (
2835
2831
genericEnv, param.getType ());
2836
2832
interfaceParams.push_back (
2837
- SILParameterInfo (getCanonicalType (paramIfaceTy ),
2833
+ SILParameterInfo (paramIfaceTy-> getCanonicalType (genericSig ),
2838
2834
param.getConvention ()));
2839
2835
}
2840
2836
2841
2837
SmallVector<SILResultInfo, 4 > interfaceResults;
2842
2838
for (auto &result : expectedType->getResults ()) {
2843
2839
auto resultIfaceTy = GenericEnvironment::mapTypeOutOfContext (
2844
2840
genericEnv, result.getType ());
2845
- auto interfaceResult = result.getWithType (getCanonicalType (resultIfaceTy));
2841
+ auto interfaceResult =
2842
+ result.getWithType (resultIfaceTy->getCanonicalType (genericSig));
2846
2843
interfaceResults.push_back (interfaceResult);
2847
2844
}
2848
2845
@@ -2852,7 +2849,7 @@ CanSILFunctionType SILGenFunction::buildThunkType(
2852
2849
auto errorIfaceTy = GenericEnvironment::mapTypeOutOfContext (
2853
2850
genericEnv, errorResult.getType ());
2854
2851
interfaceErrorResult = SILResultInfo (
2855
- getCanonicalType (errorIfaceTy ),
2852
+ errorIfaceTy-> getCanonicalType (genericSig ),
2856
2853
expectedType->getErrorResult ().getConvention ());
2857
2854
}
2858
2855
0 commit comments