The primary constructor of a class can be defined as private.
But it is not private at the level of bytecode, which is what MiMa works with.
Thus changes in such private primary constructor is deemed breaking by MiMa. But these changes are invisible to regular Scala code, so it shouldn’t break. But again, the constructor is visible to Java code which could break.
What to do with it?
Keep things as they are
“Fix” MiMa, so that it doesn’t mark private constructors as breaking
Find a way to make the primary constructor private even at the bytecode level
This issue came up when discussing how to evolve case classes without breaking backward compatibility.
I just checked and if I write class Foo private (x: Int), then I do get a private constructor in Scala 3.
However, this isn’t the case in Scala 2, I think the best we could do there is to emit the constructor as ACC_SYNTHETIC to make it invisible to javac without affecting binary compatibility.