Skip to content

Commit

Permalink
Only throw exception when actually unexpected ClassType
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Mar 31, 2024
1 parent bca9230 commit 5520430
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/laytonsmith/core/functions/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,10 @@ public static ParseTree rewrite(List<ParseTree> list, boolean returnSConcat,
list.get(k).setChildren(children);
break;
default:
throw new ConfigCompileException("Unexpected ClassType \"" + typeNode.getData().val() + "\"", typeNode.getTarget());
if(typeNode.getData().equals(CVoid.VOID) || typeNode.getData().isInstanceOf(CClassType.TYPE)) {
throw new ConfigCompileException("Unexpected ClassType \""
+ typeNode.getData().val() + "\"", typeNode.getTarget());
}
}
} else if(list.get(k + 1).getData() instanceof IVariable) {
// Not an assignment, a random variable declaration though.
Expand Down

0 comments on commit 5520430

Please sign in to comment.