Skip to content

Make PropertyKey generic in the Entity type #289

Description

@errt

Currently, any kind of entity can be associated with any property(key). This has drawbacks:

  • it is easy to accidentally either produce an EPS with an incorrect entity or, upon querying an EPS, try to match it against an incorrect entity kind without the type system showing the error
  • if the entity kind associated with a property changes (e.g., entities for escape analyses changed to be context sensitive), both analyses and clients need to be updated, but the type system does not offer any help

Thus, I propose we introduce a type parameter to PropertyKey to specify the entity type. Most properties are only sensible with a single type of entity anyway, and the ones where this is not the case can still opt for Any (or use union types in Scala 3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions