}
else if (tp1.ty == Tdelegate)
{
- if (tp1.implicitConvTo(tp2))
+ if (tp2.implicitConvTo(tp1))
goto Lcov;
}
}
goto Nomatch;
}
- if (arg.op == TOK.string_ && tp.ty == Tsarray)
+ if (arg.op == EXP.string_ && tp.ty == Tsarray)
{
if (ta.ty != Tsarray)
{
ta = tn.sarrayOf(dim);
}
}
- else if (arg.op == TOK.slice && tp.ty == Tsarray)
+ else if (arg.op == EXP.slice && tp.ty == Tsarray)
{
// Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
if (ta.ty != Tsarray)
else if ((p.storageClass & STC.in_) && global.params.previewIn)
{
// Allow converting a literal to an `in` which is `ref`
- if (arg.op == TOK.arrayLiteral && tp.ty == Tsarray)
+ if (arg.op == EXP.arrayLiteral && tp.ty == Tsarray)
{
Type tn = tp.nextOf();
dinteger_t dim = (cast(TypeSArray)tp).dim.toUInteger();
{
assert(to);
- if (this == to)
+ if (this.equals(to))
return MATCH.constant;
if (this.covariant(to) == Covariant.yes)
//printf("TypeDelegate.implicitConvTo(this=%p, to=%p)\n", this, to);
//printf("from: %s\n", toChars());
//printf("to : %s\n", to.toChars());
- if (this == to)
+ if (this.equals(to))
return MATCH.exact;
if (auto toDg = to.isTypeDelegate())
}
else
e = vd.type.defaultInitLiteral(loc);
- if (e && e.op == TOK.error)
+ if (e && e.op == EXP.error)
return e;
if (e)
offset = vd.offset + cast(uint)vd.type.size();
override bool isZeroInit(const ref Loc loc)
{
- return sym.getDefaultValue(loc).isBool(false);
+ return sym.getDefaultValue(loc).toBool().hasValue(false);
}
override bool hasPointers()