From cc9bf965fec185dd7e23fe5fe9af512f319a1d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 15 Jun 2022 19:35:06 +0800 Subject: infer type by `local tp = type(x)` --- test/type_inference/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 4d135004..3e4a910c 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2618,3 +2618,12 @@ if type(x) == 'function' then print() end ]] + +TEST 'integer' [[ +local x +local tp = type(x) + +if tp == 'integer' then + print() +end +]] -- cgit v1.2.3