Fix public examples failing due to missing imports

This commit is contained in:
MoonlightSentinel 2020-06-28 18:12:56 +02:00
parent 549fa5c300
commit c46c2c3aa6
2 changed files with 7 additions and 1 deletions

View file

@ -480,6 +480,8 @@ if (isIntegral!T || is(T == Checked!(U, H), U, H))
/// ///
static if (is(T == int) && is(Hook == void)) @safe unittest static if (is(T == int) && is(Hook == void)) @safe unittest
{ {
import std.traits : isUnsigned;
static struct MyHook static struct MyHook
{ {
static bool thereWereErrors; static bool thereWereErrors;
@ -616,6 +618,8 @@ if (isIntegral!T || is(T == Checked!(U, H), U, H))
/// ///
static if (is(T == int) && is(Hook == void)) @safe unittest static if (is(T == int) && is(Hook == void)) @safe unittest
{ {
import std.traits : isUnsigned;
static struct MyHook static struct MyHook
{ {
static bool thereWereErrors; static bool thereWereErrors;

View file

@ -591,6 +591,7 @@ if (distinctFieldNames!(Specs))
/// ///
static if (Specs.length == 0) @safe unittest static if (Specs.length == 0) @safe unittest
{ {
import std.meta : AliasSeq;
alias Fields = Tuple!(int, "id", string, float); alias Fields = Tuple!(int, "id", string, float);
static assert(is(Fields.Types == AliasSeq!(int, string, float))); static assert(is(Fields.Types == AliasSeq!(int, string, float)));
} }
@ -603,6 +604,7 @@ if (distinctFieldNames!(Specs))
/// ///
static if (Specs.length == 0) @safe unittest static if (Specs.length == 0) @safe unittest
{ {
import std.meta : AliasSeq;
alias Fields = Tuple!(int, "id", string, float); alias Fields = Tuple!(int, "id", string, float);
static assert(Fields.fieldNames == AliasSeq!("id", "", "")); static assert(Fields.fieldNames == AliasSeq!("id", "", ""));
} }
@ -992,7 +994,7 @@ if (distinctFieldNames!(Specs))
t2 = tuple(3,4,5); t2 = tuple(3,4,5);
auto t2Named = t2.rename!("", "b"); auto t2Named = t2.rename!("", "b");
// "a" no longer has a name // "a" no longer has a name
static assert(!hasMember!(typeof(t2Named), "a")); static assert(!__traits(hasMember, typeof(t2Named), "a"));
assert(t2Named[0] == 3); assert(t2Named[0] == 3);
assert(t2Named.b == 4); assert(t2Named.b == 4);
assert(t2Named.c == 5); assert(t2Named.c == 5);