Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355511 - AmbiguousFunctionReferenceError for RUIWidgets
Summary: AmbiguousFunctionReferenceError for RUIWidgets
Status: CLOSED DUPLICATE of bug 355989
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 10:18 EDT by Brian Svihovec CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments
Test EGL Files. (1.43 KB, application/zip)
2011-08-23 10:18 EDT, Brian Svihovec CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Svihovec CLA 2011-08-23 10:18:23 EDT
Created attachment 202003 [details]
Test EGL Files.

Create a package named pack2 and import the attached .egl files into the package.

When the files are generated, the following exception is thrown:

Caused by: org.eclipse.edt.mof.egl.AmbiguousFunctionReferenceError
	at org.eclipse.edt.mof.egl.impl.QualifiedFunctionInvocationImpl.resolveFunction(QualifiedFunctionInvocationImpl.java:116)
	at org.eclipse.edt.mof.egl.impl.QualifiedFunctionInvocationImpl.getTarget(QualifiedFunctionInvocationImpl.java:49)
	... 89 more

It looks like we need to add the following code to the end of TypeUtils::getBestFitFunctionMember - 

if (result.isEmpty()){
			result = candidates;
		}

		// If we still have more than one result, check to see if the first item in the list is in a part that is a subtype of the second part in the list
		// If the first part in the list is a subtype of the second part in the list, just return the first part in the list
		if (result.size() > 1){
			// Check to see if first function in the list is located in a subtype of the second function
			T first = (T)result.get(0);
			T second = (T)result.get(1);
			
			if(isSubtypeOf(((StructPart)first.getContainer()).getClassifier(), (EGLClass)IRUtils.getEGLType(((StructPart)second.getContainer()).getTypeSignature()))){
				result.clear();
				result.add((T) first);
			}
		}
		return result;

It is also worth noting that Container.getAllMembers seems to return a different set of functions when External Types are being used directly, as compared to RUIWidgets, which extend from Widget.  The attached .egl files contain an example of this scenario.
Comment 1 Paul Harmon CLA 2011-08-31 14:24:13 EDT
This appears to be a dup of Bug 355989, that is already fixed.

*** This bug has been marked as a duplicate of bug 355989 ***
Comment 2 Lisa Lasher CLA 2011-11-09 14:19:02 EST
This is a duplicate of a defect that was fixed a month ago, so I am closing it.