-
Notifications
You must be signed in to change notification settings - Fork 127
Description
Right now, we have a simplification rule for select expressions that turns a select of a struct into a pack of get_items of field names.
The issue with this is that get_item performs a validity intersection: Suppose the top-level struct is nullable, but the fields of the struct are non-nullable. get_item will return the intersection of the nullability, which means that a previously non-nullable field becomes nullable.
This means that evaluating select over a nullable struct with non-nullable fields will always return a struct with nullable fields, which is not correct. What we want is to essentially "mask out" the fields we do not want without changing the validity of anything.
The first fix is to fix the simplification rule to only rewrite the select as a pack when the child is already a pack. There might be other things that go wrong is the struct layout reader after that change.