src/Tools/subtyping.ML
changeset 49560 11430dd89e35
parent 49142 0f81eca1e473
child 49564 03381c41235b
equal deleted inserted replaced
49559:c3a6e110679b 49560:11430dd89e35
   906           handle Graph.CYCLES _ => error (
   906           handle Graph.CYCLES _ => error (
   907             Syntax.string_of_typ ctxt T2 ^ " is already a subtype of " ^
   907             Syntax.string_of_typ ctxt T2 ^ " is already a subtype of " ^
   908             Syntax.string_of_typ ctxt T1 ^ "!\n\nCannot add coercion of type: " ^
   908             Syntax.string_of_typ ctxt T1 ^ "!\n\nCannot add coercion of type: " ^
   909             Syntax.string_of_typ ctxt (T1 --> T2));
   909             Syntax.string_of_typ ctxt (T1 --> T2));
   910         val new_edges =
   910         val new_edges =
   911           flat (Graph.dest G'' |> map (fn (x, ys) => ys |> map_filter (fn y =>
   911           flat (Graph.dest G'' |> map (fn ((x, _), ys) => ys |> map_filter (fn y =>
   912             if Graph.is_edge G' (x, y) then NONE else SOME (x, y))));
   912             if Graph.is_edge G' (x, y) then NONE else SOME (x, y))));
   913         val G_and_new = Graph.add_edge (a, b) G';
   913         val G_and_new = Graph.add_edge (a, b) G';
   914 
   914 
   915         val tab' = fold
   915         val tab' = fold
   916           (fn pair => fn tab =>
   916           (fn pair => fn tab =>