Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9020] #keyPath contents are not being indexed #51523

Open
swift-ci opened this issue Oct 16, 2018 · 3 comments
Open

[SR-9020] #keyPath contents are not being indexed #51523

swift-ci opened this issue Oct 16, 2018 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9020
Radar None
Original Reporter rockbruno (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: c2312b3f52d700c9734cefcee090f567

Issue Description:

import Foundation

class Foo {
    @objc var bar: Int = 1
    private init () {}
} 

let path = #keyPath(Foo.bar)

The `Foo.Bar` ref inside the keyPath will not be indexed:

------------
module | system | Swift | /Users/bruno.rocha/Desktop/PersonalCodes/swift-source/build/Ninja-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/x86_64/Swift.swiftmodule-AW2UVXTA3TN7
------------
1:8 | module/Swift | Foundation | c:@M@Foundation | Ref | rel: 0
3:7 | class/Swift | Foo | s:14swift_ide_test3FooC | Def | rel: 0
4:15 | instance-property/Swift | bar | s:14swift_ide_test3FooC3barSivp | Def,RelChild | rel: 1
  RelChild | class/Swift | Foo | s:14swift_ide_test3FooC
4:15 | instance-method/acc-get/Swift | getter:bar | s:14swift_ide_test3FooC3barSivg | Def,Dyn,Impl,RelChild,RelAcc | rel: 1
  RelChild,RelAcc | instance-property/Swift | bar | s:14swift_ide_test3FooC3barSivp
4:15 | instance-method/acc-set/Swift | setter:bar | s:14swift_ide_test3FooC3barSivs | Def,Dyn,Impl,RelChild,RelAcc | rel: 1
  RelChild,RelAcc | instance-property/Swift | bar | s:14swift_ide_test3FooC3barSivp
4:20 | struct/Swift | Int | s:Si | Ref | rel: 0
5:13 | constructor/Swift | init() | s:14swift_ide_test3FooCACyc026_C9EA6B8D3B14235063D1370E4E5C7CA7Llfc | Def,RelChild | rel: 1
  RelChild | class/Swift | Foo | s:14swift_ide_test3FooC
8:5 | variable/Swift | path | s:14swift_ide_test4pathSSvp | Def | rel: 0
8:5 | function/acc-get/Swift | getter:path | s:14swift_ide_test4pathSSvg | Def,Impl,RelChild,RelAcc | rel: 1
  RelChild,RelAcc | variable/Swift | path | s:14swift_ide_test4pathSSvp
8:5 | function/acc-set/Swift | setter:path | s:14swift_ide_test4pathSSvs | Def,Impl,RelChild,RelAcc | rel: 1
  RelChild,RelAcc | variable/Swift | path | s:14swift_ide_test4pathSSvp
@swift-ci
Copy link
Collaborator Author

Comment by Bruno Rocha (JIRA)

It turns out that the true problem is that only properties are being resolved, which triggers a difference in components.count x resolvedComponents.count which is being seen as an error. You can see that it indexes correctly in #keyPath(myProp).

@swift-ci
Copy link
Collaborator Author

Comment by Bruno Rocha (JIRA)

#20020

@swift-ci
Copy link
Collaborator Author

Comment by Bruno Rocha (JIRA)

The approach used to solve this has fizzled due to changes in the compiler. I'm de-assigning it

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

1 participant