Skip to content

Commit 557ce05

Browse files
committed
adapt to dmd-2.111
1 parent cdf4c76 commit 557ce05

File tree

7 files changed

+82
-55
lines changed

7 files changed

+82
-55
lines changed

vdc/dmdserver/dmd

Submodule dmd updated 1111 files

vdc/dmdserver/dmderrors.d

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private __gshared // under gErrorSync lock
3131

3232
private string gLastHeader;
3333
private string[] gLastErrorMsgs; // all but first are supplemental
34-
private Loc[] gLastErrorLocs;
34+
private SourceLoc[] gLastErrorLocs;
3535
}
3636

3737
void flushLastError()
@@ -46,7 +46,7 @@ void flushLastError()
4646
char[] msg;
4747
if (pos < gLastErrorLocs.length)
4848
{
49-
Loc loc = gLastErrorLocs[pos];
49+
auto loc = gLastErrorLocs[pos];
5050
int len = snprintf(buf.ptr, buf.length, "%d,%d,%d,%d:", loc.linnum, loc.charnum - 1, loc.linnum, loc.charnum);
5151
msg ~= buf[0..len];
5252
}
@@ -57,15 +57,16 @@ void flushLastError()
5757
if (i > 0)
5858
msg ~= "\a";
5959

60-
Loc loc = gLastErrorLocs[i];
60+
auto loc = gLastErrorLocs[i];
6161
if (i == pos)
6262
{
6363
if (i > 0)
6464
msg ~= "--> ";
6565
}
6666
else if (loc.filename)
6767
{
68-
int len = snprintf(buf.ptr, buf.length, "%s(%d): ", loc.filename, loc.linnum);
68+
auto fn = loc.filename;
69+
int len = snprintf(buf.ptr, buf.length, "%.*s(%d): ", cast(int)fn.length, fn.ptr, loc.linnum);
6970
msg ~= buf[0..len];
7071
}
7172
msg ~= gLastErrorMsgs[i];
@@ -75,7 +76,7 @@ void flushLastError()
7576

7677
size_t otherLocs;
7778
foreach (loc; gLastErrorLocs)
78-
if (!loc.filename || _stricmp(loc.filename, gErrorFile) != 0)
79+
if (!loc.filename || icmp(loc.filename, gErrorFile) != 0)
7980
otherLocs++;
8081

