Bug 382841 - [1.8][compiler] ClassCastException while compiling lambda expressions.
Summary: [1.8][compiler] ClassCastException while compiling lambda expressions.
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 380188
  Show dependency tree
 
Reported: 2012-06-18 07:14 EDT by Srikanth Sankaran CLA
Modified: 2012-06-18 11:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2012-06-18 07:14:19 EDT
BETA_JAVA8:

This was already reported via https://bugs.eclipse.org/bugs/show_bug.cgi?id=382727#c0, problem (b). I am splitting that bug into two since (a) and
(b) are unrelated.

The following program results in a ClassCastException being thrown
during compilation.

// -------- 8< --------------


interface I {
  void foo(int x, int y);
}
public class X {
  public static void main(String[] args) {
    int x, y;
    I i = (p, q) -> { 
      int r = 10;
    };
  }
}

Patch will follow shortly.