nitra icon indicating copy to clipboard operation
nitra copied to clipboard

AST: Cannot access property of an object

Open ssrmm opened this issue 8 years ago • 0 comments

This code produces an compilation error:

namespace Test.Ast
{
  ast Foo 
  {
    in Test1 : string;
    in Test2 : string;
    in Test3 : string;

    Test1 = StringWrapper("Test").Attribute;
    Test2 = StringWrapper("Test").Method();
    Test3 = StringWrapper("Test").Property; // error : Unexpected expression 'Test.StringWrapper ("Test")' Call
  }
}

The string wrapper looks like this:

namespace Test
{
  [Record(Include=[Attribute])]
  class StringWrapper
  {
      public Attribute : string;
      
      public Property : string { get { Attribute } }
      
      public Method() : string
      {
          Attribute
      }
  }
}
  }
}

ssrmm avatar Nov 10 '16 12:11 ssrmm