瀏覽代碼

Merge remote-tracking branch 'jared/development' into genericParams

kindlich 4 年之前
父節點
當前提交
fe4fd443d5
沒有發現已知的金鑰在資料庫的簽署中

+ 9
- 8
CodeModel/src/main/java/org/openzen/zenscript/codemodel/type/DefinitionTypeID.java 查看文件

@@ -5,14 +5,8 @@
5 5
  */
6 6
 package org.openzen.zenscript.codemodel.type;
7 7
 
8
-import org.openzen.zenscript.codemodel.GenericName;
9
-import java.util.Arrays;
10
-import java.util.HashMap;
11
-import java.util.List;
12
-import java.util.Map;
13
-import java.util.Objects;
14
-import java.util.Set;
15 8
 import org.openzen.zenscript.codemodel.GenericMapper;
9
+import org.openzen.zenscript.codemodel.GenericName;
16 10
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
17 11
 import org.openzen.zenscript.codemodel.definition.AliasDefinition;
18 12
 import org.openzen.zenscript.codemodel.definition.EnumDefinition;
@@ -21,6 +15,13 @@ import org.openzen.zenscript.codemodel.definition.VariantDefinition;
21 15
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
22 16
 import org.openzen.zenscript.codemodel.type.storage.StorageTag;
23 17
 
18
+import java.util.Arrays;
19
+import java.util.HashMap;
20
+import java.util.List;
21
+import java.util.Map;
22
+import java.util.Objects;
23
+import java.util.Set;
24
+
24 25
 /**
25 26
  *
26 27
  * @author Hoofdgebruiker
@@ -42,7 +43,7 @@ public class DefinitionTypeID implements TypeID {
42 43
 		if (typeArguments == null)
43 44
 			throw new NullPointerException("typeParameters cannot be null");
44 45
 		if (typeArguments.length != definition.getNumberOfGenericParameters())
45
-			throw new IllegalArgumentException("Wrong number of type parameters!");
46
+			throw new IllegalArgumentException("Wrong number of type parameters! " + definition.name + " expected: " + definition.getNumberOfGenericParameters() + " got: " + typeArguments.length);
46 47
 		if (definition.isInnerDefinition() && !definition.isStatic() && outer == null)
47 48
 			throw new IllegalArgumentException("Inner definition requires outer instance");
48 49
 		if ((!definition.isInnerDefinition() || definition.isStatic()) && outer != null)

+ 3
- 2
JavaBytecodeCompiler/build.gradle 查看文件

@@ -14,7 +14,8 @@ if (!hasProperty('mainClass')) {
14 14
 }
15 15
 
16 16
 dependencies {
17
-	compile 'org.ow2.asm:asm-debug-all:6.0_BETA'
18
-	compile project(':CodeModel')
17
+    compile group: 'org.ow2.asm', name: 'asm', version: '7.2'
18
+    compile group: 'org.ow2.asm', name: 'asm-commons', version: '7.2'
19
+    compile project(':CodeModel')
19 20
 	compile project(':JavaShared')
20 21
 }

+ 3
- 5
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java 查看文件

@@ -274,7 +274,7 @@ public class JavaNativeModule {
274 274
 				} else if (specifiedName.indexOf('.') >= 0) {
275 275
 					if (!specifiedName.startsWith(pkg.fullName))
276 276
 						throw new IllegalArgumentException("Specified @Name as \"" + specifiedName + "\" for class: \"" + cls
277
-								.toString() + "\" but it's not in the module root package");
277
+								.toString() + "\" but it's not in the module root package: \"" + pkg.fullName + "\"");
278 278
 
279 279
 					classPkg = getPackage(basePackage + specifiedName.substring(pkg.fullName.length()));
280 280
 					className = specifiedName.substring(specifiedName.lastIndexOf('.') + 1);
@@ -306,9 +306,8 @@ public class JavaNativeModule {
306 306
 
307 307
 		//TypeVariableContext context = new TypeVariableContext();
308 308
 		TypeVariable<Class<T>>[] javaTypeParameters = cls.getTypeParameters();
309
-		TypeParameter[] typeParameters = new TypeParameter[cls.getTypeParameters().length];
309
+        TypeParameter[] typeParameters = new TypeParameter[cls.getTypeParameters().length];
310 310
 		definition.typeParameters = typeParameters;
311
-
312 311
 		for (int i = 0; i < javaTypeParameters.length; i++) {
313 312
 			//Put up here for nested parameters?
314 313
 			TypeVariable<Class<T>> typeVariable = javaTypeParameters[i];
@@ -324,7 +323,7 @@ public class JavaNativeModule {
324 323
 				TypeID type = loadType(context, bound).type;
325 324
 				parameter.addBound(new ParameterTypeBound(CodePosition.NATIVE, type));
326 325
 			}
327
-			typeParameters[i] = parameter;
326
+            typeParameters[i] = parameter;
328 327
 		}
329 328
 
330 329
 		if (!foundRegistry && definition instanceof ClassDefinition && cls.getAnnotatedSuperclass() != null && shouldLoadType(cls.getAnnotatedSuperclass().getType())) {
@@ -343,7 +342,6 @@ public class JavaNativeModule {
343 342
 				compiled.setImplementationInfo(member, new JavaImplementation(true, javaClass));
344 343
 			}
345 344
 		}
346
-
347 345
 		compiled.setClassInfo(definition, javaClass);
348 346
 
349 347
 		StoredType thisType = new StoredType(registry.getForMyDefinition(definition), AutoStorageTag.INSTANCE);

Loading…
取消
儲存