|  | @@ -36,7 +36,8 @@ import org.openzen.zenscript.javashared.prepare.JavaPrepareDefinitionVisitor;
 | 
		
	
		
			
			| 36 | 36 |   */
 | 
		
	
		
			
			| 37 | 37 |  public class JavaCompiler {
 | 
		
	
		
			
			| 38 | 38 |  	private int generatedScriptBlockCounter = 0;
 | 
		
	
		
			
			| 39 |  | -	
 | 
		
	
		
			
			|  | 39 | +	private int expansionCounter = 0;
 | 
		
	
		
			
			|  | 40 | +
 | 
		
	
		
			
			| 40 | 41 |  	public JavaCompiler() {}
 | 
		
	
		
			
			| 41 | 42 |  	
 | 
		
	
		
			
			| 42 | 43 |  	public JavaBytecodeModule compile(String packageName, SemanticModule module, JavaCompileSpace space) {
 | 
		
	
	
		
			
			|  | @@ -47,7 +48,7 @@ public class JavaCompiler {
 | 
		
	
		
			
			| 47 | 48 |  		context.addModule(module.module, target);
 | 
		
	
		
			
			| 48 | 49 |  		
 | 
		
	
		
			
			| 49 | 50 |  		for (HighLevelDefinition definition : module.definitions.getAll()) {
 | 
		
	
		
			
			| 50 |  | -			String filename = getFilename(definition);
 | 
		
	
		
			
			|  | 51 | +			String filename = getFilename(definition) + "_" + (definition.name == null ? "generated" : definition.name) + "_" + expansionCounter++;
 | 
		
	
		
			
			| 51 | 52 |  			JavaPrepareDefinitionVisitor definitionPreparer = new JavaPrepareDefinitionVisitor(context, target, filename, null);
 | 
		
	
		
			
			| 52 | 53 |  			definition.accept(definitionPreparer);
 | 
		
	
		
			
			| 53 | 54 |  		}
 |