Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341909

Summary: [xbase][common.types] JvmSynonymTypeReference could be useful
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: sven.efftinge
Version: 2.0.0Flags: sebastian.zarnekow: kepler+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 376037    
Bug Blocks:    

Description Sebastian Zarnekow CLA 2011-04-05 09:50:22 EDT
Usecases: Expected type in a for loop is either Iterable or an array. We cannot use MultiTypeReferences for this usecase as that would imply that the expected type is both an iterable and an array.

Other opportunities:
A string literal '123' could be either a String or a Number.
'c' could either be a String or a character.

IntegerLiteral 12345 could be Integer, Long, Short (but not byte since it is to big) as well as BigInteger or BigDecimal.

The type provider could return synonym type references for operations that return e.g. an array or a list. 

SynonymTypeReferences could have a primary type and a number of synonyms.
Comment 1 Sebastian Zarnekow CLA 2013-03-12 15:03:28 EDT
We already have something like a synonym type reference and it turned out to be only of limited value. In most cases we know which type was expected and therefore I don't see much benefit in enhancing the existing concepts further. Marked as resolved.
Comment 2 Eclipse Webmaster CLA 2017-10-31 11:07:26 EDT
Requested via bug 522520.

-M.
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:18:51 EDT
Requested via bug 522520.

-M.