# Inaccurate line number in error message

**URL:** <https://community.zeek.org/t/inaccurate-line-number-in-error-message/781>\
**Category:** Zeek\
**Created:** [June 20, 2005, 12:39am UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/781 "2005-06-20T00:39:54Z")\
**Posts on this page:** 2\
**Page:** 1

<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 20, 2005, 12:39am UTC](https://community.zeek.org/t/inaccurate-line-number-in-error-message/781/1 "2005-06-20T00:39:54Z")

</div>

Hi,

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!

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/781/2 "2022-05-06T15:37:31Z")

</div>


