Opened 6 years ago
Last modified 6 years ago
#5064 new defect
Inline doesn't work properly
Reported by: | Adrian Pop | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Cc: |
Description
The NF can flatten attached model: AdvancedNoise.Examples.VaryingDistribution
but the inline doesn't work properly, the nBuffer is not inlined or evaluated when inlined and ends up as an undefined in the code generation.
function AdvancedNoise.Sources.TimeBasedNoise.interpolation.interpolate "Inline before index reduction" "Constant interpolation in a buffer of random values" input Real[:] buffer "Buffer of random numbers"; input Real offset "Offset from buffer start (0..size(buffer)-1"; input Real samplePeriod = 1.0 "The sample period of the noise buffer"; output Real y "Interpolated value at position offset"; protected Integer nBuffer = size(buffer, 1) "Size of the buffer"; algorithm y := buffer[if nBuffer == 1 then 1 else integer(offset) + 1]; end AdvancedNoise.Sources.TimeBasedNoise.interpolation.interpolate;
Attachments (1)
Note:
See TracTickets
for help on using tickets.
replaceExp
(inCompiler/Util/VarTransform.mo) has an issuebecause the type of
is
which is unsoporrted. but
DAE.ASUB
is supported.