Ensure parameter typeinfo matches the actual object's typeinfo

AppleClang seems to generate different typeinfo for forward declarations
of classes than the actual class object, so the any_cast for the pointer
parameter fails due to the types not matching (even when they look the
same when printed in the error).

Instead, we must always ensure we use the actual object when defining
the parameter type when placing the object into the event.
This commit is contained in:
Ian McInerney 2024-01-24 16:14:32 +00:00
parent a5ee614ae8
commit d04b21c6d6
2 changed files with 2 additions and 7 deletions

View File

@ -25,14 +25,11 @@
#include <bitmaps.h>
#include <core/typeinfo.h>
#include <layer_ids.h>
#include <sch_bitmap.h>
#include <sch_line_wire_bus_tool.h>
#include <tools/ee_actions.h>
#include <tool/tool_action.h>
// Forward-define of parameter types
class SCH_BITMAP;
// Actions, being statically-defined, require specialized I18N handling. We continue to
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
// specialized, but we don't translate on initialization and instead do it in the getters.

View File

@ -30,14 +30,12 @@
#include <bitmaps.h>
#include <layer_ids.h>
#include <microwave/microwave_tool.h>
#include <pcb_reference_image.h>
#include <tool/tool_manager.h>
#include <tools/pcb_selection_tool.h>
#include <router/pns_router.h>
#include <router/pns_routing_settings.h>
// Forward declarations for types needed in the parameters
class PCB_REFERENCE_IMAGE;
// Actions, being statically-defined, require specialized I18N handling. We continue to
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
// specialized, but we don't translate on initialization and instead do it in the getters.