﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5213	Backend can't handle nested record assignment	Per Östlund	Mahder Alemseged Gebremedhin	"Many HelmHoltzMedia models (such as [https://libraries.openmodelica.org/branches/newInst/HelmholtzMedia/files/HelmholtzMedia_HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT.err HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT]) currently fail with error messages such as (using `-d=newInst`, the old frontend can't handle the models):
{{{
Warning: SimCodeUtil.makeSES_SIMPLE_ASSIGN failed for:
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.liq.phase,
    fixedMassFlowRate.medium.sat.liq.T,
    fixedMassFlowRate.medium.sat.liq.p,
    fixedMassFlowRate.medium.sat.liq.d,
    fixedMassFlowRate.medium.sat.liq.u,
    fixedMassFlowRate.medium.sat.liq.h,
    fixedMassFlowRate.medium.sat.liq.s) =
  $TMP_Medium_SaturationProperties74.liq
}}}
This seems to be due to the flattened equation:
{{{#!mo
fixedMassFlowRate.medium.sat =
  HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT.Medium.setSat_p(fixedMassFlowRate.medium.p);
}}}
that the backend expands to:
{{{#!mo
Medium.SaturationProperties(
  fixedMassFlowRate.medium.sat.psat,
  fixedMassFlowRate.medium.sat.Tsat,
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.liq.phase,
    fixedMassFlowRate.medium.sat.liq.T,
    fixedMassFlowRate.medium.sat.liq.p,
    fixedMassFlowRate.medium.sat.liq.d,
    fixedMassFlowRate.medium.sat.liq.u,
    fixedMassFlowRate.medium.sat.liq.h,
    fixedMassFlowRate.medium.sat.liq.s),
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.vap.phase,
    fixedMassFlowRate.medium.sat.vap.T,
    fixedMassFlowRate.medium.sat.vap.p,
    fixedMassFlowRate.medium.sat.vap.d,
    fixedMassFlowRate.medium.sat.vap.u,
    fixedMassFlowRate.medium.sat.vap.h,
    fixedMassFlowRate.medium.sat.vap.s)) =
HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT.Medium.setSat_p(volume.medium.p)
}}}
But it seems like the case for `Record() = f()` in `SimCodeUtil.createSingleComplexEqnCode2` can't handle the nested records and calls `makeSES_SIMPLE_ASSIGN` with a record as the lhs causing it to fail."	defect	closed	high	1.16.0	Backend	v1.13.0-dev-nightly	fixed		matthis.thorade@…
