Fix some property enforcements.

This commit is contained in:
Denis Shelomovskij 2014-09-01 18:01:16 +04:00
parent 76e2edb463
commit d63035003a
5 changed files with 15 additions and 15 deletions

View file

@ -1589,8 +1589,8 @@ public:
import std.algorithm : filter, map, joiner;
return iota(dim).
filter!(i => ptr[i]).
map!(i => BitsSet!size_t(ptr[i], i * bitsPerSizeT)).
filter!(i => ptr[i])().
map!(i => BitsSet!size_t(ptr[i], i * bitsPerSizeT))().
joiner();
}

View file

@ -27811,16 +27811,16 @@ assert(tz.dstName == "PDT");
{
name = strip(name);
enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
immutable file = buildNormalizedPath(tzDatabaseDir, name);
enforce(file.exists, new DateTimeException(format("File %s does not exist.", file)));
enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
auto tzFile = File(file);
immutable gmtZone = file.representation.canFind("GMT");
immutable gmtZone = file.representation().canFind("GMT");
try
{
@ -28128,7 +28128,7 @@ assert(tz.dstName == "PDT");
else version(Windows)
subName = replace(strip(subName), "/", dirSeparator);
enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
auto timezones = appender!(string[])();

View file

@ -2020,7 +2020,7 @@ else version(Windows)
this(string path)
{
if(!path.exists)
if(!path.exists())
throw new FileException(path, "File does not exist");
_name = path;

View file

@ -1530,7 +1530,7 @@ Returns the $(D FILE*) corresponding to this object.
/**
Returns the file number corresponding to this object.
*/
/*version(Posix) */int fileno() const @trusted
/*version(Posix) */@property int fileno() const @trusted
{
import std.exception : enforce;

View file

@ -2749,7 +2749,7 @@ pure nothrow @nogc unittest
{
char[5] s;
int i;
foreach (c; "hello".byCodeUnit.byCodeUnit())
foreach (c; "hello".byCodeUnit().byCodeUnit())
{
s[i++] = c;
}
@ -2758,7 +2758,7 @@ pure nothrow @nogc unittest
{
wchar[5] s;
int i;
foreach (c; "hello"w.byCodeUnit.byCodeUnit())
foreach (c; "hello"w.byCodeUnit().byCodeUnit())
{
s[i++] = c;
}
@ -2767,7 +2767,7 @@ pure nothrow @nogc unittest
{
dchar[5] s;
int i;
foreach (c; "hello"d.byCodeUnit.byCodeUnit())
foreach (c; "hello"d.byCodeUnit().byCodeUnit())
{
s[i++] = c;
}
@ -2788,7 +2788,7 @@ pure nothrow @nogc unittest
assert(s[1] == 'E');
}
{
auto r = "hello".byCodeUnit.byCodeUnit();
auto r = "hello".byCodeUnit().byCodeUnit();
assert(isForwardRange!(typeof(r)));
auto s = r.save;
r.popFront();
@ -2824,7 +2824,7 @@ auto byChar(R)(R r) if (isNarrowString!R)
}
else
{
return r.byCodeUnit.byChar();
return r.byCodeUnit().byChar();
}
}
@ -2839,7 +2839,7 @@ auto byWchar(R)(R r) if (isNarrowString!R)
}
else
{
return r.byCodeUnit.byWchar();
return r.byCodeUnit().byWchar();
}
}
@ -2848,7 +2848,7 @@ auto byDchar(R)(R r) if (isNarrowString!R)
{
alias tchar = Unqual!(ElementEncodingType!R);
return r.byCodeUnit.byDchar();
return r.byCodeUnit().byDchar();
}