8182
if (otherLocs == gLastErrorLocs.length)
@@ -87,8 +88,8 @@ void flushLastError()
8788
// prepend the loc inside gErrorFile to the beginning of the error message
8889
for (size_t i = 0; i < gLastErrorLocs.length; i++)
8990
{
90-
Loc loc = gLastErrorLocs[i];
91-
if (loc.filename && _stricmp(loc.filename, gErrorFile) == 0)
91+
auto loc = gLastErrorLocs[i];
92+
if (loc.filename && icmp(loc.filename, gErrorFile) == 0)
9293
{
9394
gErrorMessages ~= genErrorMessage(i) ~ "\n";
9495
break;
@@ -101,15 +102,15 @@ void flushLastError()
101102
gLastErrorMsgs.length = 0;
102103
}
103104

104-
bool errorPrint(const ref Loc loc, Color headerColor, const(char)* header,
105+
bool errorPrint(const ref SourceLoc loc, Color headerColor, const(char)* header,
105106
const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null) nothrow
106107
{
107108
if (!loc.filename)
108109
return true;
109110

110111
try synchronized(gErrorSync)
111112
{
112-
bool other = _stricmp(loc.filename, gErrorFile) != 0;
113+
bool other = icmp(loc.filename, gErrorFile) != 0;
113114
while (header && std.ascii.isWhite(*header))
114115
header++;
115116
bool supplemental = !header || !*header;

vdc/dmdserver/dmdinit.d

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ enum string[2][] dmdStatics =
5454
["_D3dmd7dmodule6Module11loadStdMathFZ8std_mathCQBsQBrQBm", "Module"],
5555
["_D3dmd7dmodule6Module14loadCoreAtomicFZ11core_atomicCQBzQByQBt", "Module"],
5656

57-
["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifiermZ2stCQFb7dsymbol12DsymbolTable", "DsymbolTable"],
57+
// up to 2.110
58+
// ["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifiermZ2stCQFb7dsymbol12DsymbolTable", "DsymbolTable"],
59+
// 2.111
60+
["_D3dmd4func15FuncDeclaration8genCfuncRPSQBm4root5array__T5ArrayTCQCl5mtype9ParameterZQBcCQDjQy4TypeCQDu10identifier10IdentifierEQEw8astenums3STCZ2stCQFr7dsymbol12DsymbolTable", "DsymbolTable"],
61+
5862
// 2.091
5963
// ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeSQBr7globals3LocPSQCi6dscope5ScopeZ11visitAArrayMFCQDpQCn10TypeAArrayZ3feqCQEn4func15FuncDeclaration", "FuncDeclaration"],
6064
// ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeSQBr7globals3LocPSQCi6dscope5ScopeZ11visitAArrayMFCQDpQCn10TypeAArrayZ4fcmpCQEo4func15FuncDeclaration", "FuncDeclaration"],
@@ -70,9 +74,13 @@ enum string[2][] dmdStatics =
7074
// ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"],
7175
// ["_D3dmd7typesem12typeSemanticRCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"],
7276
// 2.110
73-
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ3feqCQEq4func15FuncDeclaration", "FuncDeclaration"],
74-
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"],
75-
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"],
77+
// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ3feqCQEq4func15FuncDeclaration", "FuncDeclaration"],
78+
// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ4fcmpCQEr4func15FuncDeclaration", "FuncDeclaration"],
79+
// ["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeKxSQBt8location3LocPSQCl6dscope5ScopeZ11visitAArrayMFCQDsQCq10TypeAArrayZ5fhashCQEs4func15FuncDeclaration", "FuncDeclaration"],
80+
// 2.111
81+
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ3feqCQEo4func15FuncDeclaration", "FuncDeclaration"],
82+
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ4fcmpCQEp4func15FuncDeclaration", "FuncDeclaration"],
83+
["_D3dmd7typesem12typeSemanticFCQBc5mtype4TypeSQBr8location3LocPSQCj6dscope5ScopeZ11visitAArrayMFCQDqQCo10TypeAArrayZ5fhashCQEq4func15FuncDeclaration", "FuncDeclaration"],
7684

7785
["_D3dmd7typesem6dotExpFCQv5mtype4TypePSQBk6dscope5ScopeCQCb10expression10ExpressionCQDdQBc8DotIdExpEQDtQCz10DotExpFlagZ11visitAArrayMFCQFcQEi10TypeAArrayZ8fd_aaLenCQGf4func15FuncDeclaration", "FuncDeclaration"],
7886
["_D3dmd7typesem6dotExpFCQv5mtype4TypePSQBk6dscope5ScopeCQCb10expression10ExpressionCQDdQBc8DotIdExpEQDtQCz10DotExpFlagZ8noMemberMFQEdQDsQDdCQFh10identifier10IdentifieriZ4nesti", "int"],
@@ -89,8 +97,10 @@ enum string[2][] dmdStatics =
8997

9098
// ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe7globals3LocZ8countersHSQDfQDeQCvQCmFNbQBwKxQBwZ3Keyk", "countersType"],
9199
// 2.103
92-
["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe8location3LocZ8countersHSQDgQDfQCwQCnFNbQBxKxQBxZ3Keyk", "countersType"],
100+
// ["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaKxSQCe8location3LocZ8countersHSQDgQDfQCwQCnFNbQBxKxQBxZ3Keyk", "countersType"],
93101
["_D3dmd10identifier10Identifier9newSuffixFNbZ1ik", "size_t"],
102+
// 2.111
103+
["_D3dmd10identifier10Identifier17generateIdWithLocFNbAyaSQCc8location3LocQuZ8countersHSQDgQDfQCwQCnFNbQBxQBxQCdZ3Keyk", "countersType"],
94104

95105
// 2.106
96106
["_D3dmd7arrayop7arrayOpFCQw10expression6BinExpPSQBt6dscope5ScopeZQByCQCo9dtemplate19TemplateDeclaration", "TemplateDeclaration"],
@@ -287,7 +297,7 @@ void dmdSetupParams(const ref Options opts)
287297
global.params.obj = false;
288298
global.params.useDeprecated = !opts.noDeprecated ? DiagnosticReporting.off
289299
: opts.deprecatedInfo ? DiagnosticReporting.inform : DiagnosticReporting.error ;
290-
global.params.warnings = !opts.warnings ? DiagnosticReporting.off
300+
global.params.useWarnings = !opts.warnings ? DiagnosticReporting.off
291301
: opts.warnAsError ? DiagnosticReporting.error : DiagnosticReporting.inform;
292302
global.params.linkswitches = Strings();
293303
global.params.libfiles = Strings();
@@ -340,7 +350,7 @@ void dmdSetupParams(const ref Options opts)
340350
default: break;
341351
}
342352
}
343-
global.params.versionlevel = opts.versionLevel;
353+
// global.params.versionlevel = opts.versionLevel;
344354
auto versionids = new Strings();
345355
foreach(v; opts.versionIds)
346356
versionids.push(toStringz(v));
@@ -363,7 +373,7 @@ void dmdSetupParams(const ref Options opts)
363373
// always enable for tooltips
364374
global.params.ddoc.doOutput = true;
365375

366-
global.params.debuglevel = opts.debugLevel;
376+
// global.params.debuglevel = opts.debugLevel;
367377
auto debugids = new Strings();
368378
foreach(d; opts.debugIds)
369379
debugids.push(toStringz(d));
@@ -377,7 +387,7 @@ void dmdSetupParams(const ref Options opts)
377387

378388
global.path.setDim(0);
379389
foreach(i; opts.importDirs)
380-
global.path.push(toStringz(i));
390+
global.path.push(ImportPathInfo(toStringz(i)));
381391

382392
global.filePath.setDim(0);
383393
foreach(i; opts.stringImportDirs)

vdc/dmdserver/dmdrmem.d

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ module dmd.root.rmem;
33
import core.memory : GC;
44
import core.stdc.string : strlen;
55

6+
__gshared size_t heapleft = 0;
7+
__gshared void* heapp;
8+
__gshared size_t heapTotal = 0; // Total amount of memory allocated using malloc
9+
610
extern (C++) struct Mem
711
{
812
enum isGCEnabled = true;

vdc/dmdserver/dmdserver.visualdproj

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,7 @@
22082208
<preview_inclincontracts>0</preview_inclincontracts>
22092209
<preview_shortenedMethods>0</preview_shortenedMethods>
22102210
<transition_vmarkdown>0</transition_vmarkdown>
2211-
<compiler>0</compiler>
2211+
<compiler>2</compiler>
22122212
<otherDMD>0</otherDMD>
22132213
<cccmd>$(CC) -nologo -c -TP -Idmd\src -Idmd\compiler\src\dmd\backend -Idmd\compiler\src\dmd\tk -Idmd\compiler\src\dmd\root -Idmd\src\vcbuild -DTARGET_WINDOS=1 -FIwarnings.h</cccmd>
22142214
<ccTransOpt>1</ccTransOpt>
@@ -2279,6 +2279,12 @@
22792279
<File path="dmd\compiler\src\dmd\common\outbuffer.d" />
22802280
<File path="dmd\compiler\src\dmd\common\smallbuffer.d" />
22812281
</Folder>
2282+
<Folder name="mangle">
2283+
<File path="dmd\compiler\src\dmd\mangle\basic.d" />
2284+
<File path="dmd\compiler\src\dmd\mangle\cpp.d" />
2285+
<File path="dmd\compiler\src\dmd\mangle\cppwin.d" />
2286+
<File path="dmd\compiler\src\dmd\mangle\package.d" />
2287+
</Folder>
22822288
<Folder name="root">
22832289
<File path="dmd\compiler\src\dmd\root\aav.d" />
22842290
<File path="dmd\compiler\src\dmd\root\array.d" />
@@ -2301,6 +2307,16 @@
23012307
<File path="dmd\compiler\src\dmd\root\strtold.d" />
23022308
<File path="dmd\compiler\src\dmd\root\utf.d" />
23032309
</Folder>
2310+
<Folder name="visitor">
2311+
<File path="dmd\compiler\src\dmd\visitor\foreachvar.d" />
2312+
<File path="dmd\compiler\src\dmd\visitor\package.d" />
2313+
<File path="dmd\compiler\src\dmd\visitor\parsetime.d" />
2314+
<File path="dmd\compiler\src\dmd\visitor\permissive.d" />
2315+
<File path="dmd\compiler\src\dmd\visitor\postorder.d" />
2316+
<File path="dmd\compiler\src\dmd\visitor\statement_rewrite_walker.d" />
2317+
<File path="dmd\compiler\src\dmd\visitor\strict.d" />
2318+
<File path="dmd\compiler\src\dmd\visitor\transitive.d" />
2319+
</Folder>
23042320
<File path="dmd\compiler\src\dmd\access.d" />
23052321
<File path="dmd\compiler\src\dmd\aggregate.d" />
23062322
<File path="dmd\compiler\src\dmd\aliasthis.d" />
@@ -2316,7 +2332,6 @@
23162332
<File path="dmd\compiler\src\dmd\asttypename.d" tool="None" />
23172333
<File path="dmd\compiler\src\dmd\attrib.d" />
23182334
<File path="dmd\compiler\src\dmd\attribsem.d" />
2319-
<File path="dmd\compiler\src\dmd\basicmangle.d" />
23202335
<File path="dmd\compiler\src\dmd\blockexit.d" />
23212336
<File path="dmd\compiler\src\dmd\boostlicense.txt" />
23222337
<File path="dmd\compiler\src\dmd\builtin.d" />
@@ -2329,20 +2344,18 @@
23292344
<File path="dmd\compiler\src\dmd\console.d" />
23302345
<File path="dmd\compiler\src\dmd\constfold.d" />
23312346
<File path="dmd\compiler\src\dmd\cparse.d" />
2332-
<File path="dmd\compiler\src\dmd\cppmangle.d" />
2333-
<File path="dmd\compiler\src\dmd\cppmanglewin.d" />
23342347
<File path="dmd\compiler\src\dmd\ctfeexpr.d" />
23352348
<File path="dmd\compiler\src\dmd\ctorflow.d" />
23362349
<File path="dmd\compiler\src\dmd\dcast.d" />
23372350
<File path="dmd\compiler\src\dmd\dclass.d" />
23382351
<File path="dmd\compiler\src\dmd\declaration.d" />
23392352
<File path="dmd\compiler\src\dmd\delegatize.d" />
23402353
<File path="dmd\compiler\src\dmd\denum.d" />
2354+
<File path="dmd\compiler\src\dmd\deps.d" />
23412355
<File path="dmd\compiler\src\dmd\dimport.d" />
23422356
<File path="dmd\compiler\src\dmd\dinifile.d" tool="None" />
23432357
<File path="dmd\compiler\src\dmd\dinterpret.d" />
23442358
<File path="dmd\compiler\src\dmd\dmacro.d" />
2345-
<File path="dmd\compiler\src\dmd\dmangle.d" />
23462359
<File path="dmd\compiler\src\dmd\dmdparams.d" />
23472360
<File path="dmd\compiler\src\dmd\dmodule.d" />
23482361
<File path="dmd\compiler\src\dmd\dmsc.d" tool="None" />
@@ -2363,7 +2376,6 @@
23632376
<File path="dmd\compiler\src\dmd\expression.d" />
23642377
<File path="dmd\compiler\src\dmd\expressionsem.d" />
23652378
<File path="dmd\compiler\src\dmd\file_manager.d" />
2366-
<File path="dmd\compiler\src\dmd\foreachvar.d" />
23672379
<File path="dmd\compiler\src\dmd\frontend.d" tool="None" />
23682380
<File path="dmd\compiler\src\dmd\func.d" />
23692381
<File path="dmd\compiler\src\dmd\funcsem.d" />
@@ -2406,16 +2418,13 @@
24062418
<File path="dmd\compiler\src\dmd\opover.d" />
24072419
<File path="dmd\compiler\src\dmd\optimize.d" />
24082420
<File path="dmd\compiler\src\dmd\parse.d" />
2409-
<File path="dmd\compiler\src\dmd\parsetimevisitor.d" />
2410-
<File path="dmd\compiler\src\dmd\permissivevisitor.d" />
2411-
<File path="dmd\compiler\src\dmd\postordervisitor.d" />
24122421
<File path="dmd\compiler\src\dmd\pragmasem.d" />
24132422
<File path="dmd\compiler\src\dmd\printast.d" />
24142423
<File path="dmd\compiler\src\dmd\root\region.d" />
24152424
<File path="dmd\compiler\src\dmd\rootobject.d" />
24162425
<File path="dmd\compiler\src\dmd\s2ir.d" tool="None" />
24172426
<File path="dmd\compiler\src\dmd\safe.d" />
2418-
<File path="dmd\compiler\src\dmd\sapply.d" />
2427+
<File path="dmd\compiler\src\dmd\sarif.d" />
24192428
<File path="dmd\compiler\src\dmd\scanelf.d" tool="None" />
24202429
<File path="dmd\compiler\src\dmd\scanmach.d" tool="None" />
24212430
<File path="dmd\compiler\src\dmd\scanmscoff.d" tool="None" />
@@ -2424,12 +2433,10 @@
24242433
<File path="dmd\compiler\src\dmd\semantic3.d" />
24252434
<File path="dmd\compiler\src\dmd\sideeffect.d" />
24262435
<File path="dmd\compiler\src\dmd\statement.d" />
2427-
<File path="dmd\compiler\src\dmd\statement_rewrite_walker.d" />
24282436
<File path="dmd\compiler\src\dmd\statementsem.d" />
24292437
<File path="dmd\compiler\src\dmd\staticassert.d" />
24302438
<File path="dmd\compiler\src\dmd\staticcond.d" />
24312439
<File path="dmd\compiler\src\dmd\stmtstate.d" />
2432-
<File path="dmd\compiler\src\dmd\strictvisitor.d" />
24332440
<File path="dmd\compiler\src\dmd\target.d" />
24342441
<File path="dmd\compiler\src\dmd\templateparamsem.d" />
24352442
<File path="dmd\compiler\src\dmd\templatesem.d" />
@@ -2441,11 +2448,9 @@
24412448
<File path="dmd\compiler\src\dmd\tokens.d" />
24422449
<File path="dmd\compiler\src\dmd\toobj.d" tool="None" />
24432450
<File path="dmd\compiler\src\dmd\traits.d" />
2444-
<File path="dmd\compiler\src\dmd\transitivevisitor.d" />
24452451
<File path="dmd\compiler\src\dmd\typesem.d" />
24462452
<File path="dmd\compiler\src\dmd\typinf.d" />
24472453
<File path="dmd\compiler\src\dmd\utils.d" />
2448-
<File path="dmd\compiler\src\dmd\visitor.d" />
24492454
</Folder>
24502455
<File path="dmderrors.d" />
24512456
<File path="dmdinit.d" />
@@ -2467,6 +2472,7 @@ if exist &quot;%WindowsSdkDir%\bin\%WindowsSDKVersion%x86\rc.exe&quot; set rc=&q
24672472
<File path="..\ivdserver.d" />
24682473
<File path="semanalysis.d" />
24692474
<File path="semvisitor.d" />
2475+
<File path="dmd\compiler\src\dmd\timetrace.d" />
24702476
<File path="..\..\tools\tracegc.d" />
24712477
<File path="..\vdserverfactory.d" />
24722478
</Folder>

vdc/dmdserver/semanalysis.d

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import dmd.semantic2;
2525
import dmd.semantic3;
2626

2727
import std.algorithm;
28+
import std.path;
2829
import std.conv;
2930

3031
// debug version = traceGC;
@@ -235,17 +236,21 @@ string[] guessImportPaths()
235236
{
236237
import std.file;
237238

239+
string druntime = std.path.dirName(__FILE_FULL_PATH__) ~ r"\dmd\druntime\src";
240+
assert(std.file.exists(druntime ~ r"\object.d"));
241+
return [ druntime, r"c:\s\d\dlang\phobos" ]; // must have version matching compiler and runtime
242+
238243
foreach(patch; '0'..'3')
239244
{
240245
string path = r"c:\D\dmd-" ~ to!string(__VERSION__)[0..1] ~ "." ~ to!string(__VERSION__)[1..$] ~ "." ~ patch;
241246
if (std.file.exists(path ~ r"\src\druntime\import\object.d"))
242-
return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ];
247+
return [ druntime, path ~ r"\src\phobos" ];
243248
path ~= "-beta.1";
244249
if (std.file.exists(path ~ r"\src\druntime\import\object.d"))
245-
return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ];
250+
return [ druntime, path ~ r"\src\phobos" ];
246251
path = path[0..$-7] ~ "-rc.1";
247252
if (std.file.exists(path ~ r"\src\druntime\import\object.d"))
248-
return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ];
253+
return [ druntime, path ~ r"\src\phobos" ];
249254
}
250255
if (std.file.exists(r"c:\s\d\dlang\druntime\import\object.d"))
251256
return [ r"c:\s\d\dlang\druntime\import", r"c:\s\d\dlang\phobos" ];
@@ -346,7 +351,7 @@ void do_unittests()
346351
assert_equal(col, expected_col);
347352
}
348353

