瀏覽代碼

JavaNative: Moved loading of method return type to a latter time

Background: If the return type was a generic parameter, that early it wouldn't have been populated yet, and why load the return type as first thing in a method anyways?
kindlich 5 年之前
父節點
當前提交
ee949a7bd1
沒有發現已知的金鑰在資料庫的簽署中
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java

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

803
 			Parameter[] javaParameters,
803
 			Parameter[] javaParameters,
804
 			TypeVariable<Method>[] javaTypeParameters,
804
 			TypeVariable<Method>[] javaTypeParameters,
805
 			AnnotatedType[] exceptionTypes) {
805
 			AnnotatedType[] exceptionTypes) {
806
-		StoredType returnType = javaReturnType == null ? BasicTypeID.VOID.stored : loadStoredType(context, javaReturnType);
807
 
806
 
808
 
807
 
809
 		TypeParameter[] typeParameters = new TypeParameter[javaTypeParameters.length];
808
 		TypeParameter[] typeParameters = new TypeParameter[javaTypeParameters.length];
835
 		if (exceptionTypes.length > 1)
834
 		if (exceptionTypes.length > 1)
836
 			throw new IllegalArgumentException("A method can only throw a single exception type!");
835
 			throw new IllegalArgumentException("A method can only throw a single exception type!");
837
 
836
 
837
+		StoredType returnType = javaReturnType == null ? BasicTypeID.VOID.stored : loadStoredType(context, javaReturnType);
838
 		StoredType thrownType = exceptionTypes.length == 0 ? null : loadStoredType(context, exceptionTypes[0]);
838
 		StoredType thrownType = exceptionTypes.length == 0 ? null : loadStoredType(context, exceptionTypes[0]);
839
 		return new FunctionHeader(typeParameters, returnType, thrownType, AutoStorageTag.INSTANCE, parameters);
839
 		return new FunctionHeader(typeParameters, returnType, thrownType, AutoStorageTag.INSTANCE, parameters);
840
 	}
840
 	}

Loading…
取消
儲存