Bug 250632

Summary: [plan] [generics] [itds] Wrong 'cannot convert" error
Product: [Tools] AspectJ Reporter: Michael Esser <MikeEA>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: aclement, MikeEA
Version: DEVELOPMENT   
Target Milestone: 1.6.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Esser CLA 2008-10-13 07:25:13 EDT
When compiling this (with AspectJ 1.6.2):

-----------

public interface IMarker<CLOCK,STATE> { }

public aspect MyAspect
{

	public void IMarker<CLOCK,STATE>.map()
	{
		CLOCK[] var = find();
	};


	
	public CLOCK[] IMarker<CLOCK,STATE>.find()
	{
		return null;
	}
	
}

-----------

I get the error

..\src\foo\MyAspect.aj:10:0::0 Type mismatch: cannot convert from Object[] to CLOCK[]


Michael Esser
Comment 1 Andrew Clement CLA 2008-10-14 16:32:34 EDT
The problem is due to the type variable being used in a array form.  During type completion the type variable is collapsed to its bound for the find() return type and that causes problems at the call site 'CLOCK[] var = find()' since we then compare CLOCK[] and Object[].



Comment 2 Andrew Clement CLA 2008-10-14 18:55:28 EDT
test and fix committed. Fix in ResolvedMemberImpl - not great code but works.