Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions compiler/src/dmd/dmodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import dmd.cparse;
import dmd.declaration;
import dmd.dmacro;
import dmd.dsymbol;
import dmd.errors;
import dmd.errors : fatal;
import dmd.errorsink;
import dmd.expression;
import dmd.file_manager;
import dmd.func;
import dmd.globals;
import dmd.hdrgen : toErrMsg;
import dmd.id;
import dmd.identifier;
import dmd.location;
Expand Down Expand Up @@ -503,9 +504,10 @@ extern (C++) final class Module : Package
buf.writeByte('.');
}
buf.printf("%s\t(%s)", ident.toChars(), m.srcfile.toChars());
message("import %s", buf.peekChars());
auto eSink = global.errorSink;
eSink.message(Loc.init, "import %s", buf.peekChars());
if (loc != Loc.initial)
message("(imported from %s)", loc.toChars());
eSink.message(Loc.init, "(imported from %s)", loc.toChars());
}
if((m = m.parse()) is null) return null;

Expand Down Expand Up @@ -615,7 +617,7 @@ extern (C++) final class Module : Package
{
eSink.error(loc, "unable to read module `%s`", toChars());
const pkgfile = FileName.combine(FileName.sansExt(name), package_d);
.errorSupplemental(loc, "Expected '%.*s' or '%.*s' in one of the following import paths:",
eSink.errorSupplemental(loc, "Expected '%.*s' or '%.*s' in one of the following import paths:",
cast(int)name.length, name.ptr, cast(int)pkgfile.length, pkgfile.ptr);
}
}
Expand Down
7 changes: 4 additions & 3 deletions compiler/src/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import dmd.declaration;
import dmd.dmodule;
import dmd.dscope;
import dmd.dsymbol;
import dmd.errors;
import dmd.errors : Classification;
import dmd.errorsink;
import dmd.expression;
import dmd.func;
Expand Down Expand Up @@ -932,12 +932,13 @@ extern (C++) class TemplateInstance : ScopeDsymbol

// This returns a function pointer
scope printFn = () {
auto eSink = global.errorSink;
final switch (cl)
{
case Classification.error:
return &errorSupplemental;
return &eSink.errorSupplemental;
case Classification.deprecation:
return &deprecationSupplemental;
return &eSink.deprecationSupplemental;
case Classification.gagged, Classification.warning:
assert(0);
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/dtoh.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
module dmd.dtoh;

import core.stdc.stdio;
import core.stdc.stdarg;
import core.stdc.string;
import core.stdc.ctype;

Expand All @@ -22,8 +23,7 @@ import dmd.dsymbolsem;
import dmd.templatesem : computeOneMember;
import dmd.expressionsem : toInteger;
import dmd.funcsem : isVirtual;
//import dmd.errors : fatal;
import dmd.errors;
import dmd.errors : fatal;
import dmd.errorsink;
import dmd.globals;
import dmd.hdrgen;
Expand Down
Loading