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

Commit a1f95a6

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Relax restriction on input/output prefixes.
- Allow an input/output prefix on a component with a short class type that also has an input/output prefix, as long as they are the same. Belonging to [master]: - #2822 - OpenModelica/OpenModelica-testsuite#1088
1 parent e1d80fc commit a1f95a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Compiler/NFFrontEnd/NFInst.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ algorithm
15711571
Component.Attributes.ATTRIBUTES(cty, par, var, dir, io, fin, redecl, repl) := outerAttr;
15721572
cty := Prefixes.mergeConnectorType(cty, innerAttr.connectorType, node);
15731573
var := Prefixes.variabilityMin(var, innerAttr.variability);
1574-
dir := Prefixes.mergeDirection(dir, innerAttr.direction, node);
1574+
dir := Prefixes.mergeDirection(dir, innerAttr.direction, node, allowSame = true);
15751575
attr := Component.Attributes.ATTRIBUTES(cty, par, var, dir, io, fin, redecl, repl);
15761576
end if;
15771577
end mergeDerivedAttributes;

Compiler/NFFrontEnd/NFPrefixes.mo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,15 @@ function mergeDirection
375375
input Direction outerDir;
376376
input Direction innerDir;
377377
input InstNode node;
378+
input Boolean allowSame = false;
378379
output Direction dir;
379380
algorithm
380381
if outerDir == Direction.NONE then
381382
dir := innerDir;
382383
elseif innerDir == Direction.NONE then
383384
dir := outerDir;
385+
elseif allowSame and outerDir == innerDir then
386+
dir := innerDir;
384387
else
385388
printPrefixError(directionString(outerDir), directionString(innerDir), node);
386389
end if;

0 commit comments

Comments
 (0)