Process the class itself then too, because if it must be initted as it is referenced by a variable's type then we must do the initializtions (static) of said class first and then that variable is satisfied (it doesn't matter too much without an assignment expresison but would with it hence we definately want this.

This commit is contained in:
Tristan B. Kildaire 2021-06-06 19:10:26 +02:00
parent 4f0d601a0e
commit 9609e11303
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -8,6 +8,8 @@ int jNumber;
class A
{
static int jStatic;
int jInstance;
class C
{