Skip to content

[SR-12047] Types referenced with is Foo not in index #54483

@keith

Description

@keith
Previous ID SR-12047
Radar rdar://problem/58861172
Original Reporter @keith
Type Improvement
Status Resolved
Resolution Duplicate

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s
Labels Improvement
Assignee None
Priority Medium

md5: 93b6b6b2876fec49f1e8d168960dfc21

duplicates:

relates to:

Issue Description:

With this code in a single macOS CLI project:

protocol Bar {}

/// Some docstring that should appear over all references
struct Foo: Bar {
    init() {}
}

print(Foo())
let bar: Bar? = nil
print(bar is Foo)
print(bar as! Foo)

When you option click on Foo(), you correctly see the docstring, when you option click on is Foo you do not, but the as! Foo works again. This also means you do not see the is Foo use when you look up callers in Xcode.

Looking in the index data it seems that there is no symbol occurrence for Foo in the is Foo case.

Attached is a sample project and screenshot examples of how it manifests in Xcode 11.3.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.castingFeature: explicit casting (is, as, as? and as!)duplicateResolution: Duplicates another issueexpressionsFeature: expressionsindexingArea → source tooling: AST indexingsource toolingArea: IDE support, SourceKit, and other source toolingswift 5.1typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions