Skip to content

[record_use] Correctness: Support nested const instances #2867

@dcharkes

Description

@dcharkes

Currently, the way that const instances are encoded is with a json map where the keys are the fields and the values are the field values. For the top-level instance you can look at the corresponding definition:

    {
      "definition": {
        "identifier": {
          "uri": "instance_class.dart",
          "name": "MyClass"
        },
        "loading_unit": "1"
      },
      "instances": [
        {
          "constant_index": 1,
          "loading_unit": "1",
          "@": 0
        }
      ]
    }

But for constants that are nested inside other constants, there is no way what the definition is.

  "constants": [
    {
      "type": "Instance",
      "value": {
        "i": 0
      }
    }
  ],

We should consider having a top-level list of definitions and letting the current place of definitions refer with an index into that list.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions