Opened 12 years ago
Closed 12 years ago
#1808 closed defect (fixed)
Reject multiple elements in class
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | critical | Milestone: | 1.9.0 |
Component: | Parser | Version: | trunk |
Keywords: | Cc: |
Description
I'm not sure if function overloading is supported or not. I suppose that with the package system there is not much point to having it, but if overloading is attempted no errors occur but all functions are not called properly either.
package O function f input Integer i; algorithm print("foo"); end f; function f input String s; algorithm print(s); end f; end O;
setCommandLineOptions({"+d=rml,noevalfunc,failtrace","+g=MetaModelica"}); loadFile("Overloading.mo"); O.f(1); O.f("x"); O.f(2);
Expected: duplicate function definition error, or
{true,true} {true} foo x foo
Actual:
{true,true} true x
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Also, overloading looks like function abs = overload(OpenModelica.Internal.intAbs, OpenModelica.Internal.realAbs);
From: abs.html
comment:3 by , 12 years ago
Component: | Backend → Parser |
---|---|
Priority: | minor → critical |
Resolution: | → fixed |
Status: | new → closed |
Summary: | Function overloading doesn't work properly or fails silently → Reject multiple elements in class |
Note:
See TracTickets
for help on using tickets.
I will see if this check is missing for loadFile API