File tree Expand file tree Collapse file tree 4 files changed +6
-17
lines changed Expand file tree Collapse file tree 4 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
1015
1015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
1016
1016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
1017
1017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018
- refs/heads/rxwei-patch-1: dcec244c0bb2b18545ea6a79ab40663647879da4
1018
+ refs/heads/rxwei-patch-1: 197ddb57ab992a0dd8f515ec178244ff81be553b
1019
1019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
1020
1020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
1021
1021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9
Original file line number Diff line number Diff line change @@ -7205,7 +7205,7 @@ inline EnumElementDecl *EnumDecl::getUniqueElement(bool hasValue) const {
7205
7205
}
7206
7206
7207
7207
// / Retrieve parameter declaration from the given source at given index.
7208
- const ParamDecl *getParameterAt (ValueDecl *source, unsigned index);
7208
+ const ParamDecl *getParameterAt (const ValueDecl *source, unsigned index);
7209
7209
7210
7210
// / Display Decl subclasses.
7211
7211
void simple_display (llvm::raw_ostream &out, const Decl *decl);
Original file line number Diff line number Diff line change @@ -5990,7 +5990,7 @@ DeclName AbstractFunctionDecl::getEffectiveFullName() const {
5990
5990
return DeclName ();
5991
5991
}
5992
5992
5993
- const ParamDecl *swift::getParameterAt (ValueDecl *source, unsigned index) {
5993
+ const ParamDecl *swift::getParameterAt (const ValueDecl *source, unsigned index) {
5994
5994
const ParameterList *paramList;
5995
5995
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(source)) {
5996
5996
paramList = AFD->getParameters ();
Original file line number Diff line number Diff line change @@ -370,20 +370,9 @@ static Type getAdjustedParamType(const AnyFunctionType::Param ¶m) {
370
370
371
371
// Is a particular parameter of a function or subscript declaration
372
372
// declared to be an IUO?
373
- static bool paramIsIUO (Decl *decl, int paramNum) {
374
- if (auto *fn = dyn_cast<AbstractFunctionDecl>(decl)) {
375
- auto *paramList = fn->getParameters ();
376
- auto *param = paramList->get (paramNum);
377
- return param->getAttrs ().hasAttribute <ImplicitlyUnwrappedOptionalAttr>();
378
- }
379
- if (auto *ee = dyn_cast<EnumElementDecl>(decl)) {
380
- auto *param = ee->getParameterList ()->get (paramNum);
381
- return param->getAttrs ().hasAttribute <ImplicitlyUnwrappedOptionalAttr>();
382
- }
383
-
384
- auto *subscript = cast<SubscriptDecl>(decl);
385
- auto *index = subscript->getIndices ()->get (paramNum);
386
- return index->getAttrs ().hasAttribute <ImplicitlyUnwrappedOptionalAttr>();
373
+ static bool paramIsIUO (const ValueDecl *decl, int paramNum) {
374
+ return swift::getParameterAt (decl, paramNum)->getAttrs ()
375
+ .hasAttribute <ImplicitlyUnwrappedOptionalAttr>();
387
376
}
388
377
389
378
// / Determine whether the first declaration is as "specialized" as
You can’t perform that action at this time.
0 commit comments