summaryrefslogtreecommitdiff
path: root/tests/generics/bug640330.vala
blob: e57ccb07419d84e5c4fc3456fd3274b6f9e64094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[GenericAccessors]
interface Foo<G> : Object {
	public virtual G get_foo (G g) {
		assert (typeof (G) == typeof (string));
		G g_copy = g;
		assert (GLib.strcmp ((string) g_copy, "foo") == 0);
		assert (g_copy != g);
		return g;
	}
}

class Bar<G> : Object, Foo<G> {
}

void main () {
	var bar = new Bar<string> ();
	assert ("foo" == bar.get_foo ("foo"));
}