From 7c481f57c407f7e4d0b359a3cfbce66add99ec2f 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, 6 Sep 2024 17:09:33 +0800 Subject: Infer the parameter types of a same-named function in the subclass based on the parameter types in the superclass function. --- test/type_inference/common.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/type_inference') diff --git a/test/type_inference/common.lua b/test/type_inference/common.lua index 4a29454a..11fa39b8 100644 --- a/test/type_inference/common.lua +++ b/test/type_inference/common.lua @@ -4428,3 +4428,16 @@ TEST 'A' [[ local x local = 1 >> x ]] + +TEST 'number' [[ +---@class A +local A = {} + +---@param x number +function A:func(x) end + +---@class B: A +local B = {} + +function B:func() end +]] -- cgit v1.2.3