mjambon/atdgen — pull request #4 by jameister (2013-09-20 21:49:33+00:00)
Title: Allow overlapping names in record fields and classic variants (don't merge yet)

This new command line option will let Atdgen take advantage of a new feature in OCaml 4.01, which makes it possible to have several variant constructors or record fields of the same name in scope, using type information to disambiguate them. Passing the option -allow-name-overlap will disable checking for duplicate names, and appropriate type annotations will be included in the generated readers, writers, and creators.

The type annotations are actually always generated, even if -allow-name-overlap is not specified. They should never cause a problem, and doing this made the implementation simpler.

Testing is still in progress, but it appears to work for both JSON and Biniou. I'm a bit worried that I've overlooked something subtle, so more comprehensive testing is needed. I haven't tested anything related to validators yet.