diff options
author | Martin Odersky <odersky@gmail.com> | 2015-12-06 12:44:00 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-12-06 16:17:44 +0100 |
commit | f6d1153e193045ad4d8a1564e3c0cdb49b853a5b (patch) | |
tree | a013e385dc95774a843aa384cd8cdf81f31857b9 /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 50d265299ab99ace68e3813794559de2bbcdc91c (diff) | |
download | dotty-f6d1153e193045ad4d8a1564e3c0cdb49b853a5b.tar.gz dotty-f6d1153e193045ad4d8a1564e3c0cdb49b853a5b.tar.bz2 dotty-f6d1153e193045ad4d8a1564e3c0cdb49b853a5b.zip |
Avoid false positives when extracting AppliedType
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index db7550402..ab15b3e1a 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -133,7 +133,13 @@ object TypeApplications { def unapply(tp: Type)(implicit ctx: Context): Option[(Type, List[Type])] = tp match { case TypeRef(prefix, tpnme.hkApply) => unapp(prefix) - case _ => unapp(tp) + case _ => + unapp(tp) match { + case Some((tycon: TypeRef, _)) if tycon.symbol.isLambdaTrait => + // We are seeing part of a lambda abstraction, not an applied type + None + case x => x + } } private def unapp(tp: Type)(implicit ctx: Context): Option[(Type, List[Type])] = tp match { |