I understand in Scala that Int is implicitly converted to RichInt. Where in the source does that occur (I was browsing the Scala source, but I couldn’t find it…)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look at
Predef.intWrapper(Int): RichIntThis is inherited by
PredeffromLowPriorityImplicits. Inherited implicits have lower priorities than non inherited ones.Note that by browsing library source you don’t really get to see the conversion. The best way to see it on small snippet is to compile it (or run it in the REPL) with the
-Xprint:typeroption. This will show the conversion that is inserted by the typer to make the code compile when the types don’t match: