Kaynağa Gözat

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 4 yıl önce
ebeveyn
işleme
ee949a7bd1
Veri tabanında bu imza için bilinen anahtar bulunamadı

+ 1
- 1
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java Dosyayı Görüntüle

@@ -803,7 +803,6 @@ public class JavaNativeModule {
803 803
 			Parameter[] javaParameters,
804 804
 			TypeVariable<Method>[] javaTypeParameters,
805 805
 			AnnotatedType[] exceptionTypes) {
806
-		StoredType returnType = javaReturnType == null ? BasicTypeID.VOID.stored : loadStoredType(context, javaReturnType);
807 806
 
808 807
 
809 808
 		TypeParameter[] typeParameters = new TypeParameter[javaTypeParameters.length];
@@ -835,6 +834,7 @@ public class JavaNativeModule {
835 834
 		if (exceptionTypes.length > 1)
836 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 838
 		StoredType thrownType = exceptionTypes.length == 0 ? null : loadStoredType(context, exceptionTypes[0]);
839 839
 		return new FunctionHeader(typeParameters, returnType, thrownType, AutoStorageTag.INSTANCE, parameters);
840 840
 	}

Loading…
İptal
Kaydet