Update numbers.d

Fix #91. 2.064.2 does not have opCast(bool) defined in Captures, so check the result of empty().
This commit is contained in:
Hackerpilot 2014-01-31 13:07:50 -08:00
parent 451be80c5a
commit a39b492e21
1 changed files with 2 additions and 2 deletions

View File

@ -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");