diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-19 15:35:36 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-19 17:38:42 -0800 |
commit | e512518d25818b4b0381e4a078137734f8eab12f (patch) | |
tree | 8f6c4a4acc08e520d7a58e9e3809c6fa202004e0 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 63d9ae6dc4fccc97a35819d69c379073e6342bc1 (diff) | |
download | scala-e512518d25818b4b0381e4a078137734f8eab12f.tar.gz scala-e512518d25818b4b0381e4a078137734f8eab12f.tar.bz2 scala-e512518d25818b4b0381e4a078137734f8eab12f.zip |
Streamlining skolemization, specialization.
Skolemization code doesn't belong in Typers. I carved
out a little place for it. Also simplifications in
specialization.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 51542ec757..3347d2e767 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1299,7 +1299,7 @@ trait Namers extends MethodSynthesis { catch typeErrorHandler(tree, ErrorType) result match { - case PolyType(tparams @ (tp :: _), _) if tp.owner.isTerm => typer.deskolemizeTypeParams(tparams)(result) + case PolyType(tparams @ (tp :: _), _) if tp.owner.isTerm => deskolemizeTypeParams(tparams)(result) case _ => result } } @@ -1439,8 +1439,11 @@ trait Namers extends MethodSynthesis { private val ownerSym = owner.symbol override val typeParams = tparams map (_.symbol) //@M override val tree = restp.tree - if (ownerSym.isTerm) - typer skolemizeTypeParams tparams + + if (ownerSym.isTerm) { + val skolems = deriveFreshSkolems(tparams map (_.symbol)) + map2(tparams, skolems)(_ setSymbol _) + } def completeImpl(sym: Symbol) = { // @M an abstract type's type parameters are entered. |