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

Commit 9840114

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Potential fix for #5063.
- Treat functions with a discrete output variable as implicitly discrete if the arguments are continuous. Belonging to [master]: - #2604
1 parent 01f7068 commit 9840114

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Compiler/NFFrontEnd/NFCall.mo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ uniontype Call
353353
ty := getSpecialReturnType(func, args);
354354
end if;
355355

356+
// Functions that return a discrete type, e.g. Integer, should probably be
357+
// treated as implicitly discrete if the arguments are continuous.
358+
if Type.isDiscrete(ty) and var == Variability.CONTINUOUS then
359+
var := Variability.IMPLICITLY_DISCRETE;
360+
end if;
361+
356362
if intBitAnd(origin, ExpOrigin.FUNCTION) == 0 then
357363
ty := evaluateCallType(ty, func, args);
358364
end if;

0 commit comments

Comments
 (0)