GNOME Bugzilla – Bug 644241
Default arguments allowed in center of argument list
Last modified: 2018-05-22 13:57:49 UTC
It's possible to write a method signature that looks like this: void func(int a, int b = 1, int c) No warning or error is given by valac. I've tested with 0.10.3 and trunk.
Created attachment 240814 [details] [review] Warn if non-default follows default argument Fixes bug 644241
Looks good except I'm not sure about the message.
Created attachment 245379 [details] [review] Warn if non-default follows default argument * Made the error message move verbose Fixes bug 644241
What about void foo (int a = 2, int b) { ... }
Yup just checked now, warns as intended (btw. should this be an error?)
Review of attachment 245379 [details] [review]: Ok looks fine for me.
commit b22255aa25e0296211ea7ca404970d1677747180 Author: Simon Werbeck <simon.werbeck@gmail.com> Date: Sat Apr 6 08:51:19 2013 +0200 Warn if a parameter without default follows a parameter with default value Fixes bug 644241. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Committed a TODO: for coroutines we have to handle this thing separately for begin and end parameters. Reopening the bug. commit dd24a1bfe1a78bf1a37d35f5d8dd6480fd4a8941 Author: Luca Bruno <lucabru@src.gnome.org> Date: Mon Aug 26 22:36:00 2013 +0200 Do not warn about non-default parameters for coroutines. Reopens bug 644241.
Created attachment 367040 [details] [review] vala: Skip default-value positioning check for parameters of coroutines
Comment on attachment 367040 [details] [review] vala: Skip default-value positioning check for parameters of coroutines Attachment 367040 [details] pushed as 70e694d - vala: Skip default-value positioning check for parameters of coroutines
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/178.