constructor(val a: Int) { companion object { fun create(a: Int) = A(a) } } val a = A.create(10) / / OK val b = a.copy(20) / / OK, but should be an error. ERROR❌
= KtDiagnosticFactoryToRendererMap("NoCopy").apply { put( NoCopyFirErrors.COPY_CALL_FOR_DATA_CLASS_WITH_PRIVATE_CONSTRUCTOR, "data class {0} has a private constructor." + "The use of copy method is not allowed", rendererA = TO_STRING, ) } }