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

Use version marker trait for ISL model #187

Open
desaikd opened this issue Jun 19, 2023 · 0 comments
Open

Use version marker trait for ISL model #187

desaikd opened this issue Jun 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@desaikd
Copy link
Contributor

desaikd commented Jun 19, 2023

Current APIs for creating an ISL model allows mixing different versioned ISL constraints. When we try to resolve this ISL model by loading the schema(load_schema()) it returns error if the constraints are from different ISL versions. If we have something that returns a compile-time error while constructing the ISL model that gives an ease of use for the API.

We can create a marker trait for ISL versioning and have it implement for different ISL versions.
e.g.

trait IslVersion {} // ISL version marker trait

struct IslV1_0 {}
struct IslV2_0 {}

This can be used to define ISL model structs over the generic marker trait IslVersion. We can then have a particular version struct implementation for a constraint. This allows us to define constraints based on its version and gives a compile time error when a constraint doesn't exist for the given ISL version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant