From 9f236d0485ac4cee2b62261b84ef93f473596495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 2 Dec 2021 17:40:15 +0800 Subject: #832 --- test/definition/bug.lua | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'test/definition/bug.lua') diff --git a/test/definition/bug.lua b/test/definition/bug.lua index 7a2cc789..9ea47fd1 100644 --- a/test/definition/bug.lua +++ b/test/definition/bug.lua @@ -253,3 +253,60 @@ local = t[a] t[a] = ]] + +TEST [[ +---@class A +---@field x number + +---@class B: A +---@field boolean + +---@type B +local t + +local !> = t.x +]] + +TEST [[ +---@class A +---@field number + +---@class B: A + +---@type B +local t + +local !> = t.x +]] + +TEST [[ +---@class A +local A + +function A:x() end + +---@class B: A +local B + +function B:() end + +---@type B +local t + +local !> = t.x +]] + +TEST [[ +---@class A +local A + +function A:() end + +---@class B: A +local B + +---@type B +local t + +local !> = t.x +]] -- cgit v1.2.3 From 5a965d6d800f4c1bfa18a246b68e8ad68881e762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 2 Dec 2021 19:42:36 +0800 Subject: add test --- test/definition/bug.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/definition/bug.lua') diff --git a/test/definition/bug.lua b/test/definition/bug.lua index 9ea47fd1..a7780803 100644 --- a/test/definition/bug.lua +++ b/test/definition/bug.lua @@ -310,3 +310,23 @@ local t local !> = t.x ]] + +-- TODO +--TEST [[ +-----@class A +--local A +-- +-----@return A +--function A:x() end +-- +-----@class B: A +--local +-- +-----@return B +--function B:x() end +-- +-----@type B +--local t +-- +--local !> = t.x() +--]] -- cgit v1.2.3