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

Directly applying the same type in the same scope creates two instances with the same control API name #590

Closed
cole-barefoot opened this issue May 9, 2017 · 2 comments
Assignees

Comments

@cole-barefoot
Copy link
Contributor

For example:

control callee(...) { }
control caller(...) {
    apply { callee.apply(...); callee.apply(...); }
}

Will be translated to something like:

control callee(...) { }
control caller(...) {
    @name("callee") callee() tmp_1;
    @name("callee") callee() tmp_2;
    apply { tmp_1.apply(...); tmp_2.apply(...); }
}

Either duplicate applications of the same type in the same scope should be rejected, or they should refer to the same local instance (and the spec should be updated to reflect this).

@mihaibudiu
Copy link
Contributor

I actually think this is a legal program.
If there is a table in callee, then the code which generates a control-plane API should complain.

@cole-barefoot
Copy link
Contributor Author

@mbudiu-vmw: I see your point. I'm going to close this issue and open a new one about rejecting programs that have the same control API names for different controllable entities.

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

3 participants