Skip to content

Commit 557b56a

Browse files
authored
Remove conditional component warning (OpenModelica#13949)
1 parent 8298480 commit 557b56a

File tree

5 files changed

+17
-52
lines changed

5 files changed

+17
-52
lines changed

OMCompiler/Compiler/NFFrontEnd/NFTyping.mo

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,13 +2011,6 @@ algorithm
20112011

20122012
case ComponentRef.CREF(node = InstNode.COMPONENT_NODE())
20132013
algorithm
2014-
if Component.hasCondition(InstNode.component(cref.node)) and
2015-
not Config.languageStandardAtLeast(Config.LanguageStandard.experimental) and
2016-
(not InstContext.inConnect(context) or InstContext.inSubscript(context)) and not InstContext.inRelaxed(context) then
2017-
Error.addStrictMessage(Error.CONDITIONAL_COMPONENT_INVALID_CONTEXT,
2018-
{InstNode.name(cref.node)}, info);
2019-
end if;
2020-
20212014
// The context used when typing a component node depends on where the
20222015
// component was declared, not where it's used. This can be different to
20232016
// the given context, e.g. for package constants used in a function.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// name: Condition10
2+
// keywords:
3+
// status: correct
4+
//
5+
6+
model Condition10
7+
Real x if true;
8+
Real y = x;
9+
end Condition10;
10+
11+
// Result:
12+
// class Condition10
13+
// Real x;
14+
// Real y = x;
15+
// end Condition10;
16+
// endResult

testsuite/flattening/modelica/scodeinst/ConditionInvalidContext1.mo

Lines changed: 0 additions & 22 deletions
This file was deleted.

testsuite/flattening/modelica/scodeinst/ConditionInvalidContext2.mo

Lines changed: 0 additions & 21 deletions
This file was deleted.

testsuite/flattening/modelica/scodeinst/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,10 @@ Condition6.mo \
280280
Condition7.mo \
281281
Condition8.mo \
282282
Condition9.mo \
283+
Condition10.mo \
283284
ConditionInvalid1.mo \
284285
ConditionInvalidBinding1.mo \
285286
ConditionInvalidBinding2.mo \
286-
ConditionInvalidContext1.mo \
287-
ConditionInvalidContext2.mo \
288287
ConditionInvalidType1.mo \
289288
conn9.mo \
290289
conngraph1.mo \

0 commit comments

Comments
 (0)