WIP: I should make a `Type` interface

How tf do interfaces realistically work/are implemented
entity_declaration_type_checking
Tristan B. V. Kildaire 2021-04-15 17:58:27 +02:00
parent 4bbdd78b45
commit c5e744cfb8
1 changed files with 29 additions and 2 deletions

View File

@ -59,9 +59,21 @@ public final class TypeChecker
/* TODO: Idk, maybe change */
/* TODO: Just using for `checkDefinitionTypes` */
private void checkDefinitionTypes(Container c)
private bool isBuiltInType(string type)
{
/* TODO: Implemtn me */
return false;
}
private bool isClassType()
{
}
/* TODO: I don't like above, let's make shit implement Type */
private void checkVariableDeclarationTypes(Container c)
{
/* Check variable declarations */
Variable[] variables;
foreach (Statement statement; c.getStatements())
@ -72,6 +84,21 @@ public final class TypeChecker
}
}
/* Attempt to resolve the types of the variables */
foreach(Variable variable; variables)
{
/* Variable's type */
string type = variable.getType();
}
}
private void checkDefinitionTypes(Container c)
{
/* Check variable declarations */
checkVariableDeclarationTypes(c);
/* Check function definitions */
Function[] functions;