Failed to compile due to Unrecognized primitive type: "generic T" (DEPRECATED)

Hi Team

Getting following error when i compile the index

error: Unrecognized primitive type: "generic T".
 --> src/lib.rs:5:1
  |
5 | #[indexer(manifest = "/usr/home/auction-index/auction_index.manifest.yaml")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the attribute macro `indexer` (in Nightly builds, run with -Z macro-backtrace for more info)

And this is from out/release/contract.abi.json

 {
      "typeId": 11,
      "type": "generic T",
      "components": null,
      "typeParameters": null
    }

Does indexer support Generic type ?

Forc version forc 0.32.2
Forc index version forc index 0.1.13

@Ahimasjason The indexer doesn’t currently support the Generic Sway type. We’ll investigate what’s necessary to pull this off and add it to our roadmap. Cheers!

1 Like

@Ahimasjason Could you open an issue in the repository for this? I don’t think (off the top of my head) this would be a heavy lift (re: adding support for this).

But if you open an issue be sure to include your ABI JSON. It might also be helpful to comment in the issue about how you plan to save this generic struct – i.e., Are you just saving a regular GraphQL schema type? Or trying to do something fancy? The more info the more helpful for us.

Cheers.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.