This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Overloading Resolution

No replies
Steve Preston
Joined: 2010-03-24,
User offline. Last seen 42 years 45 weeks ago.
Thank you very much for your response.  The reason I was using the 2.7 version of the SLS was that I have that version of Scala installed, and that's the version you get by going to the "Reference Manuals" link of the website.

Anyway, it was helpful to look at the latest version, as there were some changes to the Overloading Resolution section.  Now I understand how the "most specific" method is chosen.  I'm still confused about the types other than parameterized methods and polymorphic methods, that could represent overloaded members, but I guess they may be talking about parameterless methods or the getter methods for vars and vals.

Thanks again for the help.

--
Steve Preston


From: Paul Phillips <paulp@improving.org>
To: Steve Preston <liveactionsteve@yahoo.com>
Cc: scala@listes.epfl.ch
Sent: Wed, March 24, 2010 2:40:39 PM
Subject: Re: [scala] Overloading Resolution

On Wed, Mar 24, 2010 at 11:55:17AM -0700, Steve Preston wrote:
> Since the phrase "parameterized method" is never defined, is the
> reader to assume that parameterized methods are simply methods
> declared or defined with a parameter list (i.e. the ParamClause
> nonterminal in the grammar)?

It would seem so.  I googled my way to this:

  http://www.scala-lang.org/node/121

"Methods in Scala can be parameterized with both values and types. Like
on the class level, value parameters are enclosed in a pair of
parentheses, while type parameters are declared within a pair of
brackets."

I'd have to look harder than I have time for at this second to take a
stab at the meat of your question.  But you should really work from an
up to date specification before asking questions:

  http://www.scala-lang.org/node/212/pdfs

--
Paul Phillips      | Every normal man must be tempted at times
In Theory          | to spit on his hands, hoist the black flag,
Empiricist        | and begin to slit throats.
pull his pi pal!  |    -- H. L. Mencken

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland