vein-lang / vein

🔮⚡️Vein is an open source high-level strictly-typed programming language with a standalone OS, arm and quantum computing support.
https://vein-lang.org
Other
52 stars 6 forks source link

Property Support #88

Closed 0xF6 closed 3 years ago

0xF6 commented 3 years ago
public class Foo
{
    public fo: Int32 { get; set; } // define auto property
    public zo: Int32 
    {
        get  {  return 32; }
    }
}

result:

public class Foo
{
    private $_shadow_prop_fo: Int32;
    public get_fo(): Int32
    { return this.$_shadow_prop_fo; }
    public set_fo(value: Int32): Void
    { this.$_shadow_prop_fo = value; }
    public get_zo(): Int32 
    { return 32; }
}