Browse Source

Set Definition Type members in JavaPrepareDefinitionVisitor

fixes issue about unknown type parameters for StdLibs::List
kindlich 5 years ago
parent
commit
187a509863
No known key found for this signature in database

+ 8
- 7
JavaShared/src/main/java/org/openzen/zenscript/javashared/prepare/JavaPrepareDefinitionMemberVisitor.java View File

5
  */
5
  */
6
 package org.openzen.zenscript.javashared.prepare;
6
 package org.openzen.zenscript.javashared.prepare;
7
 
7
 
8
-import org.openzen.zenscript.javashared.JavaNativeClass;
8
+import org.openzen.zenscript.codemodel.generic.TypeParameter;
9
+import org.openzen.zenscript.javashared.*;
9
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
10
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
10
 import org.openzen.zenscript.codemodel.definition.AliasDefinition;
11
 import org.openzen.zenscript.codemodel.definition.AliasDefinition;
11
 import org.openzen.zenscript.codemodel.definition.ClassDefinition;
12
 import org.openzen.zenscript.codemodel.definition.ClassDefinition;
19
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
20
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
20
 import org.openzen.zenscript.codemodel.type.DefinitionTypeID;
21
 import org.openzen.zenscript.codemodel.type.DefinitionTypeID;
21
 import org.openzen.zenscript.codemodel.type.TypeID;
22
 import org.openzen.zenscript.codemodel.type.TypeID;
22
-import org.openzen.zenscript.javashared.JavaClass;
23
-import org.openzen.zenscript.javashared.JavaCompiledModule;
24
-import org.openzen.zenscript.javashared.JavaContext;
25
-import org.openzen.zenscript.javashared.JavaMethod;
26
-import org.openzen.zenscript.javashared.JavaModifiers;
27
 
23
 
28
 /**
24
 /**
29
  *
25
  *
64
 	public JavaClass visitClass(ClassDefinition definition) {
60
 	public JavaClass visitClass(ClassDefinition definition) {
65
 		if (isPrepared(definition))
61
 		if (isPrepared(definition))
66
 			return context.getJavaClass(definition);
62
 			return context.getJavaClass(definition);
67
-		
63
+
68
 		return visitClassCompiled(definition, true, JavaClass.Kind.CLASS);
64
 		return visitClassCompiled(definition, true, JavaClass.Kind.CLASS);
69
 	}
65
 	}
70
 
66
 
134
 	}
130
 	}
135
 	
131
 	
136
 	private JavaClass visitClassCompiled(HighLevelDefinition definition, boolean startsEmpty, JavaClass.Kind kind) {
132
 	private JavaClass visitClassCompiled(HighLevelDefinition definition, boolean startsEmpty, JavaClass.Kind kind) {
133
+
134
+		for (TypeParameter typeParameter : definition.typeParameters) {
135
+			module.setTypeParameterInfo(typeParameter, new JavaTypeParameterInfo(-1));
136
+		}
137
+
137
 		if (definition.getSuperType() != null)
138
 		if (definition.getSuperType() != null)
138
 			prepare(definition.getSuperType());
139
 			prepare(definition.getSuperType());
139
 		
140
 		

Loading…
Cancel
Save