File tree 2 files changed +17
-1
lines changed
testsuite/tests/typing-layouts-float64
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -250,3 +250,14 @@ Line 1, characters 9-26:
250
250
Error: The type constructor float# expects 0 argument(s),
251
251
but is here applied to 2 argument(s)
252
252
|}];;
253
+
254
+ (* ******************)
255
+ (* Hint for #float *)
256
+ type t = #float;;
257
+ [%%expect {|
258
+ Line 1 , characters 10 -15 :
259
+ 1 | type t = #float;;
260
+ ^^^^^
261
+ Error: Unbound class type float
262
+ Hint: Did you mean float#?
263
+ |}]
Original file line number Diff line number Diff line change @@ -3889,7 +3889,12 @@ let report_lookup_error _loc env ppf = function
3889
3889
end
3890
3890
| Unbound_cltype lid ->
3891
3891
fprintf ppf " Unbound class type %a" ! print_longident lid;
3892
- spellcheck ppf extract_cltypes env lid;
3892
+ begin match lid with
3893
+ | Lident "float" ->
3894
+ Misc. did_you_mean ppf (fun () -> [" float#" ])
3895
+ | Lident _ | Ldot _ | Lapply _ ->
3896
+ spellcheck ppf extract_cltypes env lid
3897
+ end ;
3893
3898
| Unbound_instance_variable s ->
3894
3899
fprintf ppf " Unbound instance variable %s" s;
3895
3900
spellcheck_name ppf extract_instance_variables env s;
You can’t perform that action at this time.
0 commit comments