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

ID | Project | Category | View Status | Date Submitted | Last Update
0003970 | Part 01: TTCN-3 Core Language | Clarification | public | 15-08-2008 10:00 | 09-12-2008 16:37

Reporter | Thomas DeiÃŸ |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | major | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.1.1 (published 2009-06) | Fixed in Version | v4.1.1 (published 2009-06) |
Clause Reference(s) | part 1, 6.3
Source (company - Author) | Nokia Siemens Networks, Thomas DeiÃŸ

Summary | 0003970: Type compatibility not defined for union types
Description | Part 1 does not explain when a value of a union type is compatible with another union type. Neither does it state that union types are not compatible to each other. type union U {integer i}; type union V {integer i, boolean b}; ... var U u := {i := 1}; var V v := u; // correct?? var anytype w := u; // correct??
Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR3970_UnionCompatibility.doc (55,296) 24-11-2008 11:54 http://oldforge.etsi.org/mantis/file_download.php?file_id=1758&type=bug CR3970_UnionCompatibility_02.doc (51,712) 27-11-2008 08:49 http://oldforge.etsi.org/mantis/file_download.php?file_id=1810&type=bug

Issue History
Date Modified | Username | Field | Change
15-08-2008 10:00 | Thomas DeiÃŸ | New Issue |
15-08-2008 10:00 | Thomas DeiÃŸ | Clause Reference(s) | => part 1, 6.3
15-08-2008 10:00 | Thomas DeiÃŸ | Source (company - Author) | => Nokia Siemens Networks, Thomas DeiÃŸ
15-08-2008 10:01 | Thomas DeiÃŸ | Status | new => assigned
15-08-2008 10:01 | Thomas DeiÃŸ | Assigned To | => Ina Schieferdecker
17-08-2008 09:06 | Ina Schieferdecker | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
17-08-2008 09:07 | Ina Schieferdecker | Category | TTCN-3 Core Language => Clarification
17-08-2008 09:07 | Ina Schieferdecker | Target Version | => Edition 4.1.1 (not yet published)
24-11-2008 11:54 | Ina Schieferdecker | File Added: CR3970_UnionCompatibility.doc |
24-11-2008 11:54 | Ina Schieferdecker | Assigned To | Ina Schieferdecker => Gyorgy Rethy
24-11-2008 11:55 | Ina Schieferdecker | Note Added: 0007386 |
26-11-2008 13:48 | Gyorgy Rethy | Note Added: 0007447 |
26-11-2008 13:49 | Gyorgy Rethy | Note Edited: 0007447 |
26-11-2008 13:49 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Thomas DeiÃŸ
27-11-2008 08:49 | Thomas DeiÃŸ | File Added: CR3970_UnionCompatibility_02.doc |
27-11-2008 08:53 | Thomas DeiÃŸ | Note Added: 0007466 |
27-11-2008 08:53 | Thomas DeiÃŸ | Assigned To | Thomas DeiÃŸ => Ina Schieferdecker
09-12-2008 16:37 | Ina Schieferdecker | Status | assigned => resolved
09-12-2008 16:37 | Ina Schieferdecker | Resolution | open => fixed
09-12-2008 16:37 | Ina Schieferdecker | Fixed in Version | => Edition 4.1.1 (not yet published)
09-12-2008 16:37 | Ina Schieferdecker | Status | resolved => closed

Notes

(0007386)
Ina Schieferdecker
24-11-2008 11:55

Please check.

(0007447)
Gyorgy Rethy
26-11-2008 13:48 (edited on: 26-11-2008 13:49)

I agree to add the clause to the standard, but... Is
type union U1 {integer i};
type union U2 {integer i (0..1), boolean b};
function f( U1 p_u1) {
var U2 u2 := p_u1; // also correct?
}
We will know this only runtime. In this case either
- no need for identical fields for ALL fields of U1 in U2, enough if the selected field is compatible,
or
- the type of all identical fields of U2 shall be the same or subtypes the corresponding fields in U2. I.e. the above example becomes incorrect, but we gain compile time check-ability. In this case the correct example is
type union U1 {integer i(0..1)};
type union U2 {integer i, boolean b};
function f( U1 p_u1) {
var U2 u2 := p_u1; // also correct?
}
I vote for the 2nd solution and propose to change also existing compatibility rules accordingly.

(0007466)
Thomas DeiÃŸ
27-11-2008 08:53

I suggest to stick to the proposed solution with identical definitions. Otherwise the definitions on unselected fields would impact the type compatibility. Also, we would have to compare the type definitions to decide whether a value is compatible with a type.