Opened 8 years ago

Closed 8 years ago

#4211 closed defect (duplicate)

Duplicate function definitions are not reported as such

Reported by: Francesco Casella Owned by: somebody
Priority: normal Milestone: 2.0.0
Component: *unknown* Version:
Keywords: Cc: francois.beaude@…

Description

Consider the following test package, where function f is defined twice

package TestDuplicateFunction
  function f
    input Real x;
    output Real y;
  algorithm
    y := x;
  end f;
  
  function f
    input Real x;
    input Real z;
    output Real y;
  algorithm
    y := x+z;
  end f;

  model Test
    Real r = f(time);
  end Test;
end TestDuplicateFunction;

When compiling Test.TestDuplicateFunction, the following error messages are obtained:

[1] Translation Error
Internal error Env.avlTreeReplace failed

[2] Translation Error
Error occurred while flattening model TestDuplicateFunction.Test

I guess a somwhat clearer message pointing to the presence of multiple definitions of TestDuplicateFunction.f would be nice to have.

Attachments (1)

TestDuplicateFunction.mo (314 bytes ) - added by Francesco Casella 8 years ago.
Test package .mo file

Download all attachments as: .zip

Change History (4)

by Francesco Casella, 8 years ago

Attachment: TestDuplicateFunction.mo added

Test package .mo file

comment:1 by Francesco Casella, 8 years ago

Cc: francois.beaude@… added

comment:2 by anonymous, 8 years ago

relate to #3535

comment:3 by Francesco Casella, 8 years ago

Resolution: duplicate
Status: newclosed

Actually a duplicate of #3535

Note: See TracTickets for help on using tickets.