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

Explore possibilities of referencing outer data types from inner module. #4

Open
sviezypan opened this issue Feb 4, 2024 · 0 comments

Comments

@sviezypan
Copy link
Collaborator

When generating WIT files, there's a rule that all data types need to reside inside the module (except for WIT keywords like option, result, list etc)

E.g. the following would not work

struct AuctionId {
    auction_id: String,
}

#[golem_rust::create_wit_file]
mod auction_app {

    struct Auction {
        auction_id: Option<super::AuctionId>,
        name: String,
        description: String,
        starting_price: f32,
        deadline: Deadline,
    }
}

The reason is that macro create_wit_file can't really see tokens outside of module that it is annotating. Is there a possibility to work around that?

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

No branches or pull requests

1 participant