diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-16 15:24:52 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-16 15:24:52 +0800 |
commit | f406daaa8633afb61078a060b509c32675b6f612 (patch) | |
tree | 53a560457dd837d8d2eee28da4ee4d75f1249707 /server/src/vm/value.lua | |
parent | 20b609862d1536b1aa6befdca3eef9dedb58fc91 (diff) | |
download | lua-language-server-f406daaa8633afb61078a060b509c32675b6f612.zip |
类型推断取最大值而不是叠加
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r-- | server/src/vm/value.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 425cc0b2..c93fda90 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -70,7 +70,9 @@ function mt:setType(tp, rate) end end local current = self._type[tp] or 0.0 - self._type[tp] = current + (1 - current) * rate + if rate > current then + self._type[tp] = rate + end end function mt:getType() |