Skip to content

Kotlin interop: reporting wrong type for inner classes appearing in Kotlin method types #12086

Closed
@jbwheatley

Description

@jbwheatley

Compiler version

3.0.0-RC2

Minimized code

I'm working with a library that is written in kotlin, and running into a compilation error on 3.0.0-RC2 that doesn't happen on 2.13.5. The decompiled .class file looks like:

public abstract class VerificationResult {
  public static final class Ok extends VerificationResult {...}
  public static final class Failed extends VerificationResult {...}
  ...
}

and then there is a method on another class like:

public void displayFailures(@NotNull List<Failed> failures)

I then get this compiler error when calling the method:

Output

[error] 16 |            verifier.displayFailures(List(failed).asJava)
[error]    |                                     ^^^^^^^^^^^^^^^^^^^
[error]    |Found:    java.util.List[au.com.dius.pact.provider.VerificationResult.Failed]
[error]    |Required: java.util.List[au.com.dius.pact.provider.VerificationResult$Failed]

Expectation

Should compile.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions