[vala/0.10: 14/38] Fix ellipsis parameter position in generated methods



commit 260248750023cdbbe0bddc9348463e7efee14a35
Author: Luca Bruno <lethalman88 gmail com>
Date:   Sun Jul 25 09:03:31 2010 +0200

    Fix ellipsis parameter position in generated methods
    
    Fixes bug 620673.

 codegen/valaccodemethodmodule.vala |    4 ++--
 tests/Makefile.am                  |    1 +
 tests/methods/bug620673.vala       |    5 +++++
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 003e17a..0df172f 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -788,9 +788,9 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
 			param.ccodenode = new CCodeFormalParameter.with_ellipsis ();
 		}
 
-		cparam_map.set (get_param_pos (param.cparameter_position), (CCodeFormalParameter) param.ccodenode);
+		cparam_map.set (get_param_pos (param.cparameter_position, param.ellipsis), (CCodeFormalParameter) param.ccodenode);
 		if (carg_map != null && !param.ellipsis) {
-			carg_map.set (get_param_pos (param.cparameter_position), get_variable_cexpression (param.name));
+			carg_map.set (get_param_pos (param.cparameter_position, param.ellipsis), get_variable_cexpression (param.name));
 		}
 	}
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dcaf3f0..e09841a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,6 +32,7 @@ TESTS = \
 	methods/bug598738.vala \
 	methods/bug599892.vala \
 	methods/bug613483.vala \
+	methods/bug620673.vala \
 	control-flow/break.vala \
 	control-flow/expressions-conditional.vala \
 	control-flow/for.vala \
diff --git a/tests/methods/bug620673.vala b/tests/methods/bug620673.vala
new file mode 100644
index 0000000..a305a3e
--- /dev/null
+++ b/tests/methods/bug620673.vala
@@ -0,0 +1,5 @@
+void foo (int bar, ...) throws Error {
+}
+
+void main () {
+}
\ No newline at end of file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]