From 475ca45f83f6c8f8fb167c70d34aac2806d305ba Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Thu, 30 Aug 2007 12:33:40 +0000 Subject: [PATCH] don't implicitly derive from GLib.Object in preparation for a more 2007-08-30 Juerg Billeter * vala/valasymbolresolver.vala, vala/valasemanticanalyzer.vala, gobject/valacodegenerator.vala, gobject/valacodegeneratorclass.vala: don't implicitly derive from GLib.Object in preparation for a more consistent type system * gee/arraylist.vala, gee/hashmap.vala, gee/hashset.vala, gee/iterable.vala, gee/iterator.vala, gee/list.vala, gee/map.vala, gee/readonlycollection.vala, gee/readonlylist.vala, gee/readonlymap.vala, gee/readonlyset.vala, vala/valabindingprovider.vala, vala/valacodecontext.vala, vala/valacodenode.vala, vala/valacodevisitor.vala, vala/valascope.vala, vala/valasourcefile.vala, vala/valasourcefilecycle.vala, vala/valasourcereference.vala, ccode/valaccodenode.vala, ccode/valaccodewriter.vala, gobject/valaccodecompiler.vala, gobject/valadbusbindingprovider.vala, gobject/valatyperegisterfunction.vala, compiler/valacompiler.vala, tests/, vapigen/valavapigen.vala: derive all classes from GLib.Object svn path=/trunk/; revision=536 --- ChangeLog | 20 ++++++++++++++++++++ ccode/valaccodenode.vala | 2 +- ccode/valaccodewriter.vala | 2 +- compiler/valacompiler.vala | 2 +- gee/arraylist.vala | 4 ++-- gee/hashmap.vala | 10 +++++----- gee/hashset.vala | 4 ++-- gee/iterable.vala | 2 +- gee/iterator.vala | 2 +- gee/list.vala | 2 +- gee/map.vala | 2 +- gee/readonlycollection.vala | 4 ++-- gee/readonlylist.vala | 4 ++-- gee/readonlymap.vala | 2 +- gee/readonlyset.vala | 4 ++-- gobject/valaccodecompiler.vala | 2 +- gobject/valacodegenerator.vala | 2 ++ gobject/valacodegeneratorclass.vala | 12 +++++++----- gobject/valadbusbindingprovider.vala | 2 +- gobject/valatyperegisterfunction.vala | 2 +- tests/test-002.vala | 2 +- tests/test-003.vala | 2 +- tests/test-004.vala | 2 +- tests/test-005.vala | 2 +- tests/test-006.vala | 2 +- tests/test-007.vala | 2 +- tests/test-008.vala | 2 +- tests/test-009.vala | 2 +- tests/test-010.vala | 2 +- tests/test-011.vala | 2 +- tests/test-012.vala | 2 +- tests/test-013.vala | 2 +- tests/test-014.vala | 2 +- tests/test-015.vala | 2 +- tests/test-016.vala | 2 +- tests/test-017.vala | 4 ++-- tests/test-018.vala | 4 ++-- tests/test-019.vala | 2 +- tests/test-020.vala | 2 +- tests/test-021.vala | 2 +- tests/test-022.vala | 2 +- tests/test-023.vala | 2 +- tests/test-024.vala | 4 ++-- tests/test-025.vala | 2 +- tests/test-026.vala | 2 +- tests/test-027.vala | 2 +- tests/test-028.vala | 2 +- tests/test-029.vala | 2 +- tests/test-030.vala | 2 +- tests/test-031.vala | 2 +- tests/test-032.vala | 2 +- tests/test-033.vala | 2 +- tests/test-034.vala | 6 +++--- tests/test-035.vala | 2 +- tests/testenchant.vala | 2 +- vala/valabindingprovider.vala | 2 +- vala/valacodecontext.vala | 2 +- vala/valacodenode.vala | 2 +- vala/valacodevisitor.vala | 2 +- vala/valascope.vala | 2 +- vala/valasemanticanalyzer.vala | 7 ------- vala/valasourcefile.vala | 2 +- vala/valasourcefilecycle.vala | 2 +- vala/valasourcereference.vala | 4 +++- vala/valasymbolresolver.vala | 18 ++---------------- vapigen/valavapigen.vala | 2 +- 66 files changed, 108 insertions(+), 103 deletions(-) diff --git a/ChangeLog b/ChangeLog index 945ec2f..f799eba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 2007-08-30 Jürg Billeter + * vala/valasymbolresolver.vala, vala/valasemanticanalyzer.vala, + gobject/valacodegenerator.vala, gobject/valacodegeneratorclass.vala: + don't implicitly derive from GLib.Object in preparation for a more + consistent type system + + * gee/arraylist.vala, gee/hashmap.vala, gee/hashset.vala, + gee/iterable.vala, gee/iterator.vala, gee/list.vala, gee/map.vala, + gee/readonlycollection.vala, gee/readonlylist.vala, + gee/readonlymap.vala, gee/readonlyset.vala, + vala/valabindingprovider.vala, vala/valacodecontext.vala, + vala/valacodenode.vala, vala/valacodevisitor.vala, + vala/valascope.vala, vala/valasourcefile.vala, + vala/valasourcefilecycle.vala, vala/valasourcereference.vala, + ccode/valaccodenode.vala, ccode/valaccodewriter.vala, + gobject/valaccodecompiler.vala, gobject/valadbusbindingprovider.vala, + gobject/valatyperegisterfunction.vala, compiler/valacompiler.vala, + tests/, vapigen/valavapigen.vala: derive all classes from GLib.Object + +2007-08-30 Jürg Billeter + * vapi/libnotify.deps: add missing file 2007-08-29 Jürg Billeter diff --git a/ccode/valaccodenode.vala b/ccode/valaccodenode.vala index 18240a6..81f1136 100644 --- a/ccode/valaccodenode.vala +++ b/ccode/valaccodenode.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a node in the C code tree. */ -public abstract class Vala.CCodeNode { +public abstract class Vala.CCodeNode : Object { /** * The source file name and line number to be presumed for this code * node. diff --git a/ccode/valaccodewriter.vala b/ccode/valaccodewriter.vala index 3e33359..3393983 100644 --- a/ccode/valaccodewriter.vala +++ b/ccode/valaccodewriter.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a writer to write C source files. */ -public class Vala.CCodeWriter { +public class Vala.CCodeWriter : Object { /** * Specifies the file to be written. */ diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 40a25ee..93ac878 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -22,7 +22,7 @@ using GLib; -class Vala.Compiler { +class Vala.Compiler : Object { static string directory; static bool version; [NoArrayLength ()] diff --git a/gee/arraylist.vala b/gee/arraylist.vala index 9853bfd..2be04f2 100644 --- a/gee/arraylist.vala +++ b/gee/arraylist.vala @@ -27,7 +27,7 @@ using GLib; /** * Arrays of arbitrary elements which grow automatically as elements are added. */ -public class Gee.ArrayList : Iterable, Collection, List { +public class Gee.ArrayList : Object, Iterable, Collection, List { public int size { get { return _size; } } @@ -147,7 +147,7 @@ public class Gee.ArrayList : Iterable, Collection, List { _items.resize (value); } - private class Iterator : Gee.Iterator { + private class Iterator : Object, Gee.Iterator { public ArrayList list { set { _list = value; diff --git a/gee/hashmap.vala b/gee/hashmap.vala index 890bc7a..89abb93 100644 --- a/gee/hashmap.vala +++ b/gee/hashmap.vala @@ -27,7 +27,7 @@ using GLib; /** * Hashtable implementation of the Map interface. */ -public class Gee.HashMap : Map { +public class Gee.HashMap : Object, Map { public int size { get { return _nnodes; } } @@ -179,7 +179,7 @@ public class Gee.HashMap : Map { } } - private class KeySet : Iterable, Collection, Set { + private class KeySet : Object, Iterable, Collection, Set { public HashMap map { set { _map = value; } } @@ -216,7 +216,7 @@ public class Gee.HashMap : Map { } } - private class KeyIterator : Iterator { + private class KeyIterator : Object, Iterator { public HashMap map { set { _map = value; @@ -252,7 +252,7 @@ public class Gee.HashMap : Map { } } - private class ValueCollection : Iterable, Collection { + private class ValueCollection : Object, Iterable, Collection { public HashMap map { set { _map = value; } } @@ -293,7 +293,7 @@ public class Gee.HashMap : Map { } } - private class ValueIterator : Iterator { + private class ValueIterator : Object, Iterator { public HashMap map { set { _map = value; diff --git a/gee/hashset.vala b/gee/hashset.vala index f0bb5f4..c053a1c 100644 --- a/gee/hashset.vala +++ b/gee/hashset.vala @@ -27,7 +27,7 @@ using GLib; /** * Hashtable implementation of the Set interface. */ -public class Gee.HashSet : Iterable, Collection, Set { +public class Gee.HashSet : Object, Iterable, Collection, Set { public int size { get { return _nnodes; } } @@ -158,7 +158,7 @@ public class Gee.HashSet : Iterable, Collection, Set { } } - private class Iterator : Gee.Iterator { + private class Iterator : Object, Gee.Iterator { public HashSet set { set { _set = value; diff --git a/gee/iterable.vala b/gee/iterable.vala index 1b3e66d..cb29c66 100644 --- a/gee/iterable.vala +++ b/gee/iterable.vala @@ -24,7 +24,7 @@ * Implemented by classes that support a simple iteration over instances of the * collection. */ -public interface Gee.Iterable { +public interface Gee.Iterable : GLib.Object { /** * Returns a Iterator that can be used for simple iteration over a * collection. diff --git a/gee/iterator.vala b/gee/iterator.vala index a401946..d8c119b 100644 --- a/gee/iterator.vala +++ b/gee/iterator.vala @@ -24,7 +24,7 @@ * Implemented by classes that support a simple iteration over instances of the * collection. */ -public interface Gee.Iterator { +public interface Gee.Iterator : GLib.Object { /** * Advances to the next element in the iteration. * diff --git a/gee/list.vala b/gee/list.vala index 0ff967b..d49c525 100644 --- a/gee/list.vala +++ b/gee/list.vala @@ -23,7 +23,7 @@ /** * Represents a collection of items in a well-defined order. */ -public interface Gee.List : GLib.Object, Collection { +public interface Gee.List : Collection { /** * Returns the item at the specified index in this list. * diff --git a/gee/map.vala b/gee/map.vala index 6dcee69..8c61cbe 100644 --- a/gee/map.vala +++ b/gee/map.vala @@ -23,7 +23,7 @@ /** * A map is a generic collection of key/value pairs. */ -public interface Gee.Map { +public interface Gee.Map : GLib.Object { /** * The number of items in this map. */ diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala index 30a6ea6..c9d21dd 100644 --- a/gee/readonlycollection.vala +++ b/gee/readonlycollection.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a read-only collection of items. */ -public class Gee.ReadOnlyCollection : Iterable, Collection { +public class Gee.ReadOnlyCollection : Object, Iterable, Collection { public int size { get { return _collection.size; } } @@ -69,7 +69,7 @@ public class Gee.ReadOnlyCollection : Iterable, Collection { assert_not_reached (); } - private class Iterator : Gee.Iterator { + private class Iterator : Object, Gee.Iterator { public bool next () { return false; } diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala index b07fa4a..5aa3eff 100644 --- a/gee/readonlylist.vala +++ b/gee/readonlylist.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a read-only collection of items in a well-defined order. */ -public class Gee.ReadOnlyList : Iterable, Collection, List { +public class Gee.ReadOnlyList : Object, Iterable, Collection, List { public int size { get { return _list.size; } } @@ -97,7 +97,7 @@ public class Gee.ReadOnlyList : Iterable, Collection, List { assert_not_reached (); } - class Iterator : Gee.Iterator { + class Iterator : Object, Gee.Iterator { public bool next () { return false; } diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala index f36c9aa..2136450 100644 --- a/gee/readonlymap.vala +++ b/gee/readonlymap.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a read-only collection of key/value pairs. */ -public class Gee.ReadOnlyMap : Map { +public class Gee.ReadOnlyMap : Object, Map { public int size { get { return _map.size; } } diff --git a/gee/readonlyset.vala b/gee/readonlyset.vala index 81db5b3..272f3df 100644 --- a/gee/readonlyset.vala +++ b/gee/readonlyset.vala @@ -25,7 +25,7 @@ using GLib; /** * Represents a read-only collection of items without duplicates. */ -public class Gee.ReadOnlySet : Iterable, Collection, Set { +public class Gee.ReadOnlySet : Object, Iterable, Collection, Set { public int size { get { return _set.size; } } @@ -69,7 +69,7 @@ public class Gee.ReadOnlySet : Iterable, Collection, Set { assert_not_reached (); } - private class Iterator : Gee.Iterator { + private class Iterator : Object, Gee.Iterator { public bool next () { return false; } diff --git a/gobject/valaccodecompiler.vala b/gobject/valaccodecompiler.vala index 7cd6f98..f0273a1 100644 --- a/gobject/valaccodecompiler.vala +++ b/gobject/valaccodecompiler.vala @@ -25,7 +25,7 @@ using GLib; /** * Interface to the C compiler. */ -public class Vala.CCodeCompiler { +public class Vala.CCodeCompiler : Object { public CCodeCompiler () { } diff --git a/gobject/valacodegenerator.vala b/gobject/valacodegenerator.vala index 17067a8..fe8086a 100644 --- a/gobject/valacodegenerator.vala +++ b/gobject/valacodegenerator.vala @@ -97,6 +97,7 @@ public class Vala.CodeGenerator : CodeVisitor { TypeReference string_type; TypeReference float_type; TypeReference double_type; + DataType gobject_type; DataType gerror_type; DataType glist_type; DataType gslist_type; @@ -247,6 +248,7 @@ public class Vala.CodeGenerator : CodeVisitor { var glib_ns = root_symbol.scope.lookup ("GLib"); + gobject_type = (DataType) glib_ns.scope.lookup ("Object"); gerror_type = (DataType) glib_ns.scope.lookup ("Error"); glist_type = (DataType) glib_ns.scope.lookup ("List"); gslist_type = (DataType) glib_ns.scope.lookup ("SList"); diff --git a/gobject/valacodegeneratorclass.vala b/gobject/valacodegeneratorclass.vala index a8033d9..f911a04 100644 --- a/gobject/valacodegeneratorclass.vala +++ b/gobject/valacodegeneratorclass.vala @@ -94,10 +94,12 @@ public class Vala.CodeGenerator { decl_frag.append (new CCodeTypeDefinition ("struct %s".printf (type_struct.name), new CCodeVariableDeclarator ("%sClass".printf (cl.get_cname ())))); } decl_frag.append (new CCodeTypeDefinition ("struct %s".printf (instance_priv_struct.name), new CCodeVariableDeclarator ("%sPrivate".printf (cl.get_cname ())))); - - instance_struct.add_field (cl.base_class.get_cname (), "parent"); - instance_struct.add_field ("%sPrivate *".printf (cl.get_cname ()), "priv"); - type_struct.add_field ("%sClass".printf (cl.base_class.get_cname ()), "parent"); + + if (cl.is_subtype_of (gobject_type)) { + instance_struct.add_field (cl.base_class.get_cname (), "parent"); + instance_struct.add_field ("%sPrivate *".printf (cl.get_cname ()), "priv"); + type_struct.add_field ("%sClass".printf (cl.base_class.get_cname ()), "parent"); + } if (cl.source_reference.comment != null) { def_frag.append (new CCodeComment (cl.source_reference.comment)); @@ -114,7 +116,7 @@ public class Vala.CodeGenerator { cl.accept_children (this); - if (!cl.is_static) { + if (cl.is_subtype_of (gobject_type)) { if (class_has_readable_properties (cl) || cl.get_type_parameters ().size > 0) { add_get_property_function (cl); } diff --git a/gobject/valadbusbindingprovider.vala b/gobject/valadbusbindingprovider.vala index e22c4fc..2318069 100644 --- a/gobject/valadbusbindingprovider.vala +++ b/gobject/valadbusbindingprovider.vala @@ -26,7 +26,7 @@ using Gee; /** * Dynamic binding provider for DBus objects. */ -public class Vala.DBusBindingProvider : BindingProvider { +public class Vala.DBusBindingProvider : Object, BindingProvider { public CodeContext context { set { _context = value; diff --git a/gobject/valatyperegisterfunction.vala b/gobject/valatyperegisterfunction.vala index 57ef2ec..98f9c0d 100644 --- a/gobject/valatyperegisterfunction.vala +++ b/gobject/valatyperegisterfunction.vala @@ -25,7 +25,7 @@ using GLib; /** * C function to register a type at runtime. */ -public abstract class Vala.TypeRegisterFunction { +public abstract class Vala.TypeRegisterFunction : Object { private CCodeFragment declaration_fragment = new CCodeFragment (); private CCodeFragment definition_fragment = new CCodeFragment (); diff --git a/tests/test-002.vala b/tests/test-002.vala index ac7627d..bb93511 100644 --- a/tests/test-002.vala +++ b/tests/test-002.vala @@ -1,7 +1,7 @@ using GLib; namespace Maman { - class Bar { + class Bar : Object { static int main (string[] args) { stdout.printf ("Class in Namespace Test\n"); return 0; diff --git a/tests/test-003.vala b/tests/test-003.vala index 34b5655..3003273 100644 --- a/tests/test-003.vala +++ b/tests/test-003.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { } class Maman.SubBar : Bar { diff --git a/tests/test-004.vala b/tests/test-004.vala index ac069e5..0545ca2 100644 --- a/tests/test-004.vala +++ b/tests/test-004.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public void do_action () { stdout.printf (" 2"); } diff --git a/tests/test-005.vala b/tests/test-005.vala index e97f42c..7b6a178 100644 --- a/tests/test-005.vala +++ b/tests/test-005.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public static void do_action () { stdout.printf (" 2"); } diff --git a/tests/test-006.vala b/tests/test-006.vala index cb66d9d..af210c9 100644 --- a/tests/test-006.vala +++ b/tests/test-006.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("For Test: 1"); diff --git a/tests/test-007.vala b/tests/test-007.vala index a87a8e4..3322abc 100644 --- a/tests/test-007.vala +++ b/tests/test-007.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public virtual void do_action () { stdout.printf (" BAD"); } diff --git a/tests/test-008.vala b/tests/test-008.vala index 4400368..c990234 100644 --- a/tests/test-008.vala +++ b/tests/test-008.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public int public_base_field = 2; } diff --git a/tests/test-009.vala b/tests/test-009.vala index c653232..74c515c 100644 --- a/tests/test-009.vala +++ b/tests/test-009.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { private int _public_base_property = 2; public int public_base_property { get { diff --git a/tests/test-010.vala b/tests/test-010.vala index c1daa8d..c6297c3 100644 --- a/tests/test-010.vala +++ b/tests/test-010.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("Assignment Test: 1"); diff --git a/tests/test-011.vala b/tests/test-011.vala index 332a832..0c3867a 100644 --- a/tests/test-011.vala +++ b/tests/test-011.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("Binary Expression Test: 1"); diff --git a/tests/test-012.vala b/tests/test-012.vala index 0705ef7..99e76f2 100644 --- a/tests/test-012.vala +++ b/tests/test-012.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("Block Test: 1"); diff --git a/tests/test-013.vala b/tests/test-013.vala index 7820607..6566f93 100644 --- a/tests/test-013.vala +++ b/tests/test-013.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("Break Test: 1"); diff --git a/tests/test-014.vala b/tests/test-014.vala index 5ac7f87..feb1e80 100644 --- a/tests/test-014.vala +++ b/tests/test-014.vala @@ -2,7 +2,7 @@ using GLib; public static delegate int Maman.ActionCallback (); -class Maman.Bar { +class Maman.Bar : Object { static int do_action () { return 2; } diff --git a/tests/test-015.vala b/tests/test-015.vala index 943abb9..5811d93 100644 --- a/tests/test-015.vala +++ b/tests/test-015.vala @@ -2,7 +2,7 @@ using GLib; static delegate int Maman.ActionCallback (int i); -class Maman.Bar { +class Maman.Bar : Object { static int do_action (ActionCallback cb) { return cb (1); } diff --git a/tests/test-016.vala b/tests/test-016.vala index e0ce1f8..3129938 100644 --- a/tests/test-016.vala +++ b/tests/test-016.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { static int main (string[] args) { stdout.printf ("Conditional Expression Test: 1"); diff --git a/tests/test-017.vala b/tests/test-017.vala index 58ba607..d269ad6 100644 --- a/tests/test-017.vala +++ b/tests/test-017.vala @@ -1,10 +1,10 @@ using GLib; -interface Maman.Ibaz { +interface Maman.Ibaz : Object { public abstract void do_action (); } -class Maman.Baz : Ibaz { +class Maman.Baz : Object, Ibaz { public void do_action () { stdout.printf (" 2"); } diff --git a/tests/test-018.vala b/tests/test-018.vala index 6081ed4..1bd38dc 100644 --- a/tests/test-018.vala +++ b/tests/test-018.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public signal void activated (bool b); public void do_action (bool b) { @@ -8,7 +8,7 @@ class Maman.Foo { } } -class Maman.Bar { +class Maman.Bar : Object { void activated (Foo foo, bool b) { if (b) { stdout.printf (" BAD"); diff --git a/tests/test-019.vala b/tests/test-019.vala index bf906a9..7d33072 100644 --- a/tests/test-019.vala +++ b/tests/test-019.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public void run () { stdout.printf (" 2"); diff --git a/tests/test-020.vala b/tests/test-020.vala index 906b787..d69c365 100644 --- a/tests/test-020.vala +++ b/tests/test-020.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public void run () { stdout.printf (" 2"); diff --git a/tests/test-021.vala b/tests/test-021.vala index c2a75be..8a92082 100644 --- a/tests/test-021.vala +++ b/tests/test-021.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { static int main (string[] args) { stdout.printf ("String Test: 1"); diff --git a/tests/test-022.vala b/tests/test-022.vala index 59b2cc7..6f7a5cc 100644 --- a/tests/test-022.vala +++ b/tests/test-022.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public Foo (construct string bar) { } diff --git a/tests/test-023.vala b/tests/test-023.vala index 605f1b5..ac2387e 100644 --- a/tests/test-023.vala +++ b/tests/test-023.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public void run () { foreach (string s in create_list ()) { stdout.printf (" %s", s); diff --git a/tests/test-024.vala b/tests/test-024.vala index caef58f..288b242 100644 --- a/tests/test-024.vala +++ b/tests/test-024.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public signal void activated (int i1, int i2); public void do_action () { @@ -8,7 +8,7 @@ class Maman.Foo { } } -class Maman.Bar { +class Maman.Bar : Object { public void run () { stdout.printf (" 2"); diff --git a/tests/test-025.vala b/tests/test-025.vala index f5bfbc6..2d83913 100644 --- a/tests/test-025.vala +++ b/tests/test-025.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public virtual void do_action () { stdout.printf (" 3"); } diff --git a/tests/test-026.vala b/tests/test-026.vala index 2eddf60..2c6ab84 100644 --- a/tests/test-026.vala +++ b/tests/test-026.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public void do_action () { stdout.printf (" 3"); } diff --git a/tests/test-027.vala b/tests/test-027.vala index b539c4d..3b7cd32 100644 --- a/tests/test-027.vala +++ b/tests/test-027.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public int foo { get; set; } public void run () { diff --git a/tests/test-028.vala b/tests/test-028.vala index 1047e46..09ca122 100644 --- a/tests/test-028.vala +++ b/tests/test-028.vala @@ -6,7 +6,7 @@ enum Maman.Foo { VAL5 = 5 } -class Maman.Bar { +class Maman.Bar : Object { public void run () { stdout.printf (" %d", Foo.VAL2); diff --git a/tests/test-029.vala b/tests/test-029.vala index 62caf66..966caf8 100644 --- a/tests/test-029.vala +++ b/tests/test-029.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { public int p1 { get; set; } public int p2 { get; set; } diff --git a/tests/test-030.vala b/tests/test-030.vala index e28b4e0..4378576f 100644 --- a/tests/test-030.vala +++ b/tests/test-030.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { static void main (string[] args) { stdout.printf ( "int8: %s...%s\n", diff --git a/tests/test-031.vala b/tests/test-031.vala index 5ef4a01..665e94b 100644 --- a/tests/test-031.vala +++ b/tests/test-031.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Foo { +class Maman.Foo : Object { const float[] FLOAT_TESTS = { float.EPSILON, 0.0, 1.0, -float.INFINITY, diff --git a/tests/test-032.vala b/tests/test-032.vala index 72963a6..17d6bd7 100644 --- a/tests/test-032.vala +++ b/tests/test-032.vala @@ -1,6 +1,6 @@ using GLib; -class Maman.Bar { +class Maman.Bar : Object { public int[] foo_numbers () { return new int[3] { 2, 3, 4 }; } diff --git a/tests/test-033.vala b/tests/test-033.vala index 38a24ee..e9e9f54 100644 --- a/tests/test-033.vala +++ b/tests/test-033.vala @@ -8,7 +8,7 @@ enum Maman.BarError { LIST } -class Maman.Bar { +class Maman.Bar : Object { public void foo () throws BarError { stdout.printf (" 6"); diff --git a/tests/test-034.vala b/tests/test-034.vala index 8000c4e..835863d 100644 --- a/tests/test-034.vala +++ b/tests/test-034.vala @@ -1,15 +1,15 @@ using GLib; -class Maman.A { +class Maman.A : Object { } class Maman.B : A { } -class Maman.C { +class Maman.C : Object { } -class Maman.Bar { +class Maman.Bar : Object { static void main () { var a = new A (); var b = new B (); diff --git a/tests/test-035.vala b/tests/test-035.vala index 8e41184..f5230fa 100644 --- a/tests/test-035.vala +++ b/tests/test-035.vala @@ -1,6 +1,6 @@ using GLib; -class SwitchTest { +class SwitchTest : Object { static void main () { var foo = "Hello World"; var bar = 0; diff --git a/tests/testenchant.vala b/tests/testenchant.vala index 61c904c..67aa0ec 100644 --- a/tests/testenchant.vala +++ b/tests/testenchant.vala @@ -1,7 +1,7 @@ using Enchant; using GLib; -class TestEnchant { +class TestEnchant : Object { static void info (string message) { stdout.printf ("INFO: %s\n", message); } diff --git a/vala/valabindingprovider.vala b/vala/valabindingprovider.vala index ec1a802..ffec6ac 100644 --- a/vala/valabindingprovider.vala +++ b/vala/valabindingprovider.vala @@ -25,7 +25,7 @@ using GLib; /** * Interface for dynamic binding providers. */ -public interface Vala.BindingProvider { +public interface Vala.BindingProvider : Object { /** * Return custom binding for the specified member access expression. * diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index f67a93b..1342cbb 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -26,7 +26,7 @@ using Gee; /** * The root of the code tree. */ -public class Vala.CodeContext { +public class Vala.CodeContext : Object { /** * Specifies the name of the library to be built. * diff --git a/vala/valacodenode.vala b/vala/valacodenode.vala index 13aab72..26ffa1b 100644 --- a/vala/valacodenode.vala +++ b/vala/valacodenode.vala @@ -28,7 +28,7 @@ using GLib; * Code nodes get created by the parser and are used throughout the whole * compilation process. */ -public abstract class Vala.CodeNode { +public abstract class Vala.CodeNode : Object { /** * Parent of this code node. */ diff --git a/vala/valacodevisitor.vala b/vala/valacodevisitor.vala index 809fa39..1d5c4fc 100644 --- a/vala/valacodevisitor.vala +++ b/vala/valacodevisitor.vala @@ -26,7 +26,7 @@ using GLib; /** * Abstract code node visitor for traversing source code tree. */ -public abstract class Vala.CodeVisitor { +public abstract class Vala.CodeVisitor : Object { /** * Visit operation called for source files. * diff --git a/vala/valascope.vala b/vala/valascope.vala index 6a56104..416fdc4 100644 --- a/vala/valascope.vala +++ b/vala/valascope.vala @@ -26,7 +26,7 @@ using Gee; /** * Represents a part of the symbol tree. */ -public class Vala.Scope { +public class Vala.Scope : Object { /** * The symbol that owns this scope. */ diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 2c131a6..82b4cf6 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -302,13 +302,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor { } } - if (prereq_class == null) { - /* default to GObject */ - var obj_type = new TypeReference (); - obj_type.data_type = object_type; - iface.prepend_prerequisite (obj_type); - } - iface.accept_children (this); current_symbol = current_symbol.parent_symbol; diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala index 99c8af4..c7302bb 100644 --- a/vala/valasourcefile.vala +++ b/vala/valasourcefile.vala @@ -26,7 +26,7 @@ using Gee; /** * Represents a Vala source or VAPI package file. */ -public class Vala.SourceFile { +public class Vala.SourceFile : Object { /** * The name of this source file. */ diff --git a/vala/valasourcefilecycle.vala b/vala/valasourcefilecycle.vala index 2154dee..95cf499 100644 --- a/vala/valasourcefilecycle.vala +++ b/vala/valasourcefilecycle.vala @@ -26,7 +26,7 @@ using Gee; /** * Represents a dependency cycle of source files. */ -public class Vala.SourceFileCycle { +public class Vala.SourceFileCycle : Object { /** * The members of this source file cycle. */ diff --git a/vala/valasourcereference.vala b/vala/valasourcereference.vala index 71b7c67..1bebbc5 100644 --- a/vala/valasourcereference.vala +++ b/vala/valasourcereference.vala @@ -20,10 +20,12 @@ * Jürg Billeter */ +using GLib; + /** * Represents a reference to a location in a source file. */ -public class Vala.SourceReference { +public class Vala.SourceReference : Object { /** * The source file to be referenced. */ diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala index f726f42..1ffd026 100644 --- a/vala/valasymbolresolver.vala +++ b/vala/valasymbolresolver.vala @@ -32,8 +32,6 @@ public class Vala.SymbolResolver : CodeVisitor { Scope current_scope; Collection current_using_directives; - Class object_class; - /** * Resolve symbol names in the specified code context. * @@ -42,13 +40,7 @@ public class Vala.SymbolResolver : CodeVisitor { public void resolve (CodeContext! context) { root_symbol = context.root; current_scope = root_symbol.scope; - - // TODO: don't require GLib namespace in symbol resolver - var glib_ns = root_symbol.scope.lookup ("GLib"); - if (glib_ns != null) { - object_class = (Class) glib_ns.scope.lookup ("Object"); - } - + context.accept (this); } @@ -75,13 +67,7 @@ public class Vala.SymbolResolver : CodeVisitor { cl.base_class = (Class) type.data_type; } } - if (cl.base_class == null && cl != object_class) { - var object_type = new TypeReference (); - object_type.data_type = object_class; - cl.add_base_type (object_type); - cl.base_class = object_class; - } - + current_scope = current_scope.parent_scope; } diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index 1343a50..66499bc 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -22,7 +22,7 @@ using GLib; -class Vala.VAPIGen { +class Vala.VAPIGen : Object { static string directory; static bool version; [NoArrayLength ()] -- 2.7.4