Skip to content

Conversation

@eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Nov 6, 2018

This is a spinoff from #6490.

This is a spinoff from scala#6490.
@eed3si9n
Copy link
Member Author

eed3si9n commented Nov 6, 2018

https://scala-ci.typesafe.com/job/scala-2.13.x-validate-main/5426/console

[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/Function1.scala:37:104: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error] trait Function1[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends AnyRef { self =>
[error]                                                                                                        ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/Function2.scala:34:146: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error] trait Function2[@specialized(scala.Int, scala.Long, scala.Double) -T1, @specialized(scala.Int, scala.Long, scala.Double) -T2, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends AnyRef { self =>
[error]                                                                                                                                                  ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/Specializable.scala:27:92: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   final val Primitives  = new Group((Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit))
[error]                                                                                            ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/Specializable.scala:28:92: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   final val Everything  = new Group((Byte, Short, Int, Long, Char, Float, Double, Boolean, Unit, AnyRef))
[error]                                                                                            ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/Specializable.scala:32:60: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   final val BestOfBreed = new Group((Int, Double, Boolean, Unit, AnyRef))
[error]                                                            ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/ArrayOps.scala:121:112: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   private final class ArrayIterator[@specialized(AnyRef, Int, Double, Long, Float, Char, Byte, Short, Boolean, Unit) A](xs: Array[A]) extends AbstractIterator[A] {
[error]                                                                                                                ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/ArrayOps.scala:136:114: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   private final class ReverseIterator[@specialized(AnyRef, Int, Double, Long, Float, Char, Byte, Short, Boolean, Unit) A](xs: Array[A]) extends AbstractIterator[A] {
[error]                                                                                                                  ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/ArrayOps.scala:669:86: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]     def f[@specialized(AnyRef, Int, Double, Long, Float, Char, Byte, Short, Boolean, Unit) T](xs: Array[T], op: (Any, Any) => Any, z: Any): Any = {
[error]                                                                                      ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/ArrayOps.scala:775:86: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]     def f[@specialized(AnyRef, Int, Double, Long, Float, Char, Byte, Short, Boolean, Unit) T](xs: Array[T], op: (Any, Any) => Any, z: Any): Any = {
[error]                                                                                      ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/ArrayOps.scala:810:86: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]     def f[@specialized(AnyRef, Int, Double, Long, Float, Char, Byte, Short, Boolean, Unit) T](xs: Array[T], op: (Any, Any) => Any, z: Any): Any = {
[error]                                                                                      ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/immutable/NumericRange.scala:94:37: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   override def foreach[@specialized(Unit) U](f: T => U): Unit = {
[error]                                     ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/collection/immutable/Range.scala:174:57: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error]   /*@`inline`*/ final override def foreach[@specialized(Unit) U](f: Int => U): Unit = {
[error]                                                         ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/runtime/AbstractFunction1.scala:17:121: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error] abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function1[T1, R] {
[error]                                                                                                                         ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/runtime/AbstractFunction2.scala:17:163: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error] abstract class AbstractFunction2[@specialized(scala.Int, scala.Long, scala.Double) -T1, @specialized(scala.Int, scala.Long, scala.Double) -T2, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function2[T1, T2, R] {
[error]                                                                                                                                                                   ^
[error] /home/jenkins/workspace/scala-2.13.x-validate-main/src/library/scala/runtime/AbstractPartialFunction.scala:30:127: `Unit` companion object is not allowed in source; instead, use `()` for the unit value
[error] abstract class AbstractPartialFunction[@specialized(scala.Int, scala.Long, scala.Float, scala.Double) -T1, @specialized(scala.Unit, scala.Boolean, scala.Int, scala.Float, scala.Long, scala.Double) +R] extends Function1[T1, R] with PartialFunction[T1, R] { self =>
[error]                                                                                                                               ^

@eed3si9n
Copy link
Member Author

eed3si9n commented Nov 6, 2018

I guess this is how you get sucked into specialized.

@som-snytt
Copy link
Contributor

I seem to remember someone objecting to special-casing specialized, but IIRC I finally decided there's no way around it, because the mechanics of specialized.

@SethTisue SethTisue added the WIP label Dec 4, 2018
@som-snytt
Copy link
Contributor

som-snytt commented Dec 23, 2018

There is no suckiness at #7567. The trick was to notice that the value references in Specializable were unnecessary, as only the types matter.

The new PR uses the user-facing message introduced here, thanks.

@som-snytt som-snytt closed this Dec 23, 2018
@SethTisue SethTisue removed this from the 2.13.0-RC1 milestone Jan 3, 2019
@eed3si9n eed3si9n deleted the wip/unit-companion branch February 10, 2019 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants