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

Forbid referencing unknown types for WIT format. #5

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

Forbid referencing unknown types for WIT format. #5

sviezypan opened this issue Feb 4, 2024 · 0 comments

Comments

@sviezypan
Copy link
Collaborator

sviezypan commented Feb 4, 2024

Inside the module from which WIT file is generated, we can reference some standard rust type - which is not defined inside module. e.g.

#[golem_rust::create_wit_file]
mod component {
    struct AuctionId {
        auction_id: std::sync::Mutex<u64>
    }
}

This would generate the following content of a WIT file, which is incorrect as mutex is not wit keyword or any defined data type.

record auction-id {
        auction-id: mutex,
}

This ticket is to forbid the ability to write this - make the macro not compile. It would be nice to only allow WIT data types (option, result, list...) and whatever is defined inside the module.

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