aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-27 14:17:12 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-27 14:17:12 +0100
commitf8c9dc95929655a198066652cd12109329836198 (patch)
tree32f8c29e89ad426b7c0d6947cdda44878dc414fe /src/dotty/tools/dotc/core/Types.scala
parentf0b4fc58e0c5e5372c23bd817954ed3aa82b2102 (diff)
downloaddotty-f8c9dc95929655a198066652cd12109329836198.tar.gz
dotty-f8c9dc95929655a198066652cd12109329836198.tar.bz2
dotty-f8c9dc95929655a198066652cd12109329836198.zip
Changed Signatures
Signatures have a different meaning before and after erasure. After erasure, the result type counts also whereas before it doesn't. The new definitions refelect this behavior.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 9c849bfdf..fb430f336 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -487,7 +487,7 @@ object Types {
* poly types.
*/
def matches(that: Type)(implicit ctx: Context): Boolean =
- if (Config.newMatch) this.signature == that.signature
+ if (Config.newMatch) this.signature matches that.signature
else track("matches") {
ctx.typeComparer.matchesType(
this, that, alwaysMatchSimple = !ctx.phase.erasedTypes)
@@ -798,7 +798,7 @@ object Types {
* pattern is that method signatures use caching, so encapsulation
* is improved using an OO scheme).
*/
- def signature(implicit ctx: Context): Signature = NotAMethod
+ def signature(implicit ctx: Context): Signature = Signature.NotAMethod
/** Convert to text */
def toText(printer: Printer): Text = printer.toText(this)
@@ -1406,11 +1406,11 @@ object Types {
override def signature(implicit ctx: Context): Signature = {
def computeSignature: Signature = {
- val followSig = resultType match {
+ val followSig: Signature = resultType match {
case rtp: MethodType => rtp.signature
- case _ => Nil
+ case tp => Signature(tp)
}
- (paramTypes map Erasure.paramSignature) ++ followSig
+ paramTypes ++: followSig
}
if (ctx.runId != mySignatureRunId) {
mySignature = computeSignature
@@ -1499,7 +1499,7 @@ object Types {
abstract case class ExprType(override val resultType: Type)
extends CachedProxyType with TermType {
override def underlying(implicit ctx: Context): Type = resultType
- override def signature(implicit ctx: Context): Signature = Nil
+ override def signature(implicit ctx: Context): Signature = Signature(resultType) // todo: cache?
def derivedExprType(resultType: Type)(implicit ctx: Context) =
if (resultType eq this.resultType) this else ExprType(resultType)
override def computeHash = doHash(resultType)