Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

C# Compiler "Unexpected preprocessor directive" on #endregion

Discussion in 'Experimental Scripting Previews' started by arvzg, Sep 27, 2018.

  1. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    On Unity 2018.2.9f1
    Code was compiling fine before installing IncrementalCompiler 0.0.42 through package manager

    After the install completed one of my scripts which has an
    #endregion
    somewhere (after a #region x) throws a compiler error:

    Code (CSharp):
    1. Assets\External Assets\PC2D\Scripts\PlatformerMotor2D.cs(1033,1): error CS1028: Unexpected preprocessor directive
    It's very strange. If I move the
    #endregion
    around a bit, let's say just before 3 functions above, the error goes away. At 1 or 2 functions above it still happens. There's another #region/#endregion pair below this offending one in the same script and those work just fine.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    Can you submit a bug report for this issue? It sounds like a problem. Thanks!
     
  3. ramsart3dworld

    ramsart3dworld

    Joined:
    Oct 24, 2021
    Posts:
    1
    same problem