@@ -36,7 +36,7 @@ import dmd.dstruct;
3636import dmd.dsymbol;
3737import dmd.dsymbolsem : vtblSymbol;
3838import dmd.dtemplate;
39- import dmd.errors ;
39+ import dmd.errorsink ;
4040import dmd.expression;
4141import dmd.func;
4242import dmd.funcsem;
@@ -318,7 +318,8 @@ Symbol* toSymbol(Dsymbol s)
318318
319319 if (global.params.v.tls)
320320 {
321- message(vd.loc, " `%s` is thread local" , vd.toChars());
321+ auto eSink = global.errorSink;
322+ eSink.message(vd.loc, " `%s` is thread local" , vd.toChars());
322323 }
323324 }
324325 s.Sclass = SC .extern_;
@@ -421,7 +422,8 @@ Symbol* toSymbol(Dsymbol s)
421422 */
422423 if (fd.storage_class & STC .ctfeOnly)
423424 {
424- error(fd.loc, " function `%s` is `@__ctfe` and cannot be used at runtime" , fd.toPrettyChars());
425+ auto eSink = global.errorSink;
426+ eSink.error(fd.loc, " function `%s` is `@__ctfe` and cannot be used at runtime" , fd.toPrettyChars());
425427 result = null ;
426428 return ;
427429 }
@@ -878,6 +880,8 @@ Srcpos toSrcpos(Loc loc) nothrow
878880private Symbol* createImport (Symbol* sym, Loc loc)
879881{
880882 // printf("Dsymbol.createImport('%s')\n", sym.Sident.ptr);
883+ auto eSink = global.errorSink;
884+
881885 const char * n = sym.Sident.ptr;
882886 import core.stdc.stdlib : alloca;
883887 const allocLen = 6 + strlen(n) + 1 + type_paramsize(sym.Stype).sizeof* 3 + 1 ;
@@ -891,12 +895,12 @@ private Symbol* createImport(Symbol* sym, Loc loc)
891895 int idlen;
892896 if (target.os & Target.OS .Posix)
893897 {
894- error(loc, " cannot generate import symbol `%s` for Posix platform" , n);
898+ eSink. error(loc, " cannot generate import symbol `%s` for Posix platform" , n);
895899 assert (0 );
896900 }
897901 else if (target.os & Target.OS .Windows && sym.Stype.Tty & mTYthread)
898902 {
899- error(loc, " cannot generate import symbol for thread local symbol `%s`" , n);
903+ eSink. error(loc, " cannot generate import symbol for thread local symbol `%s`" , n);
900904 assert (0 );
901905 }
902906 else if (sym.Stype.Tmangle == Mangle.stdcall && tyfunc(sym.Stype.Tty))
0 commit comments