# Efficient reflection on structs

**URL:** https://discourse.julialang.org/t/efficient-reflection-on-structs/55278
**Category:** Performance
**Created:** [February 14, 2021, 9:24pm UTC](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278 "2021-02-14T21:24:53Z")
**Posts on this page:** 1
**Showing post:** 43

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [February 16, 2021, 5:53pm UTC](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278/43 "2021-02-16T17:53:21Z")

</div>

> [@Guillaume\_Leclerc](#):
>
> Is there a way I could get something like this:
> 
> ```julia
> struct Wrapper{T, F} <: T
> data::T
> end
> 
> ```
> 
> This way I would be able to reuse all the implementations available for `T` . Since it has the same fields (accessible through `getproperty` ) it should be swappable in place of any variable of type `T` .
> 
> Am I allowed to override `isa` or something along those lines ?

No, this is not possible. However, there are a few classes of circumstances where people desire this behaviour: [Is Julia's way of OOP superior to C++/Python? Why Julia doesn't use class-based OOP? - #137 by Mason](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058/137)

One can kinda hack their way into this sort of behaviour using IRTools.jl, but I wouldn’t recommend it.

---

_[View the full topic](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278)._
