From 71b6a0021f59f8f4732d4eb23b61ea66191d6e7d Mon Sep 17 00:00:00 2001
From: Etienne Kneuss <ekneuss@gmail.com>
Date: Wed, 14 Oct 2015 17:30:15 +0200
Subject: [PATCH] Warning about ADT fields should be positioned

---
 build.sbt                                               | 2 +-
 src/main/scala/leon/purescala/CheckADTFieldsTypes.scala | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/build.sbt b/build.sbt
index fc3aa2584..ddd3c0a82 100644
--- a/build.sbt
+++ b/build.sbt
@@ -32,7 +32,7 @@ resolvers ++= Seq(
 )
 
 libraryDependencies ++= Seq(
-  "org.scala-lang" % "scala-compiler" % "2.11.6",
+  "org.scala-lang" % "scala-compiler" % "2.11.7",
   "org.scalatest" %% "scalatest" % "2.2.4" % "test",
   "com.typesafe.akka" %% "akka-actor" % "2.3.4",
   "info.hupel" %% "libisabelle" % "0.1.1",
diff --git a/src/main/scala/leon/purescala/CheckADTFieldsTypes.scala b/src/main/scala/leon/purescala/CheckADTFieldsTypes.scala
index a62837f00..d4583e553 100644
--- a/src/main/scala/leon/purescala/CheckADTFieldsTypes.scala
+++ b/src/main/scala/leon/purescala/CheckADTFieldsTypes.scala
@@ -17,7 +17,7 @@ object CheckADTFieldsTypes extends UnitPhase[Program] {
         for(vd <- ccd.fields) {
           val tpe = vd.getType
           if (bestRealType(tpe) != tpe) {
-            ctx.reporter.warning("Definition of "+ccd.id.asString(ctx)+" has a field of a sub-type ("+vd.asString(ctx)+"): " +
+            ctx.reporter.warning(ccd.getPos, "Definition of "+ccd.id.asString(ctx)+" has a field of a sub-type ("+vd.asString(ctx)+"): " +
               "this type is not supported as-is by solvers and will be up-cast. " +
               "This may cause issues such as crashes.")
           }
-- 
GitLab