From adbe42c907c4366919d5029978983f84ef50c31f Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 16 Jan 2024 17:12:38 -0800 Subject: [PATCH] add non-pure dynamic inheritance case --- src/mule/mule_main.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/mule/mule_main.cpp b/src/mule/mule_main.cpp index 75bd4f86..da5877cc 100644 --- a/src/mule/mule_main.cpp +++ b/src/mule/mule_main.cpp @@ -1132,6 +1132,25 @@ struct PureChild : Pure double a = 0; }; +struct Base +{ + int x; + int y; + int z; + virtual ~Base() = default; + virtual void Foo() = 0; +}; + +struct Derived : Base +{ + int r; + int g; + int b; + int a; + virtual ~Derived() = default; + virtual void Foo() {a += 1;} +}; + struct OverloadedMethods{ int x; int cool_method(void){ @@ -1342,6 +1361,12 @@ extended_type_coverage_eval_tests(void){ child->Foo(); delete child; + Base *derived = new Derived(); + derived->Foo(); + derived->Foo(); + derived->Foo(); + delete derived; + OverloadedMethods overloaded_methods; { overloaded_methods.x = 0;