Bug 85870

Summary: Eclipse compiler won't detect invalid code when using 5.0 compliance level
Product: [Eclipse Project] JDT Reporter: Max Gilead <max.gilead>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Max Gilead CLA 2005-02-18 15:25:45 EST
This invalid code:

public class VoidTest
  {
  void b(Object o) {}
  void a() { b(a()); }
  }

compiles fine in Eclipse when using 5.0 compliance level. Javac gives this error:

javac -source 1.5 -target 1.5 VoidTest.java
VoidTest.java:6: 'void' type not allowed here
        b(a());
           ^
1 error


Eclipse 3.1M4 Linux/GTK
Comment 1 Philipe Mulet CLA 2005-02-18 16:11:34 EST

*** This bug has been marked as a duplicate of 81971 ***