Pop types off for Binary Operator typechecking

This commit is contained in:
Tristan B. Velloza Kildaire 2022-02-20 16:21:29 +02:00
parent de31585bcc
commit 6222aabc8b
2 changed files with 5 additions and 8 deletions

View File

@ -93,7 +93,7 @@ public final class TypeChecker
doTypeCheck(actionList); doTypeCheck(actionList);
printTypeQueue();
@ -308,6 +308,9 @@ public final class TypeChecker
/** /**
* Typechecking (TODO) * Typechecking (TODO)
*/ */
Type vRhsType = popType();
Type vLhsType = popType();
/** /**
* Codegen * Codegen
@ -326,8 +329,7 @@ public final class TypeChecker
/* Function calls */ /* Function calls */
else if(cast(FunctionCall)statement) else if(cast(FunctionCall)statement)
{ {
/* TODO: Implement me */ // gprintln("FuncCall hehe (REMOVE AFTER DONE)");
gprintln("FuncCall hehe (REMOVE AFTER DONE)");
// printTypeQueue(); // printTypeQueue();
FunctionCall funcCall = cast(FunctionCall)statement; FunctionCall funcCall = cast(FunctionCall)statement;
@ -422,8 +424,6 @@ public final class TypeChecker
*/ */
addInstr(funcCallInstr); addInstr(funcCallInstr);
addType(getType(func.parentOf(), func.getType())); addType(getType(func.parentOf(), func.getType()));
gprintln("Genaai");
gprintln(getType(func.parentOf(), func.getType()));
} }
} }
/* VariableAssigbmentDNode */ /* VariableAssigbmentDNode */

View File

@ -1,8 +1,5 @@
module simple; module simple;
discard "return 1;";
int j = 1+func(2,test()); int j = 1+func(2,test());
int func(int x1, byte x2) int func(int x1, byte x2)