Function return type inference is limited (arkts-no-implicit-return-types) <ArkTSCheck
·
这个提示表明在您的代码中,函数的返回类型推断受到了限制,可能是因为函数的实现不够清晰或者类型不明确。
function getRandomInt(min:, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
要解决这个问题,您可以显式地指定函数的返回类型。
function getRandomInt(min:number, max:number) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
更多推荐

所有评论(0)