|
@@ -7,6 +7,7 @@ package org.openzen.zenscript.codemodel.statement;
|
7
|
7
|
|
8
|
8
|
import java.util.Arrays;
|
9
|
9
|
import java.util.List;
|
|
10
|
+import java.util.Objects;
|
10
|
11
|
import java.util.function.Consumer;
|
11
|
12
|
import java.util.stream.Collectors;
|
12
|
13
|
|
|
@@ -96,6 +97,7 @@ public class BlockStatement extends Statement {
|
96
|
97
|
public StoredType getReturnType() {
|
97
|
98
|
final List<StoredType> collect = Arrays.stream(statements)
|
98
|
99
|
.map(Statement::getReturnType)
|
|
100
|
+ .filter(Objects::nonNull)
|
99
|
101
|
.distinct()
|
100
|
102
|
.collect(Collectors.toList());
|
101
|
103
|
if(collect.isEmpty())
|