Opened 14 years ago

Last modified 14 years ago

#1258 closed defect (invalid)

Frontend fails to parse redeclarations with array subscripts on type

Reported by: Peter Aronsson Owned by: Peter Aronsson
Priority: critical Milestone:
Component: Version:
Keywords: Cc: Peter Aronsson,

Description

Example:
{{{ class fieldDimensionDemo

class parent

replaceable Real field[2,2]={{0,0},{0,0}};

end parent;

class child

extends parent(redeclare Real[2,2] field={{1,1},{1,1}} );

end child;

end fieldDimensionDemo;}}}

The problem above is in the redeclaration 'redeclare Real[2,2] ...'.

Change History (2)

comment:2 by Adrian Pop, 14 years ago

This is NOT a bug! The grammar does NOT allow it.

element_redeclaration :
  redeclare [ each ] [ final ]
  ( ( class_definition | component_clause1) | element_replaceable )

component_clause1 :
  type_prefix type_specifier component_declaration1

type_specifier :
  name

You can only have a name without array subscripts as type_specifier in component_declaration1.
Any tool that lets you parse this is not conform to the specification.

Note: See TracTickets for help on using tickets.