|
7 | 7 | |---------------------------------------------------------------------------------------------------------------------
|
8 | 8 | | Explanation (enabled by `-explain`)
|
9 | 9 | |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
10 |
| - | The identifier m is ambiguous because a binding of lower precedence |
| 10 | + | The identifier m is ambiguous because a name binding of lower precedence |
11 | 11 | | in an inner scope cannot shadow a binding with higher precedence in
|
12 | 12 | | an outer scope.
|
13 | 13 | |
|
14 |
| - | The precedence of the different kinds of bindings, from highest to lowest, is: |
| 14 | + | The precedence of the different kinds of name bindings, from highest to lowest, is: |
15 | 15 | | - Definitions in an enclosing scope
|
16 | 16 | | - Inherited definitions and top-level definitions in packages
|
17 |
| - | - Names introduced by imports |
18 |
| - | - Named imports take precedence over wildcard imports |
| 17 | + | - Names introduced by import of a specific name |
| 18 | + | - Names introduced by wildcard import |
19 | 19 | | - Definitions from packages in other files
|
20 | 20 | | Note:
|
| 21 | + | - As a rule, definitions take precedence over imports. |
| 22 | + | - Definitions in an enclosing scope take precedence over inherited definitions, |
| 23 | + | which can result in ambiguities in nested classes. |
21 | 24 | | - When importing, you can avoid naming conflicts by renaming:
|
22 | 25 | | import scala.{m => mTick}
|
23 | 26 | ---------------------------------------------------------------------------------------------------------------------
|
|
30 | 33 | |--------------------------------------------------------------------------------------------------------------------
|
31 | 34 | | Explanation (enabled by `-explain`)
|
32 | 35 | |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
33 |
| - | The identifier m is ambiguous because two bindings of equal precedence |
| 36 | + | The identifier m is ambiguous because two name bindings of equal precedence |
34 | 37 | | were introduced in the same scope.
|
35 | 38 | |
|
36 |
| - | The precedence of the different kinds of bindings, from highest to lowest, is: |
| 39 | + | The precedence of the different kinds of name bindings, from highest to lowest, is: |
37 | 40 | | - Definitions in an enclosing scope
|
38 | 41 | | - Inherited definitions and top-level definitions in packages
|
39 |
| - | - Names introduced by imports |
40 |
| - | - Named imports take precedence over wildcard imports |
| 42 | + | - Names introduced by import of a specific name |
| 43 | + | - Names introduced by wildcard import |
41 | 44 | | - Definitions from packages in other files
|
42 | 45 | | Note:
|
| 46 | + | - As a rule, definitions take precedence over imports. |
| 47 | + | - Definitions in an enclosing scope take precedence over inherited definitions, |
| 48 | + | which can result in ambiguities in nested classes. |
43 | 49 | | - When importing, you can avoid naming conflicts by renaming:
|
44 | 50 | | import scala.{m => mTick}
|
45 | 51 | --------------------------------------------------------------------------------------------------------------------
|
0 commit comments