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 697342 - possible to "chain-up" to non-base classes
possible to "chain-up" to non-base classes
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-05 12:37 UTC by Simon Werbeck
Modified: 2018-05-22 14:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Werbeck 2013-04-05 12:37:29 UTC
It is possible to chain up to a class that is not listed as base class:

public class Foo {
	public Foo.foo () {}
}

public class Bar {
	public Bar () {
		Foo.foo (); // chain up
	}
}

void main() {
}

The generated construction code:

Bar* bar_construct (GType object_type) {
	Bar* self = NULL;
	self = (Bar*) foo_construct_foo (object_type);
	return self;
}
Comment 1 Michael 'Mickey' Lauer 2018-02-23 20:16:50 UTC
With Vala master your sample is rejected with:

yo.vala:7.3-7.12: error: use `new' operator to create new objects
		Foo.foo (); // chain up
		^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)

Is that sufficient or could come up with another test case for this problem?
Comment 2 GNOME Infrastructure Team 2018-05-22 14:45:16 UTC
-- 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/371.