diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-17 14:34:20 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-08-17 15:37:14 -0700 |
commit | b31d59985737d54c912c988ce26175ccaae80606 (patch) | |
tree | 7719186e433d37620ef8c92ab70613cf68e1a844 /src | |
parent | 5f598e8094c1dba3c6cf302383088f4f00626222 (diff) | |
download | dotty-b31d59985737d54c912c988ce26175ccaae80606.tar.gz dotty-b31d59985737d54c912c988ce26175ccaae80606.tar.bz2 dotty-b31d59985737d54c912c988ce26175ccaae80606.zip |
Harden copmpareHkApply for ill-typed programs
Turn assertion into test. Without this, neg/tcpoly_overloaded.scala fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeComparer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 091999412..0757c8187 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -580,7 +580,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { */ def compareHkApply2(tp1: Type, tp2: HKApply, tycon2: Type, args2: List[Type]): Boolean = { val tparams = tycon2.typeParams - assert(tparams.nonEmpty) + if (tparams.isEmpty) return false // can happen for ill-typed programs, e.g. neg/tcpoly_overloaded.scala /** True if `tp1` and `tp2` have compatible type constructors and their * corresponding arguments are subtypes relative to their variance (see `isSubArgs`). |