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

Warn about precedence of metadata over binary operators #83

Open
serjek opened this issue Feb 28, 2023 · 0 comments
Open

Warn about precedence of metadata over binary operators #83

serjek opened this issue Feb 28, 2023 · 0 comments

Comments

@serjek
Copy link

serjek commented Feb 28, 2023

Consider example:

@:constant var timeOffset:Float = @byDefault Date.now().getTimezoneOffset()/(-60);

If overriden during model init this will give a warning
... has extra field timeOffset

Real problem is the precedence of metadata over binary operators, which is fixed by wrapping data:

@:constant var timeOffset:Float = @byDefault (Date.now().getTimezoneOffset()/(-60));

Coconut should give a warning when metadata is detected with binary 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