From c5e744cfb81fd0d2e83d9a99bd272f81e63bc1cb Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 15 Apr 2021 17:58:27 +0200 Subject: [PATCH] WIP: I should make a `Type` interface How tf do interfaces realistically work/are implemented --- source/tlang/compiler/typecheck/core.d | 31 ++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/source/tlang/compiler/typecheck/core.d b/source/tlang/compiler/typecheck/core.d index 0471724..720e271 100644 --- a/source/tlang/compiler/typecheck/core.d +++ b/source/tlang/compiler/typecheck/core.d @@ -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;