Browse Source

Fixed remaining Test failures

kindlich 4 years ago
parent
commit
756599a677
No known key found for this signature in database

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/type/member/TypeMemberBuilder.java View File

@@ -589,7 +589,7 @@ public class TypeMemberBuilder implements TypeVisitorWithContext<Void, Void, Run
589 589
 		equals(builtin, BOOL_EQUALS, BOOL);
590 590
 		notequals(builtin, BOOL_NOTEQUALS, BOOL);
591 591
 		
592
-		castExplicit(builtin, BOOL_TO_STRING, STRING);
592
+		castImplicit(builtin, BOOL_TO_STRING, STRING);
593 593
 		staticMethod(builtin, BOOL_PARSE, "parse", BOOL, STRING);
594 594
 		
595 595
 		processType(builtin);

+ 5
- 2
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/CompilerUtils.java View File

@@ -25,8 +25,11 @@ public class CompilerUtils {
25 25
 	private CompilerUtils() {}
26 26
 
27 27
 	public static boolean isPrimitive(TypeID id) {
28
-		return id instanceof BasicTypeID
29
-				|| (id.isOptional() && id.withoutOptional() == BasicTypeID.USIZE);
28
+        if(id instanceof BasicTypeID) {
29
+            return id != BasicTypeID.STRING;
30
+        }
31
+	    
32
+		return id.isOptional() && id.withoutOptional() == BasicTypeID.USIZE;
30 33
 	}
31 34
 
32 35
 	public static boolean isLarge(TypeID type) {

+ 9
- 2
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/definitions/JavaExpansionMemberVisitor.java View File

@@ -5,6 +5,7 @@ import org.objectweb.asm.Label;
5 5
 import org.objectweb.asm.Type;
6 6
 import org.openzen.zenscript.codemodel.FunctionParameter;
7 7
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
8
+import org.openzen.zenscript.codemodel.annotations.*;
8 9
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
9 10
 import org.openzen.zenscript.codemodel.member.*;
10 11
 import org.openzen.zenscript.codemodel.type.TypeID;
@@ -81,8 +82,14 @@ public class JavaExpansionMemberVisitor implements MemberVisitor<Void> {
81 82
 	public Void visitMethod(MethodMember member) {
82 83
 		final boolean isStatic = member.isStatic();
83 84
 		final JavaMethod method = context.getJavaMethod(member);
84
-		if (!method.compile)
85
-			return null;
85
+        if(!method.compile) {
86
+            return null;
87
+        }
88
+        
89
+        if(member.body == null && member.hasTag(NativeTag.class)) {
90
+            //Is it an error that method.compile == true then?
91
+            return null;
92
+        }
86 93
 
87 94
 		final ArrayList<TypeParameter> typeParameters = new ArrayList<>();
88 95
 		expandedClass.extractTypeParameters(typeParameters);

Loading…
Cancel
Save