From 4d65d77f5214bf5dd935956c861580ff2b46bfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 31 Oct 2022 14:30:26 +0800 Subject: add `---@package` --- test/crossfile/diagnostic.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/crossfile/diagnostic.lua b/test/crossfile/diagnostic.lua index dd06351f..e574204a 100644 --- a/test/crossfile/diagnostic.lua +++ b/test/crossfile/diagnostic.lua @@ -140,3 +140,28 @@ TEST { content = 'require "f.a"', }, } + +TEST { + { path = 'a.lua', content = [[ + ---@class A + ---@field package x string + + ---@type A + local obj + + print(obj.x) + ]]}, +} + +TEST { + { path = 'a.lua', content = [[ + ---@class A + ---@field package x string + ]]}, + { path = 'b.lua', content = [[ + ---@type A + local obj + + print(obj.) + ]]} +} -- cgit v1.2.3