WIP: checkDeinitionTypes

Implement this to do type resolution
entity_declaration_type_checking
Tristan B. V. Kildaire 2021-04-15 17:26:14 +02:00
parent d7cd4df736
commit 4bbdd78b45
1 changed files with 42 additions and 0 deletions

View File

@ -47,12 +47,54 @@ public final class TypeChecker
*/
public void dependencyCheck()
{
/* Check declaration and definition types */
checkDefinitionTypes(modulle);
/* TODO: Implement me */
checkClassInherit(modulle);
/* TODO: Process class ? vars funcs ?*/
}
/* TODO: Idk, maybe change */
/* TODO: Just using for `checkDefinitionTypes` */
private void checkDefinitionTypes(Container c)
{
/* Check variable declarations */
Variable[] variables;
foreach (Statement statement; c.getStatements())
{
if (statement !is null && cast(Variable) statement)
{
variables ~= cast(Variable) statement;
}
}
/* Check function definitions */
Function[] functions;
foreach (Statement statement; c.getStatements())
{
if (statement !is null && cast(Function) statement)
{
functions ~= cast(Function) statement;
}
}
/* Check class inheritance types */
Clazz[] classes;
foreach (Statement statement; c.getStatements())
{
if (statement !is null && cast(Clazz) statement)
{
classes ~= cast(Clazz) statement;
}
}
}
public void beginCheck()
{
/**