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

Add operator type inspections #10

Open
Benjamin-Dobell opened this issue Jul 31, 2020 · 1 comment
Open

Add operator type inspections #10

Benjamin-Dobell opened this issue Jul 31, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Benjamin-Dobell
Copy link
Owner

Benjamin-Dobell commented Jul 31, 2020

Operators (in particular arithmetic operators) should ensure their operands are covariant of number.

The following certainly shouldn't be allowed:

---@type boolean
local aBoolean = true + true -- Illegal

However, non-arithmetic operators should also be checked for compatibility e.g.

---@type number
local a = 1

---@type number
local length = #a -- Illegal

Issue

@adriweb
Copy link

adriweb commented Jul 31, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants