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

naive question about polymorphic dispatching and currying

No replies
Meredith Gregory
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Dear Scalarazzi,
i guess this is well known, but i was surprised. Overloaded dispatching doesn't work after currying. What's the reason?
Code sample
result:
[INFO] Compiling 5 source files to /Users/lgm/work/src/projex/stellar/curry/target/classes at 1301515578111 [ERROR] /Users/lgm/work/src/projex/stellar/curry/src/main/scala/com/biosimilarity/repro/model/curry.scala:70: error: ambiguous reference to overloaded definition,[INFO] both method dialSettings in object MyPanel of type (instrument: com.biosimilarity.repro.model.Instrument)(position: com.biosimilarity.repro.model.RightPosition)Option[com.biosimilarity.repro.model.Readback] [INFO] and  method dialSettings in object MyPanel of type (instrument: com.biosimilarity.repro.model.Instrument)(position: com.biosimilarity.repro.model.MiddlePosition)Option[com.biosimilarity.repro.model.Readback] [INFO] match argument types (com.biosimilarity.repro.model.Instrument)[INFO]     dialSettings( Instrument( instName ) )([INFO]     ^[ERROR] one error found[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 20.064s[INFO] Finished at: Wed Mar 30 13:06:22 PDT 2011 [INFO] Final Memory: 6M/81M[INFO]
Best wishes,
--greg

--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136

+1 206.650.3740

http://biosimilarity.blogspot.com

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