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 706243 - Generic enum cause invalid code
Generic enum cause invalid code
Status: RESOLVED DUPLICATE of bug 659778
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-18 13:44 UTC by Maciej (Matthew) Piechotka
Modified: 2013-08-20 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Maciej (Matthew) Piechotka 2013-08-18 13:44:16 UTC
enum TestEnum {
    A, B, C
}

void f(Gee.List<TestEnum> list) {
    list.foreach ((j) => {
        j = list.get(0);
        return true;
    });
}

Produces following code:

static gboolean __lambda2_ (Block1Data* _data1_, TestEnum j) {
	// ....
}


static gboolean ___lambda2__gee_forall_func (gpointer g, gpointer self) {
	gboolean result;
	result = __lambda2_ (self, g); // <- cast from gpointer to TestEnum
	return result;
}
Comment 1 Maciej (Matthew) Piechotka 2013-08-20 11:27:44 UTC

*** This bug has been marked as a duplicate of bug 659778 ***