# Is there a tool to detect non-concrete struct fields in type definitions?

**URL:** <https://discourse.julialang.org/t/is-there-a-tool-to-detect-non-concrete-struct-fields-in-type-definitions/105127>\
**Category:** Tooling\
**Created:** [October 18, 2023, 2:39pm UTC](https://discourse.julialang.org/t/is-there-a-tool-to-detect-non-concrete-struct-fields-in-type-definitions/105127 "2023-10-18T14:39:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 18, 2023, 2:39pm UTC](https://discourse.julialang.org/t/is-there-a-tool-to-detect-non-concrete-struct-fields-in-type-definitions/105127/1 "2023-10-18T14:39:34Z")

</div>

As it says: JuliaFormatter can detect untyped fields; what I’m looking for is something to detect fields which are not completely nailed down.

---

<div class="post-metadata">

**Author:** ![Tortar](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Post date:** [October 18, 2023, 2:49pm UTC](https://discourse.julialang.org/t/is-there-a-tool-to-detect-non-concrete-struct-fields-in-type-definitions/105127/2 "2023-10-18T14:49:24Z")

</div>

If you know the types for the fields you want to use (i.e. the struct is not parametric) then

```julia
struct A
    x::Int
end

isconcretetype.(fieldtypes(A)) # (true,)

struct B
    x
end

isconcretetype.(fieldtypes(B)) # (false,)

```

But if you got a parametric type then I think you can’t know it from the definition

```julia
struct C{T}
    x::T
end

isconcretetype.(fieldtypes(C)) # (false,)
isconcretetype.(fieldtypes(C{Any})) # (false,)
isconcretetype.(fieldtypes(C{Int})) # (true,)

```

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 18, 2023, 2:57pm UTC](https://discourse.julialang.org/t/is-there-a-tool-to-detect-non-concrete-struct-fields-in-type-definitions/105127/3 "2023-10-18T14:57:37Z")

</div>

Thank you, this is useful.

However, my concern is primarily with an inspection of the source code. I have many parametric types, and it would be good to check that the struct fields use these parametric types fully qualified.
