Incorrect code analysis against SOSL

Issue #962 resolved
Phil W created an issue

Using some SOSL in Apex like the following results in a "syntax error" (illegal assignment from List<SObject>[] to List<SObject>):

String n = 'Something*';
List<SObject> results = [FIND :n IN NAME FIELDS RETURNING Contact(Id, Name) LIMIT 50][0];

This is incorrect since SOSL queries return a list of list of SObject, one entry in the outer list for each RETURNING object type.

Comments (2)

  1. Log in to comment