From 5e296dd67c117e55a99ca98d9b5297508292afe9 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Fri, 23 Apr 2021 14:09:05 +0200 Subject: [PATCH] SHow error on invalid type being used for variable declarations --- source/tlang/compiler/typecheck/core.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/tlang/compiler/typecheck/core.d b/source/tlang/compiler/typecheck/core.d index 06e18d0..187ee45 100644 --- a/source/tlang/compiler/typecheck/core.d +++ b/source/tlang/compiler/typecheck/core.d @@ -105,6 +105,12 @@ public final class TypeChecker /* TODO: Resolve type here (either built-in or class type) */ Type type = getType(c, typeString); + /* Make sure type is valid */ + if(!type) + { + Parser.expect("Invalid type \""~typeString~"\""); + } + gprintln("TYpe"~to!(string)(type)); }