斯卡拉 2.11.0
tupled
当您未在伴侣中提供其他功能时,看起来 scalac 正在预定义该功能
case class BB(a: Int, b: Int)
object BB { }
case class AA(a: Int, b: Int)
object CC { }
case class CC(a: Int, b: Int)
结果如下
public class AA implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(AA);
public static AA apply(int, int);
public static scala.Function1<scala.Tuple2<java.lang.Object, java.lang.Object>, AA> tupled();
public static scala.Function1<java.lang.Object, scala.Function1<java.lang.Object, AA>> curried();
public int a();
public int b();
public AA copy(int, int);
public int copy$default$1();
public int copy$default$2();
public java.lang.String productPrefix();
public int productArity();
public java.lang.Object productElement(int);
public scala.collection.Iterator<java.lang.Object> productIterator();
public boolean canEqual(java.lang.Object);
public int hashCode();
public java.lang.String toString();
public boolean equals(java.lang.Object);
public AA(int, int);
}
public final class AA$ extends scala.runtime.AbstractFunction2<java.lang.Object, java.lang.Object, AA> implements scala.Serializable {
public static final AA$ MODULE$;
public static {};
public final java.lang.String toString();
public AA apply(int, int);
public scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(AA);
public java.lang.Object apply(java.lang.Object, java.lang.Object);
}
public class BB implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(BB);
public static BB apply(int, int);
public int a();
public int b();
public BB copy(int, int);
public int copy$default$1();
public int copy$default$2();
public java.lang.String productPrefix();
public int productArity();
public java.lang.Object productElement(int);
public scala.collection.Iterator<java.lang.Object> productIterator();
public boolean canEqual(java.lang.Object);
public int hashCode();
public java.lang.String toString();
public boolean equals(java.lang.Object);
public BB(int, int);
}
public final class BB$ implements scala.Serializable {
public static final BB$ MODULE$;
public static {};
public BB apply(int, int);
public scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(BB);
}
public class CC implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(CC);
public static CC apply(int, int);
public int a();
public int b();
public CC copy(int, int);
public int copy$default$1();
public int copy$default$2();
public java.lang.String productPrefix();
public int productArity();
public java.lang.Object productElement(int);
public scala.collection.Iterator<java.lang.Object> productIterator();
public boolean canEqual(java.lang.Object);
public int hashCode();
public java.lang.String toString();
public boolean equals(java.lang.Object);
public CC(int, int);
}
public final class CC$ implements scala.Serializable {
public static final CC$ MODULE$;
public static {};
public CC apply(int, int);
public scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(CC);
}