Skip to content

Signature checks fail using value classes & upgrading to 2.12.9+ or 2.13.1+ #423

Open
@travisbrown

Description

@travisbrown

If you publish this code with Scala 2.12.8:

class Foo(val value: String) extends AnyVal

case class Bar(foo: Foo)

And then change the Scala version to 2.12.9 (or 10) and run sbt mimaReportBinaryIssues, you'll get these errors:

[error]  * method unapply(Bar)scala.Option in object Bar has a different signature in current version, where it is (LBar;)Lscala/Option<LFoo;>; rather than (LBar;)Lscala/Option<Ljava/lang/String;>;
[error]    filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("Bar.unapply")
[error]  * static method unapply(Bar)scala.Option in class Bar has a different signature in current version, where it is (LBar;)Lscala/Option<LFoo;>; rather than (LBar;)Lscala/Option<Ljava/lang/String;>;
[error]    filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("Bar.unapply")
[error]  * static method andThen(scala.Function1)scala.Function1 in class Bar has a different signature in current version, where it is <A:Ljava/lang/Object;>(Lscala/Function1<LBar;TA;>;)Lscala/Function1<LFoo;TA;>; rather than <A:Ljava/lang/Object;>(Lscala/Function1<LBar;TA;>;)Lscala/Function1<Ljava/lang/String;TA;>;
[error]    filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("Bar.andThen")
[error]  * static method compose(scala.Function1)scala.Function1 in class Bar has a different signature in current version, where it is <A:Ljava/lang/Object;>(Lscala/Function1<TA;LFoo;>;)Lscala/Function1<TA;LBar;>; rather than <A:Ljava/lang/Object;>(Lscala/Function1<TA;Ljava/lang/String;>;)Lscala/Function1<TA;LBar;>;
[error]    filter with: ProblemFilters.exclude[IncompatibleSignatureProblem]("Bar.compose")
[error] java.lang.RuntimeException: unapply_test: Binary compatibility check failed!

The issue seems to be the value class in the synthetic method signatures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions