aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-08-17 14:34:20 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-08-17 15:37:14 -0700
commitb31d59985737d54c912c988ce26175ccaae80606 (patch)
tree7719186e433d37620ef8c92ab70613cf68e1a844 /src
parent5f598e8094c1dba3c6cf302383088f4f00626222 (diff)
downloaddotty-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.scala2
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`).