aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-06 15:37:11 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-06 15:37:11 +0100
commit2948c91f06eacc1c1904576275b31d2872702917 (patch)
tree82e6328535100ea18274faf9328e4d12ab140529 /src/dotty/tools/dotc/core/Types.scala
parentd495cf9a0c24fb6ea63acb3e20f35b634814f1aa (diff)
downloaddotty-2948c91f06eacc1c1904576275b31d2872702917.tar.gz
dotty-2948c91f06eacc1c1904576275b31d2872702917.tar.bz2
dotty-2948c91f06eacc1c1904576275b31d2872702917.zip
Change to overloading behavior
Nullary methods are always as specific as non-nullary ones. Needed so that foo() takes precdennce over foo(x: T)
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index d281af733..930922b5b 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1451,9 +1451,11 @@ object Types {
}
}
+ trait MethodOrPoly extends SignedType
+
abstract case class MethodType(paramNames: List[TermName], paramTypes: List[Type])
(resultTypeExp: MethodType => Type)
- extends CachedGroundType with BindingType with TermType with SignedType { thisMethodType =>
+ extends CachedGroundType with BindingType with TermType with MethodOrPoly { thisMethodType =>
override val resultType = resultTypeExp(this)
assert(resultType != NoType, this)
@@ -1584,7 +1586,7 @@ object Types {
}
case class PolyType(paramNames: List[TypeName])(paramBoundsExp: PolyType => List[TypeBounds], resultTypeExp: PolyType => Type)
- extends UncachedGroundType with BindingType with TermType with SignedType {
+ extends UncachedGroundType with BindingType with TermType with MethodOrPoly {
val paramBounds = paramBoundsExp(this)
override val resultType = resultTypeExp(this)