|
Re: Implicit type conversion: msg#00480lang.scala
Hi Tony, Tony Morris wrote: I have found what appears to be an anomaly in implicit type coercion. I Note that implicit defs (which were called 'views' prior to Scala 2) are not applied transitively. If the compiler finds a function call with no matching definition, it will then check to see if, by applying any of the exact implicit defs within scope to any of the parameters, it can find a matching function definition. If it can't, then it complains. I believe it complains in the event of any ambiguity with overloaded definitions or multiple 'useful' implicit defs within scope. Implicit definitions should be used with care. Having many implicit definitions within scope can be confusing, and it was a conscious design decision to disallow transitivity. Cheers, Jon -- Jon Pretty | Sygneca Ltd. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Is the scala list getting too busy? (correction): 00480, falcon |
|---|---|
| Next by Date: | Scala paper: Actors that Unify Threads and Events: 00480, Philipp Haller |
| Previous by Thread: | Re: Implicit type conversioni: 00480, Burak Emir |
| Next by Thread: | Re: Implicit type conversion: 00480, Tony Morris |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |