Book a Demo

Author Topic: EA Ultimate 13; Code Engineering; C#7 "import static {someNameSpace}.class;"  (Read 4558 times)

NW7US

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Tomas Hood / NW7US
Greetings.

I am using EA Ultimate 13. When performing the "Import Source Directory..." task under "Code Engineering" (Ctrl+Shft+U), an error occurs.  When the importing process works on the following example code, the error will be a, "Unexpected symbol", on the "AnotherNameSpace" name space symbol.

Consider:

Code: [Select]
// file ParentClass.cs

using static AnotherNameSpace.AnotherClass;

namespace ExampleStaticImportNameSpace
{
    /// <summary>
    /// The entry point into the library
    /// </summary>
    public class ParentClass
    {
        /// <summary>
        /// Oh, oh, oh, CallMeFirst!
        /// </summary>
        public void CallMeFirst()
        {
            int grabAnInteger = CoolMethod(9);
            grabAnInteger++;
        }
    }
}

... and ...

Code: [Select]
// file: AnotherClass.cs

namespace AnotherNameSpace
{
    /// <summary>
    /// Just another typical class.
    /// </summary>
    public static class AnotherClass
    {
        /// <summary>
        /// A really cool method
        /// </summary>
        /// <param name="passThroughValue"></param>
        /// <returns></returns>
        public static int CoolMethod(int passThroughValue)
        {
            return passThroughValue;
        }
    }
}


The directive, "using static AnotherNameSpace.AnotherClass;" trips EA, and the source is not imported nor reverse engineered and modeled.


http://nw7us.us/images/UnexpectedSymbol.jpg

I've had to go change a very large number of my project files to refactor out the "using static" and resolve the ripple effect throughout the source code.

I wonder if this could be fixed, at some point.  If this works when some preference setting is changed in EA, would you let me know?

Thank you,

Tomas Hood
Tomas Hood

“For me, great algorithms are the poetry of computation. Just like verse, they can be terse, allusive, dense, and even mysterious. But once unlocked, they cast a brilliant new light on some aspect of computing. ” — Francis Sullivan

http://blog.nw7us.us

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
It's likely something we can fix easily using an MDG technology if you contact support.

Apparently, that syntax is part of C# 6, so support really is overdue. I suspect that there will be some C# 7 syntax changes that may cause errors for EA too. (Although most of them are only likely to appear inside a method so we can ignore them)

NW7US

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Tomas Hood / NW7US
Thank you for the response.  I've sent an email regarding this, today.
Tomas Hood

“For me, great algorithms are the poetry of computation. Just like verse, they can be terse, allusive, dense, and even mysterious. But once unlocked, they cast a brilliant new light on some aspect of computing. ” — Francis Sullivan

http://blog.nw7us.us