2007-09-02 Mathias Hasselmann <mathias.hasselmann@gmx.de>
+ * gobject/valacodegenerator.vala, tests/Makefile.am: handle null
+ pointer for expression_type in get_implicit_cast_expression.
+ needed for instance to pass function pointers to HashTable.full
+ * tests/test-036.exp, tests/test-036.vala: test for usability
+ of HashTable.full
+
+2007-09-02 Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
* vapigen/Makefile.am, vapigen/valavapicheck.vala: adding vapicheck
as tool to verify Vala bindings. currently only .metadata files are
checked for unresolved symbols.
return result;
}
- private CCodeExpression! get_implicit_cast_expression (CCodeExpression! cexpr, TypeReference! expression_type, TypeReference! target_type) {
+ private CCodeExpression! get_implicit_cast_expression (CCodeExpression! cexpr, TypeReference expression_type, TypeReference! target_type) {
+ if (null == expression_type) {
+ return cexpr;
+ }
+
if (expression_type.data_type == target_type.data_type) {
// same type, no cast required
return cexpr;
test-033.vala \
test-034.vala \
test-035.vala \
+ test-036.vala \
$(NULL)
EXTRA_DIST = \
test-033.exp \
test-034.exp \
test-035.exp \
+ test-036.exp \
\
testenchant.stamp \
testenchant.vala \
--- /dev/null
+testing function pointers: 1 2 3
--- /dev/null
+using GLib;
+
+class Maman.Bar : GLib.Object {
+ static void main () {
+ stdout.printf ("testing function pointers:");
+ var table = new HashTable<string, Bar>.full (str_hash, str_equal, g_free, Object.unref);
+ stdout.printf (" 1");
+
+ table.insert ("foo", new Bar ());
+ stdout.printf (" 2");
+
+ var bar = table.lookup ("foo");
+ stdout.printf (" 3\n");
+ }
+}