349-
void checkBinaryIsInLocations(string src, Loc[] locs)
354+
void checkBinaryIsInLocations(string src, SourceLoc[] locs)
350355
{
351356
initErrorMessages(filename);
352357
Module parsedModule = createModuleFromText(filename, src);
@@ -456,7 +461,7 @@ void do_unittests()
456461
checkTip(m, 7, 11, "(local variable) `int xyz`");
457462

458463
checkDefinition(m, 7, 11, "source.d", 5, 8); // xyz
459-
checkDefinition(m, 2, 14, opts.importDirs[1] ~ r"\std\stdio.d", 0, 0); // std.stdio
464+
checkDefinition(m, 2, 14, opts.importDirs[1] ~ r"\std\stdio.d", 0, 1); // std.stdio
460465

461466
//checkTypeIdentifiers(source);
462467

@@ -491,9 +496,9 @@ void do_unittests()
491496
return cpu_vendor ~ " " ~ processor;
492497
}
493498
};
494-
checkBinaryIsInLocations(source, [Loc(null, 6, 17), Loc(null, 7, 23),
495-
Loc(null, 10, 25), Loc(null, 11, 26),
496-
Loc(null, 15, 18), Loc(null, 17, 15)]);
499+
checkBinaryIsInLocations(source, [SourceLoc(null, 6, 17), SourceLoc(null, 7, 23),
500+
SourceLoc(null, 10, 25), SourceLoc(null, 11, 26),
501+
SourceLoc(null, 15, 18), SourceLoc(null, 17, 15)]);
497502

498503
m = checkErrors(source, "");
499504

@@ -784,7 +789,7 @@ void do_unittests()
784789
return f10063(p);
785790
}
786791
};
787-
m = checkErrors(source, "8,16,8,17:Error: cannot implicitly convert expression `f10063(cast(inout(void*))p)` of type `inout(void)*` to `immutable(void)*`\n");
792+
m = checkErrors(source, "8,16,8,17:Error: return value `f10063(cast(inout(void*))p)` of type `inout(void)*` does not match return type `immutable(void)*`, and cannot be implicitly converted\n");
788793
checkExpansions(m, 8, 11, "f1", [ "f10063" ]);
789794

790795
source =

0 commit comments

Comments
 (0)