diff --git a/src/main/scala/inox/ast/Expressions.scala b/src/main/scala/inox/ast/Expressions.scala index 9c87a1acb16cb3ee23080ea9753e1558b968f399..66f2f55c5ce79c7eb5c7a9d50e9f13ee51e6eb06 100644 --- a/src/main/scala/inox/ast/Expressions.scala +++ b/src/main/scala/inox/ast/Expressions.scala @@ -271,9 +271,8 @@ trait Expressions { self: Trees => case _ => None } - protected def computeType(implicit s: Symbols): Type = constructor.map { tccd => - val index = tccd.definition.selectorID2Index(selector) - tccd.fieldsTypes(index) + protected def computeType(implicit s: Symbols): Type = constructor.flatMap { tccd => + scala.util.Try(tccd.definition.selectorID2Index(selector)).toOption.map(tccd.fieldsTypes) }.getOrElse(Untyped) } diff --git a/src/main/scala/inox/ast/SymbolOps.scala b/src/main/scala/inox/ast/SymbolOps.scala index 239f0cc629fe6144adb089153a13e81f773951ba..b9f5f56b75475c6910f0ef7f58d44c06ab0893aa 100644 --- a/src/main/scala/inox/ast/SymbolOps.scala +++ b/src/main/scala/inox/ast/SymbolOps.scala @@ -648,7 +648,8 @@ trait SymbolOps { self: TypeOps => se.map(child => "\n " + "\n".r.replaceAllIn(child, "\n ")).mkString + s" because ${tfd.fd.id.name} was instantiated with " + s"${tfd.fd.tparams.zip(tps).map(k => k._1.asString + ":=" + k._2.asString).mkString(",")} " + - s"with type ${tfd.fd.params.map(_.getType.asString).mkString(",")} => ${tfd.fd.returnType.asString}" + s"with type ${tfd.fd.params.map(_.getType.asString).mkString("(", ",", ")")} => " + + s"${tfd.fd.returnType.asString}" case None => s"${e.asString} is of type ${e.getType.asString}" + se.map(child => "\n " + "\n".r.replaceAllIn(child, "\n ")).mkString +