|
Revision 1181, 476 bytes
(checked in by chuck, 4 years ago)
|
|
Warn about unnecessary parens on method declarations and calls that have no arguments.
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | namespace Test |
|---|
| 2 | |
|---|
| 3 | class Test |
|---|
| 4 | |
|---|
| 5 | def main |
|---|
| 6 | is shared |
|---|
| 7 | |
|---|
| 8 | count as int = 0 |
|---|
| 9 | x as int = 0 |
|---|
| 10 | while x<10 |
|---|
| 11 | x += 1 |
|---|
| 12 | continue |
|---|
| 13 | count += 1 |
|---|
| 14 | assert x==10 |
|---|
| 15 | assert count==0 |
|---|
| 16 | |
|---|
| 17 | x = 1 |
|---|
| 18 | for i as int = 1 .. 10 |
|---|
| 19 | x = i |
|---|
| 20 | continue |
|---|
| 21 | count += 1 |
|---|
| 22 | assert x==9 |
|---|
| 23 | assert count==0 |
|---|
| 24 | |
|---|
| 25 | s as String = 'a' |
|---|
| 26 | for arg as String in Environment.getCommandLineArgs |
|---|
| 27 | CobraCore.noOp(arg) |
|---|
| 28 | s = 'b' |
|---|
| 29 | continue |
|---|
| 30 | count += 1 |
|---|
| 31 | assert s=='b' |
|---|
| 32 | assert count==0 |
|---|