diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-04-13 20:36:08 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-04-14 09:14:11 +0200 |
commit | b42c4b54a3589cffcab9dcce603c82728bcd82d0 (patch) | |
tree | dbd833d214300b7306a57340a180b8c6e2b7d94e /vala/valadatatype.vala | |
parent | cff2e6e470efae1f4e178ab13cb2b3d5dde502c3 (diff) | |
download | vala-b42c4b54a3589cffcab9dcce603c82728bcd82d0.tar.gz |
vala: Don't make GenericType nullable by default
Allow equality between nullable and non-nullable generic-types for now
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1191
Diffstat (limited to 'vala/valadatatype.vala')
-rw-r--r-- | vala/valadatatype.vala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala index fec7e9010..897eaf72c 100644 --- a/vala/valadatatype.vala +++ b/vala/valadatatype.vala @@ -204,7 +204,11 @@ public abstract class Vala.DataType : CodeNode { return false; } if (type2.nullable != nullable) { - return false; + //TODO Allow equality between nullable and non-nullable generic-types + // This mitigation allows fixing affected source code without breaking it. + // It has to be removed at some point + var context = CodeContext.get (); + return !context.experimental_non_null && this is GenericType == type2 is GenericType; } if (type2.type_symbol != type_symbol) { return false; |