File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
ir/shared/src/main/scala/org/scalajs/ir Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ object Types {
258
258
sealed abstract class NonArrayTypeRef extends TypeRef
259
259
260
260
/** Primitive type reference. */
261
- final case class PrimRef private [Types ] (tpe : PrimTypeWithRef )(
261
+ final class PrimRef private [Types ] (val tpe : PrimTypeWithRef )(
262
262
charCodeInit : Char , displayNameInit : String ) // "Init" variants so we can have good Scaladoc on the val's
263
263
extends NonArrayTypeRef {
264
264
@@ -284,16 +284,11 @@ object Types {
284
284
* respectively.
285
285
*/
286
286
val charCode : Char = charCodeInit
287
-
288
- // Make sure the `case class` does not produce a public copy method
289
- private def copy (tpe : PrimTypeWithRef )(charCodeInit : Char , displayNameInit : String ): PrimRef =
290
- throw new Error (" dead code" )
291
287
}
292
288
293
289
object PrimRef {
294
- // Make sure the `case class` does not produce a public apply method
295
- private def apply (tpe : PrimTypeWithRef )(charCodeInit : Char , displayNameInit : String ): PrimRef =
296
- throw new Error (" dead code" )
290
+ def unapply (typeRef : PrimRef ): Some [PrimTypeWithRef ] =
291
+ Some (typeRef.tpe)
297
292
}
298
293
299
294
final val VoidRef = VoidType .primRef
Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ object BinaryIncompatibilities {
16
16
ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types.BoxedClassToPrimType" ),
17
17
ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types.PrimTypeToBoxedClass" ),
18
18
19
+ // !!! Breaking, PrimRef is not a case class anymore
20
+ ProblemFilters .exclude[MissingTypesProblem ](" org.scalajs.ir.Types$PrimRef" ),
21
+ ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.canEqual" ),
22
+ ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.productArity" ),
23
+ ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.productElement" ),
24
+ ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.productIterator" ),
25
+ ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.productPrefix" ),
26
+ ProblemFilters .exclude[IncompatibleResultTypeProblem ](" org.scalajs.ir.Types#PrimRef.unapply" ),
27
+
19
28
// !!! Breaking I guess ... we used to leak public things out of a `case class` with a private[ir] constructor
20
29
ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.this" ),
21
30
ProblemFilters .exclude[DirectMissingMethodProblem ](" org.scalajs.ir.Types#PrimRef.apply" ),
You can’t perform that action at this time.
0 commit comments