From 11e1dbf4935e492c18bb837611822df8bbb12efd Mon Sep 17 00:00:00 2001 From: Vladiwostok Date: Sun, 3 Mar 2024 17:00:38 +0200 Subject: [PATCH] Investigate failing workflows --- src/dscanner/analysis/ifelsesame.d | 76 +++++++++++++++--------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/dscanner/analysis/ifelsesame.d b/src/dscanner/analysis/ifelsesame.d index 69682e5..a0940a0 100644 --- a/src/dscanner/analysis/ifelsesame.d +++ b/src/dscanner/analysis/ifelsesame.d @@ -63,9 +63,9 @@ extern (C++) class IfElseSameCheck(AST) : BaseAnalyzerDmd } mixin VisitBinaryExpression!(AST.LogicalExp); - mixin VisitBinaryExpression!(AST.EqualExp); - mixin VisitBinaryExpression!(AST.CmpExp); - mixin VisitBinaryExpression!(AST.AssignExp); + //mixin VisitBinaryExpression!(AST.EqualExp); + //mixin VisitBinaryExpression!(AST.CmpExp); + //mixin VisitBinaryExpression!(AST.AssignExp); private template VisitBinaryExpression(NodeType) { @@ -153,41 +153,41 @@ unittest } }c, sac); - assertAnalyzerWarningsDMD(q{ - void testCmpExprSame() - { - int a = 1, b = 2; - - if (a == b) {} - if (a == a) {} // [warn]: Left side of '==' operator is identical to right side. - - if (a != b) {} - if (a != a) {} // [warn]: Left side of '!=' operator is identical to right side. - - b = a == a ? 1 : 2; // [warn]: Left side of '==' operator is identical to right side. - - if (a > b) {} - if (a > a) {} // [warn]: Left side of '>' operator is identical to right side. - - if (a < b) {} - if (a < a) {} // [warn]: Left side of '<' operator is identical to right side. - - if (a >= b) {} - if (a >= a) {} // [warn]: Left side of '>=' operator is identical to right side. - - if (a <= b) {} - if (a <= a) {} // [warn]: Left side of '<=' operator is identical to right side. - } - }c, sac); - - assertAnalyzerWarningsDMD(q{ - void testAssignSame() - { - int a = 1; - a = 5; - a = a; // [warn]: Left side of assignment operation is identical to the right side. - } - }c, sac); + //assertAnalyzerWarningsDMD(q{ + // void testCmpExprSame() + // { + // int a = 1, b = 2; + // + // if (a == b) {} + // if (a == a) {} // [warn]: Left side of '==' operator is identical to right side. + // + // if (a != b) {} + // if (a != a) {} // [warn]: Left side of '!=' operator is identical to right side. + // + // b = a == a ? 1 : 2; // [warn]: Left side of '==' operator is identical to right side. + // + // if (a > b) {} + // if (a > a) {} // [warn]: Left side of '>' operator is identical to right side. + // + // if (a < b) {} + // if (a < a) {} // [warn]: Left side of '<' operator is identical to right side. + // + // if (a >= b) {} + // if (a >= a) {} // [warn]: Left side of '>=' operator is identical to right side. + // + // if (a <= b) {} + // if (a <= a) {} // [warn]: Left side of '<=' operator is identical to right side. + // } + //}c, sac); + + //assertAnalyzerWarningsDMD(q{ + // void testAssignSame() + // { + // int a = 1; + // a = 5; + // a = a; // [warn]: Left side of assignment operation is identical to the right side. + // } + //}c, sac); assertAnalyzerWarningsDMD(q{ void foo()