diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-06 08:44:28 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-06 08:44:28 +0000 |
commit | 0b5c9ca6535b38dbfc958d92cfce691aa6de205f (patch) | |
tree | 62a33b75a98c1eb594696ae46fa3c50d2a006107 /src/compiler/scala/tools/nsc/typechecker | |
parent | c875dc635b82bd7541918cb4248cc79d818d4fc8 (diff) | |
download | scala-0b5c9ca6535b38dbfc958d92cfce691aa6de205f.tar.gz scala-0b5c9ca6535b38dbfc958d92cfce691aa6de205f.tar.bz2 scala-0b5c9ca6535b38dbfc958d92cfce691aa6de205f.zip |
I took the following comments at their word:
// Cannot be created directly; one should always use `singleType'
// for creation. Cannot be created directly; one should always use
// `refinedType' for creation. Cannot be created directly; one should
// always use `typeRef' for creation. (@M: Otherwise hashing breaks)
This involved altering about 15 locations. If there was a rhyme or a
reason as to why those particular places were entitled to ignore the
"always" dictate, I trust it will emerge from some corner now. Until
then, it's nice to see some code following its official marching orders.
Review by odersky.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index e0155e6c9a..4fc248b574 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -750,7 +750,7 @@ self: Analyzer => companion.moduleClass match { case mc: ModuleClassSymbol => buf += (mc.implicitMembers map (im => - new ImplicitInfo(im.name, SingleType(pre, companion), im))) + new ImplicitInfo(im.name, singleType(pre, companion), im))) case _ => } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index b245c257fd..5aabe7a72e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -27,7 +27,7 @@ trait Namers { self: Analyzer => case TypeRef(pre, sym, args) if (sym.isTypeSkolem && (tparams contains sym.deSkolemize)) => // println("DESKOLEMIZING "+sym+" in "+sym.owner) - mapOver(TypeRef(NoPrefix, sym.deSkolemize, args)) + mapOver(typeRef(NoPrefix, sym.deSkolemize, args)) /* case PolyType(tparams1, restpe) => new DeSkolemizeMap(tparams1 ::: tparams).mapOver(tp) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 252d089ab8..7ef219bb23 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3145,7 +3145,7 @@ trait Typers extends Modes { } def typedEta(expr1: Tree): Tree = expr1.tpe match { - case TypeRef(_, sym, _) if (sym == ByNameParamClass) => + case TypeRef(_, ByNameParamClass, _) => val expr2 = Function(List(), expr1) setPos expr1.pos new ChangeOwnerTraverser(context.owner, expr2.symbol).traverse(expr2) typed1(expr2, mode, pt) |