On the anonymous apex valid code highlighted as error
Issue #1738
resolved
code:
class Test {
Test(String field) {
this.field = field;
}
public String field;
}
Test cnt1 = new Test('test'); // <-- this line have error: 'Test' unexpected
Test cnt2;
but this code successfully executed
Comments (3)
-
-
repo owner Fix committed for inclusion in the next build.
-
repo owner - changed status to resolved
Delivered in 2.1.4.8.
- Log in to comment
I just wanted to report this myself Anonymous apex behaves like body of a class, but editor goes crazy as soon as you declare a class in script.
It has been bothering me for years.