Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A diagnostic bug #253

Closed
PythonYunfei opened this issue Jan 14, 2023 · 1 comment
Closed

A diagnostic bug #253

PythonYunfei opened this issue Jan 14, 2023 · 1 comment

Comments

@PythonYunfei
Copy link

用String的子类创建实例时,插件问题报告会显示参数太多,但实际上是正确的代码:
image

image

class CC extends String{
	__New() {
		return this
	}
}
OutputDebug(55 '`n')
c:=CC(88)
OutputDebug(c)

此时省略参数反而解释器报错:c:=CC()

@PythonYunfei
Copy link
Author

PythonYunfei commented Jan 14, 2023

类1() 接收的参数个数:
(1)应该先根据 最靠近子类的static Call参数个数n1来判断。如果Call.IsVariadic=false && Call.minParams==0,那么插件应该以Call的参数个数n1为诊断依据
(2)如果Call.IsVariadic=true:同时存在__new()方法,则插件应该以__new的参数个数作为诊断依据;若此时不存在__new()方法,则插件应该认定类1() 所接收的参数为任意可变。
本例中String()的参数非可变,必须传一个参数。
默认继承Object的类除外

thqby added a commit that referenced this issue Jan 15, 2023
@thqby thqby closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants