summaryrefslogtreecommitdiff
path: root/tests/generics
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-10-18 21:08:46 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-10-18 21:17:40 +0200
commitb8bc5e2e44698cef18fa4378deafd737297fb65e (patch)
tree64fd63cb1f6d0f31d9637253b72104b5de9d88c2 /tests/generics
parentdbf4e81d3e76857aa3bc18209cc958098672c669 (diff)
downloadvala-b8bc5e2e44698cef18fa4378deafd737297fb65e.tar.gz
codegen: Don't use inferred type for temp-value to access generic property
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1088
Diffstat (limited to 'tests/generics')
-rw-r--r--tests/generics/property-int-cast.vala12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/generics/property-int-cast.vala b/tests/generics/property-int-cast.vala
new file mode 100644
index 000000000..69478efd3
--- /dev/null
+++ b/tests/generics/property-int-cast.vala
@@ -0,0 +1,12 @@
+class Foo<G> {
+ public G prop { get; private set; }
+
+ public Foo (G g) {
+ prop = g;
+ }
+}
+
+void main() {
+ var foo = new Foo<int> (23);
+ assert (foo.prop == 23);
+}