[#721] | project: specification | priority: medium | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Gilles | Martin | fixed | 2006-09-01 15:33:33.0 | |
subject | Views lookup scope is ill-defined (see also #720) | |||
code | ||||
what happened | In the Scala reference, chapter "views" (7.3) the lookup rules for views are not understandable by a Gilles. It \ states that, to be applied, "the view must be denotable by a single identifier at the point for the application"\ (which is OK) "or else it must be a member of some companion module of the type [expression type => expe\ cted type]". The exact companion module scope bounded by "some" is not precise enough. Same problem is true for \ the other view case. |
|||
what expected | Solution depends on what is implemented exactly (see bug #720). What I would like to read (and have implemented) for chapter 7.3 is: Implicit parameters and methods can also define implicit conversions called views. A view from type S to type T is defined by an implicit value which has a type compatible with function type S=>T, or by a method convertible to a value of such a type. Views are applied in two situations.
The view scope for an expression e is composed of all implicit members denotable by a single identifier in e. The view scope for a type T is composed of all implicit members of the companion modules of all classes associated with T. ... |
|||
[back to overview] |
Gilles edited on 2006-09-01 15:36:08.0 |
Martin edited on 2006-09-04 16:35:44.0 |