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 746200 - Capturing generics inside constructor
Capturing generics inside constructor
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: 1.0
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-14 09:22 UTC by Simon Werbeck
Modified: 2018-05-22 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Werbeck 2015-03-14 09:22:14 UTC
Wrong code is generated when a generic variable is captured by a lambda expression when inside the constructor. Minimal test case:

public class Test<G> : Object {
	public Test () {
		G a = null;
		SourceFunc f = () => {
			G b = a;  // capture a
			return true;
		};
	}

	static void main () {
	}
}
Comment 1 Luca Bruno 2015-03-17 10:01:04 UTC
All this thing needs a rewrite, can't follow the code anymore :S
Comment 2 Luca Bruno 2015-03-17 10:06:14 UTC
So the main problem is that all the code used to generate the block_data_unref, is generated in the context of the constructor, not the lambda.
Comment 3 GNOME Infrastructure Team 2018-05-22 15:22:09 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/492.