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

Types allowed in reactor type args #1639

Merged
merged 7 commits into from
Mar 15, 2023
Merged

Types allowed in reactor type args #1639

merged 7 commits into from
Mar 15, 2023

Conversation

oowekyala
Copy link
Collaborator

This allows writing new R<std::vector<int>>(...) without needing curly braces around the type argument. This is appropriate since it's a type argument (so, a type), not a type parameter. It was surprising that it's possible to write eg std::optional<int> without escaping in a type annotation anywhere in LF, except in that place. See for example a use case here:

https://github.com/lf-lang/examples-lingua-franca/blob/e1dd212f28a4ccaf7ff6d717a488a113c5b466a4/Cpp/src/RequestResponse/MAC.lf#L26

Also rename type params to type args where appropriate, for consistency's sake.

Ref #1492 (grammar cleanups)

Rename type params to type args where appropriate
@cmnrd
Copy link
Collaborator

cmnrd commented Mar 10, 2023

Thanks for taking a shot at this! I have struggled with it a couple of times, but never made the change.

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! This is a great improvement. Thank you, @oowekyala!

@lhstrh lhstrh changed the title Allow Type in reactor type args Types allowed in reactor type args Mar 15, 2023
@lhstrh lhstrh merged commit 4c4b411 into master Mar 15, 2023
@lhstrh lhstrh deleted the clem.type-args branch March 15, 2023 01:31
@petervdonovan petervdonovan added the feature New feature label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants