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

Explicit duplicated types in inheritance should error #56

Closed
dburgener opened this issue Sep 30, 2022 · 0 comments · Fixed by #61
Closed

Explicit duplicated types in inheritance should error #56

dburgener opened this issue Sep 30, 2022 · 0 comments · Fixed by #61
Assignees

Comments

@dburgener
Copy link
Owner

This currently compiles fine:

virtual resource foo {}

virtual resource bar {}

resource baz inherits foo, foo, bar {}

domain requires_allow {
        allow(this, baz, file, read);
}

It should error and tell the user that "foo" was listed twice when inheriting baz.

On the other hand, something like this:

virtual resource foo {}

virtual resource bar inherits foo {}

virtual resource baz inherits foo {}

resource qux inherits bar, baz {}

domain requires_allow {
        allow(this, qux, file, read);
}

Compiles fine and should continue to do so, because the duplication isn't explicit. Since qux inherits bar and baz which each inherit foo, that's fine, and the compiler should internally dedup and only inherit foo once.

The second case is working correctly today, but we want to ensure that it continues working when we cause the first case to error.

@matt-sheets matt-sheets self-assigned this Oct 27, 2022
@matt-sheets matt-sheets linked a pull request Oct 27, 2022 that will close this issue
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 a pull request may close this issue.

2 participants