Bug 250632 - [plan] [generics] [itds] Wrong 'cannot convert" error
Summary: [plan] [generics] [itds] Wrong 'cannot convert" error
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 1.6.3   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-13 07:25 EDT by Michael Esser CLA
Modified: 2008-10-14 18:55 EDT (History)
2 users (show)

See Also:


Attachments

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