@@ -177,19 +177,27 @@ let ill_typed_term (t:term) (expected_typ got_typ : option term)
177177 ( ensures fun _ -> True )
178178=
179179 let open Pulse.PP in
180- match expected_typ , got_typ with
181- | None , None -> [
182- prefix 2 1 ( text " Ill-typed term:" ) ( pp t )
183- ]
184- | Some ty , None -> [
185- prefix 2 1 ( text " Ill-typed term:" ) ( pp t );
186- prefix 2 1 ( text " Expected a term of type" ) ( pp ty );
187- ]
188- | Some ty , Some ty' -> [
189- prefix 2 1 ( text " Expected term of type" ) ( pp ty ) ^ /^
190- prefix 2 1 ( text " got term" ) ( pp t ) ^ /^
191- prefix 2 1 ( text " of type" ) ( pp ty' )
192- ]
180+ // We used to print the term and the expected type as part of the error
181+ // message, but this is often misleading and unhelpful:
182+ // - It implies that the top-level term is at fault,
183+ // but the error might be in a subterm
184+ // - It implies that the term has the wrong type,
185+ // but the error might just be a failing precondition.
186+ [ text " Ill-typed term" ]
187+
188+ // match expected_typ, got_typ with
189+ // | None, None -> [
190+ // prefix 2 1 (text "Ill-typed term:") (pp t)
191+ // ]
192+ // | Some ty, None -> [
193+ // prefix 2 1 (text "Ill-typed term:") (pp t);
194+ // prefix 2 1 (text "Expected a term of type") (pp ty);
195+ // ]
196+ // | Some ty, Some ty' -> [
197+ // prefix 2 1 (text "Expected term of type") (pp ty) ^/^
198+ // prefix 2 1 (text "got term") (pp t) ^/^
199+ // prefix 2 1 (text "of type") (pp ty')
200+ // ]
193201
194202let instantiate_term_implicits
195203 ( g : env ) ( t0 : term ) ( expected : option typ ) ( inst_extra :bool)
0 commit comments