daml icon indicating copy to clipboard operation
daml copied to clipboard

Compiler upgrade checks don't allow alpha equivalence between datatypes

Open dylant-da opened this issue 1 year ago • 1 comments

dylant-da avatar Jul 15 '24 08:07 dylant-da

Likely revealing my ignorance, but what do you mean here? Our assumption in upgrading is that data types can't be renamed. So do you want to support renaming?

daravep avatar Aug 22 '24 07:08 daravep

This is about alpha equivalence of variable names - e.g.

data X a = X { field1: a }

should be equivalent to

data X b = X { field1 : b }

And furthermore the following should be an upgrade:

data X b = X { field1: b, field2: Optional b }

dylant-da avatar Sep 10 '24 15:09 dylant-da

Fixed by https://github.com/digital-asset/daml/pull/20016 and https://github.com/digital-asset/daml/pull/20024 on 2.x, https://github.com/digital-asset/daml/pull/20025 on 3.x

dylant-da avatar Oct 02 '24 09:10 dylant-da