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

Bug 239243

Summary: [QVTc] Unable to match parameter type in query invocations
Product: z_Archived Reporter: Victor Roldan Betancort <vroldanbet>
Component: UMLXAssignee: Ed Willink <ed>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: vsanchez
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Victor Roldan Betancort CLA 2008-07-02 09:51:58 EDT
Build ID: I20080617-2000

The editor is unable to match types of query invocation actual parameters.
The following transformation evidences this inconsistency,
where the editor shows an error for "getStringSize('foobar') = 6;" predicate.


transformation umlRdbms {
	middle imports tuml2rdbms;	
}

query umlRdbms::getStringSize (someString:String): Integer {
  someString -> size()
}

map ClassToTable in umlRdbms
{
	where middle () {		 
		  getStringSize('foobar') = 6;
	}
}
Comment 1 Ed Willink CLA 2008-07-11 02:54:13 EDT
Thanks for this.

[Functions are missing from the QVTc spec, so everything here is an extension.]

Your example is invalid so at least you get an error.

More seriously umlRdbms::getStringSize('foobar') = 6; does not give an error.

To give your example consistent behaviour QVTcEnvironment needs to support lookup of unqualified function names in the transformation scope. Will do.
------
Parsing predicates and assignments is awkward because their syntax is very similar. To avoid conflicts an assignment is parsed as

oclExpression ":=" oclExpression

rather than

name "." name ":=" oclExpression

Your example has therefore been parsed as a 'valid' left hand side, although the lookup fails. AbstractQVTcAnalyzer should reject use of anything other than 
name "." name in the left hand expression. Will do.



Comment 2 Ed Willink CLA 2008-07-12 07:31:09 EDT
Fixed in CVS.

Unqualified queries are now allowed in plausible contexts.

Example here now gives "Assignment to property or variable expected".