这种return类型推断能否更智能一点? #3086
Unanswered
xiangnanscu
asked this question in
Q&A
Replies: 2 comments 4 replies
-
以我所知,luals 目前不支持 return tuple 的概念
剛發現你正是 #1583 的作者 😂 另外是 CppCXY 大佬寫了另1個 rust-based 的 language server: #3017 |
Beta Was this translation helpful? Give feedback.
1 reply
-
之前和他讨论过这个语法的设计, 最后敲定的方式是类似这样的: ---@return =(true, some_type)
---@return =(false, string) 不过我俩都未实现 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
lua常见的错误处理模式, 要么返回
number
, 要么返回nil, string
. 不会存在其他情况.那么当res==nil的时候,err显然应该为string,不可能是nil. 但目前仍然显示可能是nil.Beta Was this translation helpful? Give feedback.
All reactions