Opened 10 years ago

Last modified 4 years ago

#2986 new defect

Trying to use a partial function gives linker error instead of compilation error

Reported by: Per Östlund Owned by: somebody
Priority: normal Milestone: Future
Component: MetaModelica Version: trunk
Keywords: Cc:

Description

Trying to run this:

function f
  input FuncType inFunc;
  input Real x;
  output Real y := FuncType(x);  // This is wrong, should be inFunc(x)

  partial function FuncType
    input Real x;
    output Real y;
  end FuncType;
end f;

function f2
  input Real x;
  output Real y := 2 * x;
end f2;

function test
  output Real x := f(f2, 3.0);
end test;

gives the error

"Error: OMC unable to load `./test.so': ./test.so: undefined symbol: omc_f_FuncType.

It would be better if it gave an error for trying to use a partial function instead.

Change History (2)

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

Component: BootstrappingFrontend
Owner: changed from Martin Sjölund to somebody

comment:2 by Per Östlund, 4 years ago

Component: FrontendMetaModelica

Works with the new frontend which will correctly give an error that FuncType is partial, but since MetaModelica uses the old frontend it's still an issue.

Note: See TracTickets for help on using tickets.