# Symbol is Base.isexported but not Base.isbindingresolved?

**URL:** <https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471>\
**Category:** Internals & Design\
**Tags:** module\
**Created:** [December 4, 2024, 9:20pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471 "2024-12-04T21:20:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajwheeler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ajwheeler/32/213970_2.png) [@ajwheeler](https://discourse.julialang.org/u/ajwheeler)\
**Post date:** [December 4, 2024, 9:21pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471/1 "2024-12-04T21:21:00Z")

</div>

Working on [Group import hints by ajwheeler · Pull Request #56753 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/56753), I was surprised to see that there are cases of symbols `s` and modules `m` for which `Base.isbindingresolved(m, s)` is false, but `Base.isexported(m, s)` is true. How does this occur?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [December 4, 2024, 11:48pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471/2 "2024-12-04T23:48:15Z")

</div>

Welcome! It’s a little funny, but you can export but not define a symbol:

```julia-repl
julia> module M
           export foo
       end
Main.M

julia> Base.isbindingresolved(M, :foo)
false

julia> Base.isexported(M, :foo)
true

```

---

<div class="post-metadata">

**Author:** ![ajwheeler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ajwheeler/32/213970_2.png) [@ajwheeler](https://discourse.julialang.org/u/ajwheeler)\
**Post date:** [December 5, 2024, 3:16pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471/3 "2024-12-05T15:16:52Z")

</div>

Thanks! Interesting. What is the reason you would do this?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [December 5, 2024, 3:26pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471/4 "2024-12-05T15:26:50Z")

</div>

It’s typically a bug. It’s not immediately an error because we support writing `export` statements _before_ the definition — and it’s not uncommon for Packages to do this.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [December 5, 2024, 3:58pm UTC](https://discourse.julialang.org/t/symbol-is-base-isexported-but-not-base-isbindingresolved/123471/5 "2024-12-05T15:58:23Z")

</div>

Just to add, Aqua.jl can detect this, so it can be used in the tests to prevent merging PRs with undefined exports: [Undefined exports · Aqua.jl](https://juliatesting.github.io/Aqua.jl/stable/exports/)
