Remove a few uses of fully qualified names that rely on a DMD bug

This commit is contained in:
Boris Carvajal 2021-02-21 02:53:49 -03:00
parent fa4682442b
commit 276053dd07
No known key found for this signature in database
GPG key ID: 6517FFB444EB6201
6 changed files with 14 additions and 14 deletions

View file

@ -786,9 +786,9 @@ private struct MapResult(alias fun, Range)
string s1 = "hello world!";
dstring s2 = "日本語";
dstring s3 = "hello world!"d;
auto ms1 = map!(std.ascii.toUpper)(s1);
auto ms2 = map!(std.ascii.toUpper)(s2);
auto ms3 = map!(std.ascii.toUpper)(s3);
auto ms1 = map!(toUpper)(s1);
auto ms2 = map!(toUpper)(s2);
auto ms3 = map!(toUpper)(s3);
static assert(!is(ms1[0])); //narrow strings can't be indexed
assert(ms2[0] == '日');
assert(ms3[0] == 'H');
@ -5459,7 +5459,7 @@ private struct SplitterResult(alias isTerminator, Range)
["là", "dove", "terminava", "quella", "valle"]
));
assert(equal(
splitter!(std.uni.isWhite)("là dove terminava quella valle"),
splitter!(isWhite)("là dove terminava quella valle"),
["là", "dove", "terminava", "quella", "valle"]
));
assert(equal(splitter!"a=='本'"("日本語"), ["日", "語"]));

View file

@ -965,8 +965,8 @@ if (isInputRange!R &&
import std.ascii : isDigit;
import std.uni : isWhite;
assert(countUntil!(std.uni.isWhite)("hello world") == 5);
assert(countUntil!(std.ascii.isDigit)("hello world") == -1);
assert(countUntil!(isWhite)("hello world") == 5);
assert(countUntil!(isDigit)("hello world") == -1);
assert(countUntil!"a > 20"([0, 7, 12, 22, 9]) == 3);
}

View file

@ -3636,13 +3636,13 @@ if (isDynamicArray!A)
return app.data;
}
import std.format : FormatSpec;
/// ditto
template toString(Writer)
if (isOutputRange!(Writer, char))
{
import std.format : FormatSpec;
void toString(ref Writer w, scope const ref std.format.FormatSpec!char fmt) const
void toString(ref Writer w, scope const ref FormatSpec!char fmt) const
{
import std.format : formatValue;
import std.range.primitives : put;

View file

@ -10364,7 +10364,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
}
// year
auto found = value[2 .. value.length].find!(not!(std.ascii.isDigit))();
auto found = value[2 .. value.length].find!(not!(isDigit))();
size_t yearLen = value.length - found.length;
if (found.length == 0)
throw new DateTimeException("Invalid year");
@ -10454,7 +10454,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
case "J": case "j": throw new DateTimeException("Invalid timezone");
default:
{
if (all!(std.ascii.isAlpha)(value[0 .. tzLen]))
if (all!(isAlpha)(value[0 .. tzLen]))
{
tz = new immutable SimpleTimeZone(Duration.zero);
break;

View file

@ -4150,7 +4150,7 @@ version (StdUnittest)
import std.array : split;
import std.conv : text;
import std.exception : assertThrown;
import std.math : isClose, sqrt, log;
import std.math : isClose, sqrt, log, abs;
import std.range : indexed, iota, join;
import std.typecons : Tuple, tuple;
import std.stdio;
@ -4480,7 +4480,7 @@ version (StdUnittest)
assert(equal(iota(1_000_000), bufTrickTest));
auto myTask = task!(std.math.abs)(-1);
auto myTask = task!(abs)(-1);
taskPool.put(myTask);
assert(myTask.spinForce == 1);

View file

@ -6088,7 +6088,7 @@ package template GetOverloadedMethods(T)
enum isMethod = false;
}
alias follows = AliasSeq!(
std.meta.Filter!(isMethod, __traits(getOverloads, T, name)),
Filter!(isMethod, __traits(getOverloads, T, name)),
follows!(i + 1));
}
}