summaryrefslogtreecommitdiff
path: root/vala/valagenericdupfield.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-11-01 21:31:47 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-11-04 11:05:49 +0100
commitd14248fdfa5ba2a39dfb8ce8a6a6a4a083c4f081 (patch)
tree62b14e58992b261de0aeb625053a8565813b9407 /vala/valagenericdupfield.vala
parenta06892eaa472ad26233ddcbcfbaf8ebdf12015f8 (diff)
downloadvala-d14248fdfa5ba2a39dfb8ce8a6a6a4a083c4f081.tar.gz
vala: Add GenericType.dup/destroy fields
This provides direct access to the according values of generic-types and type-parameters. Fixes https://gitlab.gnome.org/GNOME/vala/issues/190
Diffstat (limited to 'vala/valagenericdupfield.vala')
-rw-r--r--vala/valagenericdupfield.vala36
1 files changed, 36 insertions, 0 deletions
diff --git a/vala/valagenericdupfield.vala b/vala/valagenericdupfield.vala
new file mode 100644
index 000000000..12ab9ecea
--- /dev/null
+++ b/vala/valagenericdupfield.vala
@@ -0,0 +1,36 @@
+/* valagenericdupfield.vala
+ *
+ * Copyright (C) 2019 Rico Tzschichholz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Rico Tzschichholz <ricotz@ubuntu.com>
+ */
+
+/**
+ * Represents the Generic.dup field.
+ */
+public class Vala.GenericDupField : Field {
+ /**
+ * Creates a new generic dup field.
+ *
+ * @return newly created field
+ */
+ public GenericDupField (SourceReference source_reference) {
+ base ("dup", CodeContext.get ().analyzer.generics_dup_func_type, null, source_reference);
+ external = true;
+ }
+}