oxidecomputer / oxidecomputer/typify

Failed to make unique variant names for [=,>,<,≥,>=,≤,<=,≠,!=]

Open
#948 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
898
Forks
114
Avg merge
4h 18m
Merged PRs (30d)
14

Description

$ cargo typify ./factorio-data-raw-json-schema.full.json
The application panicked (crashed).
Message:  Failed to make unique variant names for [=,>,<,≥,>=,≤,<=,≠,!=]
Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\typify-impl-0.5.0\src\type_entry.rs:286

Schema: https://raw.githubusercontent.com/jacquev6/factorio-data-raw-json-schema/5bf7e246ce839017ee03f0f5ecb264b3b31a0b95/factorio-data-raw-json-schema.full.json.

Offending definition:


    "ComparatorString": {
      "description": "https://lua-api.factorio.com/stable/types/ComparatorString.html",
      "anyOf": [
        {
          "type": "string",
          "const": "="
        },
        {
          "type": "string",
          "const": ">"
        },
        {
          "type": "string",
          "const": "<"
        },
        {
          "type": "string",
          "const": "\u2265"
        },
        {
          "type": "string",
          "const": ">="
        },
        {
          "type": "string",
          "const": "\u2264"
        },
        {
          "type": "string",
          "const": "<="
        },
        {
          "type": "string",
          "const": "\u2260"
        },
        {
          "type": "string",
          "const": "!="
        }
      ]
    },

EDIT: Seems like this is the same issue as https://github.com/oxidecomputer/typify/issues/749

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the panic with cargo typify ./factorio-data-raw-json-schema.full.json and inspect the ComparatorString definition in the linked schema. Review the related issue #749 and the reported type_entry.rs:286 location to understand the variant-name failure. Done means typify processes these comparator constants without panicking.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.