| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The sbt command `generateSources` now generates both the AnyVal
sources and the tuple/function sources (previously done by `genprod`).
Source generation is part of the sbt build, the `scala.tools.cmd.gen`
package is removed from `scala-compiler`. This simplifies bootstrapping.
Generated sources are still in the same location and checked into git.
The shell scripts `tools/codegen` and `tools/codegen-anyvals` are
also removed. The ant build and the build scripts do not call these.
Regenerating sources is a manual step at the moment.
|
|
|
|
|
|
|
|
|
| |
- Replaces the implementations of box/unbox in AnyVal companions by
`???`, the methods are only stubs, and the impls did not correspond
to the actual behavior. The doc comment already points to the actual
implementation in BoxesRunTime.
- Replaces the body of `getClass` from `null` to `???` and clarifies in
a comment why the overrides exist.
|
|
|
|
|
|
|
|
| |
The changes are actually pretty small:
scala.language.implicitConversions is moved around so that it is only
emitted to the source file if there is an actual implicit conversion.
The rest of the diff are mostly the new generated source files
reflecting that change.
|
|
|
|
|
|
| |
- Added @boxRunTimeDoc@ and @unboxRunTimeDoc@ tokens to AnyVals
- Doc comments refer to BoxesRunTime.java in the Scala repo
- No comment for Unit
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These things are killing me. Constructions like
package scala.foo.bar.baz
import foo.Other
DO NOT WORK in general. Such files are not really in the
"scala" package, because it is not declared
package scala
package foo.bar.baz
And there is a second problem: using a relative path name means
compilation will fail in the presence of a directory of the same
name, e.g.
% mkdir reflect
% scalac src/reflect/scala/reflect/internal/util/Position.scala
src/reflect/scala/reflect/internal/util/Position.scala:9: error:
object ClassTag is not a member of package reflect
import reflect.ClassTag
^
src/reflect/scala/reflect/internal/util/Position.scala:10: error:
object base is not a member of package reflect
import reflect.base.Attachments
^
As a rule, do not use relative package paths unless you have
explicitly imported the path to which you think you are relative.
Better yet, don't use them at all. Unfortunately they mostly work
because scala variously thinks everything scala.* is in the scala
package and/or because you usually aren't bootstrapping and it
falls through to an existing version of the class already on the
classpath.
Making the paths explicit is not a complete solution -
in particular, we remain enormously vulnerable to any directory
or package called "scala" which isn't ours - but it greatly
limts the severity of the problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Float.Epsilon and Double.Epsilon contain the wrong value. Epsilon
should be an upper bound on the relative error due to rounding
errors in floating point arithmetic, i.e. it is 1/2 ULP (unit in
the last position) which is 2^(-24) for Float and 2^(-53) for Double.
This was discussed in detail in https://issues.scala-lang.org/browse/SI-3791
and it was decided to deprecate Epsilon for 2.9 and to remove it for 2.10
and to reintroduce it with the correct value for 2.11.
See also the discussion (and comment from Martin) on
https://groups.google.com/forum/?fromgroups#!topic/scala-internals/m763WjBdfyo
|
|
|
|
|
| |
Rather than stub implementations. This saves over 50K of bytecode.
I also added the necessary imports to silence the feature warnings.
|
|\ \
| | |
| | |
| | | |
'refs/pull/392/head'; commit 'refs/pull/397/head' into develop
|
| |/
| |
| |
| | |
Made the primary constructors private to prevent them from appearing in ScalaDoc.
|
|/
|
|
|
| |
Take a 15-implicit load off Predef and put it where it belongs: on
those brave souls who like their longs to get floaty by way of T.
|
|
|
|
|
|
| |
Hacks here and there to allow them to survive at least
to erasure. Since nothing is done with them there yet, they
inevitably crash and burn a little ways beyond that.
|
|
|
|
|
|
| |
Small changes to the API documentation of the AnyVal types. Contributed
by Michael Allman during the September doc spree. No review.
|
|
|
|
|
|
| |
Some great AnyVal class hierarchy documentation from Iain McGinniss. No
Review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A total rewrite of "runtimeClass", discarding the user-space approach in
favor of simply fixing getClass.
def f1 = 5.getClass // Class[Int]
def f2 = (5: AnyVal).getClass // Class[_ <: AnyVal]
def f3 = (5: java.lang.Integer).getClass // Class[_ <: java.lang.Integer]
class A
class B extends A
def f1 = (new B: Any).getClass().newInstance() // Any
def f2 = (new B: AnyRef).getClass().newInstance() // AnyRef
def f3 = (new B: A).getClass().newInstance() // A
def f4 = (new B: B).getClass().newInstance() // B
But that's not all!
def f0[T >: B] = (new B: T).getClass().newInstance()
def f5 = f0[Any] // Any
def f6 = f0[AnyRef] // AnyRef
def f7 = f0[A] // A
def f8 = f0[B] // B
Closes #490, #896, #4696. Review by moors. (Note: I think this is pretty
good, but picky review requested.)
|
|
|
|
|
|
|
| |
Various addenda to soc's patch: regenerating Product/Tuple/Function
classes and AnyVal sources, making versioning consistent, etc. Closes
#4477, no review.
|
|
|
|
|
|
| |
for the patch, as it's a change I've always wanted. Moving up in the
glamorous world of scala commits! No review.
|
|
|
|
|
|
| |
A less ad hoc infrastructure for generating AnyVal sources. A few more
comments on said sources. No review.
|
|
|
|
|
|
|
|
| |
withdraw some of the goodness I banked a while ago with the AnyVal
types. Started on what will culminate in the total elimination of
SourcelessComments. Cleaned up the docs on ancient classes like Product.
More to come. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses the issues swirling around Double.Epsilon and friends which
were battled out in more than one venue and then aptly summarized by
retronym in #3791. Thanks to Simon Ochsenreither for submitting a patch;
I wasn't able to use too much of it because the source code for these
types is generated, but effort is always appreciated. Closes #3791, and
I'm tired and I'd hate to blow this one at this late date: review by
rytz.
|
|
The AnyVal types become source files instead of polite compiler
fictions.
!! You'll need a serious "ant all.clean" now. !!
As of this commit the system is fully bootstrapped and the
synthetic code eliminated: only the source files remain. The
sort-of-AnyVal-companions in scala.runtime.* have all been eliminated
because the actual companions can do everything; deprecated vals in
the scala.runtime package object point to the companions. This left
AnyValCompanion as the only AnyVal related thing in the runtime package:
that made little sense, so I deprecated and moved it as well.
Starr is based on r24066 plus this commit. Closes #4121. Review by rytz,
odersky.
|