# \`ERROR: LoadError: TypeError: Type{...} expression: expected Type{T}, got Module\`

**URL:** <https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230>\
**Category:** New to Julia\
**Created:** [December 31, 2016, 4:33pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230 "2016-12-31T16:33:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [December 31, 2016, 4:33pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/1 "2016-12-31T16:33:42Z")

</div>

What does the following error mean? It’s too general to understand.

```julia
ERROR: LoadError: TypeError: Type{...} expression: expected Type{T}, got Module
 in include_from_node1(::String) at ./loading.jl:488
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
 in reload(::String) at ./loading.jl:336
while loading /home/calvin/Documents/git/FastSum.jl/src/FastSum.jl, in expression starting on line 480

```

Also, I have nothing but a blank line on line 480. I find that it’s quite common that I don’t see anything wrong on the line indicated by the error message. Is this something happens to others? How can I locate the error more accurately if I don’t see anything on the indicated line? Thanks!

On another note - I find that the error thrown at the terminal in a second run differs from the error thrown when the code is run the very first time. How shall I understand this?

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [January 1, 2017, 1:21am UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/2 "2017-01-01T01:21:01Z")

</div>

Bump up. Thanks.

What might be potential causes for this error?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 1, 2017, 9:26am UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/3 "2017-01-01T09:26:29Z")

</div>

In general, “bumping” a topic you created 9h ago is not necessary. People will see it when they look at the forum.

It could be that you gave the same name to a module and a type. Hard to say more without a MWE, if the problem is not obvious, try to uncomment pieces of your code and create an MWE you can post here.

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [January 1, 2017, 1:05pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/4 "2017-01-01T13:05:52Z")

</div>

Sorry, I was a bit desperate to get rid of this error. I’ll wait a little more in the future.

Thanks for the hint. I’ll try to work out a MWE to show the problem.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [January 2, 2017, 10:31am UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/5 "2017-01-02T10:31:31Z")

</div>

You can reproduce the `expected Type{T}` part of the error with

```julia
module Foo end
Foo{Int64}

```

Also, note that the stacktrace includes a call to `require`, so it seems likey that this happens in a file `include()`ed in `FastSum.jl`.  
Might also be worth looking at all instances of `{.*}` in your code.

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [January 2, 2017, 1:03pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/6 "2017-01-02T13:03:34Z")

</div>

> [@pfitzseb](#):
>
> Also, note that the stacktrace includes a call to require, so it seems likey that this happens in a file include()ed in FastSum.jl.

Thanks for the hint. I wonder if it is possible that this error has nothing to do with `include()`. The [doc](http://docs.julialang.org/en/release-0.4/stdlib/base/?highlight=require#Base.require) of `include()` says that _it sets the current include path but does not use it to search for files_.[quote=“pfitzseb, post:5, topic:1230”]  
Might also be worth looking at all instances of {.\*} in your code.  
[/quote]  
Why does dot multiplication matter in this case? Any part of the error implies that?

Thanks a lot!!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 2, 2017, 1:31pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/7 "2017-01-02T13:31:42Z")

</div>

@pfitzseb possibly meant a regex, ie `{` and `}` with something in between.

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [January 2, 2017, 1:40pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/8 "2017-01-02T13:40:01Z")

</div>

I see, but only partly. Which line of the error message tells this?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [January 2, 2017, 4:46pm UTC](https://discourse.julialang.org/t/error-loaderror-typeerror-type-expression-expected-type-t-got-module/1230/9 "2017-01-02T16:46:01Z")

</div>

Well, under the assumption that the error can only be caused by an expression of the form `ModuleName{Type}`, a search for that (with the above regex, as @Tamas_Papp noted , or something similar) should turn up the culprit.

Also, you linked the docs for `require`, which you probably wont have called directly; [`include()`](http://docs.julialang.org/en/release-0.4/stdlib/base/?highlight=require#Base.include) on the other hand _does_ explcitly search for files and evalutes them.

Going by the docs link above: Are you on 0.4? If so, is there anything that prevents you from using 0.5?

Apart from that: For us to give you any more specific help, we’d really have to see your code.
