summaryrefslogtreecommitdiff
path: root/vala/valacreationmethod.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2007-12-01 10:35:36 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-12-01 10:35:36 +0000
commitbf6d4302c70d0a521f70cfd69e936d91e54c761e (patch)
treeeef0171a6cc6c2ac46cbe38f36c8af063a27c520 /vala/valacreationmethod.vala
parent4ebc756b3aa2041b1cef1d7b2144d1f9171b997b (diff)
downloadvala-bf6d4302c70d0a521f70cfd69e936d91e54c761e.tar.gz
don't let named creation methods conflict with normal methods
2007-12-01 Juerg Billeter <j@bitron.ch> * vala/parser.y, vala/valaclass.vala, vala/valacreationmethod.vala, vala/valainterfacewriter.vala, vala/valamemberaccess.vala, vala/valasemanticanalyzer.vala, vala/valastruct.vala: don't let named creation methods conflict with normal methods * gobject/valaccodegenerator.vala: fix revealed typo * vapi/cairo.vapi: Matrix is a value-type, declare it as struct * vapi/packages/gtk+-2.0/gtk+-2.0-custom.vala, vapi/packages/gtk+-2.0/gtk+-2.0.metadata: remove default creation method from Gtk.Widget * vapi/gtk+-2.0.vapi: regenerated svn path=/trunk/; revision=743
Diffstat (limited to 'vala/valacreationmethod.vala')
-rw-r--r--vala/valacreationmethod.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala
index 818ad6996..effafcf1f 100644
--- a/vala/valacreationmethod.vala
+++ b/vala/valacreationmethod.vala
@@ -68,10 +68,10 @@ public class Vala.CreationMethod : Method {
public override string! get_default_cname () {
var parent = parent_symbol;
assert (parent is DataType);
- if (name == null) {
+ if (name.len () == ".new".len ()) {
return "%snew".printf (((DataType) parent).get_lower_case_cprefix ());
} else {
- return "%snew_%s".printf (((DataType) parent).get_lower_case_cprefix (), name);
+ return "%snew_%s".printf (((DataType) parent).get_lower_case_cprefix (), name.offset (".new.".len ()));
}
}
}