tuned;
authorwenzelm
Sat, 14 Nov 2020 16:53:18 +0100
changeset 72840 b6bce47d0b48
parent 72839 9576d0faf8f9
child 72841 a4cb880e873a
child 72849 878c73cdfa0d
tuned;
src/Pure/Thy/sessions.scala
--- a/src/Pure/Thy/sessions.scala	Sat Nov 14 16:49:48 2020 +0100
+++ b/src/Pure/Thy/sessions.scala	Sat Nov 14 16:53:18 2020 +0100
@@ -254,20 +254,20 @@
               info.document_theories.flatMap(
               {
                 case (thy, pos) =>
-                  val ancestors = sessions_structure.build_requirements(List(session_name))
+                  val parent_sessions = sessions_structure.build_requirements(List(session_name))
 
                   def err(msg: String): Option[String] =
                     Some(msg + " " + quote(thy) + Position.here(pos))
 
-                  known_theories.get(thy) match {
+                  known_theories.get(thy).map(_.name) match {
                     case None => err("Unknown document theory")
-                    case Some(entry) =>
-                      val qualifier = deps_base.theory_qualifier(entry.name)
-                      if (session_theories.contains(entry.name)) {
+                    case Some(name) =>
+                      val qualifier = deps_base.theory_qualifier(name)
+                      if (session_theories.contains(name)) {
                         err("Redundant document theory from this session:")
                       }
-                      else if (ancestors.contains(qualifier)) None
-                      else if (dependencies.theories.contains(entry.name)) None
+                      else if (parent_sessions.contains(qualifier)) None
+                      else if (dependencies.theories.contains(name)) None
                       else err("Document theory from other session not imported properly:")
                   }
               })