Skip to content

Conversation

@spywo
Copy link

@spywo spywo commented Nov 7, 2025

The buildOutCacheTemplateParameters function was incorrectly using BaseClassName (e.g., "Base") for ALL class output parameters when building the ParameterCache template type. This meant that methods like GeolocationList::GetAt that return specific types like IGeolocation* were being cached as IBase* instead.

When a method signature expects IGeolocation*& (reference to IGeolocation pointer) but the cache uses IBase* in its template, the compiler error occurs because: IBase*& and IGeolocation*& are incompatible types
References to pointers cannot be implicitly converted, even with inheritance

…mplate generation

The buildOutCacheTemplateParameters function was incorrectly using BaseClassName (e.g., "Base") for ALL class output parameters when building the ParameterCache template type. This meant that methods like GeolocationList::GetAt that return specific types like IGeolocation* were being cached as IBase* instead.

When a method signature expects IGeolocation*& (reference to IGeolocation pointer) but the cache uses IBase* in its template, the compiler error occurs because:
IBase*& and IGeolocation*& are incompatible types
References to pointers cannot be implicitly converted, even with inheritance
hasError = iter2->GetNextOptinalAnimal(optionalAnimal);
assert(hasError == true);
assert(optionalAnimal != nullptr);
std::cout << " Got animal: " << optionalAnimal->Name() << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously calling optionalAnimal->Name() was not possible, because Base was returned?

gangatp
gangatp previously approved these changes Nov 10, 2025
Copy link
Collaborator

@gangatp gangatp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding examples.

Co-authored-by: Paul Davies <40460850+paul-davies-autodesk@users.noreply.github.com>
@gangatp gangatp merged commit 8f7f84f into Autodesk:develop Nov 10, 2025
12 of 14 checks passed
@spywo spywo deleted the oliver/dynamic-cast branch November 10, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants