File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
5
- // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5
+ // Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
6
6
// Licensed under Apache License v2.0 with Runtime Library Exception
7
7
//
8
8
// See https://swift.org/LICENSE.txt for license information
@@ -3815,9 +3815,12 @@ ProtocolDecl::findProtocolSelfReferences(const ValueDecl *value,
3815
3815
// Methods of non-final classes can only contain a covariant 'Self'
3816
3816
// as a function result type.
3817
3817
if (!allowCovariantParameters) {
3818
- auto inputType = type->castTo <AnyFunctionType>()->getInput ();
3819
- auto inputKind = ::findProtocolSelfReferences (this , inputType,
3820
- skipAssocTypes);
3818
+ auto inputKind = SelfReferenceKind::None ();
3819
+ for (auto &elt : type->castTo <AnyFunctionType>()->getParams ()) {
3820
+ inputKind |= ::findProtocolSelfReferences (this , elt.getType (),
3821
+ skipAssocTypes);
3822
+ }
3823
+
3821
3824
if (inputKind.parameter )
3822
3825
return SelfReferenceKind::Other ();
3823
3826
}
You can’t perform that action at this time.
0 commit comments