mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 05:27:37 +00:00
Treated "Object" as universally compatible in JS (methods requiring int accepts Object)
This commit is contained in:
1 parent
5899ea7932
commit
131f0e2d74
1 file changed
+5
-3
@@ -43,9 +43,11 @@ public final class TypeChecker {
|
||||
if ("any".equals(expected.getFullName()) || "any".equals(actual.getFullName())) {
|
||||
return true;
|
||||
}
|
||||
// In JavaScript mode, treat java.lang.Object as "any"
|
||||
if (isJavaScriptMode() && "Object".equals(expected.getSimpleName())) {
|
||||
return true;
|
||||
|
||||
if (isJavaScriptMode()) {
|
||||
// Treat java.lang.Object as "any", universally compatible
|
||||
if ("Object".equals(expected.getSimpleName()) || "Object".equals(actual.getSimpleName()) )
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handle null literal - null is compatible with any reference type (non-primitive)
|
||||
|
||||
Reference in new issue
Block a user