diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-02-17 15:18:20 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-02-17 15:19:19 +1000 |
commit | 5a89475526fc91f677d7002b6063bef9e549f0cc (patch) | |
tree | 7b876a8379c0e1199b227cd849f7bc778c444dc2 /src | |
parent | da49d9a00ec373a0e7f2ffe946a897a65c9b0741 (diff) | |
download | scala-5a89475526fc91f677d7002b6063bef9e549f0cc.tar.gz scala-5a89475526fc91f677d7002b6063bef9e549f0cc.tar.bz2 scala-5a89475526fc91f677d7002b6063bef9e549f0cc.zip |
Cache name for dummy argument used in implicit search
This avoids a minor inefficiency of interning the name on
each implicit candidate. Instead, we follow the usual practice
and use a pre-baked name from `StdNames`.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/StdNames.scala | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 71558273a6..0861d58240 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -609,7 +609,7 @@ trait Implicits { val itree2 = if (!isView) fallback else pt match { case Function1(arg1, arg2) => typed1( - atPos(itree0.pos)(Apply(itree1, List(Ident("<argument>") setType approximate(arg1)))), + atPos(itree0.pos)(Apply(itree1, List(Ident(nme.argument) setType approximate(arg1)))), EXPRmode, approximate(arg2) ) match { diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala index f32b7326fe..c0562b0679 100644 --- a/src/reflect/scala/reflect/internal/StdNames.scala +++ b/src/reflect/scala/reflect/internal/StdNames.scala @@ -1078,6 +1078,7 @@ trait StdNames { val reflPolyCacheName: NameType = "reflPoly$Cache" val reflParamsCacheName: NameType = "reflParams$Cache" val reflMethodName: NameType = "reflMethod$Method" + val argument: NameType = "<argument>" } |