Skip to content

Commit 6b56154

Browse files
committed
Use getParams() in findProtocolSelfReferences.
1 parent ffb74a5 commit 6b56154

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/AST/Decl.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -3815,9 +3815,12 @@ ProtocolDecl::findProtocolSelfReferences(const ValueDecl *value,
38153815
// Methods of non-final classes can only contain a covariant 'Self'
38163816
// as a function result type.
38173817
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+
38213824
if (inputKind.parameter)
38223825
return SelfReferenceKind::Other();
38233826
}

0 commit comments

Comments
 (0)