Merge pull request #59 from Geod24/preview-in

Add support for upcoming '-preview=in' switch
This commit is contained in:
Sönke Ludwig 2020-08-15 09:42:08 +02:00 committed by GitHub
commit 2875f53c1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -627,7 +627,7 @@ unittest
/** Tests if the algebraic type stores a value of a certain data type.
*/
bool hasType(T, U)(in ref TaggedAlgebraic!U ta)
bool hasType(T, U)(const scope ref TaggedAlgebraic!U ta)
{
alias Fields = Filter!(fieldMatchesType!(U, T), ta.m_union.fieldNames);
static assert(Fields.length > 0, "Type "~T.stringof~" cannot be stored in a "~(TaggedAlgebraic!U).stringof~".");
@ -641,7 +641,7 @@ bool hasType(T, U)(in ref TaggedAlgebraic!U ta)
assert(false); // never reached
}
/// ditto
bool hasType(T, U)(in TaggedAlgebraic!U ta)
bool hasType(T, U)(const scope TaggedAlgebraic!U ta)
{
return hasType!(T, U)(ta);
}