Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #320 from ndykman/issue307
Browse files Browse the repository at this point in the history
Fix for issue #307
  • Loading branch information
SergeyTeplyakov committed Jan 23, 2016
2 parents 6bcd424 + b760e12 commit a89d166
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Foxtrot/Foxtrot/Extraction/ExtractorVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3534,4 +3534,4 @@ public override void VisitMethodCall(MethodCall call)
}
}
}
}
}
18 changes: 18 additions & 0 deletions Microsoft.Research/CCDoc/BooleanExpressionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,5 +341,23 @@ public override IExpression Rewrite(IConditional conditional) {
}
return base.Rewrite(conditional);
}

public override IExpression Rewrite(IGreaterThan greaterThan)
{
// Catch use of the x > null idiom used by Roslyn as generated
// code for x != null statements.
if (ExpressionHelper.IsNullLiteral(greaterThan.RightOperand))
{
var c = new NotEquality
{
LeftOperand = greaterThan.LeftOperand,
RightOperand = greaterThan.RightOperand,
Type = greaterThan.Type
};
return c;
}

return base.Rewrite(greaterThan);
}
}
}

0 comments on commit a89d166

Please sign in to comment.