incorrect error reported for implicitly omitted field
Submitted by Kristof Szabados
Assigned to fiannetti @fiannetti
Link to original bug (#499888)
Description
In the following example: type record R { integer f1, integer f2 optional, integer f3, integer f4 optional, integer f5 optional }
const R c_x := { 1, -, 2 } with { optional "implicit omit" } // after the assignment c_x contains { 1, omit, 2, omit, omit } const R c_x3 := {1, omit, 2, omit, omit};
Static analysis of the expression "if (c_x.f2 == omit) {}" reports an error on field f2 claiming it is unbound. While correctly recognizes that "if (c_x3.f2 == omit) {}" is ok, and actually is always evaluated to true.
The first is incorrect as c_x has an implicit omit attribute attached to it, effectively making it the same as c_x3
Version: 5.5.0