Skip to content

Regression in com-lihaoyi/mill for Array class tags inference in Kotlin interop #24013

@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure in com-lihaoyi/mill - build logs

Compiler version

Last good release: 3.7.3-RC1-bin-20250717-fb66af2-NIGHTLY
First bad release: 3.7.3-RC1-bin-20250718-42fdd76-NIGHTLY
Bisect points to: e6bf7b8 / #23532

Minimized code

// CompilationService.kt

public interface CompilationService {
    public fun compileJVM(sources: List<java.io.File>): Unit
}
// KotlinInterop.java 

public class KotlinInterop {
  public static <T> java.util.List<T> toKotlinList(T[] args) {
    return null;
  }
}
// test.scala

@main def Test = 
  val service: CompilationService = ???
  service.compileJVM(KotlinInterop.toKotlinList(Array()))

Reproduction steps

sdk install kotlin
kotlinc CompilationService.kt -d kotlin-service.jar  
scala compile KotlinInterop.java test.scala --jar kotlin-service.jar

Output

[error] ./test2.scala:4:39
[error] No ClassTag available for T
[error] 
[error] where:    T is a type variable with constraint >: Object & Nothing and <: java.io.File
[error]     KotlinInterop.toKotlinList(Array())
[error]                

Expectation

Should compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions