As discussed in
SI-6710 and on scala-lang , the "box" and "unbox" methods of AnyVal classes (except Unit) are not actually implemented by the code in AnyVal .
Instead, the real implementation comes from BoxesRunTime (e.g. ). This is functionally different, creating potential for confusion.
As per the scala-lang discussion and
SI-6710, changing the AnyVal code itself would have too much potential impact and thus be too risky. Documenting the behaviour would be a safer option.
From Paul Phillips' comment:
"If we're not using it in generated code and don't intend to, the ideal change is probably to deprecate it and then remove it. Next best (and to do regardless) is to document the behavior and the fact that it isn't actually used by the compiler." 
Source code of AnyVal classes and screenshots of documentation after
ant all.clean ant build ./tools/codegen-anyvals ANT_OPTS="-Xms512M -Xmx1024M -Xss1M -XX:MaxPermSize=128M" ant docs