Bug 442013 - [xtype] Linking of inner types looses information
Summary: [xtype] Linking of inner types looses information
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.6.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 442028
Blocks:
  Show dependency tree
 
Reported: 2014-08-19 02:34 EDT by Sebastian Zarnekow CLA
Modified: 2015-11-11 04:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2014-08-19 02:34:28 EDT
Observed in the context of bug 417675 :

Consider the following Java classes:

class C<T> {
  class D {
  }
}
class E extends C<String> {
}

A reference 'E.D' is equivalent to the type reference 'C<String>.D' but since JvmTypeRefernces in Xtype are modelled as plain x-refs with a qualified name, we loose this information when using 'E.D' in Xtend code.
The IJvmTypeProvider is queried with 'E.D' and should return a JvmType which is the raw type C.D. From that one, it cannot be deduced which value should be bound to the free type variable T even though the concrete syntax provided that information.
Comment 1 Sebastian Zarnekow CLA 2014-08-19 02:37:11 EDT
Possible solution / workaround:

When resolving an inner JvmParamterizedTypeReference via a subtype of the declaring type, keep the concrete syntax ('E.D' in the example) or the subtype information as an adapter / structural feature so that a proper LightweightTypeReference can be created from that by inspecting this information.
Comment 2 Sebastian Zarnekow CLA 2014-08-19 02:37:33 EDT
see ignored tests in SuperTypeTests.xtend
Comment 3 Sebastian Zarnekow CLA 2015-02-24 13:48:08 EST
Not 2.8