Bug 404572 - Typing by Example
Summary: Typing by Example
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.4.0   Edit
Hardware: PC Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 11:15 EDT by Christian Dietrich CLA
Modified: 2013-03-28 11:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2013-03-28 11:15:19 EDT
It is currently not possible to infer a type in the jvmmodelinferrer without actually assigning it a body to something (logical container magic)

Lets asume following grammar

==============================================
Model:
	elements+=Element*;
	
Element:
	"field" name=ID "=" init=XExpression;
============================================== 

i want to create simple beans from that

==============================================
val f = e.toField(e.name, inferredType(e.init)) []
   					members += f
   					members += e.toGetter(e.name, inferredType(e.init))
   					members += e.toSetter(e.name, inferredType(e.init))
==============================================

this is acutally not working since the inference does not work.
Cannot infer type from recursive usage. Type 'Object' is used.
Comment 1 Christian Dietrich CLA 2013-03-28 11:15:42 EDT
see http://www.eclipse.org/forums/index.php/t/461747/ too