Opened 15 years ago

Last modified 14 years ago

#1165 closed defect (fixed)

Lookup does not stop when a partially successful lookup fails.

Reported by: dhedberg Owned by: dhedberg
Priority: high Milestone:
Component: Version:
Keywords: Cc: dhedberg, Per Östlund

Description

Consider the following class definition:

package P

  model A
    P.B b;
  end A;

  model B
  end B;

  package P
  end P;

end P;

The lookup should fail when trying to resolve the type (P.B) of component b in model P.A.

  • The lookup will start the search for P in P.A without success.
  • It will continue the search for P in P, and find it (P.P)
  • It will fail to find B within P.P, and here it should stop the search. However instead it seems to continue to search for P again, at the top level.

Change History (6)

comment:1 by dhedberg, 15 years ago

The corresponding ticket in MathCore Trac is 2782.

comment:2 by Per Östlund, 15 years ago

This bug seems to have been fixed already, probably by Martin.

comment:3 by Per Östlund, 14 years ago

Reopened, since it doesn't seem to work now.

comment:4 by Martin Sjölund, 14 years ago

As far as I can tell, this is working correctly:

Error: Class P.B not found in scope P.A while instantiating b.

comment:5 by dhedberg, 14 years ago

Do you have a test case for this issue because it seems like it does not work anymore?

File: lookup.mo

package P

  model A
    P.B b;
  end A;

  model B
  end B;

  package P
  end P;

end P;

File: lookup.mos

loadFile("lookup.mo");
instantiateModel(P.A);
getErrorString();
checkModel(P.A);
getErrorString();

$ ../../build/bin/omc lookup.mos

true
"class P.A
end P.A;
"
""
"Check of P.A completed successfully.
Class P.A has 0 equation(s) and 0 variable(s).
0 of these are trivial equation(s).
"
""

comment:6 by Per Östlund, 14 years ago

Test case mosfiles-nosim/LookupPackageFail added in r6271.

Note: See TracTickets for help on using tickets.