diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-05-20 14:57:17 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-05-20 14:57:17 +0200 |
commit | 444cab21b36c244ee85e85c12091fa900500995a (patch) | |
tree | 481b585f84eb30ec9939f68129af17db560f8974 | |
parent | 22dc67b8001f339e11a454c20c2dc48dfcb4aa55 (diff) | |
parent | bed189ec8c373dfd429d424256dfbfcc17ac4221 (diff) | |
download | scala-444cab21b36c244ee85e85c12091fa900500995a.tar.gz scala-444cab21b36c244ee85e85c12091fa900500995a.tar.bz2 scala-444cab21b36c244ee85e85c12091fa900500995a.zip |
Merge pull request #3737 from tvierling/identity-inline
@inline Predef.identity[A].
-rw-r--r-- | src/library/scala/Predef.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index faeb1dcbe2..2be6a9dcc1 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -126,7 +126,7 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef { def optManifest[T](implicit m: OptManifest[T]) = m // Minor variations on identity functions - def identity[A](x: A): A = x // @see `conforms` for the implicit version + @inline def identity[A](x: A): A = x // @see `conforms` for the implicit version @inline def implicitly[T](implicit e: T) = e // for summoning implicit values from the nether world -- TODO: when dependent method types are on by default, give this result type `e.type`, so that inliner has better chance of knowing which method to inline in calls like `implicitly[MatchingStrategy[Option]].zero` @inline def locally[T](x: T): T = x // to communicate intent and avoid unmoored statements |