Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • T titan.EclipsePlug-ins
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 90
    • Issues 90
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Eclipse Projects
  • Eclipse Titan
  • titan.EclipsePlug-ins
  • Issues
  • #443

Closed
Open
Created Sep 28, 2021 by Adam Knapp@aknappqwtMaintainer

Assigning optional type to base types

During the code generation it may occur that an optional type (usually an optional field of a complex type) have to be assigned to its base type variant, e.g.

Optional<TitanInteger> a = new Optional<TitanInteger>(TitanInteger.class);
TitanInteger b = new TitanInteger();
b.operator_assign(a); // This is the currently generated code
b.operator_assign(a.constGet()); // This is a possible solution

The constGet() function of the Optional class performs a check to not to return an unbound or omit value. If this happens than it will result in a dynamic test case error.

A possible solution is presented above, which requires the improvement of the code generation. After investigation this solution seems a quite complex to implement in the current code structure.

An alternative way is completing the runtime lib by allowing to assign optional types to their base types. By this way the code generation doesn't need to be changed.

/cc @aknappqwt

Assignee
Assign to
Time tracking

Copyright © Eclipse Foundation, Inc. All Rights Reserved.     Privacy Policy | Terms of Use | Copyright Agent