I have a very simple query in a fairly simple class that is called from a trigger. The compiler is complaining on this singular LOC in the class:
String recordTypeName = [Select Name from RecordType where Id=:theCase.recordTypeId and SObjectType = 'Case' limit 1]];
I can execute the query in the query editor, substituting in a viable record ID, and get back a single string value:
select name from RecordType where id='01240000000MH5TXXX'
However, the error reported by the compiler on the LOC is Illegal assignment from List<RecordType> to String
I'm scratching my head because why doesn't the compiler see the query as returning a singular String value?