| Anonymous | Login | Signup for a new account | 2013-05-26 02:27 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0005224 | OCaml | OCaml general | public | 2011-02-14 10:06 | 2012-06-01 07:13 | |||
| Reporter | furuse | |||||||
| Assigned To | garrigue | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11.2 | |||||||
| Target Version | Fixed in Version | 4.00.0+dev | ||||||
| Summary | 0005224: Confusing error message at object type definition | |||||||
| Description | type 'x t = < f : 'y. 'y t > gives me an error. I do not understand why this is rejected, but the reason is not the issue. The problem is the error message: Error: In the definition of t, type 'a t should be 'b t This should be printed as type 'y t should be 'x t . | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0007481) protz (manager) 2012-05-31 13:57 |
This is rejected because this type is non-regular, i.e. it is a parameterized structural type where which is instanciated with a different type parameter. This is also the reason why the code snippet below is rejected: # type 'a foo = [`A | `B of ('a foo) foo];; Error: In the definition of foo, type 'a foo foo should be 'a foo The solution is to define an intermediary nominal type: type 'a tmp = T of 'a t Then: type 'x t = < f : 'y. 'y tmp > Of course you need these two types to be mutually recursive. # type 'a tmp = Tmp of 'a t and 'a t = < f: 'y. 'y tmp >;; type 'a tmp = Tmp of 'a t and 'a t = < f : 'y. 'y tmp > |
|
(0007492) garrigue (manager) 2012-06-01 07:13 |
Fixed in trunk and 4.00, revisions 12533 and 12534. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-02-14 10:06 | furuse | New Issue | |
| 2011-05-17 16:16 | doligez | Status | new => acknowledged |
| 2012-05-31 11:21 | frisch | Severity | major => minor |
| 2012-05-31 13:57 | protz | Note Added: 0007481 | |
| 2012-06-01 07:13 | garrigue | Note Added: 0007492 | |
| 2012-06-01 07:13 | garrigue | Status | acknowledged => closed |
| 2012-06-01 07:13 | garrigue | Assigned To | => garrigue |
| 2012-06-01 07:13 | garrigue | Resolution | open => fixed |
| 2012-06-01 07:13 | garrigue | Fixed in Version | => 4.00.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |