mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
Changed reportUnknownParameter to also flag inferred Any return types, not just Unknown.
This commit is contained in:
parent
1c877e4248
commit
f8e9dacccb
@ -358,9 +358,11 @@ export class TypeAnalyzer extends ParseTreeWalker {
|
||||
inferredReturnType = functionType.getInferredReturnType().getType();
|
||||
}
|
||||
|
||||
if (inferredReturnType instanceof UnknownType) {
|
||||
// Include Any in this check. If "Any" really is desired, it should
|
||||
// be made explicit through a type annotation.
|
||||
if (inferredReturnType.isAny()) {
|
||||
this._addDiagnostic(this._fileInfo.configOptions.reportUnknownParameter,
|
||||
`Return type is unknown`, node.name);
|
||||
`Inferred return type is unknown`, node.name);
|
||||
} else if (TypeUtils.containsUnknown(inferredReturnType)) {
|
||||
this._addDiagnostic(this._fileInfo.configOptions.reportUnknownParameter,
|
||||
`Return type '${ inferredReturnType.asString() }' is partially unknown`,
|
||||
|
Loading…
Reference in New Issue
Block a user