Opened 12 years ago

Closed 12 years ago

#1829 closed discussion (fixed)

Cannot find aliased package functions

Reported by: adabe588@… Owned by: Martin Sjölund
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc:

Description

I have this simple code that I don't understand why it fails, I'm using aliased imports in other places without problem but I had one issue that I managed to get down to a simple program.

Replacing the call to P.f() with PKG.f() or compiling without +g=MetaModelica doesn't cause compiler failure.

package PKG

function f
  output Integer result;
algorithm
  result := 1;
end f;

end PKG;

package PKG2

package P = PKG;
// This also fails:
// import P = PKG;

function test
algorithm
  P.f();
end test;

end PKG2;

model M
algorithm
  PKG2.test();
end M;

Result:

> omc +g=MetaModelica P.mo 
Error processing file: P.mo
Error: Failed to instantiate function .P.f in scope PKG2.test
Error: Error occurred while flattening model M

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

Change History (2)

comment:1 by Martin Sjölund, 12 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

comment:2 by Martin Sjölund, 12 years ago

Component: BackendFrontend
Milestone: 1.9.0
Resolution: fixed
Status: acceptedclosed

Fixed in r13029. Regression test added.

Note: See TracTickets for help on using tickets.