Bug 7137 - Invalid type not flagged by compiler
Summary: Invalid type not flagged by compiler
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-20 12:02 EST by OTI Support CLA
Modified: 2002-01-11 08:56 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OTI Support CLA 2001-12-20 12:02:57 EST
The following class doesn't cause a compiler error:

public class TestCompiler {
 static String foo() {return "";}

 public TestCompiler() {
  super();
 }
 public static void main(String[] args) {
   int jim =0;
   jim += foo();
 }

}


I think it should, since it assigns the sum of 0 and "" to an int.
Comment 1 Philipe Mulet CLA 2002-01-08 11:55:31 EST
In build 20011218, the compiler reports an error:

The operator += is undefined for the argument type(s) int, java.lang.String

Duplicate of 1GKB28A: ITPJCORE:WIN2000 - Compiler accepts incorrect code, was 
resolved early in 2.0 stream.
Closing.