[Vala] valasemanticanalyzer error
- From: Martin DeMello <martindemello gmail com>
- To: vala-list gnome org
- Subject: [Vala] valasemanticanalyzer error
- Date: Tue, 17 Aug 2010 18:09:42 +0530
What do I need to do to get the following code to compile? It dies with
$ valac --pkg gee-1.0 test.vala
**
ERROR:valasemanticanalyzer.c:2948:vala_semantic_analyzer_get_actual_type:
assertion failed: (instance_type != NULL)
Aborted
# -------------------------------------------------------
using Gee;
public interface Enumerable<G, T> : Iterable {
public delegate T DFunc(G elem);
public void map(DFunc fn, Gee.List<T> acc) {
foreach (G i in this) {
acc.add(fn(i));
}
}
}
public class EnumerableList<G, T> : Gee.ArrayList<G>, Enumerable<G, T> {
}
public static int main(string[] args) {
var a = new EnumerableList<int, string> ();
a.add(1);
a.add(2);
a.add(3);
var b = new Gee.ArrayList<string> ();
a.map( (i) => { return "%d".printf(i); }, b);
foreach (string i in b) {
println(i);
}
return 0;
}
#----------------------------------------------------
martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]