]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Subtype of string is allowed as constant
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 18 Nov 2017 16:07:38 +0000 (17:07 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 19 Nov 2017 09:15:06 +0000 (10:15 +0100)
vala/valaconstant.vala

index 53b84c60e0eb91807dac1943915b4216660e7dda..230c63d5ee03c329b0febd142e78855a3b319b53 100644 (file)
@@ -195,7 +195,7 @@ public class Vala.Constant : Symbol, Lockable {
                } else if (type is ArrayType) {
                        var array_type = type as ArrayType;
                        return check_const_type (array_type.element_type, context);
-               } else if (type.data_type == context.analyzer.string_type.data_type) {
+               } else if (type.data_type.is_subtype_of (context.analyzer.string_type.data_type)) {
                        return true;
                } else {
                        return false;