diff options
author | Haoyi Li <haoyi@haoyi-mbp.corp.dropbox.com> | 2014-11-26 00:45:31 -0800 |
---|---|---|
committer | Haoyi Li <haoyi@haoyi-mbp.corp.dropbox.com> | 2014-11-26 00:45:31 -0800 |
commit | 2c4b142503bd2d871e6818b5cab8c38627d9e4a0 (patch) | |
tree | 6ba33d2980a1a7a1286100202a695c6631bd240e /library-aux/src/main/scala/scala/runtime/BoxedUnit.scala | |
download | hands-on-scala-js-2c4b142503bd2d871e6818b5cab8c38627d9e4a0.tar.gz hands-on-scala-js-2c4b142503bd2d871e6818b5cab8c38627d9e4a0.tar.bz2 hands-on-scala-js-2c4b142503bd2d871e6818b5cab8c38627d9e4a0.zip |
Squashed 'examples/scala-js/' content from commit 47311ba
git-subtree-dir: examples/scala-js
git-subtree-split: 47311ba693f949f204f27ea9475bb63425fbd4f3
Diffstat (limited to 'library-aux/src/main/scala/scala/runtime/BoxedUnit.scala')
-rw-r--r-- | library-aux/src/main/scala/scala/runtime/BoxedUnit.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala b/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala new file mode 100644 index 0000000..b6ac773 --- /dev/null +++ b/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala @@ -0,0 +1,18 @@ +package scala.runtime + +/* This is a hijacked class. Its only instance is the value 'undefined'. + * Constructors are not emitted. + */ +class BoxedUnit private { + @inline override def equals(that: Any): Boolean = + this eq that.asInstanceOf[AnyRef] + + @inline override def hashCode(): Int = 0 + + @inline override def toString(): String = "undefined" +} + +object BoxedUnit { + val UNIT: BoxedUnit = sys.error("stub") + val TYPE: Class[Void] = sys.error("stub") +} |