Opened 14 years ago

Closed 12 years ago

#1373 closed defect (fixed)

Inheritance breaks if the parent has an external declaration

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Backend Version:
Keywords: Cc: Martin Sjölund

Description

function myacos
  input Real x;
  output Real y;
external "builtin" y=acos(x);
end myacos;
function arccosx = myacos;
function arccosx3
  extends myacos;
end arccosx3;

class A
  import arccosx2 = myacos;
  constant Real x = arccosx(0);
  constant Real x2 = arccosx2(0);
  constant Real x3 = arccosx3(0);
end A;

This will generate arccosx and arccosx3. But they will return random memory ;)

Change History (1)

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

Cc: sjoelund.se, → sjoelund.se
Component: Backend
Resolution: fixed
Status: newclosed

This now generates a warning since it usually gives unexpected behaviour (and the spec doesn't allow inheriting external declarations).

Note: See TracTickets for help on using tickets.