Compiler type inference error

Compiler seems to fail to infer a type based on the inference of another type. IntelliJ IDEA handles this fine. Example:

object InterfaceParser {
	fun parseInterfaces(dataInput: DataInputStream): Array<ConstantPoolReference<ClassConstant>> {
		val numInterfaces = dataInput.u2()
		return Array(numInterfaces) {
			ConstantPoolReference(dataInput.u2())
		}
	}
}

No errors are shown in intellij, which correctly inferes the generic type of ConstantPoolReference.

Compiler throws error:

e: InterfaceParser.kt: (12, 4): Type inference failed: Not enough information to infer parameter T in constructor ConstantPoolReference<T : Constant>(index: Int)
Please specify it explicitly.

Expected behaviour:
Since the method returns an array of constant pool references of type classconstant, in the array constructor the compiler should infer that the constant pool reference should have generic type classconstant.

Intellij already uses the new type inference that will ship with kotlin 1.4 (I belive). The compiler itself still uses the old system. You can enable the new type inference in gradle by adding

tasks.withType<KotlinCompile> {
		kotlinOptions {
			freeCompilerArgs = listOf("-Xnew-inference")
		}
	}

This new type inference is still experimental though and does still have some bugs that need to be fixed.