Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 165bbbf

Browse files
author
Mikhail Arkhipov
authored
Fix microsoft#668 (partial) (microsoft#683)
1 parent 41532fd commit 165bbbf

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@ public bool HandleIf(IfStatement node) {
6666
someRecognized = true;
6767
}
6868
}
69-
70-
// Handle basic check such as
71-
// if isinstance(value, type):
72-
// return value
73-
// by assigning type to the value unless clause is raising exception.
74-
var ce = node.Tests.FirstOrDefault()?.Test as CallExpression;
75-
if (ce?.Target is NameExpression ne && ne.Name == @"isinstance" && ce.Args.Count == 2) {
76-
var nex = ce.Args[0].Expression as NameExpression;
77-
var name = nex?.Name;
78-
var typeName = (ce.Args[1].Expression as NameExpression)?.Name;
79-
if (name != null && typeName != null) {
80-
var typeId = typeName.GetTypeId();
81-
if (typeId != BuiltinTypeId.Unknown) {
82-
var t = new PythonType(typeName, Module, string.Empty, LocationInfo.Empty, typeId);
83-
Eval.DeclareVariable(name, t, VariableSource.Declaration, nex);
84-
}
85-
}
86-
}
8769
return !someRecognized;
8870
}
8971

0 commit comments

Comments
 (0)