feat: adding Covariance for Switch
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 4m37s

This commit is contained in:
Ruben 2024-09-18 13:54:01 +02:00
parent eb454aa5b2
commit daa38183fa

View File

@ -822,6 +822,10 @@ public class TYPEStmt implements StatementVisitor {
public void visit(Switch switchStmt) {
switchStack.push(switchStmt);
if(switchStmt.getSwitch().getType() instanceof TypePlaceholder){
((TypePlaceholder) switchStmt.getSwitch().getType()).setVariance(1);
}
RefTypeOrTPHOrWildcardOrGeneric caseExpressionType = null;
for (var child : switchStmt.getBlocks()) {
for (var label : child.getLabels()) {