Fixed primitive types not being properly resolved

This commit is contained in:
bigguy345 committed 2025-12-26 23:10:36 +02:00
1 parent 8a0c7c5a65
commit c591a91857
2 files changed
+20

No files matched your search

@@ -804,6 +804,16 @@ public class ScriptDocument {
// Strip array brackets
baseName = baseName.replace("[]", "").trim();
// Check primitive types first
if (TypeResolver.isPrimitiveType(baseName)) {
return TypeInfo.forPrimitive(baseName);
}
// Check for String (common case)
if (baseName.equals("String")) {
return typeResolver.resolveFullName("java.lang.String");
}
// Check script-defined types FIRST
if (scriptTypes.containsKey(baseName)) {
return scriptTypes.get(baseName);
@@ -370,6 +370,16 @@ public class TypeResolver {
}
}
/**
* Check if a type name is a primitive type.
*/
public static boolean isPrimitiveType(String typeName) {
return typeName.equals("boolean") || typeName.equals("byte") || typeName.equals("char") ||
typeName.equals("short") || typeName.equals("int") || typeName.equals("long") ||
typeName.equals("float") || typeName.equals("double") || typeName.equals("void");
}
/**
* Represents a type occurrence within generic content.
*/