Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004907OCamltypingpublic2009-11-02 16:242016-12-07 17:34
Assigned Togarrigue 
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 "", 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
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
2016-12-07 17:34 shinwell Category OCaml general => OCaml typing
2017-02-23 16:45 doligez Category OCaml typing => typing

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker