Skip to content

Implemented newtype pattern support for tuples #2957

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egormanga
Copy link

@egormanga egormanga commented Jul 19, 2025

Description of Changes

Related issues: #2379, #2604.

To be able to do this:

#[derive(SpacetimeType)]
pub struct Position(vecmath::Vector3<f64>);

(previously, the derive macro would panic.)

This is an early attempt! I need help in figuring out all details on how to properly implement deserialization.

Also, currently this fails with errors like these:

error at typespace ref `&1`: internal codegen error: all type elements require names: (0: Array<F64>)

error at typespace ref `&2`: internal codegen error: non-special product or sum type (0: F64, 1: Array<F64>) cannot be used to generate a client type use

API and ABI breaking changes

Unknown.

Expected complexity level and risk

?…

Testing

  • SpacetimeDB compiles
  • The module builds
  • Publishing works

@bfops
Copy link
Collaborator

bfops commented Jul 21, 2025

Thank you for submitting this! We'll work on getting it reviewed (along with your other PRs)

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