diff --git a/src/ddmd/optimize.d b/src/ddmd/optimize.d index d892a0c280b2..dcf1de3fa8bd 100644 --- a/src/ddmd/optimize.d +++ b/src/ddmd/optimize.d @@ -610,7 +610,7 @@ extern (C++) Expression Expression_optimize(Expression e, int result, bool keepL // https://issues.dlang.org/show_bug.cgi?id=16980 cdfrom.size(e.loc); assert(cdfrom.sizeok == SIZEOKdone); - assert(cdto.sizeok == SIZEOKdone || !cdto.isBaseOf(cdto, null)); + assert(cdto.sizeok == SIZEOKdone || !cdto.isBaseOf(cdfrom, null)); int offset; if (cdto.isBaseOf(cdfrom, &offset) && offset == 0) {