Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test case: Valinor cannot understand array{k: T|list<T>} #487

Closed

Commits on Mar 5, 2024

  1. Failing test case: Valinor cannot understand array{k: T|list<T>}

    In this test, Valinor is being challenged to understand de-serialization of
    a given hashmap when given a type `array{a-key: T|list<T>}`.
    
    Specifically, at the time of this writing, Valinor only picks `T` during de-serialization,
    and seems to completely ignore the `list<T>` portion of the data.
    
    This kind of de-serialization is relevant when dealing with XML structures,
    where an element could be singular or plural depending on context:
    
    ```xml
    <Invoices>
      <Invoice>
        <!-- in this example, `Item` is singular, and needs to be handled as `Item` -->
        <Item><Price>123</Price></Item>
      </Invoice>
      <Invoice>
        <!-- in this example, `Item` is plural, and needs to be handled as `list<Item>` -->
        <Item><Price>456</Price></Item>
        <Item><Price>789</Price></Item>
      </Invoice>
    </Invoices>
    ```
    
    Initially discovered by @Tigerman55
    Ocramius committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    ffe0f0f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4df5cd5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9190754 View commit details
    Browse the repository at this point in the history