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

Assert compound values #1704

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Assert compound values #1704

merged 1 commit into from
Sep 9, 2024

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Sep 4, 2024

Primitive<PrintableCompoundType> resolves to (string | number | boolean | H5WebComplex)[] but we weren't actually asserting for this fully in assertPrimitiveValue. I'm correcting this and also generalising things a bit:

  • Resolve Primitive<CompoundType> to unknown[] instead of unknown (to match the existing array assertion in assertPrimitiveValue)
  • Change the generic of CompoundType to extend DType instead of Record<string, DType> to simplify usage (notably when inferring the generic in Primitive) and to remove the need for PrintableCompoundType (now replaced with just CompoundType<PrintableType>)

Base automatically changed from refact-matrix to main September 9, 2024 12:38
@axelboc axelboc merged commit 457fb59 into main Sep 9, 2024
8 checks passed
@axelboc axelboc deleted the assert-compound branch September 9, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants