Skip to content

Commit

Permalink
TypeChecker
Browse files Browse the repository at this point in the history
- When pro0cessing a `DNode` which contains a `Statement` of which is a `FunctionCall` we now will generate the corresponding `FuncCallInstr` using the name that is refered to in the `FunctionCall` (i.e. using `getname()` on the `FunctionCall`) INSTEAD of using the `getName()` method from the `Function` looked up CVIA the `FunctionCall`'s `getName()` method. This ensures that the full path expression is passed into the `FuncCallInstr`. Remember it is looked up later in the emitter but having this name fixed a lto of problems. i.e. having a `b.doThing()` call in module `a` now works. Previously it would look up just `doThng()` as that is all that was all whic was saved within the `FuncCallInstr`.
- Rule of thumb when deating any sort of `Instruction` whic refers to some entity using a name, save-what-you-see. Don't eaergly lookup stuff and re-generate names because the name y7ou see is normally syntactically correct from the user.
  • Loading branch information
deavmi committed Mar 17, 2024
1 parent a238da9 commit 1b5e182
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/tlang/compiler/typecheck/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,8 @@ public final class TypeChecker


/* TODO: Pass in FUnction, so we get function's body for calling too */
FuncCallInstr funcCallInstr = new FuncCallInstr(func.getName(), paremeters.length);
gprintln(format("funcCall.getName() %s", funcCall.getName()));
FuncCallInstr funcCallInstr = new FuncCallInstr(funcCall.getName(), paremeters.length);
gprintln("Name of func call: "~func.getName(), DebugType.ERROR);

/* If there are paremeters for this function (as per definition) */
Expand Down

0 comments on commit 1b5e182

Please sign in to comment.