Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004907OCamlOCaml generalpublic2009-11-02 16:242012-06-01 09:32
Reportermottl 
Assigned Togarrigue 
PrioritynormalSeverityfeatureReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version3.11.1 
Target VersionFixed in Version 
Summary0004907: Type manifests do not support type variable substitutions
DescriptionThe following would seem like a perfectly legitimate thing to do:

  type ('a, 'b) t = { a : 'a; b : 'b }
  type ('a, 'b) u = ('a, 'b option) t = { a : 'a; b : 'b option }

Unfortunately, the compiler fails with:

  File "foo.ml", line 3, characters 5-63:
  Error: The variant or record definition does not match that of type
  ('a, 'b option) t

This does not quite seem correct.

This restriction makes it impossible to e.g. repeat a type definition in a more specialized way such that the preprocessor can exploit the extra syntactic representation to generate code more flexibly from the type definition.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005191)
doligez (administrator)
2009-12-09 17:35

The problem is that a record type declaration is generative, so your second record type is
not an instance of the first. Can this be changed without major changes to the typechecker?
I don't know.

- Issue History
Date Modified Username Field Change
2009-11-02 16:24 mottl New Issue
2009-12-09 17:35 doligez Note Added: 0005191
2009-12-09 17:35 doligez Severity minor => feature
2009-12-09 17:35 doligez Status new => acknowledged
2012-06-01 09:32 garrigue Assigned To => garrigue
2012-06-01 09:32 garrigue Status acknowledged => assigned


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker