Opened 11 years ago
Closed 11 years ago
#2827 closed defect (fixed)
Function partial application doesn't work with polymorphic types
| Reported by: | Per Östlund | Owned by: | Martin Sjölund |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.1 |
| Component: | MetaModelica | Version: | trunk |
| Keywords: | Cc: |
Description
Function partial application gives template error when compiling:
function foldr<T, FT>
input list<T> inList;
input FoldFunc inFoldFunc;
input FT inStartValue;
output FT outResult := inStartValue;
partial function FoldFunc
input FT inFoldArg;
input T inElement;
output FT outFoldArg;
end FoldFunc;
algorithm
for e in inList loop
outResult := inFoldFunc(outResult, e);
end for;
end foldr;
public function fold1<T, FT, ArgT1>
input list<T> inList;
input FoldFunc inFoldFunc;
input ArgT1 inExtraArg;
input FT inStartValue;
output FT outResult;
partial function FoldFunc
input T inElement;
input ArgT1 inConstantArg;
input FT inFoldArg;
output FT outFoldArg;
end FoldFunc;
algorithm
outResult := fold(inList, function inFoldFunc(inConstantArg = inExtraArg), inStartValue);
end fold1;
Change History (1)
comment:1 by , 11 years ago
| Milestone: | Bootstrapping → 1.9.1 |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Fixed in r22352.