File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
main/java/org/sonar/python/checks
test/resources/checks/incompatibleOperands Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 33
33
import org .sonar .plugins .python .api .tree .BinaryExpression ;
34
34
import org .sonar .plugins .python .api .tree .Token ;
35
35
import org .sonar .plugins .python .api .tree .Tree ;
36
+ import org .sonar .plugins .python .api .tree .TypeAnnotation ;
36
37
import org .sonar .plugins .python .api .tree .UnaryExpression ;
37
38
import org .sonar .plugins .python .api .types .InferredType ;
38
39
@@ -92,6 +93,11 @@ private class IncompatibleOperandsVisitor extends BaseTreeVisitor {
92
93
this .context = context ;
93
94
}
94
95
96
+ @ Override
97
+ public void visitTypeAnnotation (TypeAnnotation tree ) {
98
+ // avoid raising FPs on type annotations
99
+ }
100
+
95
101
@ Override
96
102
public void visitBinaryExpression (BinaryExpression binaryExpression ) {
97
103
InferredType leftType = binaryExpression .leftOperand ().type ();
Original file line number Diff line number Diff line change @@ -78,3 +78,7 @@ def builtin_compliant():
78
78
myvar += 2
79
79
80
80
not myvar # coverage
81
+
82
+
83
+ def type_annotations ():
84
+ mode : "OpenBinaryMode" | "OpenTextMode"
You can’t perform that action at this time.
0 commit comments