From 83d14f6c8072d7cdf8305737065dfdafe056e6ab Mon Sep 17 00:00:00 2001
From: Nicolas Voirol <voirol.nicolas@gmail.com>
Date: Tue, 3 May 2016 15:07:04 +0200
Subject: [PATCH] bestRealType in normalizeStructure

---
 src/main/scala/leon/purescala/ExprOps.scala | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main/scala/leon/purescala/ExprOps.scala b/src/main/scala/leon/purescala/ExprOps.scala
index caf54fbb9..2f63ac23b 100644
--- a/src/main/scala/leon/purescala/ExprOps.scala
+++ b/src/main/scala/leon/purescala/ExprOps.scala
@@ -295,13 +295,14 @@ object ExprOps extends GenTreeOps[Expr] {
       var remainingIds: Map[TypeTree, List[Identifier]] = typedIds.toMap
 
       def getId(e: Expr): Identifier = {
-        val newId = remainingIds.get(e.getType) match {
+        val tpe = TypeOps.bestRealType(e.getType)
+        val newId = remainingIds.get(tpe) match {
           case Some(x :: xs) =>
-            remainingIds += e.getType -> xs
+            remainingIds += tpe -> xs
             x
           case _ =>
-            val x = FreshIdentifier("x", e.getType, true)
-            typedIds(e.getType) = typedIds(e.getType) :+ x
+            val x = FreshIdentifier("x", tpe, true)
+            typedIds(tpe) = typedIds(tpe) :+ x
             x
         }
         subst += newId -> e
-- 
GitLab