scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

IntrinsicProperty crashes the compiler when not in an Imported class

Open davidwengier opened this issue 15 years ago • 1 comments

Marking a property as intrinsic, if it isn't in a class that is Imported, crashes the compiler with no error messages.

A simple test case is:

public class Class1
{
    private string m_lastName;

    [IntrinsicProperty]
    public string LastName
    {
        get { return m_lastName; }
        set { m_lastName = value; }
    }
}

When using the command line compiler on this file, it results in a NullReferenceException

davidwengier avatar Apr 27 '11 21:04 davidwengier

As you've noticed, intrinsic properties are only meant for use in imported classes. Yes, that shouldn't cause a crash, but just avoid this as it isn't the scenario for intrinsic properties.

nikhilk avatar Apr 27 '11 21:04 nikhilk