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

Commit 2fefbbb

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Improve type checking of records.
Belonging to [master]: - #2440
1 parent 16e0883 commit 2fefbbb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Compiler/NFFrontEnd/NFTypeCheck.mo

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,9 @@ function isValidAssignmentMatch
116116
input MatchKind kind;
117117
output Boolean v = kind == MatchKind.EXACT
118118
or kind == MatchKind.CAST
119-
;
119+
or kind == MatchKind.PLUG_COMPATIBLE;
120120
end isValidAssignmentMatch;
121121

122-
function isValidBindingMatch
123-
input MatchKind kind;
124-
output Boolean v = isValidAssignmentMatch(kind);
125-
end isValidBindingMatch;
126-
127122
function isValidArgumentMatch
128123
input MatchKind kind;
129124
output Boolean v = kind == MatchKind.EXACT
@@ -2188,7 +2183,7 @@ algorithm
21882183

21892184
(exp, ty, ty_match) := matchTypes(binding.bindingType, comp_ty, binding.bindingExp, true);
21902185

2191-
if not isValidBindingMatch(ty_match) then
2186+
if not isValidAssignmentMatch(ty_match) then
21922187
Error.addSourceMessage(Error.VARIABLE_BINDING_TYPE_MISMATCH,
21932188
{name, Binding.toString(binding), Type.toString(comp_ty),
21942189
Type.toString(binding.bindingType)}, Binding.getInfo(binding));

0 commit comments

Comments
 (0)