}
}
public Nominal.EffectiveRecord expandAsEffectiveRecord(Nominal lhs)
throws IOException, ResolveError {
Type raw = lhs.raw();
if (raw instanceof Type.Record) {
Type nominal = expandOneLevel(lhs.nominal());
if (!(nominal instanceof Type.Record)) {
nominal = (Type) raw; // discard nominal information
}
return (Nominal.Record) Nominal.construct(nominal, raw);
} else if (raw instanceof Type.UnionOfRecords) {
Type nominal = expandOneLevel(lhs.nominal());
if (!(nominal instanceof Type.UnionOfRecords)) {
nominal = (Type) raw; // discard nominal information
}
return (Nominal.UnionOfRecords) Nominal.construct(nominal, raw);
}