Skip to content

[labs/context] When we move to standard decorators, we should support type checking that a private property decorated with @provide or @consume matches the context type #3926

@rictic

Description

@rictic

Should this be an RFC?

  • This is not a substantial change

Which package is this a feature request for?

Context (@lit-labs/context)

Description

With experimental decorators we can't access the type of a decorated field that's private or protected, so we can't enforce that its type matches the value type of its context object. We're also totally unable to support #private fields at all.

Later this year, when we implement @provide/@consume with standard decorators (see RFC at lit/rfcs#20) we should endeavor to fully support and type check these use cases.

Alternatives and Workarounds

Currently it's a type error to use @consume/@provide with private or protected fields. With #3733 it will be allowed, but it won't be type checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions