Illuminated cloud not supporting TYPEOF SOQL queries properly

Issue #806 resolved
Michael Ebert created an issue

When defining a so called polymorphic SOQL query in a usual Apex class, Illuminated Cloud shows a syntax error with

',' expected, got 'WHEN'

Sample query:

                          WHEN User THEN UserType
                   FROM Lead

The error only shows up in the IDE, the Apex class can be saved to the target org successfully anyway.

See for a description of the TYPEOF syntax.

Comments (10)

  1. Scott Wells repo owner

    Thanks for filing, Michael. Should be a pretty simple grammar fix. I'll see about including it in a near-term build.

  2. Scott Wells repo owner

    Wow...I think this just got lost in the shuffle as it wasn't on my radar. Thanks for bumping it back into visibility. I'll take a look shortly.

  3. Scott Wells repo owner

    Okay, I'm committing the fixes for this now for inclusion in the next build (perhaps tomorrow but likely Friday due to TDX20):


    So sorry this has languished for so long!

  4. Scott Wells repo owner

    Delivered in Please make sure that your OST is properly generated as the code completion features include here depend on the OST's polymorphic field information.

  5. Eric Kintzer

    One last issue with TYPEOF in SOQL - version

    The line ELSE Name has Name highlit in Red with inspector error: “unresolvable reference”. This compiles and executes just fine.

    CaseTeamMember[] ctms = [SELECT Id, Parent.CaseNumber,
        TYPEOF Member 
            WHEN User 
                THEN Name,IsActive 
            ELSE Name
    FROM CaseTeamMember];

  6. Scott Wells repo owner

    Thanks for letting me know, Eric. Should be simple enough to address--certainly relative to the last pass! I'll take a look for one of the near-term releases.

  7. Scott Wells repo owner

    This is now fixed for inclusion in the next build, both references and code completions for fields in TYPEOF ELSE clauses.

  8. Log in to comment