Skip to content

[.]Type completion for (any P). shows it will produce an existential metatype #65843

@AnthonyLatsis

Description

@AnthonyLatsis

Test case:

// RUN: %empty-directory(%t)
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
protocol P {}

(any P).#^COMPLETE?check=META^# 
// META: Keyword/CurrNominal:  Type[#(any P).Type#]; name=Type

This test will fail, because the current completion is Type[#any P.Type#]; name=Type. Notice how it thinks the completion will produce an existential metatype any P.Type, whereas the actual result is the singleton metatype (any P).Type.

Note
any syntax was proposed in SE-0335.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesgood first issueGood for newcomersmetatypesFeature → types: Metatypessource toolingArea: IDE support, SourceKit, and other source toolingswift 5.9typesFeature: 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