suppress dummyT, e.g. from Type_Annotation.print;
authorwenzelm
Fri, 18 Oct 2024 21:20:21 +0200
changeset 81196 eb397024b496
parent 81195 8bcb906e73f2
child 81197 794b10baf0de
suppress dummyT, e.g. from Type_Annotation.print;
src/Pure/Syntax/syntax_phases.ML
--- a/src/Pure/Syntax/syntax_phases.ML	Fri Oct 18 21:19:06 2024 +0200
+++ b/src/Pure/Syntax/syntax_phases.ML	Fri Oct 18 21:20:21 2024 +0200
@@ -682,8 +682,10 @@
     val clean_var_types = show_markup andalso not show_types;
 
     fun constrain clean T ast =
-      let val U = Type_Annotation.print clean T
-      in Ast.Appl [Ast.Constant "_constrain", ast, ast_of_termT ctxt trf (term_of_typ ctxt U)] end;
+      let val U = Type_Annotation.print clean T in
+        if U = dummyT then ast
+        else Ast.Appl [Ast.Constant "_constrain", ast, ast_of_termT ctxt trf (term_of_typ ctxt U)]
+      end;
 
     fun main tm =
       (case strip_comb tm of