Skip to content

Commit ad63d6b

Browse files
WalterBrightthewilsonator
authored andcommitted
typinf.d : transition to eSink
1 parent f14cb82 commit ad63d6b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

compiler/src/dmd/typinf.d

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import dmd.dscope;
1818
import dmd.dclass;
1919
import dmd.dstruct;
2020
import dmd.errors;
21+
import dmd.errorsink;
2122
import dmd.expression;
23+
import dmd.hdrgen : toErrMsg;
2224
import dmd.location;
2325
import dmd.mtype;
2426
import dmd.templatesem;
@@ -40,6 +42,8 @@ import core.stdc.stdio;
4042
bool genTypeInfo(Expression e, Loc loc, Type torig, Scope* sc)
4143
{
4244
// printf("genTypeInfo() %s\n", torig.toChars());
45+
import dmd.globals : global;
46+
auto eSink = global.errorSink;
4347

4448
// Even when compiling without `useTypeInfo` (e.g. -betterC) we should
4549
// still be able to evaluate `TypeInfo` at compile-time, just not at runtime.
@@ -51,9 +55,9 @@ bool genTypeInfo(Expression e, Loc loc, Type torig, Scope* sc)
5155
{
5256
global.gag = 0;
5357
if (e)
54-
.error(loc, "expression `%s` uses the GC and cannot be used with switch `-betterC`", e.toErrMsg());
58+
eSink.error(loc, "expression `%s` uses the GC and cannot be used with switch `-betterC`", e.toErrMsg());
5559
else
56-
.error(loc, "`TypeInfo` cannot be used with `-betterC`");
60+
eSink.error(loc, "`TypeInfo` cannot be used with `-betterC`");
5761

5862
if (sc && sc.tinst)
5963
sc.tinst.printInstantiationTrace(Classification.error, uint.max);
@@ -64,7 +68,7 @@ bool genTypeInfo(Expression e, Loc loc, Type torig, Scope* sc)
6468

6569
if (!Type.dtypeinfo)
6670
{
67-
.error(loc, "`object.TypeInfo` could not be found, but is implicitly used");
71+
eSink.error(loc, "`object.TypeInfo` could not be found, but is implicitly used");
6872
fatal();
6973
}
7074

0 commit comments

Comments
 (0)