System.Location confused with new Location entity (Schema.Location)

Issue #1627 new
Michael Hoefer created an issue

We have a new entity called Location (Schema.Location), which conflicts with the apex object Location (System.Location)

Repro:

API version 48.0

insert new Schema.Location(Name = 'California');   

Result:

Syntax/parse error: Expected type [SObject, List<SObject>]; found [Location, Schema.Location]

Using just new Location() should not and does not work. But Schema.Location should work, does compile in SFDC, but shows the error in IC.

Comments (1)

  1. Scott Wells repo owner

    Thanks, Michael. These types of order-of-precedence for symbol resolution--especially when implicit namespaces like System and Schema come into play--can be tricky. I'll take a look at the resolution strategy shortly and update it accordingly.

  2. Log in to comment