Skip to content

Commit 20f6c9f

Browse files
Seppli11sonartech
authored andcommitted
SONARPY-3569 Removes TrivialTypePropagationVisitor from the initial TrivialTypeInference run (#704)
GitOrigin-RevId: b6338a652bd65cfddf91769b4dc875cec6c501c8
1 parent 68b3797 commit 20f6c9f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

python-frontend/src/main/java/org/sonar/python/semantic/v2/TypeInferenceV2.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,19 @@
3535
import org.sonar.plugins.python.api.tree.Parameter;
3636
import org.sonar.plugins.python.api.tree.StatementList;
3737
import org.sonar.plugins.python.api.tree.Tree;
38+
import org.sonar.plugins.python.api.types.v2.ModuleType;
39+
import org.sonar.plugins.python.api.types.v2.PythonType;
40+
import org.sonar.plugins.python.api.types.v2.TypeWrapper;
41+
import org.sonar.plugins.python.api.types.v2.UnionType;
3842
import org.sonar.python.semantic.SymbolUtils;
3943
import org.sonar.python.semantic.v2.types.AstBasedTypeInference;
4044
import org.sonar.python.semantic.v2.types.FlowSensitiveTypeInference;
4145
import org.sonar.python.semantic.v2.types.Propagation;
4246
import org.sonar.python.semantic.v2.types.PropagationVisitor;
4347
import org.sonar.python.semantic.v2.types.TrivialTypeInferenceVisitor;
44-
import org.sonar.python.semantic.v2.types.TrivialTypePropagationVisitor;
4548
import org.sonar.python.semantic.v2.types.TryStatementVisitor;
4649
import org.sonar.python.semantic.v2.typetable.TypeTable;
4750
import org.sonar.python.tree.TreeUtils;
48-
import org.sonar.plugins.python.api.types.v2.ModuleType;
49-
import org.sonar.plugins.python.api.types.v2.PythonType;
50-
import org.sonar.plugins.python.api.types.v2.TypeWrapper;
51-
import org.sonar.plugins.python.api.types.v2.UnionType;
5251

5352
public class TypeInferenceV2 {
5453

@@ -107,7 +106,6 @@ public Map<SymbolV2, Set<PythonType>> inferTopLevelTypes(FileInput fileInput) {
107106
var trivialTypeInferenceVisitor = new TrivialTypeInferenceVisitor(projectLevelTypeTable, pythonFile, fullyQualifiedModuleName);
108107
this.importedModulesFQN = trivialTypeInferenceVisitor.importedModulesFQN();
109108
fileInput.accept(trivialTypeInferenceVisitor);
110-
fileInput.accept(new TrivialTypePropagationVisitor(projectLevelTypeTable));
111109
return inferTypesAndMemberAccessSymbols(fileInput);
112110
}
113111

0 commit comments

Comments
 (0)