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

Support direct connections from inputs to outputs without reaction in between #28

Closed
cmnrd opened this issue Sep 7, 2022 · 0 comments · Fixed by #29
Closed

Support direct connections from inputs to outputs without reaction in between #28

cmnrd opened this issue Sep 7, 2022 · 0 comments · Fixed by #29
Labels
enhancement Enhancement of existing feature

Comments

@cmnrd
Copy link
Contributor

cmnrd commented Sep 7, 2022

In lf-lang/lingua-franca#1321, @petervdonovan pointed out that the following program fails to execute:

target Cpp

reactor ReactorWithMultiport {
    input[3] in: int

    reaction(in) {=
        for (auto i = 0; i < in.size(); i++) {
            if (in[i].is_present()) {
                std::cout << "received input at port " << i << std::endl;
            }
        }
    =}
}

reactor MultiportSplitter {
    output[3] out: int

    input in0: int
    input in1: int
    input in2: int

    in0, in1, in2 -> out
}

main reactor IndexIntoMultiportInput {
    splitter = new MultiportSplitter()
    receiver = new ReactorWithMultiport()

    splitter.out -> receiver.in

    reaction(startup) -> splitter.in1 {=
        splitter.in1.set(42);
    =}
}

The problem is located here, as there is no case for directly connecting an input to an output of the same reactor.

@cmnrd cmnrd added bug Something isn't working enhancement Enhancement of existing feature and removed bug Something isn't working labels Sep 7, 2022
@cmnrd cmnrd closed this as completed in #29 Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant