From a39b492e216bc6f22dab25dd6e362bb0939ab139 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Fri, 31 Jan 2014 13:07:50 -0800 Subject: [PATCH] Update numbers.d Fix #91. 2.064.2 does not have opCast(bool) defined in Captures, so check the result of empty(). --- analysis/numbers.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analysis/numbers.d b/analysis/numbers.d index bd8d729..32637b7 100644 --- a/analysis/numbers.d +++ b/analysis/numbers.d @@ -26,8 +26,8 @@ class NumberStyleCheck : BaseAnalyzer { import std.algorithm; if (isNumberLiteral(t.type) && !t.text.startsWith("0x") - && ((t.text.startsWith("0b") && t.text.matchFirst(badBinaryRegex)) - || t.text.matchFirst(badDecimalRegex))) + && ((t.text.startsWith("0b") && !t.text.matchFirst(badBinaryRegex).empty) + || !t.text.matchFirst(badDecimalRegex).empty)) { addErrorMessage(t.line, t.column, "Use underscores to improve number constant readability");