ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0005607Part 01: TTCN-3 Core LanguageTechnicalpublic14-07-2010 15:3414-12-2010 23:59
Jacob Wieland - Spirent 
Ina Schieferdecker 
normalminorN/A
closedfixed 
 
v4.3.1 (published 2011-06)v4.3.1 (published 2011-06) 
6.2.4.
Testing Technologies - Jacob Wieland
0005607: definitions of an enum type should not have the same name as an enum value in that type
At the moment, a local definition (parameter, variable or constant) or a definition inherited from the runs on clause (i.e. component variable or constant) can have the same name as an enumerated value defined in some enumerated type.

If that definition has an enumerated type which includes such a value, it would not be possible to distinguish between the enum value and the reference to that definition (both have the same type, none of them can be prefixed to resolve the nameclash).

To avoid this, it should be forbidden to introduce (local) definitions (except struct-field-defs) of an enumerated type that have the same name as an enumerated value in that type.

For consistency's sake, the same restriction could be applied to global definitions (const, modulepar, template), as well. Then, it will never be necessary to prefix an reference to a definition of an enumerated type to resolve the nameclash with the enumerated value. Also, defining an entity of an enumerated type with the same name as an enumerated value in that type is pathological at best and would only lead to confusion in any case - another reason why this should be forbidden.
No tags attached.
related to 0005958closed Ina Schieferdecker Example 4 of section 8.2.3.1 must be rewritten according to CR5607 
related to 0006440closed Ina Schieferdecker Restriction on imported enumerated types 
doc CR5607.doc (40,960) 03-09-2010 11:54
http://oldforge.etsi.org/mantis/file_download.php?file_id=2440&type=bug
Issue History
14-07-2010 15:34Jacob Wieland - SpirentNew Issue
14-07-2010 15:34Jacob Wieland - SpirentClause Reference(s) => 6.2.4.
14-07-2010 15:34Jacob Wieland - SpirentSource (company - Author) => Testing Technologies - Jacob Wieland
30-08-2010 11:32Gyorgy RethyStatusnew => assigned
30-08-2010 11:32Gyorgy RethyAssigned To => Jacob Wieland - Spirent
30-08-2010 11:40Gyorgy RethyNote Added: 0009652
30-08-2010 13:41Jacob Wieland - SpirentNote Added: 0009654
30-08-2010 17:24Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Gyorgy Rethy
02-09-2010 09:53Gyorgy RethyNote Added: 0009691
02-09-2010 09:53Gyorgy RethyAssigned ToGyorgy Rethy => Jacob Wieland - Spirent
03-09-2010 09:25Gyorgy RethyProjectTTCN-3 Change Requests => Part 01: TTCN-3 Core Language
03-09-2010 09:25Gyorgy RethyTarget Version => Edition 4.3.1 (not yet published)
03-09-2010 11:53Jacob Wieland - SpirentNote Added: 0009708
03-09-2010 11:54Jacob Wieland - SpirentFile Added: CR5607.doc
03-09-2010 11:54Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Gyorgy Rethy
03-09-2010 11:54Jacob Wieland - SpirentAssigned ToGyorgy Rethy => Ina Schieferdecker
03-09-2010 11:55Jacob Wieland - SpirentStatusassigned => resolved
03-09-2010 11:55Jacob Wieland - SpirentFixed in Version => Edition 4.3.1 (not yet published)
03-09-2010 11:55Jacob Wieland - SpirentResolutionopen => fixed
14-12-2010 23:58Ina SchieferdeckerNote Added: 0009973
14-12-2010 23:59Ina SchieferdeckerStatusresolved => closed
28-11-2011 15:38Ina SchieferdeckerRelationship addedrelated to 0005958
19-03-2013 08:22Tomas UrbanRelationship addedrelated to 0006440

Notes
(0009652)
Gyorgy Rethy   
30-08-2010 11:40   
Forbid local and global names of enum. type use the same name as an enumer. value of that given type.
(0009654)
Jacob Wieland - Spirent   
30-08-2010 13:41   
In 6.2.4 the following sentence should be added:

"They shall also not be re-used for local or global definitions of the enumerated type which introduces them."

Maybe also a NOTE should be added that because of this all template/var/const/modulepar/formal parameter declarations of an enumerated type shall not have the same name as an enumeration in that type, regardless where that declaration occurs.
(0009691)
Gyorgy Rethy   
02-09-2010 09:53   
This sentence is somewhat too generic, will not be clear for the ordinary user. I think we should be more precise in that, like:
"When a TTCN-3 global or local definition is declared using an imported enumerated type, the name of that definition shall not be same as any of the enumeration value names of that type."
(0009708)
Jacob Wieland - Spirent   
03-09-2010 11:53   
agreed, I have added this to the document I'll shortly upload
(0009973)
Ina Schieferdecker   
14-12-2010 23:58   
Implemented as proposed