From a0a045f5c0b5aa6ed02c849c4ab013cfbfd4e24f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 7 Nov 2011 18:22:42 +0000 Subject: Dropped about 1.5 Mb off scala-library.jar. This commit and the two subsequent commits were contributed by: Todd Vierling . I combined some commits and mangled his commit messages, but all the credit is his. This pursues the same approach to classfile reduction seen in r19989 when AbstractFunctionN was introduced, but applies it to the collections. Thanks to -Xlint it's easy to verify that the private types don't escape. Design considerations as articulated by Todd: * Don't necessarily create concrete types for _everything_. Where a subtrait only provides a few additional methods, don't bother; instead, use the supertrait's concrete class and retain the "with". For example, "extends AbstractSeq[A] with LinearSeq[A]". * Examine all classes with .class file size greater than 10k. Named classes and class names ending in $$anon$ are candidates for analysis. * If a return type is currently inferred where an anon subclass would be returned, make the return type explicit. Don't allow the library-private abstract classes to leak into the public namespace [and scaladoc]. --- src/library/scala/collection/immutable/List.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/library/scala/collection/immutable/List.scala') diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index fb7808bc41..d5e5f2aee0 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -74,7 +74,8 @@ import annotation.tailrec * @define mayNotTerminateInf * @define willNotTerminateInf */ -sealed abstract class List[+A] extends LinearSeq[A] +sealed abstract class List[+A] extends AbstractSeq[A] + with LinearSeq[A] with Product with GenericTraversableTemplate[A, List] with LinearSeqOptimized[A, List[A]] { -- cgit v1.2.3