diff --git a/source/tlang/compiler/typecheck/dependancy.d b/source/tlang/compiler/typecheck/dependancy.d index 6d26b8fa..f62b7cc8 100644 --- a/source/tlang/compiler/typecheck/dependancy.d +++ b/source/tlang/compiler/typecheck/dependancy.d @@ -118,7 +118,10 @@ public void dependancyGenerate(TypeChecker tc, Container container) * Above it means that because the type of `k` is `Person` and that is a * class type therefore the Person class should have its static constructor * run (=> all static members should be initialized) + * + * Okay, so we do all of the above SECOND, first the class must be checked itself */ + dependancyGenerate(tc, classType); encounter(tc, variable, classType); } else diff --git a/source/tlang/testing/typecheck/basic_dependence_correct1.t b/source/tlang/testing/typecheck/basic_dependence_correct1.t index 9272db60..be0cdf72 100644 --- a/source/tlang/testing/typecheck/basic_dependence_correct1.t +++ b/source/tlang/testing/typecheck/basic_dependence_correct1.t @@ -8,6 +8,8 @@ int jNumber; class A { + static int jStatic; + int jInstance; class C {