Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363937 - [Xbase] avoid unnecessary closure conversion
Summary: [Xbase] avoid unnecessary closure conversion
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 346827
Blocks:
  Show dependency tree
 
Reported: 2011-11-16 11:18 EST by Sven Efftinge CLA
Modified: 2017-10-31 10:57 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: kepler+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.