Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit c7fe8a2

Browse files
perostOpenModelica-Hudson
authored andcommitted
Some small NFInst improvements.
- Fix type casting of unary expressions. - Fix definition of spatialDistribution.
1 parent e10293f commit c7fe8a2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Compiler/FrontEnd/ModelicaBuiltin.mo

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,12 +749,13 @@ end getInstanceName;
749749

750750
function spatialDistribution "Not yet implemented"
751751
input Real in0;
752-
input Real x;
753-
input Real initialPoints[:];
754-
input Real initialValues[size(initialPoints)];
755752
input Real in1;
753+
input Real x;
756754
input Boolean positiveVelocity;
757-
output Real val;
755+
parameter input Real initialPoints[:](each min = 0, each max = 1) = {0.0, 1.0};
756+
parameter input Real initialValues[size(initialPoints)] = {0.0, 0.0};
757+
output Real out0;
758+
output Real out1;
758759
external "builtin";
759760
annotation(version="Modelica 3.3");
760761
end spatialDistribution;

Compiler/NFFrontEnd/NFExpression.mo

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,12 @@ public
436436
then
437437
ARRAY(t, el);
438438

439-
case (_, Type.REAL())
439+
case (UNARY(), _)
440+
then UNARY(exp.operator, typeCastElements(exp.exp, ty));
441+
442+
else
440443
then
441-
CAST(Type.REAL(), exp);
444+
CAST(ty, exp);
442445

443446
end match;
444447
end typeCastElements;

0 commit comments

Comments
 (0)