We currently have this rule:
<nat> not in <fieldtype>;*
record { <fieldtype>;* } <: record { <fieldtype'>;* } ~> f
------------------------------------------------------------------------------
record { <fieldtype>;* } <: record { <nat> : opt <datatype'>; <fieldtype'>;* }
~> \x.{f x with <nat> = null}
This gives record {} <: record { foo : opt bool }.
We also have record { foo : opt bool } <: record { foo : reserved } (by virtue of opt bool <: reserved).
By transitivity, we should have record {} <: record { foo : reserved }.
So it seems we need
<nat> not in <fieldtype>;*
record { <fieldtype>;* } <: record { <fieldtype'>;* } ~> f
------------------------------------------------------------------------------
record { <fieldtype>;* } <: record { <nat> : reserved; <fieldtype'>;* }
~> \x.{f x with <nat> = null}
as well.
(This uses null as an arbitrary representation for a reserved value. Woudn’t mind adding an explicit reserved to the textual representation and data model, that would be handy in other contexts as well.)
We could combine the two into a single rule by saying
<nat> not in <fieldtype>;*
record { <fieldtype>;* } <: record { <fieldtype'>;* } ~> f
opt empty <: <datatype'>
------------------------------------------------------------------------------
record { <fieldtype>;* } <: record { <nat> : <datatype'>; <fieldtype'>;* }
~> \x.{f x with <nat> = null}
We currently have this rule:
This gives
record {} <: record { foo : opt bool }.We also have
record { foo : opt bool } <: record { foo : reserved }(by virtue ofopt bool <: reserved).By transitivity, we should have
record {} <: record { foo : reserved }.So it seems we need
as well.
(This uses
nullas an arbitrary representation for a reserved value. Woudn’t mind adding an explicitreservedto the textual representation and data model, that would be handy in other contexts as well.)We could combine the two into a single rule by saying