diff options
-rw-r--r-- | changelog.md | 5 | ||||
-rw-r--r-- | script/vm/operator.lua | 1 | ||||
-rw-r--r-- | test/type_inference/init.lua | 26 |
3 files changed, 32 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 72e813be..d3c78de9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # changelog +## 3.6.5 +* `FIX` [#1729] + +[#1729]: https://github.com/sumneko/lua-language-server/issues/1729 + `2022-11-29` ## 3.6.4 * `NEW` modify `require` after renaming files diff --git a/script/vm/operator.lua b/script/vm/operator.lua index 015eba38..cb27d33d 100644 --- a/script/vm/operator.lua +++ b/script/vm/operator.lua @@ -81,6 +81,7 @@ local function checkOperators(operators, op, value, result) result = vm.createNode() end result:merge(vm.compileNode(operator.extends)) + break ::CONTINUE:: end return result diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 4a60766b..33521a0d 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3974,3 +3974,29 @@ if x == 0.1 then print(<?x?>) end ]] + +TEST 'vec3' [[ +---@class mat4 +---@operator mul(vec3): vec3 -- matrix * vector +---@operator mul(number): mat4 -- matrix * constant + +---@class vec3: number + +---@type mat4, vec3 +local m, v + +local <?r?> = m * v +]] + +TEST 'mat4' [[ +---@class mat4 +---@operator mul(number): mat4 -- matrix * constant +---@operator mul(vec3): vec3 -- matrix * vector + +---@class vec3: number + +---@type mat4, vec3 +local m, v + +local <?r?> = m * v +]] |