mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
Fixed bug in reporting errors for None used as context manager -- was using the wrong parse node for the error.
This commit is contained in:
parent
ebef341997
commit
ba3d1871c1
@ -680,7 +680,7 @@ export class TypeAnalyzer extends ParseTreeWalker {
|
||||
this._addDiagnostic(
|
||||
this._fileInfo.configOptions.reportOptionalContextManager,
|
||||
`Object of type 'None' cannot be used with 'with'`,
|
||||
node);
|
||||
item.expression);
|
||||
exprType = TypeUtils.removeNoneFromUnion(exprType);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user