Commit 11ead3e
committed
Leave parentheses in place on method calls
Note that this explicitly leaves parentheses in place even if they are
empty. There are two reasons we would need to do this. The first is if
we're calling something that looks like a constant, as in:
Foo()
In this case if we remove the parentheses then this becomes a constant
reference and not a method call. The second is if we're calling a
method that is the same name as a local variable that is in scope, as
in:
foo = foo()
In this case we have to keep the parentheses or else it treats this
like assigning nil to the local variable. Note that we could attempt
to be smarter about this by tracking the local variables that are in
scope, but for now it's simpler and more efficient to just leave the
parentheses in place.1 parent 94a13f5 commit 11ead3e
2 files changed
+19
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3001 | 3001 | | |
3002 | 3002 | | |
3003 | 3003 | | |
3004 | | - | |
3005 | | - | |
3006 | | - | |
3007 | | - | |
3008 | | - | |
3009 | | - | |
3010 | | - | |
3011 | | - | |
3012 | | - | |
3013 | | - | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
3014 | 3023 | | |
3015 | 3024 | | |
3016 | 3025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
0 commit comments