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

Implicit (or explicit) casting #3

Open
theomessin opened this issue Jan 30, 2021 · 0 comments
Open

Implicit (or explicit) casting #3

theomessin opened this issue Jan 30, 2021 · 0 comments

Comments

@theomessin
Copy link
Member

theomessin commented Jan 30, 2021

Certain expressions can be simplified by casting.

For example, the following should return a Number.

alias acPowerAvailable = (L:ACPowerAvailable, bool);
alias toggleSwitch = (L:A32NX_RMP_#SIDE#_TOGGLE_SWITCH, bool);
alias pot = (A:LIGHT POTENTIOMETER:#POTENTIOMETER#, number);
(acPowerAvailable and toggleSwitch) * pot

Currently the above fails because bool * number is not allowed.
However, bool can be cast to a number when using unary operators.

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

1 participant