diff options
Diffstat (limited to 'test/references/all.lua')
-rw-r--r-- | test/references/all.lua | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/test/references/all.lua b/test/references/all.lua index 323a3bd3..71d28215 100644 --- a/test/references/all.lua +++ b/test/references/all.lua @@ -58,7 +58,45 @@ end --end --]] +TEST [[ +local function f() + return <~<!function~> () + end!> +end + +local <!f2!> = f() +]] + +TEST [[ +local function f() + return nil, <~<!function~> () + end!> +end + +local _, <!f2!> = f() +]] + +TEST [[ +local <?x?> +local function f() + return <!x!> +end +local <!y!> = f() +]] + +TEST [[ +local <?x?> +local function f() + return function () + return <!x!> + end +end +local <!y!> = f()() +]] + +-- TODO -- 泛型的反向搜索 +do return end TEST [[ ---@class Dog local <?Dog?> = {} @@ -157,39 +195,3 @@ function <!A!>:f() end local <!b!> = <!A!>:f() ]] - -TEST [[ -local function f() - return <~<!function~> () - end!> -end - -local <!f2!> = f() -]] - -TEST [[ -local function f() - return nil, <~<!function~> () - end!> -end - -local _, <!f2!> = f() -]] - -TEST [[ -local <?x?> -local function f() - return <!x!> -end -local <!y!> = f() -]] - -TEST [[ -local <?x?> -local function f() - return function () - return <!x!> - end -end -local <!y!> = f()() -]] |