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

Commit eeb9148

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Function expressions also count as discrete.
Belonging to [master]: - #2071
1 parent aa363fe commit eeb9148

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/NFFrontEnd/NFTyping.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ package ExpOrigin
125125
// Combined flags:
126126
constant Integer EQ_SUBEXPRESSION = intBitOr(EQUATION, SUBEXPRESSION);
127127
constant Integer VALID_TYPENAME_SCOPE = intBitOr(ITERATION_RANGE, DIMENSION);
128-
constant Integer DISCRETE_SCOPE = intBitOr(WHEN, INITIAL);
128+
constant Integer DISCRETE_SCOPE = intBitOr(WHEN, intBitOr(INITIAL, FUNCTION));
129129
end ExpOrigin;
130130

131131
public
@@ -1071,7 +1071,7 @@ algorithm
10711071
end match;
10721072

10731073
// Expressions inside when-clauses and initial sections are discrete.
1074-
if intBitAnd(origin, ExpOrigin.DISCRETE_SCOPE) > 1 and variability == Variability.CONTINUOUS then
1074+
if intBitAnd(origin, ExpOrigin.DISCRETE_SCOPE) > 0 and variability == Variability.CONTINUOUS then
10751075
variability := Variability.DISCRETE;
10761076
end if;
10771077
end typeExp;

0 commit comments

Comments
 (0)