10000 WIP · odersky/scala.github.com@4a4cdcf · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a4cdcf

Browse files
committed
WIP
1 parent 554b31a commit 4a4cdcf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sips/pending/_posts/2016-01-01-static-members.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ There is no special syntax proposed to access these members, they are accessed a
3030

3131
The following rules ensure that method can be correctly compiled into static member on JVM:
3232

33-
1. Only objects can have fields annotated as `@static`
33+
1. Only objects can have members annotated as `@static`
3434

3535
2. The fields annotated with `@static` should preceed any non-`@static` fields. This ensures that we do not introduce surprises for users in initialization order.
3636

37-
3. The right hand side of method or field annotated as `@static` can only refer to members of globally accessable objects and `@static` members.
37+
3. The right hand side of method or field annotated as `@static` can only refer to members of globally accessible objects and `@static` members. In particular, for non-static objects `this` is not accesable. `Super` is never accessable.
3838

39-
4. If member `foo` of `object C` is annotated `@static`, companion class `C` is not allowed define term members with name `foo`.
39+
4. If member `foo` of `object C` is annotated `@static`, companion class `C` is not allowed to define term members with name `foo`.
4040

4141
5. If member `foo` of `object C` is annotated `@static`, companion class `C` is not allowed to inherit classes that define a term member with name `foo`..
4242

0 commit comments

Comments
 (0)
0