New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parameterized recursive types broken #2433
Comments
Comment author: administrator Sure, the example is simple and can be written differently. That wasn't the It's simply broken and worked before (in 2.02). -Manuel P.S. It's also broken in 2.99 -----Original Message----- On Fri, Apr 28, 2000 at 08:39:42PM +0200, maf@microsoft.com wrote:
You can write it like this: type 'a collection = 'a list;; You have a similar problem when you write: where f is not generalized. But you can write: -- |
Comment author: administrator On Fri, Apr 28, 2000 at 08:39:42PM +0200, maf@microsoft.com wrote:
You can write it like this: type 'a collection = 'a list;; You have a similar problem when you write: where f is not generalized. But you can write: -- |
Comment author: administrator Hi Manuel,
Actually, it treats parameterized types like polymorphic functions: The reason for this restriction is to prevent the creation of
which can "bomb" later during typechecking. This was a bug in early
|
Comment author: administrator There seems to be some confusion here.
type a = int collectionand b = string collection To sum up what has been said before, this is not a bug, but a somehow strange type a = int collectionand 'a collection = 'a list;; My personal feeling is that this specification is wrong. In particular it is Another possible specification would be to require writing type constraints on
For these reasons, this was not done for 3.00.
|
Comment author: administrator Thanks for your explanations. I wasn't aware of the previous discussion of -Manuel -----Original Message----- There seems to be some confusion here.
type a = int collectionand b = string collection To sum up what has been said before, this is not a bug, but a somehow type a = int collectionand 'a collection = 'a list;; My personal feeling is that this specification is wrong. In particular it is Another possible specification would be to require writing type constraints
For these reasons, this was not done for 3.00.
|
Comment author: administrator Not a bug, but this should be corrected. 3.01 now has expected behavior. |
Original bug ID: 95
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Manuel Fahndrich
Version: 3.00
OS: win2000
Submission from: tide78.microsoft.com (131.107.3.78)
type a = int collection
and b = string collection
and 'a collection = 'a list
;;
yields:
This type string should be an instance of type int
where "this type" refers to the "string" argument in 'b' definition.
Look like the compiler does not treat collection as a properly parameterized
type.
-Manuel
The text was updated successfully, but these errors were encountered: