Skip to content

Assertion fail in lambda code completion #274

@sam-mccall

Description

@sam-mccall

auto x = []{^

The issue:

  • x is itself a valid completion
  • in the code-complete callback, we try to compute its linkage (for two reasons: as a CC signal, and to compute USR->symbol ID for index merge)
  • at this point its type is "undeduced auto" and its linkage is external, this gets cached
  • after the code-complete callback the parser bails out, sema attaches the initializer to the variable x
  • now x has type unspellable-lambda, so its linkage should de-facto internal, which doesn't match the cache
  • this inconsistency is caught by an assertion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions