-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Description
| Previous ID | SR-12903 |
| Radar | None |
| Original Reporter | rockbruno (JIRA User) |
| Type | Bug |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 673dbd66810d405d1790652da9602332
Issue Description:
import Foundation
@objc protocol Foo {
@objc optional func bar()
}
class Sample {
weak var delegate: Foo?
func doSomething() {
delegate?.bar()
}
}In this snippet, `bar` from `delegate?.bar()` will not get indexed. This only happens if the declaration is `optional`. It works with just `objc`.
Here's how the AST of this looks like:
(optional_evaluation_expr implicit type='<null>'
(call_expr type='<null>' arg_labels=
(unresolved_dot_expr type='<null>' field 'bar' function_ref=single
(bind_optional_expr type='<null>' depth=0
(unresolved_dot_expr type='<null>' field 'delegate' function_ref=unapplied
(declref_expr implicit type='<null>' decl=blabla.(file).Sample.doSomething().self@/Users/rochab/Desktop/blabla.swift:11:10 function_ref=unapplied))))
Looks like it hasn't got resolved.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.