Skip to content

Commit e7f56db

Browse files
committed
Let the JavaNativeModule find the ObjectTypeSymbol
This fixes an issue when checking supertypes with the module not knowing about the object module
1 parent 7b2df3b commit e7f56db

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

JavaIntegration/src/main/java/org/openzen/zencode/java/module/JavaNativeModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.openzen.zenscript.javashared.JavaClass;
2727
import org.openzen.zenscript.javashared.JavaCompiledModule;
2828
import org.openzen.zenscript.javashared.JavaNativeField;
29+
import org.openzen.zenscript.javashared.types.ObjectTypeSymbol;
2930
import org.openzen.zenscript.parser.BracketExpressionParser;
3031
import stdlib.Strings;
3132

@@ -200,6 +201,9 @@ public Optional<TypeSymbol> findLocalClass(Class<?> cls) {
200201
}
201202

202203
public Optional<TypeSymbol> findClass(Class<?> cls) {
204+
if (Object.class.equals(cls)) {
205+
return Optional.of(ObjectTypeSymbol.INSTANCE);
206+
}
203207
return nativeModuleSpace.getModule(cls).flatMap(module -> module.findLocalClass(cls));
204208
}
205209

0 commit comments

Comments
 (0)