Number identifiers in saved interfaces from the request baseline
Why
A saved interface took its identifiers' stamps from the compilation's counter, which reading imported interfaces also advances. An interface whose signature didn't change was saved with other stamps, and so another CRC, whenever an interface it reads grew: adding a value to a module changed the CRC of the modules matching on its constructors, and a build system comparing CRCs had to rebuild their dependents.
The substitution that renames a signature's identifiers for saving now numbers them from the request baseline, then lets the counter continue after both.
modifiedInterface User.cmi after let extra = 2 is added to Shape
// Shape.restype t = A | B({x: int})let make = () => A // User.reslet value = switch Shape.make() {| A => 1| B({x}) => x}
text
modifiedInterface 2000-module synthetic project, after adding a value to a module with 5 direct dependents
text
Review
- Can an identifier numbered from the baseline be confused with another? The predefined identifiers all come before the baseline, and every other identifier in a signature being saved is bound in it and renamed by this substitution. Reading the interface back renames them again, and the counter continues past both for the rest of the compilation.