Skip to content

Commit

Permalink
[ternary] Fix with void types
Browse files Browse the repository at this point in the history
  • Loading branch information
5pilow committed Jul 4, 2023
1 parent e026fb7 commit ae56c8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/leekscript/compiler/JavaCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public AIClassEntry(Class<?> clazz, long timestamp) {
static {
classpath = new File(LeekScript.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getPath();
classpath += ":/home/pierre/dev/leek-wars/generator/bin/main";
classpath += ":/home/pierre/dev/leek-wars/generator/leek-wars-env/bin/main";
arguments.addAll(Arrays.asList("-classpath", classpath, "-nowarn"));
try {
urlLoader = new URLClassLoader(new URL[] { new File(IA_PATH).toURI().toURL() }, new ClassLoader() {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ public void analyze(WordCompiler compiler) throws LeekCompilerException {
}

if (mExpression1 != null && mExpression2 != null) {
type = Type.compound(mExpression1.getType(), mExpression2.getType());
var type1 = mExpression1.getType();
var type2 = mExpression2.getType();
if (type1 == Type.VOID) type1 = Type.NULL;
if (type2 == Type.VOID) type2 = Type.NULL;
type = Type.compound(type1, type2);
}
}

Expand Down

0 comments on commit ae56c8d

Please sign in to comment.