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] Test case. 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' return to_string(); ^^^^^^^^^ 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.
commit 63ae7e3c8705aa77f4394bce502c082ca1df3a2a Author: Jürg Billeter <j@bitron.ch> Date: Mon Aug 6 15:15:10 2012 +0200 Do not require explicit `this' to access generated to_string method Fixes bug 614424.