diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-25 16:35:37 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-25 16:35:37 -0700 |
commit | a1275c4cb6fbc7483c0064a072f8cb3dbf7193d4 (patch) | |
tree | 3337ce3be34836b770b78ea486b06a79f3148f7e | |
parent | c61f554acd65885cedee8ebae2bfaf2c9d70275a (diff) | |
download | scala-a1275c4cb6fbc7483c0064a072f8cb3dbf7193d4.tar.gz scala-a1275c4cb6fbc7483c0064a072f8cb3dbf7193d4.tar.bz2 scala-a1275c4cb6fbc7483c0064a072f8cb3dbf7193d4.zip |
TODO: binding example
-rw-r--r-- | 04-identifiers-names-and-scopes.md | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/04-identifiers-names-and-scopes.md b/04-identifiers-names-and-scopes.md index 57af8afc3e..3086525634 100644 --- a/04-identifiers-names-and-scopes.md +++ b/04-identifiers-names-and-scopes.md @@ -34,18 +34,21 @@ in some inner scope _shadows_ bindings of lower precedence in the same scope as well as bindings of the same or lower precedence in outer scopes. +<!-- TODO: either the example, the spec, or the compiler is wrong + Note that shadowing is only a partial order. In a situation like ``` -val x = 1; +val x = 1 { - import p.x; + import p.x x } ``` neither binding of `x` shadows the other. Consequently, the -reference to `x` in the third line above would be ambiguous. +reference to `x` in the last line of the block above would be ambiguous. +--> A reference to an unqualified (type- or term-) identifier $x$ is bound by the unique binding, which |