Skip to content
Tags

,

JSR335: Overload Resolution

August 20, 2013

Since methods and constructors can be overloaded in Java, the rules for finding application methods must take into account poly expressions. The compiler performs overload resolution in 3 phases:

  1. Identify potentially applicable methods
  2. Perform type analysis to find applicable methods based on argument types
  3. Choose the most specific method from the list of applicable methods

With poly fills, some of the search for applicable methods occur with the known types, and completed even though some expression types won’t be known until runtime.

To accomodate lambda expressions, potential applicability takes into account arity of the method and the functional interface target types.

Advertisements

From → Java

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: