Bug 105580 - Possibly Misleading Type mismatch error message
Summary: Possibly Misleading Type mismatch error message
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P5 trivial (vote)
Target Milestone: ---   Edit
Assignee: Andrew J Huff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-29 11:56 EDT by Bill Napier CLA
Modified: 2007-10-23 09:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Napier CLA 2005-07-29 11:56:24 EDT
With 2 classes a.C1 and b.C1, the following line:

a.C1 a = new b.C1();

yields this error message:

Type mismatch: cannot convert from C1 to C1.

While in this case it is pretty obvious what the problem is, but we came across
this problem when using a external API (Type mismatch: cannont convert from
Iterator to Iterator).

A simple fix would be to test for the case when the shortened name of both
classes are the same and instead give the full package name.  For example:

Type mismatch: cannot convert from b.C1 to a.C1.
Comment 1 Adrian Colyer CLA 2005-08-01 04:09:53 EDT
Andrew, this is a nice self-contained bug report you could possibly take a look
at please.
Comment 2 Andrew J Huff CLA 2005-08-01 06:06:20 EDT
Found this in JDT for eclipse 3.1.0 final, so I've raised it as bug 105658 in JDT.