diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/type-builder-nominal.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/example/type-builder-nominal.cpp b/test/example/type-builder-nominal.cpp index f3eed5810..1904bb7ee 100644 --- a/test/example/type-builder-nominal.cpp +++ b/test/example/type-builder-nominal.cpp @@ -323,6 +323,20 @@ void test_subtypes() { } { + // Subtype declarations, but still no subtypes + std::vector<HeapType> built; + { + TypeBuilder builder(3); + builder[0].subTypeOf(builder[1]); + builder[0] = Struct{}; + builder[1] = Struct{}; + builder[2] = Struct{}; + built = builder.build(); + } + assert(LUB(built[0], built[2]) == HeapType::data); + } + + { // Subtyping of identical types std::vector<HeapType> built; { |