diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 17:05:04 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 17:05:04 +0800 |
commit | f76cd50992dab57a57c61e8e6f5f788745544da9 (patch) | |
tree | 03b49b1b32f8044ca4c7d1dc16d01a068c354166 /test | |
parent | 8af599790936f81cddaecb31d36eede70ad3739c (diff) | |
download | lua-language-server-f76cd50992dab57a57c61e8e6f5f788745544da9.zip |
resolve #1221 generic with optional
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 9bd66761..5fa70f5f 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2799,3 +2799,39 @@ m.x = {} --> 4th print(m.<?x?>) ]] + +TEST 'boolean?' [[ +---@generic T +---@param x T +---@return T +local function echo(x) end + +---@type boolean? +local b + +local <?x?> = echo(b) +]] + +TEST 'boolean' [[ +---@generic T +---@param x T? +---@return T +local function echo(x) end + +---@type boolean? +local b + +local <?x?> = echo(b) +]] + +TEST 'boolean' [[ +---@generic T +---@param x? T +---@return T +local function echo(x) end + +---@type boolean? +local b + +local <?x?> = echo(b) +]] |