File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1956,12 +1956,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1956
1956
unsigned appliedArgStartIdx =
1957
1957
substConv.getNumSILArguments () - PAI->getNumArguments ();
1958
1958
for (auto p : llvm::enumerate (PAI->getArguments ())) {
1959
+ unsigned argIdx = appliedArgStartIdx + p.index ();
1959
1960
requireSameType (
1960
1961
p.value ()->getType (),
1961
- substConv.getSILArgumentType (appliedArgStartIdx + p.index (),
1962
- F.getTypeExpansionContext ()),
1962
+ substConv.getSILArgumentType (argIdx, F.getTypeExpansionContext ()),
1963
1963
" applied argument types do not match suffix of function type's "
1964
1964
" inputs" );
1965
+ if (PAI->isOnStack ()) {
1966
+ require (!substConv.getSILArgumentConvention (argIdx).isOwnedConvention (),
1967
+ " on-stack closures do not support owned arguments" );
1968
+ }
1965
1969
}
1966
1970
1967
1971
// The arguments to the result function type must match the prefix of the
You can’t perform that action at this time.
0 commit comments