Skip to content

Commit

Permalink
TypeChecker (unittests)
Browse files Browse the repository at this point in the history
- Fixed missing `sourceFile` argument to various `Compiler` constructors
- Fixed the module obtaining in one of the tests
  • Loading branch information
deavmi committed Apr 7, 2024
1 parent 0a3a543 commit d1460cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/tlang/compiler/typecheck/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -3886,7 +3886,7 @@ unittest
string sourceFile = "source/tlang/testing/unused_vars.t";


Compiler compiler = new Compiler(gibFileData(sourceFile), fileOutDummy);
Compiler compiler = new Compiler(gibFileData(sourceFile), sourceFile, fileOutDummy);
compiler.doLex();
compiler.doParse();
compiler.doTypeCheck();
Expand All @@ -3899,7 +3899,7 @@ unittest
Variable[] unusedVars = tc.getUnusedVariables();
assert(unusedVars.length == 1);
Variable unusedVarActual = unusedVars[0];
Variable unusedVarExpected = cast(Variable)tc.getResolver().resolveBest(tc.getModule(), "j");
Variable unusedVarExpected = cast(Variable)tc.getResolver().resolveBest(compiler.getProgram().getModules()[0], "j");
assert(unusedVarActual is unusedVarExpected);
}

Expand All @@ -3918,7 +3918,7 @@ unittest
string sourceFile = "source/tlang/testing/unused_vars_none.t";


Compiler compiler = new Compiler(gibFileData(sourceFile), fileOutDummy);
Compiler compiler = new Compiler(gibFileData(sourceFile), sourceFile, fileOutDummy);
compiler.doLex();
compiler.doParse();
compiler.doTypeCheck();
Expand Down

0 comments on commit d1460cc

Please sign in to comment.