From 664a5c78ade155d99543c94d3f63b98b4d0df82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 16 Dec 2022 03:35:08 +0800 Subject: fix cast --- test/type_inference/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/type_inference') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 0eb43ed3..b8ca4df9 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -4060,3 +4060,17 @@ local m, v local = m * v ]] + +TEST 'A|B' [[ +---@class A +---@class B + +---@type A|B +local t + +if x then + ---@cast t A +else + print() +end +]] -- cgit v1.2.3