ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0005607 | Part 01: TTCN-3 Core Language | Technical | public | 14-07-2010 15:34 | 14-12-2010 23:59

Reporter | Jacob Wieland - Spirent |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.3.1 (published 2011-06) | Fixed in Version | v4.3.1 (published 2011-06) |
Clause Reference(s) | 6.2.4.
Source (company - Author) | Testing Technologies - Jacob Wieland

Summary | 0005607: definitions of an enum type should not have the same name as an enum value in that type

Description

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.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

related to | 0005958 | closed | Ina Schieferdecker | Example 4 of section 8.2.3.1 must be rewritten according to CR5607
related to | 0006440 | closed | Ina Schieferdecker | Restriction on imported enumerated types

Attached Files | CR5607.doc (40,960) 03-09-2010 11:54 http://oldforge.etsi.org/mantis/file_download.php?file_id=2440&type=bug

Issue History
Date Modified | Username | Field | Change
14-07-2010 15:34 | Jacob Wieland - Spirent | New Issue |
14-07-2010 15:34 | Jacob Wieland - Spirent | Clause Reference(s) | => 6.2.4.
14-07-2010 15:34 | Jacob Wieland - Spirent | Source (company - Author) | => Testing Technologies - Jacob Wieland
30-08-2010 11:32 | Gyorgy Rethy | Status | new => assigned
30-08-2010 11:32 | Gyorgy Rethy | Assigned To | => Jacob Wieland - Spirent
30-08-2010 11:40 | Gyorgy Rethy | Note Added: 0009652 |
30-08-2010 13:41 | Jacob Wieland - Spirent | Note Added: 0009654 |
30-08-2010 17:24 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
02-09-2010 09:53 | Gyorgy Rethy | Note Added: 0009691 |
02-09-2010 09:53 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
03-09-2010 09:25 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
03-09-2010 09:25 | Gyorgy Rethy | Target Version | => Edition 4.3.1 (not yet published)
03-09-2010 11:53 | Jacob Wieland - Spirent | Note Added: 0009708 |
03-09-2010 11:54 | Jacob Wieland - Spirent | File Added: CR5607.doc |
03-09-2010 11:54 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
03-09-2010 11:54 | Jacob Wieland - Spirent | Assigned To | Gyorgy Rethy => Ina Schieferdecker
03-09-2010 11:55 | Jacob Wieland - Spirent | Status | assigned => resolved
03-09-2010 11:55 | Jacob Wieland - Spirent | Fixed in Version | => Edition 4.3.1 (not yet published)
03-09-2010 11:55 | Jacob Wieland - Spirent | Resolution | open => fixed
14-12-2010 23:58 | Ina Schieferdecker | Note Added: 0009973 |
14-12-2010 23:59 | Ina Schieferdecker | Status | resolved => closed
28-11-2011 15:38 | Ina Schieferdecker | Relationship added | related to 0005958
19-03-2013 08:22 | Tomas Urban | Relationship added | related 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