mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Fix spurious diagnostic about move-only tuples
This commit is contained in:
@@ -5992,7 +5992,7 @@ NeverNullType TypeResolver::resolveTupleType(TupleTypeRepr *repr,
|
||||
!isa<TupleTypeRepr>(tyR)) {
|
||||
auto contextTy = GenericEnvironment::mapTypeIntoContext(
|
||||
resolution.getGenericSignature().getGenericEnvironment(), ty);
|
||||
if (contextTy->isNoncopyable())
|
||||
if (!contextTy->hasError() && contextTy->isNoncopyable())
|
||||
moveOnlyElementIndex = i;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,3 +23,7 @@ func inferredTuples<T>(x: Int, y: borrowing Butt, z: T) {
|
||||
_ = b
|
||||
_ = c
|
||||
}
|
||||
|
||||
// Avoid spurious diagnostic with the tuple here
|
||||
func bogus<T>(_: T, _: (T, T)) where T == DoesNotExist {}
|
||||
// expected-error@-1 {{cannot find type 'DoesNotExist' in scope}}
|
||||
|
||||
Reference in New Issue
Block a user