Skip to content

Make UtEnumConstantModel and UtClassRefModel subclasses of UtReferenceModel #414

Closed
@dtim

Description

@dtim

Description

Although Enum is a reference type, UtEnumConstantModel is not currently a subtype of UtReferenceModel and does not have any id that would allow the reference comparison of Enum values. As a result, we can't use Enum values as elements of generic collections (Map<K, V>, List<E> etc).

The intended solution:

  • UtEnumConstantModel and UtClassRefModel should be subtypes of UtReferenceModel.
  • The address assigned to a UtEnumConstantModel should be equal to one and only one address assigned to models of the static fields of the corresponding Enum class, and reference equality must hold.
  • The addresses should be assigned to UtClassRefModel with respect to class equality condition: all models of the same class should have the same address, models of different classes should have different addresses,

Related issue: #230

Expected behavior

UtEnumConstantModel is a subtype of UtReferenceModel, and enum values can be used as elements of any generic collection.

Environment

The intended behavior does not depend on any specific environment.

Metadata

Metadata

Assignees

Labels

comp-symbolic-engineIssue is related to the symbolic execution enginectg-enhancementNew feature, improvement or change request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions