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

Commit f0376d4

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix equation counting for _.
- Set wildcard crefs (_) to be Type.UNKNOWN() instead of Type.ANY(), to avoid them being counted when counting equations. Belonging to [master]: - #2959
1 parent b691eb1 commit f0376d4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Compiler/NFFrontEnd/NFComponentRef.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public
262262
case CREF()
263263
then getSubscriptedType2(cref.restCref, Type.subscript(cref.ty, cref.subscripts));
264264
case EMPTY() then Type.UNKNOWN();
265-
case WILD() then Type.ANY();
265+
case WILD() then Type.UNKNOWN();
266266
end match;
267267
end getSubscriptedType;
268268

Compiler/NFFrontEnd/NFTypeCheck.mo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2589,7 +2589,13 @@ algorithm
25892589
end if;
25902590

25912591
for ty2 in tyl2 loop
2592+
// Skip matching if the rhs is _.
2593+
if Type.isUnknown(ty2) then
2594+
continue;
2595+
end if;
2596+
25922597
ty1 :: tyl1 := tyl1;
2598+
25932599
(_, _, matchKind) := matchTypes(ty1, ty2, expression, allowUnknown);
25942600

25952601
if matchKind <> MatchKind.EXACT then

0 commit comments

Comments
 (0)