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

Handle props access on base object #1177

Open
ssalbdivad opened this issue Oct 15, 2024 · 0 comments
Open

Handle props access on base object #1177

ssalbdivad opened this issue Oct 15, 2024 · 0 comments
Labels
bug Something isn't working confirmed The maintainers of the repo would like to address this

Comments

@ssalbdivad
Copy link
Member

Currently this crashes:

import { generic, Hkt } from "arktype";

const Enum = generic(["O", "object"])(
  ({ O }) => {
    console.log(O.props); // TypeError: this.applyStructuralOperation[0] is not iterable
  },
  class extends Hkt {
    declare body: this[0];
  }
);

This is based on props only existing on nodes with an actual structure, but we need to find a better way to work around that for object.

@ssalbdivad ssalbdivad added bug Something isn't working confirmed The maintainers of the repo would like to address this labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed The maintainers of the repo would like to address this
Projects
Status: Backlog
Development

No branches or pull requests

1 participant