diff options
Diffstat (limited to 'test/gtest/possible-contents.cpp')
-rw-r--r-- | test/gtest/possible-contents.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/gtest/possible-contents.cpp b/test/gtest/possible-contents.cpp index 1e1f0e5c9..933e220bb 100644 --- a/test/gtest/possible-contents.cpp +++ b/test/gtest/possible-contents.cpp @@ -280,9 +280,16 @@ TEST_F(PossibleContentsTest, TestIntersection) { assertHaveIntersection(exactFuncSignatureType, exactFuncSignatureType); assertHaveIntersection(i32Zero, i32One); // TODO: this could be inferred false + // Exact types only differing by nullability can intersect (not on the null, + // but on something else). + assertHaveIntersection(exactAnyref, exactNonNullAnyref); + // Due to subtyping, an intersection might exist. assertHaveIntersection(funcGlobal, funcGlobal); assertHaveIntersection(funcGlobal, exactFuncSignatureType); + assertHaveIntersection(nonNullFuncGlobal, exactFuncSignatureType); + assertHaveIntersection(funcGlobal, exactNonNullFuncSignatureType); + assertHaveIntersection(nonNullFuncGlobal, exactNonNullFuncSignatureType); // Neither is a subtype of the other, but nulls are possible, so a null can be // the intersection. |