summaryrefslogtreecommitdiff
path: root/src/library/scala/Unit.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-6710 / PR 5072 follow-up: fix Unit.box / Unit.unboxLukas Rytz2016-04-201-2/+2
| | | | | | | The backend replaces .box / .unbox methods by corresponding invocations to BoxesRunTime, but not for Unit. This commit restores the body of `Unit.box` and `Unit.unbox`.
* Generate AnyVal source stubs from sbtStefan Zeiger2016-04-061-2/+2
| | | | | | | | | | | | 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.
* SI-6710 Clarify stub methods in primitive value classesLukas Rytz2016-04-011-3/+4
| | | | | | | | | - 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.
* SI-7624 Fix -Xlint warnings in AnyVal-related codeSimon Ochsenreither2013-08-151-5/+4
| | | | | | | | 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.
* Reverting changes to AnyVals generated classes in 9a82fc0Andrew Phillips2013-04-221-0/+3
| | | | - Since the generator was not changed, the classes no longer represent the generated versions
* Remove unused symbols and imports from the library.Eugene Vigdorchik2013-03-051-3/+0
|
* Updated copyright to 2013Carlo Dapor2013-01-021-1/+1
|
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Generate abstract methods in scala.Byte and friends.Paul Phillips2012-06-061-3/+5
| | | | | Rather than stub implementations. This saves over 50K of bytecode. I also added the necessary imports to silence the feature warnings.
* Improved formatting/display of documentation.Simon Ochsenreither2012-04-131-2/+2
| | | | Made the primary constructors private to prevent them from appearing in ScalaDoc.
* Unsealed AnyVal.Paul Phillips2012-01-281-1/+1
| | | | | | 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.
* updated man pages, fixed svn props, did some cl...michelou2011-09-251-0/+0
| | | | | updated man pages, fixed svn props, did some cleanup
* Small changes to the API documentation of the A...Heather Miller2011-09-181-3/+4
| | | | | | 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...Josh Suereth2011-09-021-3/+3
| | | | | | Some great AnyVal class hierarchy documentation from Iain McGinniss. No Review.
* A total rewrite of "runtimeClass", discarding t...Paul Phillips2011-06-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* A less ad hoc infrastructure for generating Any...Paul Phillips2011-04-011-4/+23
| | | | | | A less ad hoc infrastructure for generating AnyVal sources. A few more comments on said sources. No review.
* Working on the documentation of core classes.Paul Phillips2011-04-011-3/+5
| | | | | | | | 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.Eps...Paul Phillips2011-03-151-1/+1
| | | | | | | | | | | 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...Paul Phillips2011-01-241-0/+23
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.