# Inaccurate line number in error message

**URL:** <https://community.zeek.org/t/inaccurate-line-number-in-error-message/784>\
**Category:** Zeek\
**Created:** [June 20, 2005, 7:29am UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/784 "2005-06-20T07:29:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vern](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/vern/32/630_2.png) [@Vern](https://community.zeek.org/u/Vern)\
**Post date:** [June 20, 2005, 7:29am UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/784/1 "2005-06-20T07:29:46Z")

</div>

> when running the following policy snippet below, one gets the error  
> message "line 1 (i): error, not a BRO type".
> 
> 1 function foo(i: int)  
> 2 {  
> 3 # ...  
> 4 local j: i;  
> 5 }
> 
> However, there is no error in line 1. It's in line 4, which should be "j  
> = i" instead. I just had a more complicated scenario with basically this  
> error and it took me ages to locate the problem. I kept looking in the  
> wrong spot because my line "4" was much further down in a biggish  
> function.
> 
> After looking at parse.y for a while I conclude that I don't really know  
> the right way to fix this -- could anyone provide pointers, or better  
> yet, a patch? Thanks!

The following does the trick.

&nbsp;&nbsp;&nbsp;&nbsp;Vern

Index: parse.in

---

<div class="post-metadata">

**Author:** ![Christian\_Kreibich3](https://avatars.discourse-cdn.com/v4/letter/c/4af34b/32.png) [@Christian\_Kreibich3](https://community.zeek.org/u/Christian_Kreibich3)\
**Post date:** [June 21, 2005, 6:30pm UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/784/2 "2005-06-21T18:30:59Z")

</div>

Like a charm -- thanks! 🙂

Cheers,  
Christian.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:37pm UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/784/3 "2022-05-06T15:37:31Z")

</div>


