aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-14 17:32:16 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-14 17:32:16 +0100
commit01db9a68e5e68f08c8236c23c905009789d51587 (patch)
tree3e45103b0d36505d6f86f3024e56780e840c156b /src/dotty/tools/dotc/core/SymDenotations.scala
parentd65587ae74cfe2dc7601f57e163b7e22bf89582a (diff)
downloaddotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.gz
dotty-01db9a68e5e68f08c8236c23c905009789d51587.tar.bz2
dotty-01db9a68e5e68f08c8236c23c905009789d51587.zip
Fixed several deep problems in handling of types and symbols.
1. We forgot to mark declaration symbols Deferred. 2. Types with NoPrefix and the same name got identified. Fixed by adding a new category WithNoPrefix to named types, and changing the way named types get generated. 3. Self types lacked parameters. (Question: Do we need to also track type members?) 4. Printers caused cyclic reference errors. Now some print operations are more careful with forcing. 5. Namedparts accumulator has to be more careful with ThisTypes. Because self types now contain parameters, which might lead back to this, we only add the class name (or the source module, if it's a module class). 6. toBounds in TypeApplications needs to use Co/Contra aliases for expanded name parameters, not just local ones.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 3c6a32707..ccf4f83e7 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -117,6 +117,12 @@ object SymDenotations {
case _ => myInfo
}
+ /** Optionally, the info if it is completed */
+ final def unforcedInfo: Option[Type] = myInfo match {
+ case myInfo: LazyType => None
+ case _ => Some(myInfo)
+ }
+
private def completeFrom(completer: LazyType): Unit = {
if (myFlags is Touched) throw new CyclicReference(this)
myFlags |= Touched
@@ -646,17 +652,17 @@ object SymDenotations {
/** The TypeRef representing this type denotation at its original location. */
def typeRef(implicit ctx: Context): TypeRef =
- TypeRef(owner.thisType, name.asTypeName).withDenot(this)
+ TypeRef(owner.thisType, name.asTypeName, this)
/** The TermRef representing this term denotation at its original location. */
def termRef(implicit ctx: Context): TermRef =
- TermRef(owner.thisType, name.asTermName).withDenot(this)
+ TermRef(owner.thisType, name.asTermName, this)
/** The TermRef representing this term denotation at its original location
* and at signature `NotAMethod`.
*/
def valRef(implicit ctx: Context): TermRef =
- TermRef.withSig(owner.thisType, name.asTermName, Signature.NotAMethod).withDenot(this)
+ TermRef.withSig(owner.thisType, name.asTermName, Signature.NotAMethod, this)
/** The TermRef representing this term denotation at its original location
* at the denotation's signature.
@@ -664,7 +670,7 @@ object SymDenotations {
* denotation via a call to `info`.
*/
def termRefWithSig(implicit ctx: Context): TermRef =
- TermRef.withSig(owner.thisType, name.asTermName, signature).withDenot(this)
+ TermRef.withSig(owner.thisType, name.asTermName, signature, this)
/** The NamedType representing this denotation at its original location.
* Same as either `typeRef` or `termRefWithSig` depending whether this denotes a type or not.