Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363937

Summary: [Xbase] avoid unnecessary closure conversion
Product: [Modeling] TMF Reporter: Sven Efftinge <sven.efftinge>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: sebastian.zarnekow
Version: 2.1.1Flags: sebastian.zarnekow: kepler+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 346827    
Bug Blocks:    

Description Sven Efftinge CLA 2011-11-16 11:18:11 EST
If closures are used in the context of a functional type (i.e. some type with one method in addition to all public Object members) we should use that as the closures type.

This should avoid unnecessary conversions in the compiler and also allows for
being able throw checked exceptions as long as they are declared as thrown by the functional type's method.

We could have a utility function to wrap and re-throw checked exceptions, which allows us to write code like this:

val x = unchecked[ someCodeThrowingCheckedExceptions() ]

Unchecked would internally rethrow any checked exception as a runtime exception.
That could be a convenient compromise if you have to deal with APIs (over)using checked exceptions.
Comment 1 Sebastian Zarnekow CLA 2013-04-19 05:43:05 EDT
Resolved.
Comment 2 Eclipse Webmaster CLA 2017-10-31 10:46:31 EDT
Requested via bug 522520.

-M.
Comment 3 Eclipse Webmaster CLA 2017-10-31 10:57:45 EDT
Requested via bug 522520.

-M.