You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the typedtree.ml has class_description and class_type_declaration being defined as the same thing. git blame doesn't show useful historical reason for this.
and class_description =
class_type class_infos
and class_type_declaration =
class_type class_infos
These two notions correspond to distinct source syntaxes (see below), but at the typing stage they carry the exact same information. The distinction between both is not very useful, but it has a meaning: to test which one to use, you should think of which of the two concrete language constructions is being manipulated.
In parsing/parsetree.mli:
| Psig_class of class_description list
(* class c1 : ... and ... and cn : ... )
| Psig_class_type of class_type_declaration list
( class type ct1 = ... and ... and ctn = ... *)
Original bug ID: 7237
Reporter: @gasche
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-09-24T15:32:53Z)
Resolution: fixed
Priority: low
Severity: tweak
Version: 4.03.1+dev
Target version: 4.03.1+dev
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: ~DO NOT USE (was: OCaml general)
Tags: junior_job
Monitored by: @yallop @hcarty
Bug description
The very large tuples in the typeclass.mli interface (this code type-checks class declarations in particular)
https://github.com/ocaml/ocaml/blob/5401ce8/typing/typeclass.mli
could be turned into records with named fields to make code manipulating them more readable.
A good way to get started would be to look at the variable names used in the implementation, for example check_coercions in
https://github.com/ocaml/ocaml/blob/5401ce8/typing/typeclass.ml#L1592-L1593
The text was updated successfully, but these errors were encountered: