From 00920ad43be54f7eeb7f639965621e0322435a8d Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Mon, 7 Jun 2021 14:00:06 +0200 Subject: [PATCH] Added quick fix for gotcha --- source/tlang/compiler/typecheck/dependancy.d | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/typecheck/dependancy.d b/source/tlang/compiler/typecheck/dependancy.d index bea60be2..1c6ce880 100644 --- a/source/tlang/compiler/typecheck/dependancy.d +++ b/source/tlang/compiler/typecheck/dependancy.d @@ -134,7 +134,15 @@ public final class StructuralOrganizer */ if(clazz.getModifierType() != InitScope.STATIC) { - Parser.expect("Cannot use a class type that is of a class that is non-static"); + /** + * All module-level classes are static (even though not marked as such) + * + * TODO: Add this into the parser code to seth this + */ + if(clazz.parentOf() != tc.getModule()) + { + Parser.expect("Cannot use a class type that is of a class that is non-static"); + } } /**