Manu Chadha
Manu Chadha

Reputation: 16723

implementation of product method of List

I want to see the implementation of 'product' method in class List in Scala. I checked in the following file but cannot see it.

https://github.com/scala/scala/blob/2.11.x/src/library/scala/collection/immutable/List.scala

The version of Scala I am running is 2.11.8 so I must be at the correct branch.

Where can I see how 'product' method is implemented?

Upvotes: 0

Views: 75

Answers (2)

Jasper-M
Jasper-M

Reputation: 15086

If you look at the scaladoc and open the documentation of product, you can see that is says "Definition Classes". There you can see that it is defined by GenTraversableOnce and implemented by TraversableOnce. If you click through to the scaladoc of TraversableOnce, you find a link straight to the correct source file ("Source", under the summary of the class).

Upvotes: 0

Luka Jacobowitz
Luka Jacobowitz

Reputation: 23512

It's defined in TraversableOnce and then List inherits it.

You can check the source here.

Upvotes: 2

Related Questions