aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-27 22:10:45 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-28 11:43:43 +0200
commit0c582b883971fd89476244aa6905be95da7e79d0 (patch)
tree079efc09d1e5b53b1e258b565dbb15c8b14954f7 /src/dotty/tools/dotc/core/Types.scala
parentfcb68309c2760a6797b0a9ec23722808060e9aa1 (diff)
downloaddotty-0c582b883971fd89476244aa6905be95da7e79d0.tar.gz
dotty-0c582b883971fd89476244aa6905be95da7e79d0.tar.bz2
dotty-0c582b883971fd89476244aa6905be95da7e79d0.zip
Several bug fixes to typer and classfile reader.
In particular, changed internal representation of Java constructors and changed treatment of parent constructors in templates.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index ee76f0dc7..59ac01819 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -214,6 +214,15 @@ object Types {
case _ => NoSymbol
}
+ /** The type symbol associated with the type, skipping alises */
+ final def dealiasedTypeSymbol(implicit ctx: Context): Symbol = this match {
+ case tp: TermRef => NoSymbol
+ case tp: ClassInfo => tp.cls
+ case ThisType(cls) => cls
+ case tp: TypeProxy => tp.underlying.dealiasedTypeSymbol
+ case _ => NoSymbol
+ }
+
/** The least class or trait of which this type is a subtype, or
* NoSymbol if none exists (either because this type is not a
* value type, or because superclasses are ambiguous).