Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361044 - Domain Model Example: TypeCheck is missing
Summary: Domain Model Example: TypeCheck is missing
Status: VERIFIED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-15 07:01 EDT by Christian Dietrich CLA
Modified: 2011-10-28 12:01 EDT (History)
3 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.