Skip to content

Commit e2b8312

Browse files
committed
Code completion: try to substitute generic arguments when completing
a constructor reference Swift SVN r10820
1 parent 942b490 commit e2b8312

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,11 +1122,12 @@ class CompletionLookup : public swift::VisibleDeclConsumer {
11221122
Builder.addLeadingDot();
11231123
Builder.addTextChunk("init");
11241124
}
1125-
Type ArgsType = CD->getType()
1126-
->castTo<AnyFunctionType>()->getResult()
1127-
->castTo<AnyFunctionType>()->getInput();
1128-
addPatternFromType(Builder, ArgsType);
1129-
addTypeAnnotation(Builder, CD->getResultType());
1125+
Type ConstructorType =
1126+
getTypeOfMember(CD)->castTo<AnyFunctionType>()->getResult();
1127+
addPatternFromType(
1128+
Builder, ConstructorType->castTo<AnyFunctionType>()->getInput());
1129+
addTypeAnnotation(
1130+
Builder, ConstructorType->castTo<AnyFunctionType>()->getResult());
11301131
}
11311132

11321133
void addSubscriptCall(const SubscriptDecl *SD, DeclVisibilityKind Reason) {

0 commit comments

Comments
 (0)