From 4a2e8eecc742207236d7b0d95bafc168388f186d Mon Sep 17 00:00:00 2001
From: Etienne Kneuss <ekneuss@gmail.com>
Date: Fri, 22 Jan 2016 00:52:26 +0100
Subject: [PATCH] Fix bug with passes filtering too many cases:

((), Nil()) passes {
  case () => Cons(0, Nil())
}

was true(!) because Nil </: Cons and Cons </: Nil which caused the case
to filtered out silently.
---
 src/main/scala/leon/purescala/Constructors.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/scala/leon/purescala/Constructors.scala b/src/main/scala/leon/purescala/Constructors.scala
index f0b2a975b..a5ef87e1d 100644
--- a/src/main/scala/leon/purescala/Constructors.scala
+++ b/src/main/scala/leon/purescala/Constructors.scala
@@ -145,7 +145,7 @@ object Constructors {
 
     resType match {
       case Some(tpe) =>
-        casesFiltered.filter(c => isSubtypeOf(c.rhs.getType, tpe) || isSubtypeOf(tpe, c.rhs.getType))
+        casesFiltered.filter(c => typesCompatible(c.rhs.getType, tpe))
       case None =>
         casesFiltered
     }
-- 
GitLab