The new notation for updating fields (the dot-parenthesis notation) can't be used to update ghost fields of non-ghost variables. The old, deprecated notation (brackets) still supports updating such ghost fields. It would be useful if we could update ghost fields using the new notation as well.
datatype PartRealPartGhost = PartRealPartGhost(x:int, ghost y:int)
method UpdateField()
{
var v := PartRealPartGhost(3, 4);
ghost var g := 5;
v := v[y := g];
v := v.(y := g);
}
datatype PartRealPartGhost = PartRealPartGhost(x:int, ghost y:int)
method UpdateField()
{
var v := PartRealPartGhost(3, 4);
ghost var g := 5;
v := v[y := g];
v := v.(y := g);
}