cocos-engine
cocos-engine copied to clipboard
getComponent() can't support abstract class.
Cocos Creator version
3.8.1
System information
all
Issue description
getComponent() can't support abstract class.
2.4.x has support this feature.
Relevant error log output
No response
Steps to reproduce
node.getComponent(OneAbstractClass) , vscode reports error message.
Minimal reproduction project
No response
看了下cc.d.ts 你们对 _types_globals__AbstractedConstructor 的定义错误, 缺少了关键字 abstract
应该是
export type _types_globals__AbstractedConstructor<T = unknown> = abstract new (...args: any[]) => T;