I'm a newbie to APEX but not the platform. Yes I'm going through the trailhead Apex Basics & Database and on the SOSL module I think I have this correct but I'm getting this List to List error: Invalid conversion from runtime type List to List.
Since this is what I think a very simple example, ie no type casting is required from what I've seen in other posts. The screen shot has my code and the error of what it's saying: screenshot.
public class ContactAndLeadSearch {
public static List<List<sObject>> searchContactsAndLeads(String findMe){
List<List<sObject>> myList = [FIND :findMe IN Name FIELDS
RETURNING Lead(Name),Contact(Name)];
Contact[] searchContact = (Contact[])myList[0];
Lead[] searchLead = (Lead[])myList[1];
return myList;
}
}