Backing fields of properties can be accessed like defined fields
Submitted by Raul Gutierrez Segales
Link to original bug (#655741)
Description
Why does the following code works:
class Dog
{
public string name { get; private set; }
public Dog (string n)
{
_name = n;
}
public void info ()
{
GLib.stdout.printf ("My name is %s\n", _name);
}
public static int main()
{
var d = new Dog ("scobby");
d.info ();
return 0;
}
}
?
Vala seems to be confused and treating _name as this.name (or just name).
Edited by Rico Tzschichholz