Add some tests for distinguishability of unions

This commit is contained in:
JustOff 2019-03-13 19:01:09 +02:00 • committed by Roy Tam
commit 17d23ee848

View file

@ -2321,8 +2321,10 @@ class IDLNullableType(IDLParameterizedType):
return self return self
def isDistinguishableFrom(self, other): def isDistinguishableFrom(self, other):
if (other.nullable() or (other.isUnion() and other.hasNullableType) or if (other.nullable() or
other.isDictionary()): other.isDictionary() or
(other.isUnion() and
(other.hasNullableType or other.hasDictionaryType()))):
# Can't tell which type null should become # Can't tell which type null should become
return False return False
return self.inner.isDistinguishableFrom(other) return self.inner.isDistinguishableFrom(other)