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

Bug 361044

Summary: Domain Model Example: TypeCheck is missing
Product: [Modeling] TMF Reporter: Christian Dietrich <christian.dietrich.opensource>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sebastian.zarnekow, tmf.xtext-inbox
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Christian Dietrich CLA 2011-10-15 07:01:56 EDT
Build Identifier: 2.0.0 2.0.1 2.1.0.20111013

There is not typecheck performed in the domain model example.
something like the following is missing from the domainmodeljavavalidator

	@Override
	protected Set<EReference> getTypeConformanceCheckedReferences() {
		return Sets.union(super.getTypeConformanceCheckedReferences(), ImmutableSet.of(DomainmodelPackage.Literals.OPERATION__BODY));

	}

Reproducible: Always
Comment 1 Jan Koehnlein CLA 2011-10-21 11:32:50 EDT
I solved this issue more profoundly: If an expression has a logical container, it should be evaluated no matter what the containment reference is. Thus, users of Xbase only have to associate the logical container.

Currently fixing tests
Comment 2 Jan Koehnlein CLA 2011-10-24 10:35:37 EDT
Fixed in HEAD
Comment 3 Jan Koehnlein CLA 2011-10-24 10:36:46 EDT
Note: It's the expected *return* type of the expression that had to be changed, not the expected type.
Comment 4 Christian Dietrich CLA 2011-10-26 14:06:34 EDT
Hi,

i just tried yesterdays build. org.eclipse.xtext.xtext.ui.examples_2.1.0.v201110251848
a model like

entity Test {
	
	op test() : String {
		return 1
	}
	 
}

still is valid in the editor but leads to a compile error in the generated java class
Comment 5 Jan Koehnlein CLA 2011-10-27 06:16:37 EDT
Fixed confusion around ILogicalContainers in HEAD. Thanks for testing.