Parser fails on instantiating local class inside trigger

Issue #2052 resolved
Dr. Alexander Hug created an issue

Hello,
I have some projects with existing code where an Apex Trigger contains a Class definition, and the Class is instantiated in the (same) Trigger. The code compiles fine, but the parser marks it as invalid:

(The discussion is not about “don't put classes inside triggers” 🙂 )

Comments (3)

  1. Scott Wells repo owner

    Don't put classes inside triggers.

    Okay...had to say that, but if this is allowed Apex syntax, IC2 should support it...though I may also add a code inspection that chastises the user for doing so! I'll take a look. Hopefully it'll be a pretty simple parser update.

  2. Scott Wells repo owner

    Fixes committed for the next build. Turns out that IC2's Apex parser was just fine with this, but there were issues with reference resolution for inner types in trigger files. That should all work properly as of the next build.

  3. Log in to comment