Commit ac262ed6 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Mark creation methods as instance methods to fix lambda expressions in

2008-10-23  Jürg Billeter  <j@bitron.ch>

	* vala/valaparser.vala:
	* vala/valasemanticanalyzer.vala:
	* gobject/valaccodemethodbinding.vala:

	Mark creation methods as instance methods to fix lambda
	expressions in creation methods

svn path=/trunk/; revision=1879
parent 5fc29cef
2008-10-23 Jürg Billeter <j@bitron.ch>
* vala/valaparser.vala:
* vala/valasemanticanalyzer.vala:
* gobject/valaccodemethodbinding.vala:
Mark creation methods as instance methods to fix lambda
expressions in creation methods
2008-10-23 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegenerator.vala:
......
......@@ -268,7 +268,8 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", cself));
cinit.append (cdecl);
} else if (m.binding == MemberBinding.INSTANCE) {
} else if (m.binding == MemberBinding.INSTANCE
&& !(m is CreationMethod)) {
var ccheckstmt = create_method_type_check_statement (m, creturn_type, cl, true, "self");
ccheckstmt.line = codegen.function.line;
cinit.append (ccheckstmt);
......
......@@ -1964,7 +1964,6 @@ public class Vala.Parser : CodeVisitor {
&& !cl.is_static && !cl.is_abstract
&& cl.default_construction_method == null) {
var m = new CreationMethod (cl.name, null, cl.source_reference);
m.binding = MemberBinding.STATIC;
m.access = SymbolAccessibility.PUBLIC;
m.body = new Block (cl.source_reference);
cl.add_method (m);
......@@ -2723,7 +2722,6 @@ public class Vala.Parser : CodeVisitor {
}
method.access = access;
set_attributes (method, attrs);
method.binding = MemberBinding.STATIC;
if (!accept (TokenType.SEMICOLON)) {
method.body = parse_block ();
} else if (scanner.source_file.external_package) {
......
......@@ -1760,7 +1760,9 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
} else if (member is Method) {
var m = (Method) member;
access = m.access;
instance = (m.binding == MemberBinding.INSTANCE);
if (!(m is CreationMethod)) {
instance = (m.binding == MemberBinding.INSTANCE);
}
klass = (m.binding == MemberBinding.CLASS);
} else if (member is Property) {
var prop = (Property) member;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment