After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 433290 - need to check accessibility of parameter types
need to check accessibility of parameter types
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
0.0.x
Other All
: Normal minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-25 12:37 UTC by Michael Lawrence
Modified: 2008-10-18 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Lawrence 2007-04-25 12:37:59 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:
Comment 1 Jürg Billeter 2007-04-30 06:22:11 UTC
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.
Comment 2 Jürg Billeter 2008-03-22 20:17:33 UTC
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.
Comment 3 Marc-Andre Lureau 2008-10-18 00:38:20 UTC
Added to vala-tests