Skip to content

Commit

Permalink
Dependency
Browse files Browse the repository at this point in the history
- When resolving a `FunctionCall`'s `Function` use the safe resolver
- When resolving a `VariableExpression`'s `Variable` use the safe resolver
- When resolving the `VariableAssignmentStdAlone`'s `Variable` use the safe resolver
  • Loading branch information
deavmi committed May 12, 2024
1 parent 3501dec commit 01a05d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/tlang/compiler/typecheck/dependency/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public class DNodeGenerator
DEBUG("FuncCall: "~funcCall.getName());

/* TODO: We need to fetch the cached function definition here and call it */
Entity funcEntity = resolver.resolveBest(context.container, funcCall.getName());
Entity funcEntity = resolver.resolveBest_Safe(context.container, funcCall.getName(), Function.classinfo);
assert(funcEntity);

// FIXME: The below is failing (we probably need a forward look ahead?)
Expand Down Expand Up @@ -716,7 +716,7 @@ public class DNodeGenerator
varExp.setContext(context);

// Resolve the entity the name refers to
Entity namedEntity = tc.getResolver().resolveBest(context.getContainer(), nearestName);
Entity namedEntity = tc.getResolver().resolveBest_Safe(context.getContainer(), nearestName, Variable.classinfo);


/* If the entity was found */
Expand Down Expand Up @@ -1149,7 +1149,7 @@ public class DNodeGenerator
// resolveBest, if that fails, then it is an error (see #46)
assert(tc.getResolver().resolveBest(c, vAsStdAl.getVariableName()));
DEBUG("YEAST ENJOYER");
Variable variable = cast(Variable)tc.getResolver().resolveBest(c, vAsStdAl.getVariableName());
Variable variable = cast(Variable)tc.getResolver().resolveBest_Safe(c, vAsStdAl.getVariableName(), Variable.classinfo);
assert(variable);

/* Assinging to a variable is usage, therefore increment the reference count */
Expand Down

0 comments on commit 01a05d9

Please sign in to comment.