Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342035 - [xbase][typeconformance] Supertype may not be visible
Summary: [xbase][typeconformance] Supertype may not be visible
Status: CLOSED DUPLICATE of bug 343710
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 376037
Blocks:
  Show dependency tree
 
Reported: 2011-04-06 11:23 EDT by Sebastian Zarnekow CLA
Modified: 2017-10-31 11:31 EDT (History)
0 users

See Also:
sebastian.zarnekow: kepler+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-04-06 11:23:31 EDT
if (true) new StringBuilder() else new StringBuffer()

The type of this expression is AbstractStringBuilder & Comparable<? extends CharSequence> or something similar.

However, AbstractStringBuilder is not visible but exposes public methods such as #trimToSize which may only be referenced from classes in the java.lang package. That's why the infered type of the if-expression should take the visibility of potential super types into account.

Proposed solution:
Add an error marker and a quickfix that adds a cast to a visible type such as CharSequence, Serializable or Object or at least a hint on what the user should do to avoid the problem.

Scheduled for Indigo but marked as minor since this is a rare corner case.
Comment 1 Sven Efftinge CLA 2012-11-21 04:07:01 EST
duplicate

*** This bug has been marked as a duplicate of bug 343710 ***
Comment 2 Eclipse Webmaster CLA 2017-10-31 11:31:13 EDT
Requested via bug 522520.

-M.