GNOME Bugzilla – Bug 614424
to_string requires explicit "this" in enum methods
Last modified: 2012-08-06 13:58:12 UTC
Created attachment 157552 [details]
When an enum method accesses its own implicit to_string() method, it must provide the "this" ref in order to access it. Calling other methods in its scope does not require "this". The compiler says:
test.vala:13.16-13.24: error: The name `to_string' does not exist in the context of `Xyzzy.fail'
However, if an explicit to_string() method is coded in the enum, the problem does not surface.
Test case attached.
Confirming, looks like there's a bug in the method lookup for enums.
Author: Jürg Billeter <email@example.com>
Date: Mon Aug 6 15:15:10 2012 +0200
Do not require explicit `this' to access generated to_string method
Fixes bug 614424.