diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2013-01-29 13:46:56 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2013-02-03 21:08:34 +0100 |
commit | b74c33eb860622e3630949ee0eeac9c15e8df166 (patch) | |
tree | c5f80cbe5d5a552bd1bb8efeb6f3b8b1499b0e2e /src/reflect | |
parent | a06d31f6a2df021acc18b10ad9cad0f80d7498f2 (diff) | |
download | scala-b74c33eb860622e3630949ee0eeac9c15e8df166.tar.gz scala-b74c33eb860622e3630949ee0eeac9c15e8df166.tar.bz2 scala-b74c33eb860622e3630949ee0eeac9c15e8df166.zip |
SI-1803, plus documentation and cleanups in Namers, mainly in typeSig
- when typing (and naming) a ValDef, tpt and rhs are now type checked
in the same context (the inner / ValDef context). this does not change
any behavior, but is more uniform (same as for DefDef). martin told me
(offline) that this change is desirable if it doesn't break anything.
(it doesn't).
- typeSig is now more uniform with a separate method for each case
(methodSig, valDefSig, etc). methodSig was cleaned up (no more variables)
and documented. the type returned by methodSig no longer contains /
refers to type skolems, but to the actual type parameters (so we don't
need to replace the skolems lateron).
- documentation on constructor contexts, type skolems
- more tests for SI-5543
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala | 15 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 4 |
2 files changed, 4 insertions, 15 deletions
diff --git a/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala b/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala index 59c027868e..8b24678fd6 100644 --- a/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala +++ b/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala @@ -32,19 +32,4 @@ trait ExistentialsAndSkolems { } (new Deskolemizer).typeSkolems } - - /** Convert to corresponding type parameters all skolems of method - * parameters which appear in `tparams`. - */ - def deskolemizeTypeParams(tparams: List[Symbol])(tp: Type): Type = { - class DeSkolemizeMap extends TypeMap { - def apply(tp: Type): Type = tp match { - case TypeRef(pre, sym, args) if sym.isTypeSkolem && (tparams contains sym.deSkolemize) => - mapOver(typeRef(NoPrefix, sym.deSkolemize, args)) - case _ => - mapOver(tp) - } - } - new DeSkolemizeMap mapOver tp - } } diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 1dec11548f..5be479add0 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -1188,6 +1188,10 @@ trait Symbols extends api.Symbols { self: SymbolTable => * to generate a type of kind * * for a term symbol, its usual type. * See the tpe/tpeHK overrides in TypeSymbol for more. + * + * For type symbols, `tpe` is different than `info`. `tpe` returns a typeRef + * to the type symbol, `info` returns the type information of the type symbol, + * e.g. a ClassInfoType for classes or a TypeBounds for abstract types. */ def tpe: Type = info def tpeHK: Type = tpe |