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

ID | Project | Category | View Status | Date Submitted | Last Update
0007215 | Part 01: TTCN-3 Core Language | Clarification | public | 05-11-2015 12:07 | 11-12-2015 14:02

Reporter | Gyorgy Rethy |
Assigned To | Jacob Wieland - Spirent |
Priority | high | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.7.1 (published 2015-06) |
Target Version | v4.8.1 (published 2016-07) | Fixed in Version | v4.8.1 (published 2016-07) |
Clause Reference(s) | 6.2.4
Source (company - Author) | L.M.Ericsson

Summary | 0007215: Clarify the what the enumerated value's "type context" means
Description | The standard states that "The identifiers of enumerated values shall be unique within the enumerated type (but do not have to be globally unique) and are consequently visible in the context of the given type only." However, the exact meaning of "context of the given type" is not further elaborated. Therefore it shall be specified in more detail.
Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7215_resolution_v1.docx (97,138) 05-11-2015 16:31 http://oldforge.etsi.org/mantis/file_download.php?file_id=3370&type=bug CR7215_resolution_v2.docx (108,649) 04-12-2015 11:15 http://oldforge.etsi.org/mantis/file_download.php?file_id=3384&type=bug CR7215_resolution_v3.docx (108,555) 04-12-2015 13:12 http://oldforge.etsi.org/mantis/file_download.php?file_id=3385&type=bug

Issue History
Date Modified | Username | Field | Change
05-11-2015 12:07 | Gyorgy Rethy | New Issue |
05-11-2015 12:07 | Gyorgy Rethy | Assigned To | => Gyorgy Rethy
05-11-2015 12:07 | Gyorgy Rethy | Status | new => assigned
05-11-2015 13:10 | Gyorgy Rethy | Description Updated | bug_revision_view_page.php?rev_id=208#r208
05-11-2015 16:31 | Gyorgy Rethy | File Added: CR7215_resolution_v1.docx |
05-11-2015 16:37 | Gyorgy Rethy | Note Added: 0013512 |
05-11-2015 16:38 | Gyorgy Rethy | Note Edited: 0013512 | bug_revision_view_page.php?bugnote_id=13512#r210
05-11-2015 16:38 | Gyorgy Rethy | Note Edited: 0013512 | bug_revision_view_page.php?bugnote_id=13512#r211
05-11-2015 16:39 | Gyorgy Rethy | Note Edited: 0013512 | bug_revision_view_page.php?bugnote_id=13512#r212
05-11-2015 16:40 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
05-11-2015 16:40 | Gyorgy Rethy | Status | assigned => confirmed
06-11-2015 09:47 | Jacob Wieland - Spirent | Note Added: 0013515 |
06-11-2015 09:48 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Gyorgy Rethy
06-11-2015 09:48 | Jacob Wieland - Spirent | Status | confirmed => assigned
01-12-2015 15:05 | Gyorgy Rethy | Note Added: 0013540 |
01-12-2015 15:32 | Gyorgy Rethy | Note Edited: 0013540 | bug_revision_view_page.php?bugnote_id=13540#r218
01-12-2015 15:52 | Gyorgy Rethy | Note Edited: 0013540 | bug_revision_view_page.php?bugnote_id=13540#r219
02-12-2015 12:59 | Jacob Wieland - Spirent | Note Added: 0013541 |
04-12-2015 10:34 | Gyorgy Rethy | File Added: CR7215_resolution_v2.docx |
04-12-2015 10:37 | Gyorgy Rethy | Note Added: 0013549 |
04-12-2015 10:37 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jacob Wieland - Spirent
04-12-2015 10:37 | Gyorgy Rethy | Priority | normal => high
04-12-2015 10:37 | Gyorgy Rethy | Status | assigned => confirmed
04-12-2015 10:37 | Gyorgy Rethy | Product Version | => v4.7.1 (published 2015-06)
04-12-2015 10:37 | Gyorgy Rethy | Target Version | => v4.8.1 (published 2016-07)
04-12-2015 10:38 | Gyorgy Rethy | File Deleted: CR7215_resolution_v2.docx |
04-12-2015 10:58 | Gyorgy Rethy | File Added: CR7215_resolution_v2.docx |
04-12-2015 11:00 | Gyorgy Rethy | File Deleted: CR7215_resolution_v2.docx |
04-12-2015 11:15 | Gyorgy Rethy | File Added: CR7215_resolution_v2.docx |
04-12-2015 11:16 | Gyorgy Rethy | Note Added: 0013550 |
04-12-2015 13:12 | Gyorgy Rethy | File Added: CR7215_resolution_v3.docx |
04-12-2015 13:13 | Gyorgy Rethy | Note Added: 0013552 |
04-12-2015 14:25 | Jacob Wieland - Spirent | Note Added: 0013555 |
04-12-2015 14:25 | Jacob Wieland - Spirent | Status | confirmed => resolved
04-12-2015 14:25 | Jacob Wieland - Spirent | Fixed in Version | => v4.8.1 (published 2016-07)
04-12-2015 14:25 | Jacob Wieland - Spirent | Resolution | open => fixed
11-12-2015 14:02 | Gyorgy Rethy | Note Added: 0013588 |
11-12-2015 14:02 | Gyorgy Rethy | Status | resolved => closed

