Anonymous apex fails to detect grammar when a class is defined within window

Issue #1865 resolved
Nagendra Singh created an issue

List<String> strings = new List<String>();
strings.add('123');
strings.add('123');
System.debug(strings);

public class NewString{
    public String value;
    public NewString(String value){
        this.value = value;
    }
}

Set<NewString> uniqueStrings = new Set<NewString>();
uniqueStrings.add(new NewString('123'));
uniqueStrings.add(new NewString('123'));
System.debug(uniqueStrings);

Anonymous apex fails to understand the grammar for above snippet but runs successfully as shown in image.

Comments (2)

  1. Log in to comment