Skip to content

Commit dbb3a64

Browse files
committed
[IDE] Type check property wrappers so their USRs can be reported in cursor info
1 parent 29af96f commit dbb3a64

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/IDE/CursorInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ void typeCheckDeclAndParentClosures(ValueDecl *VD) {
5050
typeCheckASTNodeAtLoc(
5151
TypeCheckASTNodeAtLocContext::declContext(VD->getDeclContext()),
5252
VD->getLoc());
53+
// Type check any attached property wrappers so the annotated declaration can
54+
// refer to their USRs
55+
if (auto VarD = dyn_cast<VarDecl>(VD)) {
56+
(void)VarD->getPropertyWrapperBackingPropertyType();
57+
}
5358
}
5459

5560
// MARK: - NodeFinderResults
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@propertyWrapper struct State {
2+
public init(initialValue value: Int)
3+
public var wrappedValue: Int { get nonmutating set }
4+
}
5+
6+
func loadPage() {
7+
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):14 %s -- %s
8+
@State var pageListener: Int
9+
}

0 commit comments

Comments
 (0)