void _mixin() { writefln( "" ); } void main() { mixin( _mixin ); } //Assertion failure: '!dim || (parameters && (parameters->dim == dim))' on line 140 in file 'interpret.c' With both D1.056 and D2.040
Reduced test case for test suite: ----- void badvariadic(...) {} static assert(!is(typeof(mixin(badvariadic())))); --- PATCH: interpret.c line 118. The check for C-style variadics failed in the case where there were no non-variadic parameters. TypeFunction *tf = (TypeFunction *)tb; Type *tret = tf->next->toBasetype(); - if (tf->varargs && arguments && parameters && arguments->dim != parameters->dim) + if (tf->varargs && arguments && (parameters && arguments->dim != parameters->dim) || (!parameters && arguments->dim)) { cantInterpret = 1; error("C-style variadic functions are not yet implemented in CTFE"); return NULL; }
Oops, there's a missing parentheses. Should be: if (tf->varargs && arguments && ((parameters && arguments->dim != parameters->dim) || (!parameters && arguments->dim)))
Changeset 376
Fixed dmd 1.057 and 2.041
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル