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

ID | Project | Category | View Status | Date Submitted | Last Update
0008197 | Part 01: TTCN-3 Core Language | New Feature | public | 20-01-2023 13:59 | 23-01-2024 10:17

Reporter | Matthias Simon |
Assigned To | Jens Grabowski |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | won't fix |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version |  |
Clause Reference(s) | 6.2.5 -- Unions
Source (company - Author) | Nokia - Matthias Simon

Summary | 0008197: Automatic Alternative Selection for Unions

Description

I suggest support for automatic alternative selection for unions.
This feature would make the use of unions more convenient and less verbose. Additionally, it would also be helpful for specifying useful predefined types such as Optional, Result, and others.
Examples:
type union Payload {
charstring name,
integer number,
}
var Payload p := "Joseph Malik"; // implicit field name is chosen automatically
// Question: automatic selection also for right hand side contexts?
if (p != 23) {
setverdict(fail, "unexpected payload");
}

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files |

Issue History
Date Modified | Username | Field | Change
20-01-2023 13:59 | Matthias Simon | New Issue |
25-07-2023 12:30 | Gusztáv Adamis | Note Added: 0016498 |
26-07-2023 10:45 | Matthias Simon | Note Added: 0016502 |
05-09-2023 09:06 | Jens Grabowski | Note Added: 0016510 |
05-09-2023 09:06 | Jens Grabowski | Assigned To | => Matthias Simon
05-09-2023 09:06 | Jens Grabowski | Status | new => assigned
07-11-2023 14:28 | Jens Grabowski | Note Added: 0016538 |
07-11-2023 14:28 | Jens Grabowski | Status | assigned => closed
07-11-2023 14:28 | Jens Grabowski | Assigned To | Matthias Simon => Jens Grabowski
07-11-2023 14:28 | Jens Grabowski | Resolution | open => won't fix

Notes

(0016498)
Gusztáv Adamis
25-07-2023 12:30

It will not work, if a union has two fields of the same type type union Payload { charstring name, charstring birthplace, } var Payload p := "Joseph Malik"; // name or birthplace to be chosen?

(0016502)
Matthias Simon
26-07-2023 10:45

Yes, that's correct. The selection rules must include that alternative selections shall be unambiguous. Thanks for the mention.

(0016510)
Jens Grabowski
05-09-2023 09:06

TTF discussion: Proposal is not acceptable in its current form. Matthias will work on a new proposal.

(0016538)
Jens Grabowski
07-11-2023 14:28

TTF discussion: Problems are bigger than benefit.