diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-11-17 23:41:02 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2015-11-18 03:32:01 +0100 |
commit | 7d76151109db168d025dfc0f6501fa7694e17053 (patch) | |
tree | 2cc70c0eadab25304c03aa2d494097e60bac077a /src/dotty/tools/dotc/core/Types.scala | |
parent | 945334c8affd0dc5067316447e8384f1ea7025ad (diff) | |
download | dotty-7d76151109db168d025dfc0f6501fa7694e17053.tar.gz dotty-7d76151109db168d025dfc0f6501fa7694e17053.tar.bz2 dotty-7d76151109db168d025dfc0f6501fa7694e17053.zip |
Fix ambiguity errors with polymorphic implicits
Previously, `isAsSpecific(alt1, tp1, alt2, tp2)` did not handle
having `tp2` be a polymorphic non-method type like `[A]Foo[A]`.
Also update the documentation of `isAsSpecific` to account for this
change, the new documentation is based on SLS ยง 6.26.3 but
adapted to reflect the code.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 559839db2..db518d959 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2266,6 +2266,11 @@ object Types { protected def computeSignature(implicit ctx: Context) = resultSignature + def isPolymorphicMethodType: Boolean = resType match { + case _: MethodType => true + case _ => false + } + def instantiate(argTypes: List[Type])(implicit ctx: Context): Type = resultType.substParams(this, argTypes) |