# Generator code, what have I done?

**URL:** https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181
**Category:** Developers
**Created:** [October 12, 2017, 1:25am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181 "2017-10-12T01:25:03Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sakrejda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/sakrejda/32/845_2.png) [@sakrejda](https://discourse.mc-stan.org/u/sakrejda)
#### Post date: [October 12, 2017, 1:25am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/1 "2017-10-12T01:25:03Z")

</div>

It’s telling me it doesn’t recognize the type but tells me exactly what the type is… @mitzimorris @Bob_Carpenter any ideas? Unless it’s an accidental circular include this makes no sense to me:

```
In file included from src/test/test-models/stanc.cpp:1:
In file included from src/stan/command/stanc_helper.hpp:6:
In file included from src/stan/lang/compile_functions.hpp:5:
In file included from src/stan/lang/generator/generate_standalone_functions.hpp:7:
In file included from src/stan/lang/generator/generate_function_instantiations.hpp:5:
In file included from src/stan/lang/generator/generate_function_instantiation.hpp:7:
src/stan/lang/generator/generate_function_instantiation_name.hpp:19:53: error: unknown type name
      'function_decl_def'; did you mean '::stan::lang::function_decl_def'?
    void generate_function_instantiation_name(const function_decl_def& fun,
                                                    ^ ~~~~~~~~~~~~~~~~
                                                    ::stan::lang::function_decl_def

```

---

<div class="post-metadata">

### Author: ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)
#### Post date: [October 12, 2017, 1:47am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/2 "2017-10-12T01:47:02Z")

</div>

what branch?

---

<div class="post-metadata">

### Author: ![sakrejda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/sakrejda/32/845_2.png) [@sakrejda](https://discourse.mc-stan.org/u/sakrejda)
#### Post date: [October 12, 2017, 1:49am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/3 "2017-10-12T01:49:59Z")

</div>

I haven’t pushed yet. I thought the type of error might look familiar. I  
wrapped up for today so I’ll push tomorrow.

---

<div class="post-metadata">

### Author: ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)
#### Post date: [October 12, 2017, 1:53am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/4 "2017-10-12T01:53:08Z")

</div>

check your includes?

---

<div class="post-metadata">

### Author: ![sakrejda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/sakrejda/32/845_2.png) [@sakrejda](https://discourse.mc-stan.org/u/sakrejda)
#### Post date: [October 12, 2017, 2:20am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/5 "2017-10-12T02:20:09Z")

</div>

What am I checking for? The file with that specific struct is included…

---

<div class="post-metadata">

### Author: ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)
#### Post date: [October 12, 2017, 12:23pm UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/6 "2017-10-12T12:23:12Z")

</div>

sorry, not enough info here to help - please show file: src/stan/lang/generator/generate\_function\_instantiation\_name.hpp

what else have you changed?

---

<div class="post-metadata">

### Author: ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)
#### Post date: [October 14, 2017, 9:27pm UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/7 "2017-10-14T21:27:41Z")

</div>

> [@sakrejda](#):
>
> src/stan/lang/generator/generate\_function\_instantiation\_name.hpp:19:53: error: unknown type name  
> ‘function\_decl\_def’; did you mean ‘::stan::lang::function\_decl\_def’?  
> void generate\_function\_instantiation\_name(const function\_decl\_def& fun,  
> ^ ~~~~~~~~~~~~~~~~  
> ::stan::lang::function

That looks like you’re not inside the `stan::lang` namespace.

---

<div class="post-metadata">

### Author: ![sakrejda](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/sakrejda/32/845_2.png) [@sakrejda](https://discourse.mc-stan.org/u/sakrejda)
#### Post date: [October 16, 2017, 8:30pm UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/8 "2017-10-16T20:30:28Z")

</div>

Turns out the solution to this mystery was that a completely different file that never showed up as a problem (I had edited it) was one closing paren short in the middle of the file so it put this file inside of the `stan` namespace… so the inside code was in the `stan::stan::lang` namespace.

---

<div class="post-metadata">

### Author: ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)
#### Post date: [October 22, 2017, 2:19am UTC](https://discourse.mc-stan.org/t/generator-code-what-have-i-done/2181/9 "2017-10-22T02:19:43Z")

</div>

Not surprising. The compiler was clearly indicating you weren’t in `stan::lang::` or hadn’t included the file with the declearations you needed.
