-
-
Notifications
You must be signed in to change notification settings - Fork 354
一些3.4.0新增功能的语法检查异常 #1260
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
Comments
感觉上可以加个忽略可控类型验证的配置,不然现有代码出现太多错误了,大部分都是没验证空 |
可以使用 |
呃,最后一个不是else,我的错 |
算术运算都变成number了 另外number和integer不兼容,这个检查太头疼了 |
设置里有让 number 和 integer 兼容的选项 |
3.5.0 会支持重载运算符,可以解决这个问题 |
我家里没能复现,周一上班公司的提示也没了 |
我今天又大改了一下局部变量追踪,可能已经修复了,之后再观察一下。 |
诊断速度变慢,写代码时十几秒才能诊断完 |
请开一个新的issue并提供日志与可复现此问题的演示工程 |
示例估计太好复现,我是拿我们的项目来说的,文件比较多 500多个 |
500个应该是没问题的,我的工作项目有1500+个文件也无压力,应该是有什么隐藏的bug导致的,这个只有用示例调试才好查 |
|
有没有方法实现可选返回值? |
|
这种怎么处理,手动写个 return nil? ---@return BattleRecordOne?
function BattleEnemy:GetBattleRecord()
if self.battleRecord then
return self.battleRecord.record
end--这里提示要返回值
end |
|
local tm = os.date("*t", os.time())
local t = os.time(tm) -- 不能将 `string|osdate` 赋给参数 `osdate?`。 |
开个单独的issue,以后版本改为分析参数来决定返回值 |
Is there any other issue? |
单独写lua没能复现
另外有没有强制修改类型的配置方式,比如
`---@Class A
local a = {}
---@Class B:A
---@type string|number
local c = 1
---comment
---@return A
---@return string|number
local function func1()
return a, c
end
---comment
---@return B
---@return number
local function func2()
local ta, tb = func1()
return ta, tb
end`
在这种情况下我怎么去配置使ta、ta符合返回值类型?
The text was updated successfully, but these errors were encountered: