diff --git a/python/cudaq/kernel/kernel_decorator.py b/python/cudaq/kernel/kernel_decorator.py index 2a406fa5074..cd864940c61 100644 --- a/python/cudaq/kernel/kernel_decorator.py +++ b/python/cudaq/kernel/kernel_decorator.py @@ -92,7 +92,7 @@ def __init__(self, # Register any external class types that may be used # in the kernel definition for name, var in self.globalScopedVars.items(): - if isinstance(var, type): + if isinstance(var, type) and hasattr(var, '__annotations__'): globalRegisteredTypes[name] = (var, var.__annotations__) # Once the kernel is compiled to MLIR, we