GNOME Bugzilla – Bug 433290
need to check accessibility of parameter types
Last modified: 2008-10-18 00:38:20 UTC
Please describe the problem: If I declare a callback without the "public" keyword and use it as an argument to a public method, the C code (specifically the header file) will not compile. Steps to reproduce: callback void My.Callback (uint j, pointer user_data); class My.Class { public void apply(Callback cb, pointer user_data) { } } Actual results: The C code fails, because the callback is not declared in the header file. Expected results: Vala (valac) should fail to compile the above code. Does this happen every time? Yes Other information:
We need to generally ensure that parameter types are at least as accessible as the method, not only for callbacks. Your example is valid code, though, as the whole class is not public, so neither the method nor the callback declaration should be visible in the public header file.
2008-03-22 Jürg Billeter <j@bitron.ch> * vala/valascope.vala, vala/valasemanticanalyzer.vala, vala/valasymbol.vala: check accessiblity of parameter and return types, fixes bug 433290 Fixed in r1148.
Added to vala-tests