From e3edc5d1880a392e065a71926b6f8ff113ea300c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 25 Oct 2022 00:55:15 +0800 Subject: diagnostic for invisible fields #1316 --- test/diagnostics/common.lua | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'test/diagnostics/common.lua') diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index f7cbbb0d..0231cc86 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -2081,3 +2081,64 @@ end print(1) ]] + +TEST [[ +---@class A +---@field private x number +---@field protected y number +---@field public z number +local t +print(t.x) +]] + +TEST [[ +---@class A +---@field private x number +---@field protected y number +---@field public z number + +---@type A +local t + +print(t.) +]] + +TEST [[ +---@class A +---@field private x number +---@field protected y number +---@field public z number + +---@class B: A +local t + +print(t.y) +]] + +TEST [[ +---@class A +---@field private x number +---@field protected y number +---@field public z number + +---@class B: A + +---@type B +local t + +print(t.) +]] + +TEST [[ +---@class A +---@field private x number +---@field protected y number +---@field public z number + +---@class B: A + +---@type B +local t + +print(t.z) +]] -- cgit v1.2.3