Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 399537 - [1.8][compiler] Exceptions thrown from lambda body must match specification per function descriptor
Summary: [1.8][compiler] Exceptions thrown from lambda body must match specification p...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 382701
  Show dependency tree
 
Reported: 2013-01-30 13:53 EST by Srikanth Sankaran CLA
Modified: 2013-02-05 20:49 EST (History)
0 users

See Also:


Attachments
Work in progress. (12.19 KB, patch)
2013-02-01 14:23 EST, Srikanth Sankaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-01-30 13:53:08 EST
BETA_JAVA8:

The following program should trigger an error at the throw site as it illegal
to throw a checked exception from a lambda body that is not specified in the
function descriptor computed for the single abstract method of the functional
interface.

// -- 
import java.io.IOException;

interface I { void run(int x); }

class X {
	void foo() {
	    I r = (int y) -> {
	    	throw new IOException();
	    };
        }
}
Comment 1 Srikanth Sankaran CLA 2013-02-01 14:23:56 EST
Created attachment 226463 [details]
Work in progress.