diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-06 15:37:11 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-06 15:37:11 +0100 |
commit | 2948c91f06eacc1c1904576275b31d2872702917 (patch) | |
tree | 82e6328535100ea18274faf9328e4d12ab140529 /src/dotty/tools/dotc/core | |
parent | d495cf9a0c24fb6ea63acb3e20f35b634814f1aa (diff) | |
download | dotty-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')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
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) |