base class -> derived class autocast in eval system; completion of first pass

This commit is contained in:
Ryan Fleury
2024-01-17 13:28:03 -08:00
parent a0a6fc0988
commit d3931fd3e2
9 changed files with 124 additions and 155 deletions
+29
View File
@@ -1151,6 +1151,22 @@ struct Derived : Base
virtual void Foo() {a += 1;}
};
struct DerivedA : Base
{
float a;
float b;
virtual void Foo() {a += 1;}
virtual ~DerivedA() = default;
};
struct DerivedB : Base
{
double c;
double d;
virtual void Foo() {c += 1;}
virtual ~DerivedB() = default;
};
struct OverloadedMethods{
int x;
int cool_method(void){
@@ -1367,6 +1383,19 @@ extended_type_coverage_eval_tests(void){
derived->Foo();
delete derived;
Base *base_array[1024] = {0};
for(int i = 0; i < sizeof(base_array)/sizeof(base_array[0]); i += 1)
{
if(i & 1 == 1)
{
base_array[i] = new DerivedA();
}
else
{
base_array[i] = new DerivedB();
}
}
OverloadedMethods overloaded_methods;
{
overloaded_methods.x = 0;