@@ -3593,7 +3593,8 @@ TypeResolver::resolveASTFunctionTypeParams(TupleTypeRepr *inputRepr,
3593
3593
}
3594
3594
3595
3595
// Validate the presence of ownership for a noncopyable parameter.
3596
- if (inStage (TypeResolutionStage::Interface)) {
3596
+ if (inStage (TypeResolutionStage::Interface)
3597
+ && !options.contains (TypeResolutionFlags::SILMode)) {
3597
3598
diagnoseMissingOwnership (getASTContext (), dc, ownership,
3598
3599
eltTypeRepr, ty, options);
3599
3600
@@ -4776,6 +4777,7 @@ NeverNullType TypeResolver::resolveVarargType(VarargTypeRepr *repr,
4776
4777
// do not allow move-only types as the element of a vararg
4777
4778
if (!element->hasError ()
4778
4779
&& inStage (TypeResolutionStage::Interface)
4780
+ && !options.contains (TypeResolutionFlags::SILMode)
4779
4781
&& isInterfaceTypeNoncopyable (
4780
4782
element, getDeclContext ()->getGenericEnvironmentOfContext ())) {
4781
4783
diagnoseInvalid (repr, repr->getLoc (), diag::noncopyable_generics_variadic,
@@ -4954,11 +4956,13 @@ NeverNullType TypeResolver::resolveTupleType(TupleTypeRepr *repr,
4954
4956
hadError = true ;
4955
4957
}
4956
4958
// Tuples with move-only elements aren't yet supported.
4957
- // Track the presence of a noncopyable field for diagnostic purposes.
4959
+ // Track the presence of a noncopyable field for diagnostic purposes only .
4958
4960
// We don't need to re-diagnose if a tuple contains another tuple, though,
4959
4961
// since we should've diagnosed the inner tuple already.
4960
4962
if (inStage (TypeResolutionStage::Interface)
4963
+ && !options.contains (TypeResolutionFlags::SILMode)
4961
4964
&& isInterfaceTypeNoncopyable (ty, dc->getGenericEnvironmentOfContext ())
4965
+ && !ctx.LangOpts .hasFeature (Feature::MoveOnlyTuples)
4962
4966
&& !moveOnlyElementIndex.has_value () && !isa<TupleTypeRepr>(tyR)) {
4963
4967
moveOnlyElementIndex = i;
4964
4968
}
@@ -5011,9 +5015,7 @@ NeverNullType TypeResolver::resolveTupleType(TupleTypeRepr *repr,
5011
5015
return ParenType::get (ctx, elements[0 ].getType ());
5012
5016
}
5013
5017
5014
- if (moveOnlyElementIndex.has_value ()
5015
- && !options.contains (TypeResolutionFlags::SILType)
5016
- && !ctx.LangOpts .hasFeature (Feature::MoveOnlyTuples)) {
5018
+ if (moveOnlyElementIndex.has_value ()) {
5017
5019
auto noncopyableTy = elements[*moveOnlyElementIndex].getType ();
5018
5020
auto loc = repr->getElementType (*moveOnlyElementIndex)->getLoc ();
5019
5021
assert (!noncopyableTy->is <TupleType>() && " will use poor wording" );
0 commit comments