Opened 18 years ago

Closed 10 years ago

#95 closed defect (worksforme)

I get "Stack overflow!" during instantiation (or parsing?)

Reported by: jakesson Owned by: Per Östlund
Priority: critical Milestone:
Component: Frontend Version:
Keywords: Cc: jakesson, Adrian Pop, Jens Frenkel

Description


Change History (6)

comment:1 by jakesson, 18 years ago

The following model results in a "Stack overflow!" error message when Cm1 is
instantiated using

omc Cm1.mo

I am not sure if the error is in the parser or later in the instantiation process.

model Cm1 
  
  extends C0.Colors.MyPalette(p(redeclare C0.Colors.Green
c3(r=0.56,g=0.85,b=0.24),c1(b=0.23)));
  
  model C0 
    
    model Colors 
      model Color 
        Real r=0;
        Real g=0;
        Real b=0;
      end Color;
      
      model Red 
        extends Color(r=1);
      end Red;
      
      model Green 
        extends Color(g=1);
      end Green;
      
      model Blue 
        extends Color(b=1);
      end Blue;
      
      model Palette 
         replaceable Color c1;
         replaceable Color c2;
         replaceable Color c3(b=0.001);
      end Palette;
      
      model MyPalette 
        
        Real q = 0.3;
        
        Palette p(redeclare replaceable Red c1(g=0.1,b=q),redeclare replaceable
Blue c2,
                                redeclare replaceable Green c3(b=0.002));
        
      end MyPalette;
      
    end Colors;
    
  end C0;
  
  C0.Colors.MyPalette palette(p(c3(r=0.1),redeclare C0.Colors.Red c1(g=0.2)));
  
end Cm1;
Last edited 12 years ago by Martin Sjölund (previous) (diff)

comment:2 by Peter Aronsson, 18 years ago

Now it does not give stack overflow, but instead says:
Variable q not found in scope Cm1.C0.Colors.Red. Probably due to elaborating of
modifiers in wrong scope.

comment:3 by Jens Frenkel, 12 years ago

Cc: Jens Frenkel added
Component: Backend
Owner: changed from jakesson to Per Östlund

comment:4 by anonymous, 12 years ago

Component: BackendFrontend

comment:5 by anonymous, 10 years ago

This is a historical, very old ticket.
But I think it can be closed now: the model works well now!

regards

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

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.