Notes

(0013512)
Gyorgy Rethy
05-11-2015 16:37 (edited on: 05-11-2015 16:39)

Actually, I didn't need to change or specify the rules for enumarated. It was already further down, in paragraph 3 and example 2 of the same clause (6.2.4):
"For any instantiation or value reference of an enumerated type, the given type shall be implicitly or explicitly referenced.
NOTE 2: If the enumerated type is an element of a user defined structured type, the enumerated type is implicitly referenced via the given element (i.e. by the identifier of the element or the position of the value in a value list notation) at value assignment, instantiation, etc.
EXAMPLE2:
...
// But the following causes an error
if ( Tuesday == Wednesday ) {...}
// there is no TTCN-3 type(d) object to establish the type context for the equality operator
// Please note that the values Tuesday and Wednesday are defined within the type
// MyFirstEnumType only, but this is not sufficient to establish the type context
"
So, to make it more readable and to keep related rules in one place, I have moved paragraph 3 into paragraph 1, added two more examples to NOTE2 and a matching example to EXAMPLE2.
Please review.

(0013515)
Jacob Wieland - Spirent
06-11-2015 09:47

Yes, this makes things more clear.
However, reading the text, I stumbled upon this sentence:
"Operations on enumerated types shall only use these identifiers and are restricted to assignment, equivalence and ordering operators."
Doesn't that entail that I cannot compare a variable/field of the enumerated type or pass it as an actual parameter, since the only operations allowed on it are comparisons and these cannot use variables, but only the enumerated names (I guess on both sides) which then does not work because there is no enum context.
I think this sentence is bogus and needs to be rewritten.

(0013540)
Gyorgy Rethy
01-12-2015 15:05 (edited on: 01-12-2015 15:52)

Of course you can compare an enumerated value with a typed object and can pass it as actual parameter.
The given sentence talks about "operations" only, and mentions equality explicitly. The note below says: "Another example is passing an enumerated value as actual parameter, in which case the type of the corresponding formal parameter establishes the type context needed to make the enumeration value visible."
But based on the discussion today at the STF160 tool vendors meeting I tend to think that a more generic approach is needed to explain what establishes a type context.
I propose to define it in a way that all language procedures requiring type compatibility (operations, parameter passing etc.) establish the type context, if at least one participant is a typed object, while statements allowing type incompatibility require typed objects as arguments.

(0013541)
Jacob Wieland - Spirent
02-12-2015 12:59

it is not only statements allowing type incompatibility (which at the moment is only match) but also statements/operations allowing parameters of any type (i.e. no specific type required), which are log, testcase.stop and setverdict as well as the is-functions (if I'm not forgetting anything).

(0013549)
Gyorgy Rethy
04-12-2015 10:37

The issue (the specific case of using enum values within match()) has been also raised by STF160 at their tool vendors meeting @01.dec.2015. Hence priority is raised to high.

(0013550)
Gyorgy Rethy
04-12-2015 11:16

Please review CR7215_resolution_v2.docx.

(0013552)
Gyorgy Rethy
04-12-2015 13:13

CR7215_resolution_v3.docx: type context for comparision operators is added to Note2.

(0013555)
Jacob Wieland - Spirent
04-12-2015 14:25

I think this is ok now, can be set to resolved.

(0013588)
Gyorgy Rethy
11-12-2015 14:02

Added to draft V4.7.4