Merge: Give top-level methods some rules
authorJean Privat <jean@pryen.org>
Tue, 17 Jun 2014 01:14:04 +0000 (21:14 -0400)
committerJean Privat <jean@pryen.org>
Tue, 17 Jun 2014 01:14:04 +0000 (21:14 -0400)
1. explicit `self` is forbidden in top-level method
2. top-level methods can only be called without a explicit receiver

In the code, there is workarounds for 3 hard-coded special cases:
* `sys` and `exit`: because, for an unknown reason, intern method cannot be top-level. #493
* `args` because it is currently both in Sys and Object thus has a crazy status. #461

These rules are only enforced as it in `typing` but does not change the model, tools, or engines.

Note: the first commits fix a bug in the `for` where the implicit `iterator` method was resolved with the `recv_is_self` flag always set to true.

Pull-Request: #494
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>


Trivial merge